[OpenLayers-Users] maxResolution,
minResolution and resolutions in OpenLayers
Esben Taudorf
eta at le34.dk
Wed Jul 21 05:17:10 EDT 2010
Hi everybody.
In OpenLayers 2.9.1 my map options is defined with a maxResolution,
minResolution and a MaxExtent like below:
var mapOptions =
{
projection: 'EPSG:25832',
units: 'm',
maxExtent: new OpenLayers.Bounds(100000,6000000,1000000,6500000),
minResolution: '0.125',
maxResolution: '768',
restrictedExtent: new
OpenLayers.Bounds(100000,6000000,1000000,6500000),
controls:
[
]
};
This works fine in OpenLayers 2.9.1 but doesn't work with the nightly
build (version 19-07-2010 and 14-06-2010)
In the nightly build I get this error in firebug when adding the first
layer to the map:
this.resolutions is undefined: zoom = Math.max(0, Math.min(zoom,
this.resolutions.length - 1)); (Layer.js (line 1061))
When I define the resolutions in my map options like below the map works
fine again:
var mapOptions =
{
projection: 'EPSG:25832',
units: 'm',
maxExtent: new OpenLayers.Bounds(100000,6000000,1000000,6500000),
minResolution: '0.125',
maxResolution: '768',
restrictedExtent: new
OpenLayers.Bounds(100000,6000000,1000000,6500000),
resolutions: [768, 384, 192, 96, 48, 24, 12, 6, 3, 1.5, 0.75, 0.375,
0.185],
controls:
[
]
};
I can see that there are some issues with the resolutions:
http://trac.openlayers.org/ticket/2427
My question is now do I always need to add the resolutions in map
options or can I use maxResolution, minResolution and a MaxExtent?
Regards Esben
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20100721/d0b0beec/attachment.html
More information about the Users
mailing list