You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
void addMarkers(){
//create some markers here
//add markers to the Map<MarkerId, Marker> markers
...
If I call addMarkers() inside onMapCreated, the app will throw exception:
Unhandled Exception: PlatformException(error, Attempt to invoke virtual method 'void net.daum.mf.map.api.MapView.addPOIItem(net.daum.mf.map.api.MapPOIItem)' on a null object reference, null, java.lang.NullPointerException: Attempt to invoke virtual method 'void net.daum.mf.map.api.MapView.addPOIItem(net.daum.mf.map.api.MapPOIItem)' on a null object reference
Seems like the MapView is not instantiated yet.
If I call addMarkers() from a button (ie: after map fully loads), it works and all the markers are added to the map. I thought that onMapCreated callback is fired after the map has fully loaded, but it seems like this is not working.
Where can I call addMarkers() to add markers automatically without triggering it from a button?
Thanks:)
The text was updated successfully, but these errors were encountered:
Can you please help me understand how I can add markers to the map on map first showing up?
If I call addMarkers() inside onMapCreated, the app will throw exception:
Seems like the MapView is not instantiated yet.
If I call addMarkers() from a button (ie: after map fully loads), it works and all the markers are added to the map. I thought that onMapCreated callback is fired after the map has fully loaded, but it seems like this is not working.
Where can I call addMarkers() to add markers automatically without triggering it from a button?
Thanks:)
The text was updated successfully, but these errors were encountered: