mapbox-gl-native icon indicating copy to clipboard operation
mapbox-gl-native copied to clipboard

My Location indicator does not get tilted

Open ahuang13 opened this issue 10 years ago • 2 comments

Tilting the map does not immediately tilt the My Location blue dot indicator. (However, tilting the map a second time will then cause the My Location indicator to get tilted.)

Platform: Android Mapbox SDK version: 4.2.0-beta.5

Steps to trigger behavior

  1. Start out with map showing the My Location indicator.

device-2016-11-15-161227

  1. Tilt the map by calling the following tiltCamera() method.
private void tiltCamera() {
    final CameraPosition cameraPosition = new CameraPosition.Builder().tilt(MapboxConstants.MAXIMUM_TILT).build();
    final CameraUpdate cameraUpdate = CameraUpdateFactory.newCameraPosition(cameraPosition);
    mMapboxMap.moveCamera(cameraUpdate);
}

Expected behavior

I expect both the map and the My Location indicator to be tilted as such... (note that calling tiltCamera() a second time will achieve this result.)

device-2016-11-15-161248

Actual behavior

Only the map gets tilted. The My Location indicator remains in its original perspective as seen here...

device-2016-11-15-161239

ahuang13 avatar Nov 16 '16 00:11 ahuang13

I noticed that the problem happens with all of the below camera methods...

  • moveCamera(CameraUpdate)
  • easeCamera(CameraUpdate)
  • animateCamera(CameraUpdate)

However, when I add a sufficiently long duration (~1 second or more) to easeCamera(...) and animateCamera(...), the My Location indicator will get tilted.

ahuang13 avatar Nov 16 '16 01:11 ahuang13

Thank you for the detailed explanation @ahuang13. It seems that setting tilt while out of screen is not getting applied. Tilt isn't changed as part of onDraw and is only set when we explicitly call setTilt.

tobrun avatar Nov 17 '16 10:11 tobrun