Geocoder http refused fix

280
0
09-30-2020 01:51 PM
JoshuaDalton
New Contributor III

So, this is not a question so much as a kludge for those of you who have http apps built on the javascript api which broke today because ESRI turned off http for the World Geocode Service, as detailed here: FAQ: How is the World Geocoding Service affected by HTTPS Only enforcement? 

You can change your all of your apps to https only, and you should... but while you do all of that, here's a kludge that may fix the address search widget until you can get the work done:

1: Find your arcgis_js_api folder that you deployed in your web server. 

2: Locate the <version>/js/esri/dijit subfolder.

3: Edit Geocoder.js

4: Replace the text:

"http:":location.protocol)+"//geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"), 

   With:

"http:":"https")+"//geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer"),

5: Save the change, clear your cache, and reload your app and it should work to use the built in arcgisGeocoder again.

In theory you could probably do this also by editing each app you have to change the file <app folder>/widgets/Geocoder/config.json, setting "arcgisGeocoder":false, then defining the https geocoder according to the specs here Geocoder | API Reference | ArcGIS API for JavaScript 3.33  under "geocoders", but you will need to do that to each app and I haven't tried that yet, so cannot confirm it works.

Has anyone done that change instead?  If so, can you share your settings that worked in the config here?

0 Kudos
0 Replies