Class: ADIWG::Mdtranslator::Writers::Simple_html::Html_GeometryObject

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

Instance Method Summary collapse

Constructor Details

#initialize(html) ⇒ Html_GeometryObject

Returns a new instance of Html_GeometryObject.



14
15
16
# File 'lib/adiwg/mdtranslator/writers/simple_html/sections/html_geometryObject.rb', line 14

def initialize(html)
   @html = html
end

Instance Method Details

#writeHtml(hObject) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'lib/adiwg/mdtranslator/writers/simple_html/sections/html_geometryObject.rb', line 18

def writeHtml(hObject)

   # geometry object - coordinates
   unless hObject[:coordinates].nil?
      @html.div do
         @html.div('Coordinates', 'class' => 'h5')
         @html.div(:class => 'block') do
            @html.text!(hObject[:coordinates].to_s)
         end
      end
   end

   # geographic element - native GeoJson
   unless hObject[:nativeGeoJson].empty?
      @html.div do
         @html.div('GeoJson', 'class' => 'h5')
         @html.div(:class => 'block') do
            @html.text!(hObject[:nativeGeoJson].to_json)
         end
      end
   end

end