class BlacklightMaps::Geometry::Point
This class contains Point
objects and methods for working with them
Public Class Methods
from_lat_lon_string(points)
click to toggle source
Creates a new point from from a coordinate string “-50,100” (lat,long)
# File lib/blacklight/maps/geometry.rb, line 77 def self.from_lat_lon_string(points) new(points.split(',').reverse) end
new(points)
click to toggle source
points is an array corresponding to the longitude and latitude values
- long, lat
# File lib/blacklight/maps/geometry.rb, line 62 def initialize(points) @long = points[0].to_f @lat = points[1].to_f end
Public Instance Methods
normalize_for_search()
click to toggle source
returns a string that can be used as the value of solr_parameters normalizes any long values >180 or <-180
# File lib/blacklight/maps/geometry.rb, line 69 def normalize_for_search @long -= 360 if @long > 180 @long += 360 if @long < -180 [@long, @lat] end