Mapbox-gl-native: [android][release-v4.2.0] zoomIn, zoomOut CameraUpdate disable automatically tracking mode (Follow to None)

Created on 25 Jan 2017  路  3Comments  路  Source: mapbox/mapbox-gl-native

Platform:Android
Mapbox SDK version: Release Android v4.2.0

Expected behavior
On tracking mode follow, when user clicks on zoom buttons, the tracking should not be lost.

Actual behavior
User loose the tracking mode (follow) on zoom in or zoom out.

Instead of calling mapView.resetTrackingModesIfRequired(cameraPosition) in animateCamera runnable callback, should you not check if resetting tracking mode is required like in easeCamera method?

if (resetTrackingMode) {
    mapView.resetTrackingModesIfRequired(cameraPosition);
}
Android good first issue

Most helpful comment

Thanks @tobrun for the feedback. These buttons are implemented by myself. Using animateCamera from MapboxMap with the camera update and MapboxMap cancelable callback as parameters.

Adding a flag to avoid resetting tracking seems like a good idea.

All 3 comments

when user clicks on zoom buttons

@13kz are these buttons implemented by you or are we talking about the on screen buttons shown by the SDK?

Instead of calling mapView.resetTrackingModesIfRequired(cameraPosition) in animateCamera runnable callback, should you not check if resetting tracking mode is required like in easeCamera method?

I think this is a viable solution. The parameter exposed on easeCamera was added to allow for more dynamic animations (eg. navigation mode) but I'm also thinking about other solutions as setting a flag that results in not stopping tracking mode except for setTrackingMode.

Thanks @tobrun for the feedback. These buttons are implemented by myself. Using animateCamera from MapboxMap with the camera update and MapboxMap cancelable callback as parameters.

Adding a flag to avoid resetting tracking seems like a good idea.

Picking this up now as this changes public API for the 5.0.0 release.
PR in https://github.com/mapbox/mapbox-gl-native/pull/7871.

Was this page helpful?
0 / 5 - 0 ratings