[OpenLayers-Trac] [OpenLayers] #1321: maxScale value not always respected

OpenLayers trac at openlayers.org
Mon Feb 4 09:43:19 EST 2008


#1321: maxScale value not always respected
------------------------------------------+---------------------------------
 Reporter:  openlayers                    |       Owner:  euzuro     
     Type:  bug                           |      Status:  new        
 Priority:  major                         |   Milestone:  2.7 Release
Component:  Layer                         |     Version:  2.4        
 Keywords:  layer scale resolution patch  |       State:             
------------------------------------------+---------------------------------
 In some scenarios the maxScale value is not respected.

 In the attached example, maxScale for the "DM Solutions Demo" layer is set
 to 800000.  However, when the user zooms to 865K, the layer is disabled
 inappropriately. (At other zoom levels, the application works as
 expected.)

 After review, it appears that the minResolution value is being overridden
 with a value that is based on that layer being the base layer. When the
 layer in question is not the base layer, it is unpredictable (without
 extensive calculation) whether the layer will behave correctly in calls to
 calculateInRange().

 It is possible that this bug also affects
 minResolution/minScale/maxResolution but I have yet to create a test case.
 I have added additional code to avoid this possibility.

 The attached patch corrects the problem, but this function has so many
 potential uses that I recommend an independent review of the code to avoid
 unforseen sideeffects.

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


More information about the Trac mailing list