Disable Use current location

786
7
Jump to solution
09-10-2020 01:58 PM
MatthewStull1
Occasional Contributor

I have a public app that lets citizens look up their evacuation zone (https://santarosa.maps.arcgis.com/apps/instant/lookup/index.html?appid=5ddafd14d6f94c259e75bcd4a5f3d... ).  I would like to disable the "Use current location" option that appears below the address search box because it is not mapping to the correct location.  We want citizens to enter their address instead of using any GPS-based (or otherwise) location tool.  I can't find a place to turn this off in the app configuration settings.  Does anyone know if this can be turned off?  See the sample image.

1 Solution

Accepted Solutions
DavidAsbury1
New Contributor II

This is a "brittle" option, but I was able to get this to work by using the ArcGIS Online Assistant and editing the app's JSON.

In the JSON editor, under the Data tab, add the line

 

 

 

"locationEnabled": false,

 

 

 

under searchConfiguration (partial example below)

 

 

 

        "disableScroll": true,
        "search": true,
        "searchConfiguration": {
            "locationEnabled": false,
            "sources": [
                {
                    "displayField": "title_formatted",

 

 

 

 

The problem with this method is that if you go back into the Instant App's configuration and re-publish it your JSON edits will be overwritten. So you need to go back in and re-add the locationEnabled: false line every time you make any further updates to your app.

View solution in original post

0 Kudos
7 Replies
BrittanyBurson
Occasional Contributor III

Came here looking to do the same thing. We have the option to search by feature, but my client wishes to intentionally disable searching by address. However, the "Use Current Location" prompt still appears when you click in the box.

I do not see the option in the Search settings within the app (JS 4.x Minimalist) to disable it. I also made sure the tick marks in the map settings for Search by Address are disabled, but issue persists.

BrittanyBurson_0-1616445344948.png

Did you ever find a way to disable? Thank you

0 Kudos
MatthewStull1
Occasional Contributor

Thanks for your feedback!  I haven't had time to pursue this any further but I'm hoping that ESRI will build it in as an option. 

DavidAsbury1
New Contributor II

Also looking to disable this option. Doesn't seem to be possible with the several Instant Apps that I've tried.

0 Kudos
DavidAsbury1
New Contributor II

This is a "brittle" option, but I was able to get this to work by using the ArcGIS Online Assistant and editing the app's JSON.

In the JSON editor, under the Data tab, add the line

 

 

 

"locationEnabled": false,

 

 

 

under searchConfiguration (partial example below)

 

 

 

        "disableScroll": true,
        "search": true,
        "searchConfiguration": {
            "locationEnabled": false,
            "sources": [
                {
                    "displayField": "title_formatted",

 

 

 

 

The problem with this method is that if you go back into the Instant App's configuration and re-publish it your JSON edits will be overwritten. So you need to go back in and re-add the locationEnabled: false line every time you make any further updates to your app.

0 Kudos
MatthewStull1
Occasional Contributor

Thanks for the feedback and solution, even if it is brittle.

0 Kudos
DavidAsbury1
New Contributor II

No problem, hope it helps.

If you feel like this is enough of a solution for the time being, would you mark it as solved?

To do that - in the post above click the dropdown, Post Options -> Accept as Solution

Thanks!

0 Kudos
MatthewStull1
Occasional Contributor

Thanks for the solution!  While it would be nice to see ESRI put in some kind of "Disable Use Current Location" button into the app, I doubt they will do it anytime soon if at all.  I'll mark your solution as accepted.