From 0cb5d2cc937b74773a2ccf73b65a2823baacae81 Mon Sep 17 00:00:00 2001 From: AntonioTerceiro Date: Mon, 9 Jun 2008 22:44:59 +0000 Subject: [PATCH] ActionItem265: notifying missing items in map --- app/views/search/_google_maps.rhtml | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/app/views/search/_google_maps.rhtml b/app/views/search/_google_maps.rhtml index bd0ebd6..af02c5a 100644 --- a/app/views/search/_google_maps.rhtml +++ b/app/views/search/_google_maps.rhtml @@ -28,17 +28,24 @@ if (GBrowserIsCompatible()) { map.addControl(new GLargeMapControl()); map.addControl(new GMapTypeControl()); - map.setCenter(new GLatLng(-15.0, -50.1419), 4); + centerPoint = new GLatLng(-15.0, -50.1419); + map.setCenter(centerPoint, 4); <% + missed = false @results.each do |name,results| results.each do |item| if item.lat && item.lng %> putMarker(<%= item.lat.to_json %>, <%= item.lng.to_json %>, <%= item.name.to_json %>, <%= display_profile_info(item).to_json %>); <% - end + else + missed = true + end end end %> + <% if missed %> + <%= "map.openInfoWindowHtml(centerPoint, %s);" % _("One or more items don't have geographical information, and won't be shown in the map. Choose \"Display in list\" to see them.").to_json %> + <% end %> } -- libgit2 0.21.2