Hi There !
I'm new in google maps api
I have build a function for plotting several address onto the map which
comes from db
This is the loop pro plotting multiple address onto the map
var geocoder=new GClientGeocoder;
for(i=0;i<address.length;i++){
geocoder.getLatLng(address[i],function(point){
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
if (point){
map.setCenter(point, 13);
map.addOverlay(createmarker(point));
}
});
}
the createmarker function as
function createmarker(p){
var m = l-1;
var num = runorder[m];
var icon = new GIcon();
icon.image
=
'http://gmaps-samples.googlecode.com/svn/trunk/markers/circular/greencirclemarker.png';
icon.iconSize = new GSize(25, 25);
icon.iconAnchor = new GPoint(13, 12);
icon.infoWindowAnchor = new GPoint(25, 7);
opts = {
"icon": icon,
"clickable": true,
"labelText": num,
"labelOffset": new GSize(-6, -10)
};
var marker = new LabeledMarker(p, opts);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(displayadd[m]);
});
labeledmarkers[l-1] = marker;
l=l+1;
return marker;
}
the problem is this sometime it plot the 12 address and when i refresh
th page markers are changed and sometimes plots only 1 address no any
condition to plot the total address from my address[] array
what to do is there i have mistaken?
--
You received this message because you are subscribed to the Google Groups
"Google Maps API V2" 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.