Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught SyntaxError: Unexpected token : when loading an Esri Basemap #1142

Closed
jubasse opened this issue Mar 20, 2019 · 4 comments · Fixed by #1143
Closed

Uncaught SyntaxError: Unexpected token : when loading an Esri Basemap #1142

jubasse opened this issue Mar 20, 2019 · 4 comments · Fixed by #1143

Comments

@jubasse
Copy link

jubasse commented Mar 20, 2019

  • Browser and version:

Chrome 51

  • Version of Leaflet (L.version):

^1.3.3

  • Version of esri Leaflet (L.esri.VERSION):

^2.2.3 updated today to the last version

Steps to reproduce the error:

instanciate the map with a featureLayer.
Until today i do not have any problem, but today, it seems like the attribution url doesn't send the same data anymore, because in the library script, we have the _getAttributionData that send a jsonp request to arcgis, but now the given url https://static.arcgis.com/attribution/World_Topo_Map?callback=window._EsriLeafletCallbacks.c0&f=pjson returns a json, and this json isn't recognize (header text/plain).

I think that we should now use an http request to get data instead of jsonp..

  • Optional: I'm not using the CDN, I'm loading/bundling the library using: npm
@jgravois
Copy link
Contributor

jgravois commented Mar 20, 2019

thanks for the report.

my hunch is that this is a bug introduced during yesterday's ArcGIS Online release, but i'll need to confirm.

related: #1064

@jgravois
Copy link
Contributor

it turns out we made a conscious choice to turn off JSONP support on static.arcgis.com to retire some old infrastructure and optimize our CDN.

in Esri Leaflet land we should have been using L.esri.request() all along, but i can't go back in time. folks are going to have to upgrade to v2.2.4 to ensure their app continues to display attribution dynamically.

thanks for opening this issue to bring it to my attention!

@jgravois jgravois changed the title Attribution is now a json url instead of jsonp Uncaught SyntaxError: Unexpected token : when loading an Esri Basemap Mar 20, 2019
@zbeat
Copy link

zbeat commented Mar 21, 2019

@jgravois Thx for the quick fix, as well as this additional info on the AGOL change:

it turns out we made a conscious choice to turn off JSONP support on static.arcgis.com to retire some old infrastructure and optimize our CDN.

@jubasse
Copy link
Author

jubasse commented Mar 21, 2019

@jgravois Thanks for the quick fix !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants