Hii all,
I am new to ArcGIS runtime SDK for android. I want to add a point on map on button click like Field Maps mobile app by ESRI where by clicking on 'Add Point' button, point added on map according to crosshair position on map . please help regarding the same thanx in advance
// create and style graphic with symbol to be added to the map
val locationGraphic = Graphic().apply {
symbol = SimpleMarkerSymbol(SimpleMarkerSymbol.Style.X, Color.MAGENTA, 15f)
}
// create a graphics overlay to add the graphic
val graphicsOverlay = GraphicsOverlay().apply {
graphics.add(locationGraphic)
}
// add the graphics overlay to the MapView
mapView.graphicsOverlays.add(graphicsOverlay)
addPointButton.setOnClickListener {
val screenPoint = android.graphics.Point(xPosition, yPosition)
// create a map point from the screen point
val mapPoint: Point = mapView.screenToLocation(screenPoint)
// show graphic at the screen point
locationGraphic.geometry = mapPoint
}