iOS Question maps_markerclick event not firing

jamesnz

Active Member
Licensed User
Longtime User
When I click on a marker the default behaviour is to show the content set in the title.
I want to display a picture in a separate image view so am using the marker click event , however it will not fire. Does the name of the event matter ?
This works in my android app, but not IOS. Android uses a mapfragment I'm just adding it to a panel in iOS.
B4X:
Sub makemap
    Dim initialcamlat As Float
    Dim initialcamlon As Float
    gmap.Initialize("gmap", ApiKey)
   
    MapPanel.AddView(gmap,0,0,MapPanel.Width,MapPanel.Height)
    'MAP TYPE
    gmap.MapType=gmap.MAP_TYPE_NORMAL
   
    'LOOP THROUGH SEGMENTS
    For Each item As Camera In Main.mapofcameras.Values
        initialcamlat=item.lat
        initialcamlon=item.lon
               
        'SET MARKERS
       
        'create marker
        'Dim markerSL As Marker
        ' set marker data
        gmap.AddMarker2(item.lat,item.lon,item.description,Colors.Green)
    Next
    Dim cp As CameraPosition
    'Sets camera to last item 
   cp.Initialize(initialcamlat,initialcamlon,13)
    gmap.AnimateCamera(cp)
End Sub

Sub MapPanel_MarkerClick (SelectedMarker As Marker) As Boolean 'Return True to consume the click
    Log("i got clicked") '<==DOES NOT RUN
   
    For Each item As Camera In Main.mapOfCameras.Values
        If item.lat = SelectedMarker.Position.Latitude And item.lon = SelectedMarker.Position.Longitude Then
            displayimage(item)
        End If
    Next
   'Return True
End Sub
 
Top