replaceGeometry method

void replaceGeometry(
  1. Geometry geometry
)

Replaces the current GeometryEditor.geometry with the specified geometry.

Use this method to make changes to the GeometryEditor.geometry that are not directly supported using other GeometryEditor methods. For example, to start a new part in a Polygon or Polyline geometry, get the current GeometryEditor.geometry, use a MultipartBuilder to add the required part, and then pass the updated GeometryBuilder.toGeometry to this method.

The GeometryEditor.geometry is replaced by the given geometry, and therefore the z-awareness of GeometryEditor.geometry will be the same as the given geometry.

Parameters:

  • geometry — The new geometry to replace the current geometry. The GeometryType of these geometries must match.