Sha256: bded0864752088cd922afec4ca4edfe24291cd992e642c3c30a1ccb271a24ff4

Contents?: true

Size: 827 Bytes

Versions: 3

Compression:

Stored size: 827 Bytes

Contents

module GeoConcerns
  module BoundingBoxHelper
    ##
    # Builds HTML string for bounding box selector tool.
    # Calls boundingBoxSelector javascript function and
    # passes the id of the location input element that it binds to.
    # @param [Symbol] name of property that holds bounding box string
    # @return[String]
    def bbox(property)
      %(
        <div id='bbox'></div>
        <script>
          boundingBoxSelector({inputId: #{bbox_input_id(property)}});
        </script>
      ).html_safe
    end

    ##
    # Returns id of location input that is bound to bbox selector.
    # @param [Symbol] name of property that holds bounding box string
    # @return[String] id of location input element
    def bbox_input_id(property)
      "#{curation_concern.class.name.underscore}_#{property}"
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
geo_concerns-0.0.6 app/helpers/geo_concerns/bounding_box_helper.rb
geo_concerns-0.0.5 app/helpers/geo_concerns/bounding_box_helper.rb
geo_concerns-0.0.4 app/helpers/geo_concerns/bounding_box_helper.rb