[OpenLayers-Trac] [OpenLayers] #3173: Bad calculation of layer.maxScale while parsing OpenLayers.Format.WMSCapabilities

OpenLayers trac-20090302 at openlayers.org
Mon Mar 14 14:32:23 EDT 2011


#3173: Bad calculation of layer.maxScale while parsing
OpenLayers.Format.WMSCapabilities
------------------------------------+---------------------------------------
 Reporter:  jachym                  |       Owner:  tschaub     
     Type:  bug                     |      Status:  new         
 Priority:  minor                   |   Milestone:  2.11 Release
Component:  Format.WMSCapabilities  |     Version:  2.10        
 Keywords:                          |       State:              
------------------------------------+---------------------------------------
 In v1 of OpenLayers.Format.WMSCapabilities, v1_1,

 [http://trac.osgeo.org/openlayers/browser/trunk/openlayers/lib/OpenLayers/Format/WMSCapabilities/v1_1.js#L76]

 {{{
 [...]
             "ScaleHint": function(node, obj) {
                 var min = node.getAttribute("min");
                 var max = node.getAttribute("max");
                 var rad2 = Math.pow(2, 0.5);
                 var ipm = OpenLayers.INCHES_PER_UNIT["m"];
                 obj.maxScale = parseFloat(
                     ((min / rad2) * ipm *
                         OpenLayers.DOTS_PER_INCH).toPrecision(13)
                 );
                 obj.minScale = parseFloat(
                     ((max / rad2) * ipm *
                         OpenLayers.DOTS_PER_INCH).toPrecision(13)
                 );

 }}}

 If OpenLayers.DOTS_PER_INCH is set to 72, it seems to be working well. But
 if it is 96 (or other number), the result is different.

 Is it right?

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


More information about the Trac mailing list