Im having trouble referencing the Marker information for adding custom
info window popups,

problem being that the GetLocations function completes after my
Markers are drawn,

I can make the custom popup window show, roughly based on this example
http://marcgrabanski.com/article/jquery-google-maps-tutorial-basics,

but only occurs for the last drawn element, is there a method I can
use that will allow me to run the marker creation script after the
markers are drawn, with a index of the array would also be nice?
Finding it hard to locate examples on this.

        function parseJson(doc) {
                        var jsonData = eval("(" + doc + ")");
                        for (var i = 0; i < jsonData.markers.length; i++) {
                                var mData = jsonData.markers[i];
                                gmapdata.push(mData);

                                geocoder.getLocations(mData.fulladdress, 
createMarker);
                        }               }

                function createMarker(response) {
                        place = response.Placemark[0];
                        point = new GLatLng(place.Point.coordinates[1],
                          place.Point.coordinates[0]);
                        marker = new GMarker(point);
                        gmarkers.push(marker);
                        GEvent.addListener(marker, "click", function() {

                        Infowin(marker.getPoint());
                        });

                        gmap.addOverlay(marker);
                }


        var geocoder = new GClientGeocoder();
                GDownloadUrl("Json.ashx", function(data, responseCode) {
                        parseJson(data);
                });

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to