Error while loading survey form

295
3
05-07-2021 02:46 AM
RakeshKharvi
New Contributor

Hi Community,

I am working on a scenario where i have to capture the location of user using javascript and i am trying to publish , it works fine but while loading survey form it will throw an error saying like failing to load data from source.

Please assist me get out of this situation.

 

Thank you in advance

0 Kudos
3 Replies
GeoJosh
Esri Contributor

Rakesh,

Can you please provide the JavaScript you're using to get the user's location?

-Josh

0 Kudos
RakeshKharvi
New Contributor

Hi GeoJosh

Actually i dont have any idea about javascript but i got this code from some post and its working for me.

function getLocation() {

if (navigator.geolocation) {

navigator.geolocation.getCurrentPosition(showPosition);

} else {

x.innerHTML = "Geolocation is not supported by this browser.";

}

}

 

function showPosition(position) {

x.innerHTML = "Latitude: " + position.coords.latitude ;

}

0 Kudos
RakeshKharvi
New Contributor

If you have any other javascript format to get user current location, please share with me it helps me a lot

0 Kudos