A mixin object containing methods related to editing objects on the map.
- Source:
Methods
(method) clearInteractions()
Clears the interactions on the map.
- Source:
(method) cloneFeature(feature, format, projection, projectionForSave) → {Object}
Clones a feature and transforms its geometry to a different projection.
Parameters:
Name | Type | Description |
---|---|---|
feature |
Feature | The feature to clone. |
format |
GeoJSON | The format used to serialize the feature. |
projection |
string | The projection of the feature's geometry. |
projectionForSave |
string | The projection to transform the feature's geometry to before saving. |
- Source:
Returns:
The cloned feature as a GeoJSON object.
- Type
- Object
(method) compassChanged()
(method) deleteObject()
(method) editProps(options)
Opens the property editor or the image viewer for the selected feature.
Parameters:
Name | Type | Description |
---|---|---|
options |
Object | The options for editing the properties. |
(method) endObject()
Ends the current object editing mode.
(method) filesUrl()
(method) formatArea(polygon) → {string}
Calculates the area of a polygon and formats it as a string. If the area is greater than 10000, it is formatted in square kilometers (km²). Otherwise, it is formatted in square meters (m²).
Parameters:
Name | Type | Description |
---|---|---|
polygon |
Polygon | The polygon for which to calculate the area. |
Returns:
The formatted area string.
- Type
- string
(method) formatLength(line) → {string}
Formats the length of a line.
Parameters:
Name | Type | Description |
---|---|---|
line |
LineString | The line to calculate the length for. |
- Source:
Returns:
The formatted length with unit (meters or kilometers).
- Type
- string
(method) getFeatureArea()
Gets the area of a given feature. Only works for features with a Polygon geometry type.
Parameters:
Name | Type | Description |
---|---|---|
feature. |
feature |
(method) newObject(options)
Creates a new object for editing on the map.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | The options for creating the new object. Properties
|
(method) readCustomFeatures() → {Promise.<void>}
Reads custom features from the server and adds them to the editable source.
- Source:
Returns:
A promise that resolves when the features are added.
- Type
- Promise.<void>
(method) saveFeature(feature, format, projection, projectionForSave) → {Promise.<void>}
Saves the geometry of a feature by sending it to the server.
Parameters:
Name | Type | Description |
---|---|---|
feature |
feature | The feature to be saved. |
format |
format | The format used to serialize the feature. |
projection |
projection | The projection of the feature's geometry. |
projectionForSave |
projection | The projection to transform the feature's geometry to before saving. |
- Source:
Returns:
A promise that resolves when the feature is successfully saved.
- Type
- Promise.<void>
(method) specificEditorSave()
(function) condition()
(async, function) deleteObject() → {Promise.<void>}
Deletes the selected object.
Returns:
- Type
- Promise.<void>