Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

[Android][Bug] Bearing Mode is disabled when touching the MapView #3535

Closed
mayardb opened this issue Jan 13, 2016 · 7 comments · Fixed by #3546
Closed

[Android][Bug] Bearing Mode is disabled when touching the MapView #3535

mayardb opened this issue Jan 13, 2016 · 7 comments · Fixed by #3546
Assignees
Labels
Android Mapbox Maps SDK for Android bug GL JS parity For feature parity with Mapbox GL JS

Comments

@mayardb
Copy link
Contributor

mayardb commented Jan 13, 2016

Hi MapBox team,

In the MyLocationTrackingModeActivity sample, I noticed that the bearing mode is disabled when touching the MapView.

@Override
        public boolean onDown(MotionEvent event) {
            // Show the zoom controls
            if (mZoomControlsEnabled && mZoomEnabled) {
                mZoomButtonsController.setVisible(true);
            }

            // Disable tracking mode if a gesture occurs
            try {
                setMyLocationTrackingMode(MyLocationTracking.TRACKING_NONE);
                setMyBearingTrackingMode(MyBearingTracking.NONE);
            }catch(SecurityException ignore){
                // User did not accept location permissions
            }

            return true;
        }

Is it possible to change it just to disable Tracking only when running a gesture :

  • pan
  • scale
  • rotate
  • tilt / pitch

and not in the onDown method anymore ?

@tobrun tobrun added Android Mapbox Maps SDK for Android bug labels Jan 14, 2016
@tobrun tobrun added this to the android-v3.1.0 milestone Jan 14, 2016
@tobrun tobrun added the GL JS parity For feature parity with Mapbox GL JS label Jan 14, 2016
@tobrun
Copy link
Member

tobrun commented Jan 14, 2016

I have taken a closer look at iOS and they are doing the same thing you are suggesting,
will take this up now.

@tobrun
Copy link
Member

tobrun commented Jan 14, 2016

This will probably result in the requirement to subclass the gesturedetector from almeros

@tobrun
Copy link
Member

tobrun commented Jan 14, 2016

Been looking at integrating this requirement but this won't be an easy fix because we rely on external gesturedetectors and these are not always compliant with returning a correct boolean value if a gesture starts also resetting the tracking modes in the listener callback (eg. onScaleBegin) is too late to reset tracking modes. Ideally I would love to pick this up with #553.

Since we are going to release 3.1.0 #3537 next week, I'm going to refocus on other issues first.

@mayardb
Feel free to tackle this issue and provide a PR.
We at Mapbox ❤️ PR's.

@tobrun
Copy link
Member

tobrun commented Jan 14, 2016

@mayardb
I just gave it a 2nd look and was able to find a easy solution.

@mayardb
Copy link
Contributor Author

mayardb commented Jan 14, 2016

@tobrun
If I am right, you are still disabling the bearing when updating the map.

I think you just have to reset the MyTrackingMode and let the MyBearingMode in the same state.

@tobrun
Copy link
Member

tobrun commented Jan 14, 2016

@mayardb
To be on par with iOS, I have to disable them both (this is required for react-native)
Feel free to create a builder pattern to make this configurable,
with default configuration reflecting current setup.

@mayardb
Copy link
Contributor Author

mayardb commented Jan 14, 2016

@tobrun
If react-native uses mapbox-gl and requires the bearing not to remain enable when interacting with the MapView, I think that using a listener to detect map bounds change and reseting the bearing might do the same and let mapbox-gl users free to do what they want when map bounds change.

Unfortunately there is no possibility to undo a reset with a listener on the bearing changes because of the accuracy reset (by the way, it might be another bug).

Looking at the iOS you pointed out in your first comment.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android bug GL JS parity For feature parity with Mapbox GL JS
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants