drawNewFeature()

Sets the map in the drawing mode to draw new feature.

Example:

const allFeatureLayers = map.getFeatureLayers();
const intendedLayer = allFeatureLayers["<intended layer name>"];
intendedLayer.drawNewFeature();

beginEditFeature(Id)

Sets the map in the drawing mode to edit existing feature.

Parameters:

Id (Number): A feature id.

Example:

const allFeatureLayers = map.getFeatureLayers();
const intendedLayer = allFeatureLayers["<intended layer name>"];
intendedLayer.beginEditFeature(10);

saveEditFeature(Id)

Use saveEditFeature to save feature changes and cancelEditFeature to cancel changes. If you give the Id of the feature in saveEditFeature, the existing feature will be updated, otherwise a new feature will be inserted.

Parameters:

Id (Number)?: A feature id.

Example:

intendedLayer.saveEditFeature(10)

deleteFeature(Id)

Deletes the existing feature.

Parameters:

Id (Number): A feature id.

Example:

const allFeatureLayers = map.getFeatureLayers();
const intendedLayer = allFeatureLayers["<intended layer name>"];
intendedLayer.deleteFeature(10);

Leave a comment

Your email address will not be published. Required fields are marked *