<?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 Click events on GeoJSON layer: How to access properties from click events? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/click-events-on-geojson-layer-how-to-access/m-p/173497#M16069</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a GeoJSON layer that I have added to my webmap. I want to be able to click on the layer features and populate a sidepanel with elements based on the feature's properties (make request to db from app with Express query, populate sidepanel with returned array). How can I access the GeoJSON layer's properties for the feature that is being clicked? I looked at &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest"&gt;hitTest()&lt;/A&gt;, a MapView method. But surprised to see that GeoJSON is not a supported type of layer for the method.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any ideas on how I could achieve this? I'm able to access the properties on the popupTemplate fine. But I need more features than what the popupTemplate is giving me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TLDR: Need to access GeoJSON properties from clicking element on map.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 03 May 2020 17:06:51 GMT</pubDate>
    <dc:creator>KevinCheriyan</dc:creator>
    <dc:date>2020-05-03T17:06:51Z</dc:date>
    <item>
      <title>Click events on GeoJSON layer: How to access properties from click events?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/click-events-on-geojson-layer-how-to-access/m-p/173497#M16069</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a GeoJSON layer that I have added to my webmap. I want to be able to click on the layer features and populate a sidepanel with elements based on the feature's properties (make request to db from app with Express query, populate sidepanel with returned array). How can I access the GeoJSON layer's properties for the feature that is being clicked? I looked at &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-views-MapView.html#hitTest"&gt;hitTest()&lt;/A&gt;, a MapView method. But surprised to see that GeoJSON is not a supported type of layer for the method.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any ideas on how I could achieve this? I'm able to access the properties on the popupTemplate fine. But I need more features than what the popupTemplate is giving me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;TLDR: Need to access GeoJSON properties from clicking element on map.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 03 May 2020 17:06:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/click-events-on-geojson-layer-how-to-access/m-p/173497#M16069</guid>
      <dc:creator>KevinCheriyan</dc:creator>
      <dc:date>2020-05-03T17:06:51Z</dc:date>
    </item>
    <item>
      <title>Re: Click events on GeoJSON layer: How to access properties from click events?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/click-events-on-geojson-layer-how-to-access/m-p/173498#M16070</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Looks like it's just an omission in the docs. hitTest works with GeoJSONLayer.&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/odoe/pen/dyYZxaG?editable=true&amp;amp;editors=100"&gt;Here is a demo&lt;/A&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2020 15:12:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/click-events-on-geojson-layer-how-to-access/m-p/173498#M16070</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2020-05-04T15:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Click events on GeoJSON layer: How to access properties from click events?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/click-events-on-geojson-layer-how-to-access/m-p/173499#M16071</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Rene! Wish I'd given it a try before I switched my entire application to render Feature Layer instead.&lt;/P&gt;&lt;P&gt;Now I'm facing a problem where client-side graphics added to the feature layer cannot recognize click events for hitTest() or popupTemplate.&lt;/P&gt;&lt;P&gt;I believe this is a bug that was recognized in the API a couple of years ago, but still hasn't been fixed. See&amp;nbsp;&lt;A href="https://community.esri.com/thread/189210"&gt;view.hitTest returning 0 results&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A href="https://community.esri.com/thread/188561"&gt;PopupTemplate from Client Side Graphics Not Working&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2020 15:31:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/click-events-on-geojson-layer-how-to-access/m-p/173499#M16071</guid>
      <dc:creator>KevinCheriyan</dc:creator>
      <dc:date>2020-05-04T15:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Click events on GeoJSON layer: How to access properties from click events?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/click-events-on-geojson-layer-how-to-access/m-p/173500#M16072</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm not sure.&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/sample-code/sandbox/index.html?sample=layers-featurelayer-collection"&gt;This sample&lt;/A&gt; works with popups.&lt;/P&gt;&lt;P&gt;I tried with &lt;A href="https://codepen.io/odoe/pen/XWmVrGK?editable=true&amp;amp;editors=100"&gt;hitTest&lt;/A&gt; and it works.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 May 2020 16:00:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/click-events-on-geojson-layer-how-to-access/m-p/173500#M16072</guid>
      <dc:creator>ReneRubalcava</dc:creator>
      <dc:date>2020-05-04T16:00:05Z</dc:date>
    </item>
  </channel>
</rss>

