In my version 2 of the API I was able to define a new MarkerManager and then
following that add markers to the marker manager.

It is to my understanding that now I must wait until it is "loaded" after
declaring a new MarkerManager?

Let me explain my circumstances a bit.  I have a web element embedded into
some c++ code for a project I have been working on.  I am reading values
that I had previously stored in and was adding them one at a time to the
MarkerManager.  I was doing this one at a time b/c I was using the same
function to add new markers to the map whenever a user added another marker.
 I preformed a test to see if the MM exists and if it does add the marker to
the manager and if not create a new on and then add the markers.

My problem is that it apparently isn't being initialized and loaded in any
descent amount of time and I have no real way of knowing when it is loaded
or not, so how do I know when I need to load the markers?  I don't want to
skip over adding the markers entirely, so how can I go about achieving this?

Here is what I have so far:
var StartMarker = new google.maps.Marker(point1, ZoneStartMarkerOptions);
var FinishMarker = new google.maps.Marker(point2, ZoneFinishMarkerOptions);

try {
if (ZoneStartFinishMMLoaded == true) {
alert("ZoneStartFinishMM");
ZoneStartFinishMM.addMarker(ZoneStartFinishMarkers[idStart], 1);
ZoneStartFinishMM.addMarker(ZoneStartFinishMarkers[idFinish], 1);
ZoneStartFinishMM.refresh();
} //  End if ZoneStartFinishMM
//------------------------------------------------------------------------------------------------------------------------------------------------
//  If it doesn't exist then we create a new one and then add our markers
//------------------------------------------------------------------------------------------------------------------------------------------------
else {
alert("!ZoneStartFinishMM");
try {
while(ZoneStartFinishMMLoaded == false) {
if(!ZoneStartFinishMM) {
ZoneStartFinishMM = new MarkerManager(map);
try {
MMListeners.push(google.maps.event.addListener(ZoneStartFinishMM, 'loaded',
function(){
alert("setup");
setupStartFinishMarkers();
}));
}
catch(error) {
alert("Error creating listener");
}
}
}
}
                catch(error) {
alert("Error creating MarkerManager " + error);
}
try {
if(ZoneStartFinishMMLoaded == true){
ZoneStartFinishMM.addMarker(ZoneStartFinishMarkers[idStart], 1, 18);
ZoneStartFinishMM.addMarker(ZoneStartFinishMarkers[idFinish], 1, 18);
}
else
return;
}
catch(error) {
alert("Error adding the markers to the marker manager");
}
                ZoneStartFinishMM.refresh();
      }

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to