[OpenLayers-Trac] [OpenLayers] #3621: calculateResolutions - fault with min/max scale denomiators when both set to 0.

OpenLayers trac-20090302 at openlayers.org
Thu Feb 16 06:31:48 EST 2012


#3621: calculateResolutions - fault with min/max scale denomiators when both set
to 0.
--------------------------------------------------------------------------+-
 Reporter:  coastal                                                       |       Owner:  euzuro      
     Type:  bug                                                           |      Status:  new         
 Priority:  minor                                                         |   Milestone:  2.12 Release
Component:  Layer.WMS                                                     |     Version:  2.11        
 Keywords:  calculateResolutions minscaledenominator maxscaledenominator  |       State:              
--------------------------------------------------------------------------+-
 When connecting to a WMS that has an incorrect getCapbilities response the
 calculateResolutions function fails with 'invalid array length'.
 http://mapgateway.snh.gov.uk/ServicesWMS/FCS_Admin_Boundaries/MapServer/WMSServer?
 is the server that we've tested against. The getCapabilities response
 returns 0.0000000 values for min & max scale denominators. In the below
 calculate resolutions check numZoomLevels is NaN so goes through fine but
 fails at the array creation. I suspect a isNaN check should be included in
 the check as well.

 // are we able to calculate resolutions?
 if(typeof numZoomLevels !== "number" || numZoomLevels <= 0 || (typeof
 maxResolution !== "number" && typeof minResolution !== "number")) {
         return;
 }

 // now we have numZoomLevels and at least one of maxResolution
 // or minResolution, we can populate the resolutions array
 var resolutions = new Array(numZoomLevels);

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


More information about the Trac mailing list