Untitled

 avatar
unknown
plain_text
14 days ago
847 B
3
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