hey , I am practicing vuejs and i am facing one problem I want to initially call the api using the longitude and latitude in the created() lifecycle.
watch the pen and please help me
suraj rathod
student and javascript lover more into web design and web development
Levan Gabeskiria
Web Development
You can use geolocation api:
created(){ //want to make api call using latitude and longitude// if (navigator.geolocation) { navigator.geolocation.getCurrentPosition((position) => { this.apiCall( position.coords.latitude, position.coords.longitude ); }); } }