We have an application where we've created custom icons for each point
on the map.
We process and display the icons as follows:
for (var i = 0; i < locations.length; i++) { // cycle thru locations
points[i] = new GLatLng(locations[i].getAttribute("lat"),locations
[i].getAttribute("lng"));
bounds.extend(points[i]);
if(locations[i].getAttribute("icon")=="DESTINATION"){
markers[i] = new GMarker(points[i], dest_icon);
}
else if(locations[i].getAttribute("icon")=="ORIGIN"){
markers[i] = new GMarker(points[i], origin_icon);
}
else if(locations[i].getAttribute("icon")=="CURRENT"){
markers[i] = new GMarker(points[i], box_icon);
}else{
markers[i] = new GMarker(points[i], transfer_icon);
}
map.addOverlay(markers[i]);
}
That function works great and displays the markers as we want. We
recently switched from using loadFromWaypoints() to load() for our
gDirections calls and now we seem to be getting the google default
markers in addition to the custom markers. Commenting out the
map.addOverlay(markers[i]);
line takes away our custom markers, as expected, but the default ones
remain. How does one specify that we don't want to display default
markers on the returned directions? Can we override them somehow?
Below is the function that is displaying the directions (and the
default markers it seems).
function addDirections( leg ) {
var directions = new GDirections(map);
directions.load("from: " + leg[0] + " to: " + leg[1],
{'preserveViewport': 'true'});
}
Thanks for your help!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---