Hi again.
I just found a solution to my problem. The Layer.initResolutions has been rewritten in the nightly build and now it checks if maxResolution and minResolution is a number. So when I remove the quotation marks from maxResolution and minResolution 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), controls: [ ] }; maxResolution and minResolution can be set to 'auto' so I assumed it could only be a string. My mistake... Fra: users-boun...@openlayers.org [mailto:users-boun...@openlayers.org] På vegne af Esben Taudorf Sendt: 21. juli 2010 11:17 Til: users@openlayers.org Emne: [OpenLayers-Users] maxResolution,minResolution and resolutions in OpenLayers 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
_______________________________________________ Users mailing list Users@openlayers.org http://openlayers.org/mailman/listinfo/users