AnsweredAssumed Answered

Replacement setting for L.esri.get = L.esri.Request.get.JSONP

Question asked by C_Hutch on Sep 15, 2015
Latest reply on Sep 15, 2015 by JGravois-esristaff

Can you tell me what value to change in v2 beta 5 that will cause esri leaflet to default to JSONP instead of CORS? 

 

Our SSO setup returns a '302 found' when using the default CORS requests.  If I make the change below, everything works fine.

 

https://github.com/Esri/esri-leaflet/blob/master/src/Support.js#L1

export var cors = ((window.XMLHttpRequest && 'withCredentials' in new window.XMLHttpRequest()));

 

export var cors = false;

 

The docs show that the old way to turn off default CORS is:

If you cannot or do not want to enable CORS on your server the following code will make all requests utilize JSONP.

L.esri.get = L.esri.Request.get.JSONP;

 

But release notes for Beta 2 say:

  • L.esri.Request has been removed. Please use L.esri.get, L.esri.get.CORS, L.esri.get.JSONP,L.esri.post or L.esri.request directly.

 

What is the new way to do this in beta 2?

Outcomes