[OpenLayers-Users] Maxextent, resolution and zoom issue

Arnd Wippermann arnd.wippermann at web.de
Tue Feb 2 17:00:46 EST 2010


Hi,
 
that's from an OS OpenSpace map for the whole UK:
 
osMap.getMaxResolution() : 2500
osMap.getExtent() for zoomLevel 0 (whole UK) : left-bottom=(-611483,-135514)
right-top=(1888517,1364486) 
osMap.resolutions : [2500,1000,500,200,100,50,25,10,5,2,1]
 
The example you refer to, seems to display only a small area of the UK,
perhaps Southampton.
 
Arnd

  _____  

Von: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] Im
Auftrag von jbloc1878 at googlemail.com
Gesendet: Dienstag, 2. Februar 2010 18:52
An: users at openlayers.org
Betreff: [OpenLayers-Users] Maxextent, resolution and zoom issue


Hi, i have been struggling with this problem for some time now.




Basically I am trying to display two layers. 50k and 250K of the uk. Can
anyone explain further what resolution, maxextent and zoom values I should
have to display these layers correctly? My layers cover the whole of the UK.
I have tried quite a few different values however I cannot make sense of how
this works. The example I am referring to is below.

Thanks for any help in advance

Create an options object that holds a limited set of map resolutions and a
maximum bounding extent to show the map. A new OS OpenSpace map object is
created by passing in our 'map' HTML div element id and the map options.

1.      var options = {resolutions: [10, 5],

2.                    maxExtent: new OpenSpace.MapBounds(400000, 100000,
450000, 150000) );

3.      osMap = new OpenSpace.Map('map', options);

We now set the centre of the map and set the initial map zoom level to 1
(corresponding to the second defined layer in the resolutions array).

1.      osMap osMap.setCenter(new OpenSpace.MapPoint(400000,100000), 1);

Cheers



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100202/5c9a292b/attachment.html


More information about the Users mailing list