Using the V3 Google Maps API, I've run into a case where it seems that
creating the map for .setMap() causes .setPanel() to not do anything.
The ultimate goal is to have the map load once. If I create the Map
prior to the route call, everything works fine. But I first see the
map that is loaded when the Map is created, then the .route callback
causes the map to load a second time. I want to eliminate that first
load or minimize the time gap. Here's the snippet that works:
map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
directionsService.route(parms, function(result, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setMap(map);
directionsDisplay.setDirections(result);
directionsDisplay.setPanel(document.getElementById("textlist"));
}
});
Here's the broken:
directionsService.route(parms, function(result, status) {
if (status == google.maps.DirectionsStatus.OK) {
map = new google.maps.Map(document.getElementById("map_canvas"),
myOptions);
directionsDisplay.setMap(map);
directionsDisplay.setDirections(result);
directionsDisplay.setPanel(document.getElementById("textlist"));
}
});
--
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=.