1

Hi i want to know how to find the distance between two markers in openlayers.

```
var distance = distanceBetweenMarkers(latLon1, latLon2){
//code to find the distance between latLon1, latLon2
}
```

pleae help me...

4

Create points from your `LonLat`

and call `distanceTo`

method from `Geometry.Point`

[1].

```
p1 = new OpenLayers.Geometry.Point(latLon1.lon,latLon1.lat);
p2 = new OpenLayers.Geometry.Point(latLon2.lon,latLon2.lat);
len = p1.distanceTo(p2);
```