class ADIWG::Mdtranslator::Writers::Html::Html_GeographicExtent

Public Class Methods

new(html) click to toggle source
# File lib/adiwg/mdtranslator/writers/html/sections/html_geographicExtent.rb, line 20
def initialize(html)
   @html = html
end

Public Instance Methods

writeHtml(hExtent) click to toggle source
# File lib/adiwg/mdtranslator/writers/html/sections/html_geographicExtent.rb, line 24
def writeHtml(hExtent)

   # classes used
   identifierClass = Html_Identifier.new(@html)
   boundingClass = Html_BoundingBox.new(@html)
   geographicClass = Html_GeographicElement.new(@html)

   # geographic extent - contains data {Boolean}
   @html.em('Geographic Extent Encompasses Data: ')
   @html.text!(hExtent[:containsData].to_s)
   @html.br

   # geographic extent - description
   unless hExtent[:description].nil?
      @html.em('Geographic Description: ')
      @html.section(:class => 'block') do
         @html.text!(hExtent[:description])
      end
   end

   # geographic extent - map {div}
   @html.details do
      @html.summary('Map', 'class' => 'h5 map-summary')
      @html.section(:class => 'block') do
         @html.div('class' => 'map', 'id' => 'map') do
            # map drawn by html_bodyScript.js
         end
      end
   end

   # geographic extent - geographic element [] {geographicElement}
   unless hExtent[:geographicElements].empty?
      @html.details do
         @html.summary('Elements', 'class' => 'h5')
         @html.section(:class => 'block') do
            hExtent[:geographicElements].each do |hElement|
               geographicClass.writeHtml(hElement)
            end
         end
      end
   end

   # geographic extent - user bounding box
   unless hExtent[:boundingBox].empty?
      @html.details do
         @html.summary('User Provided Bounding Box', 'class' => 'h5')
         @html.section(:class => 'block') do
            boundingClass.writeHtml(hExtent[:boundingBox])
            @html.div(:class =>'userBBox hidden') do
               @html.text!(hExtent[:boundingBox].to_json)
            end
         end
      end
   end

   # computed bounding box - {boundingBox}
   unless hExtent[:computedBbox].empty?
      @html.details do
         @html.summary('Computed Bounding Box', 'class' => 'h5')
         @html.section(:class => 'block') do
            boundingClass.writeHtml(hExtent[:computedBbox])
            @html.div(:class =>'computedBBox hidden') do
               @html.text!(hExtent[:computedBbox].to_json)
            end
         end
      end
   end

   # geographic extent - identifier {identifier}
   unless hExtent[:identifier].empty?
      @html.details do
         @html.summary('Identifier', 'class' => 'h5')
         @html.section(:class => 'block') do
            identifierClass.writeHtml(hExtent[:identifier])
         end
      end
   end

   # geographic extent - native GeoJson
   unless hExtent[:nativeGeoJson].empty?
      @html.details do
         @html.summary('GeoJson', 'class' => 'h5')
         @html.section(:class => 'block') do
            @html.div(:class =>'geojson', :dataPopup => 'fill in popData') do
               @html.text!(hExtent[:nativeGeoJson].to_json)
            end
         end
      end
   end

end