question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

arcgis-rest-geocoding: ARCGIS_ONLINE_GEOCODING_URL refers to endpoint that forwards to homepage

See original GitHub issue

https://github.com/Esri/arcgis-rest-js/commit/613837ddaa0638f826aa75d11c00ee1007cb6e72 changes the endpoint URL for geocoding requests. At least for me, that endpoint returns a 301 Moved Permanentlyand redirects to https://www.arcgis.com. This in turn causes requests to that endpoint to return an HTML file instead of a JSON, leading to a parsing error and generally unpleasant behaviour.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
gavinrcommented, Mar 9, 2021

I see now, https://geocode-api.arcgis.com/arcgis/rest/services/World/GeocodeServer/geocodeAddresses?f=json specifically is redirecting incorrectly. I am looking into this. For now, you may pass the endpoint property as a workaround:

bulkGeocode({
    addresses: [
      { "OBJECTID": 1, "SingleLine": "380 New York Street 92373" },
      { "OBJECTID": 2, "SingleLine": "1 World Way Los Angeles 90045" }
    ],
    authentication: apiKey,
    endpoint: 'https://geocode.arcgis.com/arcgis/rest/services/World/GeocodeServer/geocodeAddresses',
  })
1reaction
gavinrcommented, Mar 9, 2021

Could you please post a code example that causes the issue for you? (Using JSBin, etc)

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found