<?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: How can I trigger a FeatureLayer click event on mobile devices? in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-trigger-a-featurelayer-click-event-on/m-p/690601#M64267</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've fixed this issue. I discovered it may have been caused by the method Angular Material uses to handle gestures and touch events. I didn't dig into their code too much, so I'm not sure what the optimal solution for this kind of problem would be. However, my workaround was to add a mousedown event to the feature layer&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;CODE class="javascript"&gt;myLayer.on("touchend, click, mouse-down", function(evt) {&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/CODE&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;CODE class="javascript"&gt;&amp;nbsp; //do something&amp;nbsp; &lt;/CODE&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;CODE class="javascript"&gt;} &lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Apr 2016 19:56:20 GMT</pubDate>
    <dc:creator>DavidMeza</dc:creator>
    <dc:date>2016-04-11T19:56:20Z</dc:date>
    <item>
      <title>How can I trigger a FeatureLayer click event on mobile devices?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-trigger-a-featurelayer-click-event-on/m-p/690596#M64262</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm having an issue where click events don't fire as touch/tap events on mobile and would like to know what is the proper way to do this. Currently, my code looks like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE class="language-javascript"&gt;&amp;nbsp; var myLayer = new FeatureLayer(...); 
&amp;nbsp; myLayer.on('click', function (evt) { 
&amp;nbsp;&amp;nbsp;&amp;nbsp; // do something&amp;nbsp;&amp;nbsp; 
&amp;nbsp; });&amp;nbsp;&amp;nbsp; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Also worth noting, I've tried requiring this module&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;'dojox/mobile/View'&lt;/PRE&gt;&lt;P&gt;and setting this variable&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;document.dojoClick = false;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated. Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 16:48:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-trigger-a-featurelayer-click-event-on/m-p/690596#M64262</guid>
      <dc:creator>DavidMeza</dc:creator>
      <dc:date>2021-12-12T16:48:24Z</dc:date>
    </item>
    <item>
      <title>Re: How can I trigger a FeatureLayer click event on mobile devices?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-trigger-a-featurelayer-click-event-on/m-p/690597#M64263</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Try:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;myLayer.on("touchend, click", function(evt) {
&amp;nbsp; //do something
}&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:04:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-trigger-a-featurelayer-click-event-on/m-p/690597#M64263</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T05:04:13Z</dc:date>
    </item>
    <item>
      <title>Re: How can I trigger a FeatureLayer click event on mobile devices?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-trigger-a-featurelayer-click-event-on/m-p/690598#M64264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Robert,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you for your suggestion and prompt response. Unfortunately, this did not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also have a mouse-over event going on that triggers a tooltip, and this seems to work just fine on mobile devices. I don't think this other event is conflicting with the mouse click / touchend event since I've tried to turn the mouse-over event off and still ran into the same issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've also noticed that it IS possible to trigger the click event. You just have to be extremely precise on where you tap and it can take 50+ attempts to get it to work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any other ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2016 13:57:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-trigger-a-featurelayer-click-event-on/m-p/690598#M64264</guid>
      <dc:creator>DavidMeza</dc:creator>
      <dc:date>2016-04-07T13:57:52Z</dc:date>
    </item>
    <item>
      <title>Re: How can I trigger a FeatureLayer click event on mobile devices?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-trigger-a-featurelayer-click-event-on/m-p/690599#M64265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;David,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I have seen instances where you have to use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;myLayer.on("touchend, click", function(evt) {
&amp;nbsp; // Add a delay to compensate for Dojo's touch event handling 
&amp;nbsp; setTimeout(function() {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //do something 
&amp;nbsp; }, 250);
}&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it sounds like you may be trying to click a point feature and this has always seemed to be an issue in the JS API.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:04:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-trigger-a-featurelayer-click-event-on/m-p/690599#M64265</guid>
      <dc:creator>RobertScheitlin__GISP</dc:creator>
      <dc:date>2021-12-12T05:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: How can I trigger a FeatureLayer click event on mobile devices?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-trigger-a-featurelayer-click-event-on/m-p/690600#M64266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you again. Unfortunately, this solution did not make a difference in my application.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I agree with you. I have noticed that this has been an issue from as early as 2012. Is there any way we can get in touch with the developers and point this out? This is very much a crucial feature of the Javascript API and the application I'm working on. I'm a bit surprised it doesn't work so well on mobile devices (it is not just this single issue, but there are other modules such as the LocateButton, other events handling, etc that don't work well).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Apr 2016 22:41:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-trigger-a-featurelayer-click-event-on/m-p/690600#M64266</guid>
      <dc:creator>DavidMeza</dc:creator>
      <dc:date>2016-04-07T22:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: How can I trigger a FeatureLayer click event on mobile devices?</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-trigger-a-featurelayer-click-event-on/m-p/690601#M64267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've fixed this issue. I discovered it may have been caused by the method Angular Material uses to handle gestures and touch events. I didn't dig into their code too much, so I'm not sure what the optimal solution for this kind of problem would be. However, my workaround was to add a mousedown event to the feature layer&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;CODE class="javascript"&gt;myLayer.on("touchend, click, mouse-down", function(evt) {&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/CODE&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;CODE class="javascript"&gt;&amp;nbsp; //do something&amp;nbsp; &lt;/CODE&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;CODE class="javascript"&gt;} &lt;/CODE&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Apr 2016 19:56:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/how-can-i-trigger-a-featurelayer-click-event-on/m-p/690601#M64267</guid>
      <dc:creator>DavidMeza</dc:creator>
      <dc:date>2016-04-11T19:56:20Z</dc:date>
    </item>
  </channel>
</rss>

