Hi karmats-

That's a lot of panning/zooming code for a sidebar click. What effect
are you trying to achieve?

I wonder if the openInfoWindow call is interfering with your pan/zoom
requests, since info windows pan the map. Have you tried removing that
call to see what happens?

- pamela

On Thu, Oct 16, 2008 at 12:46 AM, karmats <[EMAIL PROTECTED]> wrote:
>
> Hi all,
> I have a problem of making it work when trying to zoom in or out when
> the map is panning. When I try that the map heads out to a random
> place in the NW corner of the world.
>
> Here is the code I'm trying to use (I am using that sidebar described
> in the demo section and when a user clicks on one of the sidbar links
> this is firing off):
>            function onItemClick(event:MouseEvent):void
>            {
>                latLngPanningTo = item.getLatLng();
>                // Distance >  2000 km -> zoom out
>                if( _map.getCenter().distanceFrom(latLngPanningTo) >
> 2000000 ) {
>                        _map.setZoom(3);
>                } else {
>                        _map.setZoom(6);
>                }
>                item.openInfoWindow(infoWindowOpts);
>                _map.panTo(latLngPanningTo);
>                isPanning = true;
>            }
>        }
>
> And for when the panning has ended I use this event listener:
>
>        private function moveEnd(evt:MapMoveEvent):void {
>                if( evt.latLng.equals(latLngPanningTo) && _map.getZoom() < 4
> && isPanning == true) {
>                        isPanning = false;
>                        _map.setZoom(6);
>                }
>        }
>
> I use continuous zoom for the map.
>
> Thank you in advanced.
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to