Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add show user location feature to GeolocateControl #4354

Closed
cusspvz opened this issue Mar 2, 2017 · 4 comments · Fixed by #4479
Closed

Add show user location feature to GeolocateControl #4354

cusspvz opened this issue Mar 2, 2017 · 4 comments · Fixed by #4479
Assignees

Comments

@cusspvz
Copy link

cusspvz commented Mar 2, 2017

Does mapbox-gl-js has a similar api that offers the my location/user location feature available on the native APIs?

#android
mapView.setMyLocationEnabled( true )
#ios
mapView.showsUserLocation = true

location circle

@andrewharvey
Copy link
Collaborator

@cusspvz
Copy link
Author

cusspvz commented Mar 2, 2017

@andrewharvey thanks for your response. I'm not looking for the geolocation control, but instead, for the user location circle feature.

@cusspvz cusspvz changed the title Does mapbox-gl-js offers a current location feature? Does mapbox-gl-js offers a current location "circle" feature? Mar 2, 2017
@andrewharvey
Copy link
Collaborator

Not out of the box, however you might want to checkout out #3781.

Unfortunately the approach I used means it can't be merged into the master branch as is (the user location dot is injected directly into your style which has a bunch of unintended side affects, like if you use setStyle to change the style the dot is lost).

I implemented an alternate version using the HTML Marker, see my recent comments in the thread, but I'm not happy with that approach.

I simply don't have the time right now to make the changes required to build the dot as a custom layer type which works outside of the user visible style, or build it as a plug in. That said I'm happy with how the branch works currently and have been using it in one project.

@andrewharvey
Copy link
Collaborator

Progressing in #4479

@andrewharvey andrewharvey changed the title Does mapbox-gl-js offers a current location "circle" feature? Add show user location feature to GeolocateControl Apr 6, 2017
@andrewharvey andrewharvey self-assigned this Apr 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants