class ADIWG::Mdtranslator::Writers::Html::Html_GeometryCollection

Public Class Methods

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

Public Instance Methods

writeHtml(hCollection) click to toggle source
# File lib/adiwg/mdtranslator/writers/html/sections/html_geometryCollection.rb, line 21
def writeHtml(hCollection)

   # classes used
   geometryClass = Html_GeometryObject.new(@html)
   boxClass = Html_BoundingBox.new(@html)

   # geometry collection - objects
   hCollection[:geometryObjects].each do |hObject|
      @html.details do
         @html.summary(hObject[:type], 'class' => 'h5')
         @html.section(:class => 'block') do
            geometryClass.writeHtml(hObject)
         end
      end
   end

   # geometry collection - user bounding box
   unless hCollection[:bbox].empty?
      @html.details do
         @html.summary('User Provided Bounding Box', 'class' => 'h5')
         @html.section(:class => 'block') do
            bbox = {}
            bbox[:westLongitude] = hCollection[:bbox][0]
            bbox[:eastLongitude] = hCollection[:bbox][2]
            bbox[:southLatitude] = hCollection[:bbox][1]
            bbox[:northLatitude] = hCollection[:bbox][3]
            boxClass.writeHtml(bbox)
         end
      end
   end

   # geometry collection - computed bounding box
   unless hCollection[:computedBbox].empty?
      @html.details do
         @html.summary('Computed Bounding Box', 'class' => 'h5')
         @html.section(:class => 'block') do
            boxClass.writeHtml(hCollection[:computedBbox])
         end
      end
   end

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

end