Open asifjavaid opened 1 year ago
@asifjavaid what compass mode are you using? In the example activity you can see how the modes are switched.
@yunikkk Hi thank you for your response. We have not set any mode. It is with its default settings. Which mode we need to set to make it work?
Environment
Observed behavior and steps to reproduce
We are migrating our old app with legacy SDK version 8.xxx to latest mapbox SDK. The map is not stable. Its compass is keep on rotating.
Expected behavior
We want the behaviour like legacy SDK works, like, as we move the device the compass should rotate the map accordingly with correct bearing angle. Please suggest.
Notes / preliminary analysis
Here is my initials settings of code in kotlin.
` private fun initLocationComponent() { val locationComponentPlugin = mapView!!.location locationComponentPlugin.updateSettings { this.enabled = true this.locationPuck = LocationPuck2D( bearingImage = AppCompatResources.getDrawable( this@MapBoxBaseActivity, R.drawable.mapbox_user_puck_icon, ), shadowImage = AppCompatResources.getDrawable( this@MapBoxBaseActivity, R.drawable.mapbox_user_icon_shadow, ), /scaleExpression = interpolate { linear() zoom() stop { literal(0.0) literal(0.6) } stop { literal(20.0) literal(1.0) } }.toJson()/ ) } locationComponentPlugin.addOnIndicatorPositionChangedListener(onIndicatorPositionChangedListener) locationComponentPlugin.addOnIndicatorBearingChangedListener(onIndicatorBearingChangedListener) mapView!!.gestures.addOnMoveListener(onMoveListener) mapView!!.compass.getSettings().fadeWhenFacingNorth = false mapView!!.compass.position = Gravity.RIGHT }
Additional links and references