I found the mistake ;)

       // extend the map buffer zone
        var nePoint2:Point = new Point(nePoint.x+1000,
nePoint.y-11000);
        var swPoint2:Point = new Point(swPoint.x-1000, swPoint.y
+1000);


cheers, Flexa



On 4 Dez., 21:53, Flexa <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I would like to extend the map viewport to create a "buffer zone"
> around the viewport to show some markers.. and if the user navigate
> out of the "buffer zone" I would like to load new markers. I know
> there is a marker manager.. but i have to show 1mio markers on the
> map.. so i think there is no way to reload the markers and but the new
> ones on the map.
>
> So how can I extend the viewport zone/ bounds ?
>
> I created a class and with the following function i would like to
> extend the viewport:
>
> public function setLatLngBounds(value:LatLngBounds):void
> {
>         var zoom:Number = this._map.getZoom();
>         var ne:LatLng = value.getNorthEast();
>         var sw:LatLng = value.getSouthWest();
>
>        // translate to pixel
>         var nePoint:Point = this._map.MERCATOR_PROJECTION.fromLatLngToPixel
> (ne, zoom);
>         var swPoint:Point = this._map.MERCATOR_PROJECTION.fromLatLngToPixel
> (sw, zoom);
>
>        // extend the map buffer zone
>         var nePoint2:Point = new Point(nePoint.x+1000, nePoint.y+1000);
>         var swPoint2:Point = new Point(swPoint.x+1000, swPoint.y+1000);
>
>        // translate to geo data
>         var ne2:LatLng = this._map.MERCATOR_PROJECTION.fromPixelToLatLng
> (nePoint2, zoom);
>         var sw2:LatLng = this._map.MERCATOR_PROJECTION.fromPixelToLatLng
> (swPoint2, zoom);
>
>         // create new bounds and set the "buffer zone"
>         var latLngBounds:LatLngBounds  =  new LatLngBounds(sw2, ne2);
>         this._mapLatLngBounds = latLngBounds;
>
> }
>
> private function handleMoveStep(e:MapMoveEvent):void
> {
>     // check if the map is in the buffer zone
>     if( ! this._mapLatLngBounds.containsBounds
> ( this._map.getLatLngBounds()) ) {
>            trace("do something");
>    }
>
> }
--~--~---------~--~----~------------~-------~--~----~
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