<?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: GeoJSON attributes are undefined in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/geojson-attributes-are-undefined/m-p/1237966#M79563</link>
    <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please share your geojson url so that I can take a look at what might be going on? If you cannot share then would you mind sharing json for one feature from your geojson file?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 05 Dec 2022 19:59:53 GMT</pubDate>
    <dc:creator>UndralBatsukh</dc:creator>
    <dc:date>2022-12-05T19:59:53Z</dc:date>
    <item>
      <title>GeoJSON attributes are undefined</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/geojson-attributes-are-undefined/m-p/1237562#M79544</link>
      <description>&lt;P&gt;I have a geojson url that I am able to see features on the map. I can use a definition query towards it, but I cannot access the values. The data comes in as undefined, though I can see the count of the features. The data comes in as:&amp;nbsp;(36)&amp;nbsp;[u, u, u, u, u, u, u, u, u, u, u, u, u, u, u, u, u, u, u, u, u, u, u, u, u, u, u, u, u, u, u, u, u, u, u, u] in the console. I'm not sure how to extract the values from a geojson link.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;const query = geoJSONLayer.createQuery().set({
                        outFields: ["Category"],
                        returnGeometry: true
                    });

                    console.log(query)
                    const { features, fields } = await geoJSONLayer.queryFeatures(query);
                    console.log(features.attributes)
                    let sel = document.getElementById("sel").innerHTML = "";

                    // Populate dropdown with list of provinces
                    let dropdown = document.getElementById('locality-dropdown');
                    dropdown.length = 0;

                    let defaultOption = document.createElement('option');
                    defaultOption.text = 'Choose State/Province';

                    dropdown.add(defaultOption);
                    dropdown.selectedIndex = 0;

                    const url = mygeojsonurl;
                    fetch(url)
                        .then(
                            function (response) {
                                if (response.status !== 200) {
                                    console.warn('Looks like there was a problem. Status Code: ' +
                                        response.status);
                                    return;
                                }

                                // Examine the text in the response  
                                response.json().then(function (data) {
                                    let option;

let jsonobj = url;
jsonobj.length; i++) {
                                        dropdown.innerHTML = dropdown.innerHTML + '&amp;lt;option value="' + jsonobj[i]['id'] + '"&amp;gt;' + jsonobj[i]['Category'] + '&amp;lt;/option&amp;gt;'
                                    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Dec 2022 21:36:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/geojson-attributes-are-undefined/m-p/1237562#M79544</guid>
      <dc:creator>GeospatialEnterprise</dc:creator>
      <dc:date>2022-12-03T21:36:51Z</dc:date>
    </item>
    <item>
      <title>Re: GeoJSON attributes are undefined</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/geojson-attributes-are-undefined/m-p/1237966#M79563</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you please share your geojson url so that I can take a look at what might be going on? If you cannot share then would you mind sharing json for one feature from your geojson file?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Dec 2022 19:59:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/geojson-attributes-are-undefined/m-p/1237966#M79563</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2022-12-05T19:59:53Z</dc:date>
    </item>
    <item>
      <title>Re: GeoJSON attributes are undefined</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/geojson-attributes-are-undefined/m-p/1239093#M79597</link>
      <description>&lt;P&gt;I can repost it in the code if need be. Try this one.&lt;/P&gt;&lt;P&gt;&lt;A href="https://locateallfunctions.azurewebsites.net/api/SampleGeoJSON?code=9RSQB1gzYZlaYlss6b4_F5entOm_gPRDqJUxfm4M5ORtAzFu0vFpJQ==&amp;amp;ID=61f57d69a92711a9e7ec6782" target="_blank"&gt;https://locateallfunctions.azurewebsites.net/api/SampleGeoJSON?code=9RSQB1gzYZlaYlss6b4_F5entOm_gPRDqJUxfm4M5ORtAzFu0vFpJQ==&amp;amp;ID=61f57d69a92711a9e7ec6782&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 11:35:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/geojson-attributes-are-undefined/m-p/1239093#M79597</guid>
      <dc:creator>GeospatialEnterprise</dc:creator>
      <dc:date>2022-12-08T11:35:36Z</dc:date>
    </item>
    <item>
      <title>Re: GeoJSON attributes are undefined</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/geojson-attributes-are-undefined/m-p/1239214#M79602</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Perhaps I misunderstood your question. GeoJSONLayer.queryFeatures runs successfully and returns attributes of the features as expected as you can see here in this codepen:&amp;nbsp;&lt;A href="https://codepen.io/U_B_U/pen/ExRMoGB?editors=1000" target="_blank"&gt;https://codepen.io/U_B_U/pen/ExRMoGB?editors=1000&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Dec 2022 16:55:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/geojson-attributes-are-undefined/m-p/1239214#M79602</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2022-12-08T16:55:30Z</dc:date>
    </item>
  </channel>
</rss>

