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

[Android] check availability of MyBearingTracking.COMPASS

Open P-Zenker opened this issue 9 years ago • 1 comments

Hey,

**Platform: Android ** Mapbox SDK version: 5.1.2

Steps to trigger behavior

  1. I use for example a MOBISTEL Cynus E4 - a very cheap smartphone. There a some other smartphones who don't have a compass inside.
  2. mapboxMap.getTrackingSettings() .setMyLocationTrackingMode(MyLocationTracking.TRACKING_FOLLOW);
  3. 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

P-Zenker avatar Aug 08 '17 15:08 P-Zenker

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;
    }

tobrun avatar Aug 08 '17 20:08 tobrun