i'm using the maps v2 in my Android APP
My map is automatically updated every few seconds to show some new points on the map. For every time it refresh, automatically the following event: "setOnCameraChangeListener" is called.
The user can interact with the map by moving the camera or doing the Zoom. I need to intercept the user's gesture on the map such as "Zoom", "Drag", the "Pinch Open" or "Pinch Close".
So I can not use the "OnCameraChangeListener" because this is already done automatically from application when it auto update the data, and I am not able to understand when the event occurs for an automatic update of the map or when by user interaction
How do I trap these this user gesture?
automatically the following event: "setOnCameraChangeListener" is called.
Nothing is done automatically.
updated every few seconds to show some new points on the map.
and:
Then readjust the Zoom to fit the actual Marker on the map.
This seems like a very bad user experience: forcing user to look at your marker when they just want to swipe to Africa.
Anyway, if you have GoogleMap.animateCamera call in your code, you may use CancelableCallback parameter to help you distinguish between user activity and code call resulting in onCameraChange. See this comment on gmaps-api-issues for how to achieve this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With