Class: Geogov::Google
- Inherits:
-
Object
- Object
- Geogov::Google
- Defined in:
- lib/geogov/providers/google.rb
Instance Method Summary collapse
- #dimension(l1, l2) ⇒ Object
- #location(l1, l2) ⇒ Object
- #map_href(lat, lon, options = {}) ⇒ Object
- #map_img(lat, lon, options = {}) ⇒ Object
Instance Method Details
#dimension(l1, l2) ⇒ Object
5 6 7 |
# File 'lib/geogov/providers/google.rb', line 5 def dimension(l1,l2) "#{l1}x#{l2}" end |
#location(l1, l2) ⇒ Object
9 10 11 |
# File 'lib/geogov/providers/google.rb', line 9 def location(l1,l2) "#{l1},#{l2}" end |
#map_href(lat, lon, options = {}) ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/geogov/providers/google.rb', line 31 def map_href(lat,lon, = {}) = { :z => [:z] || 14, :ie => "UTF8", :q => location(lat,lon) } if [:marker_lat] && [:marker_lon] location = location([:marker_lat],[:marker_lon]) [:sll] = location end params = Geogov.hash_to_params() "http://maps.google.com/maps?#{params}" end |
#map_img(lat, lon, options = {}) ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/geogov/providers/google.rb', line 13 def map_img(lat,lon,= {}) = { :zoom => [:z] || 14, :size => dimension([:w],[:h]), :center => location(lat,lon), :sensor => false } if [:marker_lat] && [:marker_lon] location = location([:marker_lat],[:marker_lon]) [:markers] = ["color:blue",location].join("|") end params = Geogov.hash_to_params() "http://maps.google.com/maps/api/staticmap?#{params}" end |