Android Question MapFragment1_MarkerClick Problem

RichardN

Well-Known Member
Licensed User
Longtime User
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 lang="b4x" title="Marker_Click"]Sub MapFragment1_MarkerClick (SelectedMarker As Marker) As Boolean 'Return True to consume the click

CurrentLabel = SelectedMarker.Title
Log(CurrentLabel)
Return False

End Sub[/CODE]

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

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?
 
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
Back
Top