Skip to content

Get current user location through Location Layer Plugin #136

Closed

Description

@vicobz

Hey guys,

Thanks for this amazing Mapbox SDK.

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.

  1. 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)

  2. 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 ?

Thanks :)

Activity

  1. added
    location-layer-plugin
    on Oct 15, 2017
  2. added this to the location-layer-0.3.0 milestone on Dec 2, 2017
  3. cammace commented on Dec 21, 2017

    @cammace

    #199 adds this API, closing

  4. vicobz commented on Jan 3, 2018

    @vicobz
    Author

    Thx !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurelocation-layer-plugin

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions