[OpenLayers-Users] Large denominator scales are inaccurate

Balázs Bámer bamerbalazs at gmail.com
Sat Jun 6 06:50:37 EDT 2009


Hi All,

This might be a developer post, but I write here, as may be useful for
someone. When displaying large scale maps, over 1:1000000
the scale is displayed as 1:1M 1:2M even if it is actually 1:1500000
which is quite inaccurate. I propose to change appropriate part of
OpenLayers/Control/Scale.js to

 if (scale >= 9500 && scale < 9500000) {
            scale = Math.round(scale / 1000) + "K";
        } else if (scale >= 9500000) {
            scale = Math.round(scale / 1000000) + "M";
        } else {
            scale = Math.round(scale);
        }

achieve similar behaviour as under 1:9500. Applies to 2.7

Best regards: Balázs



More information about the Users mailing list