I am adding a new GraphicOverlay to my map using `mapView.graphicsOverlays.add` but it does not update the UI. Once you move or tap the map it refreshes and the new graphics are shown.
In my case I am drawing a polygone.
Is there anything that I am missing?
Hi,
Can you share any sample code on when & how the graphicsOverlay being added?
Or
We have many samples adding graphics to graphicsOverlay, may be you can tweak one of those to showcase your workflow to reproduce the problem and share it here
https://github.com/Esri/arcgis-runtime-samples-android
Thanks
Rama
Refreshing the viewpoint works as a workaround:
mapView.setViewpointScaleAsync(getMapScale(getZoomLevel(mapView)))
Here is some example code that I can share:
// When creating the view:
defaultGraphicsOverlay = GraphicsOverlay()
mapView.graphicsOverlays.add(defaultGraphicsOverlay)
// Method that adds the graphics:
private fun onAddGraphic() {
val newGraphics = createNewGraphics()
defaultGraphicsOverlay.graphics.addAll(newGraphics)
}
Its quiet simple. onAddGraphic is called at some point by the user, not initially.