mapbox-gl-native
mapbox-gl-native copied to clipboard
[Android] check availability of MyBearingTracking.COMPASS
Hey,
**Platform: Android ** Mapbox SDK version: 5.1.2
Steps to trigger behavior
- I use for example a MOBISTEL Cynus E4 - a very cheap smartphone. There a some other smartphones who don't have a compass inside.
- mapboxMap.getTrackingSettings() .setMyLocationTrackingMode(MyLocationTracking.TRACKING_FOLLOW);
- mapboxMap.getTrackingSettings() .setMyBearingTrackingMode(MyBearingTracking.COMPASS);
Expected behavior
Either rotate the map (not possible, I know ;) ) or give me a method to check if MyBearingTracking.COMPASS is available (for example check, if you get sensor-data from the compass (or maybe from a six-axis-gyro?))
Actual behavior
Neither map rotation nor error message.
Best regards, Patrick
closing as a duplicate of https://github.com/mapbox/mapbox-gl-native/issues/9149 and actually we do print an error message:
public boolean isSensorAvailable() {
if (rotationVectorSensor == null && reportMissingSensor) {
reportMissingSensor = false;
Timber.e("Sensor.TYPE_ROTATION_VECTOR is missing from this device. Unable to use MyBearingTracking.COMPASS.");
}
return rotationVectorSensor != null;
}