0
Location in java script
I wanted to write an application like a google map, but nowhere can I find how to get the user's location, can you guys explain?
2 Answers
+ 3
You have to use geolocation API in JavaScript.
Using that you can get users longitude and latitude.
https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API
https://developers.google.com/maps/documentation/javascript/examples/map-geolocation
0
If you use geolocation api you must have a secure origin.
I have tried but it throw this error.
https://code.sololearn.com/WeLcqUnkYx4R/?ref=app