Class: ADIWG::Mdtranslator::Writers::Simple_html::Html_GeographicExtent

Inherits:
Object
  • Object
show all
Defined in:
lib/adiwg/mdtranslator/writers/simple_html/sections/html_geographicExtent.rb

Instance Method Summary collapse

Constructor Details

#initialize(html) ⇒ Html_GeographicExtent

Returns a new instance of Html_GeographicExtent.



20
21
22
# File 'lib/adiwg/mdtranslator/writers/simple_html/sections/html_geographicExtent.rb', line 20

def initialize(html)
   @html = html
end

Instance Method Details

#writeHtml(hExtent) ⇒ Object



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# File 'lib/adiwg/mdtranslator/writers/simple_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.div(:class => 'block') do
         @html.text!(hExtent[:description])
      end
   end

   # geographic extent - map {div}
   @html.div do
      @html.div('Map', 'class' => 'h5 map-summary')
      @html.div(: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.div do
         @html.div('Elements', 'class' => 'h5')
         @html.div(: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.div do
         @html.div('User Provided Bounding Box', 'class' => 'h5')
         @html.div(: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.div do
         @html.div('Computed Bounding Box', 'class' => 'h5')
         @html.div(: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.div do
         @html.div('Identifier', 'class' => 'h5')
         @html.div(:class => 'block') do
            identifierClass.writeHtml(hExtent[:identifier])
         end
      end
   end

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

end