R RichardN Well-Known Member Licensed User Longtime User Jul 20, 2025 #1 I have a mapping project where I am using GoogleMapsExtra to capture and display LatLong bounds of a group of markers. I am adding the markers with gMap.AddMarker(Lat,Log,"Marker Title") To designate a marker for deletion I wish to set a variable to the marker title when the marker is selected and the MapFragment1_MarkerClick event is triggered. Code: Sub MapFragment1_MarkerClick (SelectedMarker As Marker) As Boolean 'Return True to consume the click CurrentLabel = SelectedMarker.Title Log(CurrentLabel) Return False End Sub Unfortunately the program halts with: java.lang.IllegalArgumentException: method com.zzzzz.xxxxxxx.main._mapfragment1_markerclick argument 1 has type uk.co.martinpearman.b4a.osmdroid.views.overlays.wrappers.MyOverlayItemWrapper, got anywheresoftware.b4a.objects.MapFragmentWrapper$MarkerWrapper Click to expand... I have also tried adding the markers with the GoogleMapsExtras method but I get a similar result. I seem to be missing an initialzed link between GoogleMapsExtra and the instance of MapFragment in use. Been staring at this screen too long now.... Anybody see my error?
I have a mapping project where I am using GoogleMapsExtra to capture and display LatLong bounds of a group of markers. I am adding the markers with gMap.AddMarker(Lat,Log,"Marker Title") To designate a marker for deletion I wish to set a variable to the marker title when the marker is selected and the MapFragment1_MarkerClick event is triggered. Code: Sub MapFragment1_MarkerClick (SelectedMarker As Marker) As Boolean 'Return True to consume the click CurrentLabel = SelectedMarker.Title Log(CurrentLabel) Return False End Sub Unfortunately the program halts with: java.lang.IllegalArgumentException: method com.zzzzz.xxxxxxx.main._mapfragment1_markerclick argument 1 has type uk.co.martinpearman.b4a.osmdroid.views.overlays.wrappers.MyOverlayItemWrapper, got anywheresoftware.b4a.objects.MapFragmentWrapper$MarkerWrapper Click to expand... I have also tried adding the markers with the GoogleMapsExtras method but I get a similar result. I seem to be missing an initialzed link between GoogleMapsExtra and the instance of MapFragment in use. Been staring at this screen too long now.... Anybody see my error?
Erel B4X founder Staff member Licensed User Longtime User Jul 22, 2025 #2 It looks like you are using OSMDroid: https://www.b4x.com/android/forum/threads/osmdroid-mapview-for-b4a.16309/ It doesn't work with Google Maps. Upvote 0
It looks like you are using OSMDroid: https://www.b4x.com/android/forum/threads/osmdroid-mapview-for-b4a.16309/ It doesn't work with Google Maps.
R RichardN Well-Known Member Licensed User Longtime User Jul 22, 2025 #3 Thanks @Erel. It was a code snippet I copied from an old project that was merely utilising the distance calculation between two GeoPoints. I eventually discovered the incompatibility by removing libraries one at a time. Upvote 0
Thanks @Erel. It was a code snippet I copied from an old project that was merely utilising the distance calculation between two GeoPoints. I eventually discovered the incompatibility by removing libraries one at a time.