[OpenLayers-Users] ZoomBox Pan in two Mapdivs at the same time

Alexandre Dube adube at mapgears.com
Thu Jul 30 07:56:07 EDT 2009


Hi,

  Assuming your 'main' map is oMap and your 'second' map (that follows 
the main) is oMap2, the below code should do what you seek :

        oMap.events.register("moveend", null, function(e) 
{oMap2.panTo(e.object.getCenter())});
        oMap.events.register("zoomend", null, function(e) 
{oMap2.zoomTo(oMap2.getZoomForExtent(e.object.getExtent(), true))});

Regards,

Alexandre

Rahn Hanno (rahn) wrote:
>
> Hello list,
>
>  
>
> I have a problem with the zoomBox.
>
> In my Project I have two different map windows. The maps show the same 
> but in different times. The Geometries are polygons.
>
> Now I try to realise a rectangle zoom with a button. For this I use 
> the NavToolbar Control.
>
> This works fine for the first window. But now I will use it for the 
> second window in the same time. If I zoom into the first map, then the 
> second map should zoom in to the same center, zoomlevel, usw..
>
> The Pan should work for both maps, too.
>
> I will only use one button for both maps.
>
>  
>
> Perhaps somebody can help me. Sorry for my bad english and a lot of 
> thanks for your help.
>
>  
>
> Greetings
>
> Hanno Rahn
>
>  
>
> ------------------------------------------
>
> Hanno Rahn, Dipl.-Ing. (FH) Geoinformatik
>
> ZHAW Zürcher Hochschule für Angewandte Wissenschaften Umwelt und 
> Natürliche Ressourcen
>
> Fachstelle Geoinformatik
>
> Grüental, Postfach CH-8820 Wädenswil
>
> Tel +41 (0)58 934 5592
>
> Fax +41 (0)58 934 5580
>
> hanno.rahn at zhaw.ch
>
>  
>
>  
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at openlayers.org
> http://openlayers.org/mailman/listinfo/users
>   


-- 
Alexandre Dubé
Mapgears
www.mapgears.com




More information about the Users mailing list