# distance

return type | Number
syntax | $.geo.distance( Object shape1 ( GeoJSON object ), Object shape2 ( GeoJSON object ) )

usage

    var distanceBetween = $.geo.distance(
      { type: "Point", "coordinates": [ -71, 40 ] },
      { type: "Point", "coordinates": [ -70.5, 41 ] }
    )

The distance method calculates the distance between two basic GeoJSON geometry objects and returns it in non-geodetic units. The basic shapes are Point, LineString and Polygon. If you are using geomap with its default map service, the distance is in meters because the default projection is web mercator meters.

If either argument is not a basic GeoJSON geometry object, this function returns undefined.

This function is similar to Geometry.distance in JTS.