svn commit: r911539 - /ofbiz/trunk/framework/common/webcommon/includes/geolocation.ftl

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r911539 - /ofbiz/trunk/framework/common/webcommon/includes/geolocation.ftl

bibryam
Author: bibryam
Date: Thu Feb 18 19:38:44 2010
New Revision: 911539

URL: http://svn.apache.org/viewvc?rev=911539&view=rev
Log:
Allowed specifying InfoWindowHtml for each GMarker in google map. Before this fix, only the last GMarker had InfoWindowHtml.
Commented out duplicate code.

Modified:
    ofbiz/trunk/framework/common/webcommon/includes/geolocation.ftl

Modified: ofbiz/trunk/framework/common/webcommon/includes/geolocation.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/includes/geolocation.ftl?rev=911539&r1=911538&r2=911539&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/includes/geolocation.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/includes/geolocation.ftl Thu Feb 18 19:38:44 2010
@@ -38,14 +38,18 @@
             <#else>
               map.setUIToDefault();
             </#if>
-            <#list geoChart.points as point>
-              marker = new GMarker(new GLatLng(${point.lat?c}, ${point.lon?c}));
-              map.addOverlay(marker);
-              map.addOverlay(new GMarker(new GLatLng(${point.lat?c}, ${point.lon?c})));
-              <#if point.link?has_content>
-                marker.openInfoWindowHtml("<div style=\"width:210px; padding-right:10px;\"><a href=${point.link.url}>${point.link.label}</a></div>");
-              </#if>
-            </#list>
+            <#if geoChart.points?has_content>
+                <#list geoChart.points as point>
+                  var marker_${point_index} = new GMarker(new GLatLng(${point.lat?c}, ${point.lon?c}));
+                  map.addOverlay(marker_${point_index});
+                  //map.addOverlay(new GMarker(new GLatLng(${point.lat?c}, ${point.lon?c})));
+                  <#if point.link?has_content>
+                      GEvent.addListener(marker_${point_index}, "click", function() {
+                          marker_${point_index}.openInfoWindowHtml("<div style=\"width:210px; padding-right:10px;\"><a href=${point.link.url}>${point.link.label}</a></div>");
+                      });
+                  </#if>
+                </#list>
+            </#if>
           }
         </script>
       <#elseif  geoChart.dataSourceId == "GEOPT_YAHOO">