Map JS API
Learn how to manage geometry on the map
In a Rasters.io map, items can be added to the maps. The following geometries are supported : Point, Polygon, Circle, and Line.
When an item is added with the JS API it’s possible to add a relation to a specfic Annotation layer of the map (LayerId not null) OR just add it globally and not related to any layers (LayerId to null). When items are related to a layer, the following features can be used :
- When the Layer is Hidden/Displayed, all related items are automatically hidden/displayed
- When the Layer is deleted, all related items are automatically deleted
- Queries can be executed to get or set properties to all items of a layer.
The API method AddMapItems is used to add a feature on the map and the following parameters can be set :
items : GeoJSon defining the features to add and all properties
layerId : Id of the related layer for the features. If no layer is related set to “”.
isShared : indicates if the features added are shared and persistent (true) OR live only in the current session (false)
isLocked : Indicates if the features can be moved by the user (false) or not (true). A Locked feature can be still deleted or updated via the JS API.