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

Tracking the user on startup app #78

Closed
FabianHofman2 opened this issue Dec 5, 2018 · 5 comments
Closed

Tracking the user on startup app #78

FabianHofman2 opened this issue Dec 5, 2018 · 5 comments

Comments

@FabianHofman2
Copy link

Is there a way to set the location tracker on when the application loads?
I have no idea how it works.

I am using the NgxMapboxGLModule and the @types for this.

Thanks in advance!

@Wykks
Copy link
Owner

Wykks commented Dec 5, 2018

@FabianHofman2
Copy link
Author

Yes, but i want the button to be pressed when the application starts.
Without the user to interact with it!

@Wykks
Copy link
Owner

Wykks commented Dec 5, 2018

Like this : https://stackblitz.com/edit/angular-y89zlb?file=demo.ts
(open the live app in a new window to allow geolocation)

(TODO for me: expose ControlComponent to avoid the any type)

@FabianHofman2
Copy link
Author

Yes!!
Thank you very much!

@LarryBarker
Copy link

Can you provide the source for the demo.js is the link seems to be broken. I am trying to achieve the same result, by tracking the user location when my app/page is loaded without having to press the locate user button. I can successfully use the geolocation api to get the popup, but I haven't figured out how to update the map position with these coordinates.

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

3 participants