<?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 Re: Request featureservice with f=geojson &amp; callback parameter in onpremise installation  in ArcGIS REST APIs and Services Questions</title>
    <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/request-featureservice-with-f-geojson-callback/m-p/303640#M1505</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A quick update: This was accepted by Esri as a bug: &lt;EM&gt;BUG-000130672: Callback function in query request is not working with geojson format.&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Jun 2020 05:38:08 GMT</pubDate>
    <dc:creator>AndryJoos</dc:creator>
    <dc:date>2020-06-03T05:38:08Z</dc:date>
    <item>
      <title>Request featureservice with f=geojson &amp; callback parameter in onpremise installation</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/request-featureservice-with-f-geojson-callback/m-p/303639#M1504</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi folks&lt;/P&gt;&lt;P&gt;We’re currently working on a webapp based on &lt;A href="https://leafletjs.com/"&gt;leaflet 1.6.0&lt;/A&gt; and angular. &lt;BR /&gt;To access featureservices served by our onpremise installation of ArcGIS Server 10.7.1 or ArcGIS online, we use &lt;A href="https://esri.github.io/esri-leaflet/api-reference/"&gt;esri-leaflet (2.4.0)&lt;/A&gt;. Esri-leaflet, by default, uses when querying a featurelayer the output format geojson (&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;f=geojson&lt;/SPAN&gt;), combined with the parameter `&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;callback&lt;/SPAN&gt;` to define a callback function which should be called, once the data arrived at the client. (I was not able to find a documentation about this behaviour, but it is how I think esri-leaflet works, when I’m looking at the request it sends to the ArcGIS server.)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;A sample request from esri-leaflet to ArcGIS online looks like this:&lt;BR /&gt;https://services.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/Hazards_Uptown_Charlotte/FeatureServer/0/query?returnGeometry=true&amp;amp;where=1=1&amp;amp;outFields=*&amp;amp;f=geojson&amp;amp;callback=window._EsriLeafletCallbacks.c23&lt;BR /&gt;As you can see, the requested output format is geojson and a callback function is provided. The response’s MIME type is `&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;text/javascript&lt;/SPAN&gt;` and the callback function gets returned to the client. &lt;BR /&gt;The result looks like&lt;/P&gt;&lt;PRE class="language-javascript line-numbers"&gt;&lt;CODE&gt;window&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;_EsriLeafletCallbacks&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;c23&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; … &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Now when I do a similar request with the same parameters `&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;f=geojson&lt;/SPAN&gt;` and `&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;callback=window._EsriLeafletCallbacks.c23&lt;/SPAN&gt;` to a featureservice served by our onpremise ArcGIS Server, the callback functions gets ignored and the response’s MIME-type is `&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;application/geo+json&lt;/SPAN&gt;`. In this case we are not able to display the features on our map, because 1.) the wrong MIME-type is returned and gets blocked, 2.) the callback function gets ignored and is not returned to the client.&lt;BR /&gt;With esri-leaflet you have the possibility to set `&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;isModern=false&lt;/SPAN&gt;` to make the request with `&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;f=json&lt;/SPAN&gt;` instead of `&lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;f=geojson&lt;/SPAN&gt;`. With this option, everything works fine on our onpremise installation, the response has the correct MIME-type and the callback function gets returend as well.&lt;/P&gt;&lt;P&gt;We were not able to fix this on our ArcGIS Server.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Did anybody observe the same behaviour on their onpremise installation or knows a way how to fix this?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot &amp;amp; kind regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Apr 2020 09:02:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/request-featureservice-with-f-geojson-callback/m-p/303639#M1504</guid>
      <dc:creator>TobiasWyss</dc:creator>
      <dc:date>2020-04-29T09:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Request featureservice with f=geojson &amp; callback parameter in onpremise installation</title>
      <link>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/request-featureservice-with-f-geojson-callback/m-p/303640#M1505</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;A quick update: This was accepted by Esri as a bug: &lt;EM&gt;BUG-000130672: Callback function in query request is not working with geojson format.&lt;/EM&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Jun 2020 05:38:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-rest-apis-and-services-questions/request-featureservice-with-f-geojson-callback/m-p/303640#M1505</guid>
      <dc:creator>AndryJoos</dc:creator>
      <dc:date>2020-06-03T05:38:08Z</dc:date>
    </item>
  </channel>
</rss>

