utils/geojson¶
Type Aliases¶
LngLat¶
Defined in: utils/geojson.ts:7
Small typed builders for the GeoJSON features the map renderers and drawing managers construct inline all over the codebase. Coordinates follow the GeoJSON convention: [lng, lat].
Functions¶
pointFeature()¶
Defined in: utils/geojson.ts:9
Parameters¶
coordinates¶
properties?¶
GeoJsonProperties = {}
id?¶
string | number
Returns¶
Feature\<Point>
lineStringFeature()¶
Defined in: utils/geojson.ts:22
Parameters¶
coordinates¶
LngLat[]
properties?¶
GeoJsonProperties = {}
Returns¶
Feature\<LineString>
polygonFeature()¶
Defined in: utils/geojson.ts:37
Build a polygon feature from a single outer ring. The ring is closed automatically (first point appended) unless it already is.
Parameters¶
ring¶
LngLat[]
properties?¶
GeoJsonProperties = {}
Returns¶
Feature\<Polygon>
featureCollection()¶
Defined in: utils/geojson.ts:49
Type Parameters¶
G¶
G extends Geometry
Parameters¶
features?¶
Feature\<G, GeoJsonProperties>[] = []
Returns¶
FeatureCollection\<G>
toLngLatCoords()¶
Defined in: utils/geojson.ts:56
Convert {lat, lng} points (drawing managers' format) to [lng, lat].
Parameters¶
points¶
object[]
Returns¶
LngLat[]