class Administrate::Field::LatLng
Public Instance Methods
google_api_key()
click to toggle source
Get Google API Key. How to obtain one: developers.google.com/maps/documentation/javascript/get-api-key
# File lib/administrate/field/lat_lng.rb, line 40 def google_api_key options.fetch(:google_api_key, nil) end
initial()
click to toggle source
Returns the initial co-ordinates of blank maps (defaults to Leeds, UK)
# File lib/administrate/field/lat_lng.rb, line 50 def initial options.fetch(:initial, [53.8003,-1.5519]) end
lat?()
click to toggle source
True if the :lat option has been provided, or field is called :lat
# File lib/administrate/field/lat_lng.rb, line 25 def lat? options.fetch(:lat, attribute == :lat) end
lng?()
click to toggle source
True if the :lng option has been provided, or field is called :lng
# File lib/administrate/field/lat_lng.rb, line 30 def lng? options.fetch(:lng, attribute == :lng) end
search?()
click to toggle source
Return wether or not search should be enabled (defaults to true)
# File lib/administrate/field/lat_lng.rb, line 35 def search? options.fetch(:search, true) && google_api_key.present? end
to_s()
click to toggle source
# File lib/administrate/field/lat_lng.rb, line 59 def to_s data end
which()
click to toggle source
Returns :lat or :lng depending on which type this is
# File lib/administrate/field/lat_lng.rb, line 45 def which lat? ? :lat : :lng end
zoom()
click to toggle source
Returns the initial zoom level for maps (defaults to 11)
# File lib/administrate/field/lat_lng.rb, line 55 def zoom options.fetch(:zoom, 11) end