Ability to remove LocationPuck
New Feature
I would like the ability to remove the LocationPuck entirely
SDK v10.12.2
Why
In my app I render a custom puck icon. I noticed in order to achieve this, I started to do the following:
locationComponentPlugin.updateSettings {
this.enabled = true
this.locationPuck = LocationPuck2D()
}
But this still leaves a memory footprint under the hood which I was not happy with. I then starting doing:
map.getStyle()?.removeStyleLayer("mapbox-location-indicator-layer")
This feels better but now I'm left with a littered console of warning messages:
[maps-android\MapboxLocationLayerWrapper]: Skip updating layer property location, layer mapbox-location-indicator-layer not ready yet.
[maps-android\MapboxLocationLayerWrapper]: Skip updating layer property bearing, layer mapbox-location-indicator-layer not ready yet.
[maps-android\MapboxLocationLayerWrapper]: Skip updating layer property accuracy-radius, layer mapbox-location-indicator-layer not ready yet.
This feels like a gap in functionality to me, especially since iOS allows you to do:
mapView.location.options.puckType = .none
hey @okcoker - if you don't need to see the the puck, why not disable location component? it actually represents the puck + customisations related to puck:
locationComponentPlugin.updateSettings {
this.enabled = false
}
I still want the user location updates and locationComponentPlugin.addOnIndicatorPositionChangedListener(onIndicatorPositionChangedListener) doesn't fire when enabled = false
When my app loads, I use that listener to center the map where the user is
When my app loads, I use that listener to center the map where the user is
You could separately subscribe to location provider and move map as you wish.