Reading the official documentation for Google Maps I found that is possible to add the "onMarkerDragEnd" event, but is not available in the b4a library of google maps, I wonder if it is possible to add the event with java code, something like this:
B4X:
#If Java
public void onMarkerDragEnd (com.google.android.gms.maps.model.Marker marker) {
if (processBA.subExists("gmap_MarkerDragged")) {
processBA.raiseEvent2(null, true, "gmap_MarkerDragged", false, (marker));
}
}
#End If
Obviously the code above does not work, I believe it is missing the part of declaring the event listener (setOnMarkerDragListener)
I also tried:
B4X:
#If Java
public void startListener(com.google.android.gms.maps.GoogleMap mMap){
mMap.setOnMarkerDragListener(new OnMarkerDragListener() {
@Override
public void onMarkerDragEnd(Marker marker) {
if (processBA.subExists("gmap_MarkerDragged")) {
processBA.raiseEvent2(null, true, "gmap_MarkerDragged", false, (marker));
}
}
});
}
#End If
Hi All, I am trying to get the correct process for MarkerDragListener operation when there are multiple markers. In the code below there are two markers and originally I "Dimensioned" a DragListener for each marker with a corresponding Sub for each marker-drag. I found that only one sub was...
Dim MarkerDrag As Marker
MarkerDrag.Draggable = True
MarkerDrag = GoogleMap1.AddMarker3(MapLatitude, MapLongitude, Null, MKBitmap)
'Id Marker
Dim IdMarker As String = MarkerExtras1.GetId(MarkerDrag)
B4X:
Dim DragListener1 As OnMarkerDragListener
DragListener1.Initialize("DragListener1")
GoogleMapsExtras1.SetOnMarkerDragListener(GoogleMap1,DragListener1)