+ 5
Please give a code for geolocation API
I learnt geolocation API yesterday and I can't understand how to use it Please give a sample code that finds the location of user
13 Respuestas
+ 1
That's the backend task that
as programme you get data sent it to server (to you ).
You can access it as
For example
Send this data
That is
position.coords.latitude
To server.(to you )
And you will get the latitude of your user.similarily for longitude,altitude,speed .....
Sorry dude I don't know back end more.
+ 4
I don't think this is html 5 geolocation api.
This has been done using js library leaflet.js but very nice
And geolocation api as much I have heard works only on secure origin i.e, https
https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API
I have tried it on sololearn but as it's playground is not https.... I got this error.
https://code.sololearn.com/WeLcqUnkYx4R/?ref=app
+ 3
Thanks
Now it's more clear
+ 3
I also wanted to ask that how will it return location
+ 3
I mean if I send the link of my code to someone and he opens it,then how will I receive his location
+ 3
How will that object reach me
I mean how can I access it
+ 3
I know this already
Just I want you to tell me how I get to see that person's location by my eyes
You just tell me how
For e.g. via notification or message etc
+ 2
If geolocation works succes fully position.coords give you an object having info like user latitude,longitude,speed,heading,altitude,accuracy..
Which can you easily extract from object.
+ 2
Thanks
+ 2
Complete python / php and enjoy backend.👍
+ 2
Yeah
Thanks for your assistance
+ 2
Someone pls help me on html challenge 3 question