I wrestled with how to zoom out, then pan and then zoom back in to the
new destination heres the what I came up with:
first function(){
_map.addEventListener(MapZoomEvent.ZOOM_CHANGED, secondFunction);
var zoomOutLevel = int(zoomLevelVariable-2);
_map.setZoom(zoomOutLevel,true);
}
public static function secondFunction(event:MapZoomEvent):void{
_map.removeEventListener(MapZoomEvent.ZOOM_CHANGED, secondFunction);
map.panTo(latLongPointVariable);
myTimer = new Timer(100);
myTimer.addEventListener("timer", zoomBack);
myTimer.start();
}
public static function zoomBack(eventArgs:TimerEvent):void {
myTimer.removeEventListener("timer", zoomBack);
myTimer = new Timer(100);
myTimer.addEventListener("timer", zoomBack);
myTimer.start();
var val1 = String(_map.getCenter());
var val2 = String(lastPoint);
lastPoint = _map.getCenter();
if(val1==val2){
myTimer.stop();
_map.setZoom(zoomLevelVariable,true);
}
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API For Flash" 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-for-flash?hl=en
-~----------~----~----~----~------~----~------~--~---