Android Question GoogleMap Tocuh Actions

mkh_fx

Member
Licensed User
Longtime User
i need an event for detect touch action on the google map
like this
StartMoving
EndMoving
MapTouch
 

DonManfred

Expert
Licensed User
Longtime User
You can not add own buttons on GoogleMaps.

If you click the map then a event will be raised with the position.

What you do in this event is up to you.
 
Upvote 0

mkh_fx

Member
Licensed User
Longtime User
i want send some data to the server before and after drag or move the map like uber and similar apps.
 
Upvote 0

mkh_fx

Member
Licensed User
Longtime User
i need an event when user drop finger from the map
CameraChange and similar events call every time user move the map
and not call when the user drop finger from the map
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
B4X:
Sub Process_Globals
   Private const NO_MOVEMENT_INTERVAL As Int = 1000
   Private LastMovement As Long
End Sub

Sub MapFragment1_CameraChange (Position As CameraPosition)
   Dim last As Long = DateTime.Now
   LastMovement = last
   Sleep(NO_MOVEMENT_INTERVAL)
   If LastMovement = last Then
     Log("map was not moved for more than " & NO_MOVEMENT_INTERVAL & "ms.")
     
   End If
End Sub

Note that it will also be raised when the map moves from other reasons.
 
Upvote 0

mkh_fx

Member
Licensed User
Longtime User
thanks erel
But this code does not solve my problem
for example:
i want show nearest drivers and calculate distance and price for a online taxi application
by user code if user moving the map send lots Unreasonable request to server for calculating
if you have seen this feature in similar apps like (uber,lyft,....) when user release the finger from the map then data sent to server and show data

please look at this link
https://stackoverflow.com/questions/14013002/google-maps-android-api-v2-detect-touch-on-map
 
Upvote 0
Top