-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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 geolocation control #2283
Add geolocation control #2283
Conversation
(closes #1939)
@@ -9,7 +9,8 @@ var map = new mapboxgl.Map({ | |||
hash: true | |||
}); | |||
|
|||
map.addControl(new mapboxgl.Navigation()); | |||
// map.addControl(new mapboxgl.Navigation()); | |||
map.addControl(new mapboxgl.Geolocate()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per #2281, I would like to see this as a seperate controls.html
page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is actually useful even on a simple debug page. Maybe I would even consider adding it by default in GL JS maps if it's integrated into the zoom buttons toolbar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per #1929 / #1554 I am going to make the button layout more flexible. This will involve splitting up the Navigation control and moving some of what it does into a container class to manage the screen regions. Developers should be able to pick and choose which navigation controls they want to appear on the map, and this geolocation button is no different.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bhousel Sounds great!
So cool! I can't wait to merge 😄 |
I think this is ok to merge. I also left the control enabled in One more 👀 @lucaswoj ? |
LGTM! 🚢 |
Pinging with #3473 for some much-appreciated improvement on mobile devices. It's an easy win! |
Not ready to merge yet. I want to
make it so that all the button controls can coexist happily.Nevermind: they already can coexist happily, I just didn't understand the
addControl
code.navigator
code to be, likejs/util/browser
?(closes #1939)