[OpenLayers-Users] Is "1:27K" representing that one pix in screen is 27 KiloMeters?

Yang Zhaohui yangzhaozhao2008 at 163.com
Thu Oct 11 04:16:05 EDT 2007


Hello dir sir,
    I found some codes as the followed in the scale.js.
But I donnot know the reason that it is choosen 9500 and 950000 to be the threshold value.What's the meanings of the "K" and "M" ? Are they represeting KiloMeter and Meter?
    And what's the meaning of ' 1 : getScale()'?
    For example ,referencing the mouse-position example,I make my demo page display pageX,pageY and map coordinates at the same time.When x=3,the map coordinate x=88.86156.And when x=4 ,the map coordinate  x=88.86165.At this time the scale span diaplays "1:27K".Is "1:27K"  representing that
 one pix in screen is 27 KiloMeters?I am puzzled.Any help will be ok. 
Thank you very much!
                                                       Sincerely yours,
                                                             Yang
 var scale = this.map.getScale();
        if (!scale) return;
         if (scale >= 9500 && scale <= 950000) {
            scale = Math.round(scale / 1000) + "K";
        } else if (scale >= 950000) {
            scale = Math.round(scale / 1000000) + "M";
        } else {
            scale = Math.round(scale);
        }   
       
        this.element.innerHTML = "Scale = 1 : " + scale;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20071011/2ca2e653/attachment.html


More information about the Users mailing list