Module: ol-map-editing

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 compassChanged
Source:

(method) deleteObject()

Method deleteObject
Source:

(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.

Source:

(method) endObject()

Ends the current object editing mode.

Source:

(method) filesUrl()

Method filesUrl
Source:

(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.

Source:
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
Source:

(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
Name Type Description
type string

The type of object to create.

geometry_type_id number

The ID of the geometry type.

Source:

(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()

Method specificEditorSave
Source:

(function) condition()

Method condition
Source:

(async, function) deleteObject() → {Promise.<void>}

Deletes the selected object.

Source:
Returns:
Type
Promise.<void>