incrementing variable names - how do I do it? Google Maps API
I am trying to integrate google maps into my website. I want the user to be able to view my company's current customers on the map.
I can query my database and get the customer's Name, and longitude, latitude.
I can make a single marker on the map like this:
var marker = new GMarker(new GLatLng(<cfoutput>#geoip.testilat#</cfoutput>, <cfoutput>#geoip.testilong#</cfoutput>));
GEvent.addListener(marker, "click", function() {
var html = '<div style="width: 210px; padding-right: 10px"><cfoutput>#geoip.schoolName#</cfoutput><br><cfoutput>#geoip.text# </cfoutput><\/div>';
marker.openInfoWindowHtml(html);
});
map.addOverlay(marker);
GEvent.trigger(marker, "click");
But I need to iterate through the database and create a marker for each row, with a different variable name for each, ie. marker, marker1, etc..
I know I need to build some sort of loop but I don't know how. Can someone point me in the right direction?
Thanks
