return type | Number |
---|---|

syntax | $.geo.length( Object shape ( GeoJSON object ) ) |

usage | var length = $.geo.length( { type: "LineString", coordinates: [[ [-75, 39.7], [-74.8, 39.3], [-75.2, 39.3] ]] } ) |

The length method calculates the length of a basic GeoJSON geometry object 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 length is in meters because the default projection is web mercator meters.

This function returns 0 for Point objects, the length of LineString objects and the perimeter of Polygon objects.

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

This function is similar to Geometry.getLength in JTS.