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

Amend the geocoder example to draw a marker at the result's location #2692

Closed
planemad opened this issue Jun 8, 2016 · 7 comments
Closed

Comments

@planemad
Copy link

planemad commented Jun 8, 2016

The GL implementation of geolocate does not visually show a position marker after successful geolocation, this makes it hard to identify where the user is located.

This is very handy for tools that is based on user position. Here is an example map to try the existing Geolocate() behavior for which i'd like to add a position marker. This app is being used to map trees locations.

cc @bhousel

@bhousel
Copy link
Contributor

bhousel commented Jun 8, 2016

We dispatch a geolocate event on success, so the listening code can display a marker if they want to. Is this ok? It gives developers a bit more flexibility rather than just forcing a marker on them.

@lucaswoj
Copy link
Contributor

lucaswoj commented Jun 8, 2016

I agree with @bhousel. This behaviour isn't want an end user would want in all cases and should be implemented downstream. (This'll get a even easier when we land @mourner plugin for #656 soon!)

What we can do is amend the geocoder example to include a marker.

@lucaswoj lucaswoj changed the title Adding a location marker for Geolocate() Amend the geocoder example to draw a marker at the result's location Jun 8, 2016
@danielduhh
Copy link

danielduhh commented Jul 1, 2016

How can I listen for an event after geolocate is triggered
map.on('geolocate') ?

@lucaswoj
Copy link
Contributor

lucaswoj commented Jul 7, 2016

@danielduhh map.on('geolocate') is the correct way to listen for events from the geolocator control. In the future, please direct all questions except bug reports and feature requests to StackOverflow.

@danielduhh
Copy link

#2824

@lucaswoj
Copy link
Contributor

lucaswoj commented Jul 7, 2016

Oh! Hm. this already existed. http://127.0.0.1:4000/mapbox-gl-js/example/point-from-geocoder-result/

@lucaswoj lucaswoj closed this as completed Jul 7, 2016
@mprove
Copy link

mprove commented Mar 6, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants