19th Jul 2018, 4:46 PM
Sina
Sina - avatar
5 Answers
0
The error says that the getCurrentPostion() method is missing a parameter. That meets takes a function as a parameter. Please read about it here https://www.w3schools.com/htmL/html5_geolocation.asp
19th Jul 2018, 4:49 PM
Vedant Bang
Vedant Bang - avatar
0
The function which is the parameter of the getCurrentPostion () method will receive an object as a parameter, which will contain the coordinates
19th Jul 2018, 4:51 PM
Vedant Bang
Vedant Bang - avatar
0
So you shall have to make a function something like this ``` let lat, lon; function showPostion(position){ lat = position.coords.latitude; lon = position.coords.longitude; } ``` Then you can use the lat and lon variables for your purpose.
19th Jul 2018, 4:54 PM
Vedant Bang
Vedant Bang - avatar
0
what about my code I want to write my code as a promise
19th Jul 2018, 5:00 PM
Sina
Sina - avatar
0
help me in that way
19th Jul 2018, 5:00 PM
Sina
Sina - avatar