Kunt u mij vertellen welke waarde ik moet wijzigen in v2 beta 5 zodat esri leaflet standaard JSONP gebruikt in plaats van CORS? <\/P>
<\/P>
Onze SSO-configuratie geeft een '302 gevonden' terug bij gebruik van de standaard CORS-verzoeken. Als ik onderstaande wijziging doorvoer, werkt alles prima.<\/P>
https:\/\/github.com\/Esri\/esri-leaflet\/blob\/master\/src\/Support.js#L1<\/A><\/P> exporteer<\/SPAN> var<\/SPAN> cors <\/SPAN>=<\/SPAN> ((<\/SPAN>window<\/SPAN>.<\/SPAN>XMLHttpRequest<\/SPAN> &&<\/SPAN> '<\/SPAN>withCredentials'<\/SPAN><\/SPAN> in<\/SPAN> nieuw<\/SPAN> window.XMLHttpRequest<\/SPAN>()));<\/SPAN><\/P> <\/P>exporteer<\/SPAN> var<\/SPAN> cors <\/SPAN>=<\/SPAN> onwaar<\/SPAN>;<\/SPAN><\/P> <\/P>De documentatie toont dat de oude manier om standaard CORS uit te schakelen is:<\/P>Als u CORS niet kunt of wilt inschakelen op uw server, zal de volgende code alle verzoeken JSONP laten gebruiken.<\/SPAN><\/P>L.esri.get = L.esri.Request.get.JSONP;<\/SPAN><\/P> <\/P>Maar de release-opmerkingen voor Beta 2 zeggen:<\/P>L.esri.Request<\/CODE> is verwijderd. Gebruik alstublieft direct L.esri.get<\/CODE>, L.esri.get.CORS<\/CODE>, L.esri.get.JSONP<\/CODE>,L.esri.post<\/CODE> of L.esri.request<\/CODE>.<\/LI> <\/>\n<\/>\n <\/>\nWat is de nieuwe manier om dit te doen in beta 2?<\/>
exporteer<\/SPAN> var<\/SPAN> cors <\/SPAN>=<\/SPAN> ((<\/SPAN>window<\/SPAN>.<\/SPAN>XMLHttpRequest<\/SPAN> &&<\/SPAN> '<\/SPAN>withCredentials'<\/SPAN><\/SPAN> in<\/SPAN> nieuw<\/SPAN> window.XMLHttpRequest<\/SPAN>()));<\/SPAN><\/P> <\/P>exporteer<\/SPAN> var<\/SPAN> cors <\/SPAN>=<\/SPAN> onwaar<\/SPAN>;<\/SPAN><\/P> <\/P>De documentatie toont dat de oude manier om standaard CORS uit te schakelen is:<\/P>Als u CORS niet kunt of wilt inschakelen op uw server, zal de volgende code alle verzoeken JSONP laten gebruiken.<\/SPAN><\/P>L.esri.get = L.esri.Request.get.JSONP;<\/SPAN><\/P> <\/P>Maar de release-opmerkingen voor Beta 2 zeggen:<\/P>L.esri.Request<\/CODE> is verwijderd. Gebruik alstublieft direct L.esri.get<\/CODE>, L.esri.get.CORS<\/CODE>, L.esri.get.JSONP<\/CODE>,L.esri.post<\/CODE> of L.esri.request<\/CODE>.<\/LI> <\/>\n<\/>\n <\/>\nWat is de nieuwe manier om dit te doen in beta 2?<\/>
L.esri.Request<\/CODE> is verwijderd. Gebruik alstublieft direct L.esri.get<\/CODE>, L.esri.get.CORS<\/CODE>, L.esri.get.JSONP<\/CODE>,L.esri.post<\/CODE> of L.esri.request<\/CODE>.<\/LI> <\/>\n<\/>\n <\/>\nWat is de nieuwe manier om dit te doen in beta 2?<\/>
L.esri.get<\/CODE>, L.esri.get.CORS<\/CODE>, L.esri.get.JSONP<\/CODE>,L.esri.post<\/CODE> of L.esri.request<\/CODE>.<\/LI> <\/>\n<\/>\n <\/>\nWat is de nieuwe manier om dit te doen in beta 2?<\/>
L.esri.get.CORS<\/CODE>, L.esri.get.JSONP<\/CODE>,L.esri.post<\/CODE> of L.esri.request<\/CODE>.<\/LI> <\/>\n<\/>\n <\/>\nWat is de nieuwe manier om dit te doen in beta 2?<\/>
L.esri.get.JSONP<\/CODE>,L.esri.post<\/CODE> of L.esri.request<\/CODE>.<\/LI> <\/>\n<\/>\n <\/>\nWat is de nieuwe manier om dit te doen in beta 2?<\/>
L.esri.post<\/CODE> of L.esri.request<\/CODE>.<\/LI> <\/>\n<\/>\n <\/>\nWat is de nieuwe manier om dit te doen in beta 2?<\/>
L.esri.request<\/CODE>.<\/LI> <\/>\n<\/>\n <\/>\nWat is de nieuwe manier om dit te doen in beta 2?<\/>
Esri Leaflet only falls back onto JSONP when POSTing from a client browser that doesn't support CORS. if you'd like to trick our plugin into thinking that the end users browser doesn't support CORS, you can call...
L.esri.Support.cors = false;
Afterward, when calling L.esri.request(), JSONP will be used if its necessary to POST.
// to send a single JSONP ajax request L.esri.request('http://sampleserver6.arcgisonline.com/arcgis/rest/services/', { fakeParam: 'value that will push the request length past 2000 characters' }, function (error, response) { if (error) { console.log(error) } else { console.log(response) } })
If you need to POST across domains, please remember that it will be necessary to invoke a proxy.
we'll be updating the API reference soon, so i'll make sure the new information pertaining to L.esri.request() is as clear as possible.
Aangemelde leden kunnen berichten plaatsen, updates volgen en meer. Nieuw hier? Registreer een gratis account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.