1 2 Previous Next 15 Replies Latest reply on Mar 10, 2011 6:53 AM by v.bannur Go to original post
      • 15. Re: show point on the map
        v.bannur

        Hi,

         

        I have created gmap. and wanted to load all the markers.

        But here in the alert data.lat giving undefiened value. even i tried data.getAttribute("lat"); But not getting proper value.

         

        May i know how to get data.lat value in JS?

         

        code : <a4j:jsFunction name="loadPoints" data="#{gmBean.point}" oncomplete="createPoints(data)" />

         

        function createPoints(data) {

                                       alert(data.length);

                                       for (var i = 0; data.length; i++) {

        alert(data.lat);

                                                 var point = new GLatLng(data.lat, data.lng);

                                                 map.addOverlay(createMarkerWithIdentifier(point, data.desc));

                                                 }

                                       }

                                      

                                       function createMarkerWithIdentifier(point, desc) {

                                       var marker = new GMarker(point);

                                       GEvent.addListener(marker, "click", function() {

                                       marker.openInfoWindowHtml(desc);

                                       });

                                       return marker;

                                       }

        1 2 Previous Next