module Geos::GoogleMaps::ApiCommon::Geometry
Public Instance Methods
to_g_json_point()
click to toggle source
Spit out Google's JSON geocoder Point
format. The extra 0 is added on as Google's format seems to like including the Z coordinate.
# File lib/geos/google_maps/api_common.rb, line 10 def to_g_json_point { :coordinates => (self.centroid.to_a << 0) } end
to_g_lat_lon_box()
click to toggle source
Spit out Google's JSON geocoder ExtendedData LatLonBox format.
# File lib/geos/google_maps/api_common.rb, line 17 def to_g_lat_lon_box { :north => self.north, :east => self.east, :south => self.south, :west => self.west } end
to_g_url_value(precision = 6)
click to toggle source
Spit out Google's toUrlValue format.
# File lib/geos/google_maps/api_common.rb, line 27 def to_g_url_value(precision = 6) c = self.centroid "#{Geos::Helper.number_with_precision(c.lat, precision)},#{Geos::Helper.number_with_precision(c.lng, precision)}" end
Also aliased as: to_g_url_value_point
to_g_url_value_bounds(precision = 6)
click to toggle source
Force to Google's toUrlValue as a set of bounds.
# File lib/geos/google_maps/api_common.rb, line 34 def to_g_url_value_bounds(precision = 6) url_value = self.to_g_url_value(precision) "#{url_value},#{url_value}" end