# encoding: utf-8
- @page_title = "Global Links"
#placemarks
%h3 Global Links
%table.globallinks
- @globallinks.each do |g,c|
%tr
%th Globallink
%th Zähler
%th Orte
%tr
%td
%h4 #{g}
%p
- g_latlon = Geocoder.coordinates(g)
- hh_latlon = [53.5510846, 9.9936818] # hamburg
- distance = Geocoder::Calculations.distance_between(hh_latlon,g_latlon)
- if distance && !distance.nan?
- d = distance.round
(Distanz: #{d} km)
%br
= image_tag "http://maps.google.com/maps/api/staticmap?size=225x125&sensor=false&zoom=2&markers=#{g_latlon[0]}%2C#{g_latlon[1]}"
- else
(Globallink nicht gefunden)
%td
%h4 #{c}
%td
%ul
- pp = Placemark.where('geo_relation LIKE ?', "%#{g}%")
- pp.each do |p|
%li
#{p.layer.map.title} >
=link_to "#{p.title}", placemark_path(p)