Select to view content in your preferred language

Location widget works fine on locahost but not on shared hosting environment

692
2
Jump to solution
08-10-2023 01:22 PM
DavidShearan
New Contributor III

I am using the ARCGIS SDK tools version 4.18 on the website I have recently inherited. I had an earlier question about grabbing the user location and retrieving the lat/long to fill out HTML input fields. I had brilliant support from the community (thank you Joel Bennett for your help with that Retrieval of latitude/longitude when Locate button clicked 

Joel provided me with the code which resolved the problem immediately except it only works on my localhost and not on the live website. The website is secured with an SSL certificate and the URL has the https:  prefix.

I contacted the hosting support team but they have no explanation for why it is not working. Has anyone had any experience with this. Are there any configuration options anywhere which would explain this?

0 Kudos
1 Solution

Accepted Solutions
DavidShearan
New Contributor III

Thank you so much for your response Andy. I found the problem and it was my own silly mistake.

I woke in the middle of the night with the sudden realisation that I had used FTP to upload the calling PHP script and not the .js file with the new code in it.

Doh! But at least I now have a working solution.

View solution in original post

0 Kudos
2 Replies
AndyGup
Esri Regular Contributor

Hi @DavidShearan the Locate widget uses the native JavaScript Geolocation API. Most issues you run into will be related to your browser capabilities when using that API.

Give this test app a try and let us know if there are any errors in the browser's developer console. You can change the CSS and SDK version to 4.18: https://codepen.io/andygup/pen/jOQjqOo?editors=1100

Here's an example error:

geolocation-error.png

DavidShearan
New Contributor III

Thank you so much for your response Andy. I found the problem and it was my own silly mistake.

I woke in the middle of the night with the sudden realisation that I had used FTP to upload the calling PHP script and not the .js file with the new code in it.

Doh! But at least I now have a working solution.

0 Kudos