Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there any source describing the accuracy of OpenLayer's scale line? You can get an scale line by using the constructor:

map.addControl(new OpenLayers.Control.ScaleLine());

However, it seems to be very inaccurate in relation to my geodesic measurements (0.5 km - 1.5 km difference depending on zoom). Is there any info I can cite to explain this different?

I'm using OpenLayers "Release 2.13.1" and OSM as base layer. I'm calculating the distance between point using WGS84 projection with 3 decimals and geopy distance module.

As an example, the distance between the points -2.416,55.703 and -2.434,55.698 is 2066.599 m according to my calculations and 2.5 - 3 km according to the scale line depending on zoom.

Ideally, the info I'm looking for is something like "the scale is accurate in +- 1 km because it calculates the distance using X method". The official doc ( doesn't mention accuracy.

share|improve this question
up vote 5 down vote accepted

The ScaleLine represents the scale of the map on the screen, and hence is intrinsically different from the scale of a printed map.

The OSM tileset is built using the Web Mercator projection, and this projection does not maintain scale. This is why you do not get perfect scale.

If you want the geodesic scale, you should use the geodesic:true parameter while constructing the Scale line control. You should note, that this gives the geodesic scale at the center of the map, which might not be the same as the scale at other parts of the map.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.