Add/sync feature(point) to map

241
1
06-01-2023 03:50 AM
komalzoting
New Contributor II

Hii All,

I have loaded map using portal/portal item. Now i want to add/sync feature(point) on the same map, how can i add/sync,  please help.

0 Kudos
1 Reply
PriyankaRupani
Esri Contributor

Hello,
You can add the point graphic to the same map using below code snippet:

// create and add a map with with portal item
val map = ArcGISMap(portalItem)
// add the marker graphic to the graphics overlay
graphicsOverlay.graphics.add(markerGraphic)
mapView.apply {
this.map = map
// add the graphics overlay to the MapView
graphicsOverlays.add(graphicsOverlay)
}
// setup the red pin marker as a Graphic
private val markerGraphic: Graphic by lazy {
// creates a symbol from the marker drawable
val markerSymbol = PictureMarkerSymbol.createWithImage(markerDrawable).apply {
// resize the symbol into a smaller size
width = 30f
height = 30f

}
// create the graphic from the symbol
Graphic(symbol = markerSymbol)
}

 Let me know if this helps?

0 Kudos