D Declan Well-Known Member Licensed User Longtime User May 14, 2024 #1 I am using the following code to display a Marker on GoogleMaps: B4X: Copy Dim cp As CameraPosition cp.Initialize(myLat, myLon, 16) mkr = GMap.AddMarker2(myLat, myLon, markerTxt,File.GetUri(File.DirAssets, "othermark.png")) GMap.MoveCamera(cp) mapMarkers.Put(myFriendname, mkr) I write the Device unique ID "myFriendname" as the Key of mapMarkers map and marker details as the Value of mapMarkers. I must now remove the Marker from the GoogleMaps using: B4X: Copy GMap.RemoveMarker(m) Where m is the Marker displayed on GoogleMaps.
I am using the following code to display a Marker on GoogleMaps: B4X: Copy Dim cp As CameraPosition cp.Initialize(myLat, myLon, 16) mkr = GMap.AddMarker2(myLat, myLon, markerTxt,File.GetUri(File.DirAssets, "othermark.png")) GMap.MoveCamera(cp) mapMarkers.Put(myFriendname, mkr) I write the Device unique ID "myFriendname" as the Key of mapMarkers map and marker details as the Value of mapMarkers. I must now remove the Marker from the GoogleMaps using: B4X: Copy GMap.RemoveMarker(m) Where m is the Marker displayed on GoogleMaps.
DonManfred Expert Licensed User Longtime User May 14, 2024 #2 Start learning B4X. To use B4X: Copy GMap.RemoveMarker(m) you need to get the markerobject first. I don´t see you getting it from the Map? Why not? B4X: Copy dim m as marker = mapMarkers.get(myfriendname) GMap.RemoveMarker(m) Upvote 1
Start learning B4X. To use B4X: Copy GMap.RemoveMarker(m) you need to get the markerobject first. I don´t see you getting it from the Map? Why not? B4X: Copy dim m as marker = mapMarkers.get(myfriendname) GMap.RemoveMarker(m)