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) markup = '' markup << %(
) markup << bbox_display_inputs markup << bbox_script_tag(property) markup.html_safe end ## # Returns markup for a row of read only bounding box inputs. # @return[String] # rubocop:disable MethodLength def bbox_display_inputs %(
North
East
South
West
) end # rubocop:enable MethodLength ## # Returns script tag markup for loading the bounding box selector. # @param[Symbol] name of property that holds bounding box string # @return[String] script tag def bbox_script_tag(property) %( ) 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