<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Replacement setting for L.esri.get = L.esri.Request.get.JSONP in Open Source Mapping Libraries Ques.</title>
    <link>https://community.esri.com/t5/open-source-mapping-libraries-ques/replacement-setting-for-l-esri-get-l-esri-request/m-p/830654#M472</link>
    <description>&lt;P&gt;Can you tell me what value to change in v2 beta 5 that will cause esri leaflet to default to JSONP instead of CORS?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Our SSO setup returns a '302 found' when using the default CORS requests.&amp;nbsp; If I make the change below, everything works fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="https://github.com/Esri/esri-leaflet/blob/master/src/Support.js#L1" href="https://github.com/Esri/esri-leaflet/blob/master/src/Support.js#L1" target="_blank"&gt;https://github.com/Esri/esri-leaflet/blob/master/src/Support.js#L1&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="pl-k"&gt;export&lt;/SPAN&gt; &lt;SPAN class="pl-k"&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; cors &lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; ((&lt;/SPAN&gt;&lt;SPAN class="pl-c1"&gt;window&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN class="pl-c1"&gt;XMLHttpRequest&lt;/SPAN&gt; &lt;SPAN class="pl-k"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;'&lt;/SPAN&gt;withCredentials&lt;SPAN class="pl-pds"&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="pl-k"&gt;in&lt;/SPAN&gt; &lt;SPAN class="pl-k"&gt;new&lt;/SPAN&gt; &lt;SPAN class="pl-en"&gt;window.XMLHttpRequest&lt;/SPAN&gt;&lt;SPAN&gt;()));&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="pl-k"&gt;export&lt;/SPAN&gt; &lt;SPAN class="pl-k"&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; cors &lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; false&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The docs show that the old way to turn off default CORS is:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you cannot or do not want to enable CORS on your server the following code will make all requests utilize JSONP.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;L.esri.get = L.esri.Request.get.JSONP;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But release notes for Beta 2 say:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;CODE style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; padding: 0.2em 0; background-color: rgba(0, 0, 0, 0.0392157);"&gt;L.esri.Request&lt;/CODE&gt; has been removed. Please use &lt;CODE style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; padding: 0.2em 0; background-color: rgba(0, 0, 0, 0.0392157);"&gt;L.esri.get&lt;/CODE&gt;, &lt;CODE style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; padding: 0.2em 0; background-color: rgba(0, 0, 0, 0.0392157);"&gt;L.esri.get.CORS&lt;/CODE&gt;, &lt;CODE style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; padding: 0.2em 0; background-color: rgba(0, 0, 0, 0.0392157);"&gt;L.esri.get.JSONP&lt;/CODE&gt;,&lt;CODE style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; padding: 0.2em 0; background-color: rgba(0, 0, 0, 0.0392157);"&gt;L.esri.post&lt;/CODE&gt; or &lt;CODE style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; padding: 0.2em 0; background-color: rgba(0, 0, 0, 0.0392157);"&gt;L.esri.request&lt;/CODE&gt; directly.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the new way to do this in beta 2?&lt;/P&gt;</description>
    <pubDate>Mon, 28 Aug 2023 13:40:13 GMT</pubDate>
    <dc:creator>ChadHutcherson</dc:creator>
    <dc:date>2023-08-28T13:40:13Z</dc:date>
    <item>
      <title>Replacement setting for L.esri.get = L.esri.Request.get.JSONP</title>
      <link>https://community.esri.com/t5/open-source-mapping-libraries-ques/replacement-setting-for-l-esri-get-l-esri-request/m-p/830654#M472</link>
      <description>&lt;P&gt;Can you tell me what value to change in v2 beta 5 that will cause esri leaflet to default to JSONP instead of CORS?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Our SSO setup returns a '302 found' when using the default CORS requests.&amp;nbsp; If I make the change below, everything works fine.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="https://github.com/Esri/esri-leaflet/blob/master/src/Support.js#L1" href="https://github.com/Esri/esri-leaflet/blob/master/src/Support.js#L1" target="_blank"&gt;https://github.com/Esri/esri-leaflet/blob/master/src/Support.js#L1&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="pl-k"&gt;export&lt;/SPAN&gt; &lt;SPAN class="pl-k"&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; cors &lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; ((&lt;/SPAN&gt;&lt;SPAN class="pl-c1"&gt;window&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN class="pl-c1"&gt;XMLHttpRequest&lt;/SPAN&gt; &lt;SPAN class="pl-k"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="pl-s"&gt;&lt;SPAN class="pl-pds"&gt;'&lt;/SPAN&gt;withCredentials&lt;SPAN class="pl-pds"&gt;'&lt;/SPAN&gt;&lt;/SPAN&gt; &lt;SPAN class="pl-k"&gt;in&lt;/SPAN&gt; &lt;SPAN class="pl-k"&gt;new&lt;/SPAN&gt; &lt;SPAN class="pl-en"&gt;window.XMLHttpRequest&lt;/SPAN&gt;&lt;SPAN&gt;()));&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="pl-k"&gt;export&lt;/SPAN&gt; &lt;SPAN class="pl-k"&gt;var&lt;/SPAN&gt;&lt;SPAN&gt; cors &lt;/SPAN&gt;&lt;SPAN class="pl-k"&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; false&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The docs show that the old way to turn off default CORS is:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If you cannot or do not want to enable CORS on your server the following code will make all requests utilize JSONP.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;L.esri.get = L.esri.Request.get.JSONP;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But release notes for Beta 2 say:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;CODE style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; padding: 0.2em 0; background-color: rgba(0, 0, 0, 0.0392157);"&gt;L.esri.Request&lt;/CODE&gt; has been removed. Please use &lt;CODE style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; padding: 0.2em 0; background-color: rgba(0, 0, 0, 0.0392157);"&gt;L.esri.get&lt;/CODE&gt;, &lt;CODE style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; padding: 0.2em 0; background-color: rgba(0, 0, 0, 0.0392157);"&gt;L.esri.get.CORS&lt;/CODE&gt;, &lt;CODE style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; padding: 0.2em 0; background-color: rgba(0, 0, 0, 0.0392157);"&gt;L.esri.get.JSONP&lt;/CODE&gt;,&lt;CODE style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; padding: 0.2em 0; background-color: rgba(0, 0, 0, 0.0392157);"&gt;L.esri.post&lt;/CODE&gt; or &lt;CODE style="font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 13.6px; padding: 0.2em 0; background-color: rgba(0, 0, 0, 0.0392157);"&gt;L.esri.request&lt;/CODE&gt; directly.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the new way to do this in beta 2?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Aug 2023 13:40:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/open-source-mapping-libraries-ques/replacement-setting-for-l-esri-get-l-esri-request/m-p/830654#M472</guid>
      <dc:creator>ChadHutcherson</dc:creator>
      <dc:date>2023-08-28T13:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: Replacement setting for L.esri.get = L.esri.Request.get.JSONP</title>
      <link>https://community.esri.com/t5/open-source-mapping-libraries-ques/replacement-setting-for-l-esri-get-l-esri-request/m-p/830655#M473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Esri Leaflet only falls back onto JSONP when POSTing from a client browser that doesn't support CORS.&amp;nbsp; if you'd like to trick our plugin into thinking that the end users browser doesn't support CORS, you can call...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;L.esri.Support.cors = false;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Afterward, when calling L.esri.request(), JSONP will be used if its necessary to POST.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;// to send a single JSONP ajax request
&lt;SPAN&gt;L.esri.request('&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://community.esri.com/external-link.jspa?url=http%3A%2F%2Fsampleserver6.arcgisonline.com%2Farcgis%2Frest%2Fservices%2F" target="_blank"&gt;http://sampleserver6.arcgisonline.com/arcgis/rest/services/&lt;/A&gt;&lt;SPAN&gt;', {&lt;/SPAN&gt;
&amp;nbsp; fakeParam: 'value that will push the request length past 2000 characters'
}, function (error, response) {
&amp;nbsp; if (error) {
&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(error)
&amp;nbsp; } else {
&amp;nbsp;&amp;nbsp;&amp;nbsp; console.log(response)
&amp;nbsp; }
})&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="line-height: 1.5;"&gt;If you need to POST across domains, please remember that it will be necessary to invoke a proxy.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 10:01:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/open-source-mapping-libraries-ques/replacement-setting-for-l-esri-get-l-esri-request/m-p/830655#M473</guid>
      <dc:creator>JohnGravois</dc:creator>
      <dc:date>2021-12-12T10:01:55Z</dc:date>
    </item>
  </channel>
</rss>

