You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Get current user location through Location Layer Plugin #136
I recently started to use the Location Layer Plugin to show user location on map as it is advised on the Mapbox website plugin page and to benefit from the possibility "to display the location icons/markers within the map itself rather than on top as an Android view".
However, I'm not able to dynamically get the user location from the location layer plugin itself.
Before implementing the plugin, I used to call the getMyLocation() method from MapboxMap object but I can't find an equivalent directly using the plugin.
I tried to combine the MapboxMap approach with the Location Layer plugin but, in order to use MapboxMap.getMyLocation() method, I have to call 'setMyLocationEnabled(true)' on my MapboxMap object, which enables and draws the 'my-location layer' from MapboxMap over the marker drawn within the map by the Location Layer Plugin. So I get a second marker to show the user location on a new layer, what I do not want. (Sometimes, these two markers are even separated by tens of meters)
My second idea was to override the 'onLocationChanged()' method from my LocationEngineListener, but I'm not satisfied with this approach as I have to wait for this to update before being able to access the current user location.
Please, does somebody have any idea overcome this ?
Activity
cammace commentedon Dec 21, 2017
#199 adds this API, closing
vicobz commentedon Jan 3, 2018
Thx !