Location on mobile devices on GeoForm

1900
15
Jump to solution
10-13-2016 04:48 AM
Highlighted
New Contributor II

hi, 

  .I am using GeoForm web application, and recently the application can't locate my location 

I tried both in ios and Android /

I checked that the location service in my device is enabled . 

will appreciate any ideas  

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Esri Frequent Contributor

Hi Sergio,

The location button in the Geoform app (and other apps) uses the Geolocation API to prompt the user for permission and find their position. Starting with Google Chrome version 50 and potentially other browsers, some HTML5 web APIs will require using a secure origin like https to work correctly such as the Geolocation API.

This blog explains this in further detail: Increased web API security in Google Chrome | ArcGIS Blog 

As a result of these changing standards, the locate button shouldn't be displayed for apps that are loaded via http. There is a bug where the locate button appears with some mobile browsers that is resulting in the error that you are seeing when you try to use the locate button with an app that loads of http. The bug is being worked on for a future release.

Long story short: If you want to use the locate button, ensure that you load the app over https.

-Kelly

View solution in original post

15 Replies
Highlighted
Esri Frequent Contributor

Hi,

This functionality should be working, so I suggest contacting Technical Support to look into the specific issue. 

Here are some initial troubleshooting steps:

Try loading the sample geoform app on your phone: https://www.arcgis.com/apps/GeoForm/index.html

Are you able to use the locate button using the different app?

Are you launching the app using http or https? Can you share the app url?

-Kelly

Highlighted
New Contributor III

I have the same problem! I have checked that I can use the location button in the sample geoform app. I have noticed that locate button is enabled in my GeoForm app when I use a httpS connection. Why? How does it work? Thanks in advance Kelly!

Reply
0 Kudos
Highlighted
Esri Frequent Contributor

Hi Sergio,

The location button in the Geoform app (and other apps) uses the Geolocation API to prompt the user for permission and find their position. Starting with Google Chrome version 50 and potentially other browsers, some HTML5 web APIs will require using a secure origin like https to work correctly such as the Geolocation API.

This blog explains this in further detail: Increased web API security in Google Chrome | ArcGIS Blog 

As a result of these changing standards, the locate button shouldn't be displayed for apps that are loaded via http. There is a bug where the locate button appears with some mobile browsers that is resulting in the error that you are seeing when you try to use the locate button with an app that loads of http. The bug is being worked on for a future release.

Long story short: If you want to use the locate button, ensure that you load the app over https.

-Kelly

View solution in original post

Highlighted
New Contributor III

Thank you very much for your fast response!

Reply
0 Kudos
Highlighted
New Contributor III

Nowadays I am trying to use the locate button in another app, but I can not see it: GeoForm 

I am using a httpS connection. Any idea?

Reply
0 Kudos
Highlighted
Esri Frequent Contributor

Hi Sergio,

It appears that you haven't enabled the show location option on this app:

http://www.arcgis.com/sharing/rest/content/items/a8cfc331916641508e4beced9c17ca11/data?f=pjson 

locationSearchOptions": {
"enableMyLocation": false,
"enableSearch": true,
"enableLatLng": false,
"enableUSNG": false,
"enableMGRS": false,
"enableUTM": false
},

Try checking the Select Location by My location button to enable the option.

-Kelly

Reply
0 Kudos
Highlighted
New Contributor III

You are rigth! 😉 Thank you Kelly! I forgot that...

Reply
0 Kudos
Highlighted
New Contributor

Hello All-

I've recently created a really basic app using GeoForm and am having trouble with mobile devices (Android/iOS) being located by the app although it does appear to work on my desktop when I allow access to my location.  I have checked the box 'Locate on load' in the configuration, ensured location is available to both Safari and Chrome, and load the GeoForm as a https. I still get a message 'Location could not be found' when the site loads. When I've tried the demo GeoForm, it does read my location, so it seems like it's something that I've missed. Any ideas?

Thanks,

Mark

PS: The GeoForm URL is 

https://calema.maps.arcgis.com/apps/GeoForm/index.html?appid=8369443387ec408b8670de55269eb2ae 

Reply
0 Kudos
Highlighted
Esri Frequent Contributor

Hi Mark,

This looks to be caused be a mixed content issue with the logo in your form. Is there a link to your url from https?

Try removing the logo to see if the location will work on load and let me know if that resolves the issue,

Kelly