[OpenLayers-Trac] [OpenLayers] #1127: cannot set maxResolution as an option on layer creation, it is always overridden in initResolutions

OpenLayers trac at openlayers.org
Wed Nov 7 11:07:10 EST 2007


#1127: cannot set maxResolution as an option on layer creation, it is always
overridden in initResolutions
--------------------------+-------------------------------------------------
 Reporter:  johnwebbcole  |       Owner:     
     Type:  bug           |      Status:  new
 Priority:  major         |   Milestone:     
Component:  general       |     Version:  2.5
 Keywords:                |  
--------------------------+-------------------------------------------------
 I have a utility that emits the JS needed for creating OL layers, an
 option is to emit the resolutions available to each layer.

 An issue I ran into is that if you pass in a full array of resolutions,
 and try to set a maxResolution, the initResolutions function resets
 maxResolution to resolutions[0].  It appears that confProps.maxResolution
 is set, so I've modified initResolutions to use that value instead of the
 top of the resoltuions array.

 This fixes my issue with the LayerSelector and not being able to have a
 layer out of range from the layers options.

 I can easily see possible side effects if other code is assuming that the
 max resolution of a layer is equal to the first value in the resolution
 array but a quick find in files didn't turn up anyone using
 resolutions[0].

 This issue might also cause a maxScale option to be effectively ignored as
 well (as the inRange is set from the maxResolution value and not the
 maxScale value).

 Not sure on everyone else's priority but it was major to me :-) It took a
 while to figure out why an option was being ignored.

-- 
Ticket URL: <http://trac.openlayers.org/ticket/1127>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list