Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

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

i am using distanceTo function in OpenLayers Geometry.

here am confused in which format it will return the value. It is in Kilometers or meters?

share|improve this question
up vote 0 down vote accepted

Meters if your map units are in meters (default).


Sorry, default is degrees. map units documentation

Defaults to ‘degrees’. Possible values are ‘degrees’ (or ‘dd’), ‘m’, ‘ft’, ‘km’, ‘mi’, ‘inches’.

But you can change that in your map constructor:

var map = new OpenLayers.Map({
    div: "map",
    units: 'm'

You can get the units like this:

share|improve this answer
thanks.. how to know map units, can u give me example. – Ramesh Kotha Apr 20 '12 at 18:07
I was wrong, please see my update. – CaptDragon Apr 20 '12 at 18:38

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.