Untitled
unknown
plain_text
10 months ago
847 B
7
Indexable
private fun undoLastGraphic() {
if (graphicsStack.isNotEmpty()) {
val lastGraphics = graphicsStack.removeAt(graphicsStack.size - 1)
lastGraphics.forEach { graphic ->
graphicsOverlay.graphics.remove(graphic)
}
if (selectedGeometryType == "Area" && polygonPoints.isNotEmpty()) {
polygonPoints.removeAt(polygonPoints.size - 1)
if (polygonPoints.size < 3) {
calloutLocation.value = null
areaText.value = ""
} else {
convertToArea(polygonSymbol, originalAreaUnit, polygonPoints)
val polygon = Polygon(polygonPoints)
calloutLocation.value = GeometryEngine.labelPointOrNull(polygon)
}
}Editor is loading...
Leave a Comment