<?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 Popup(Template) of featureLayer conflicting with MapView click events  in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-template-of-featurelayer-conflicting-with/m-p/248445#M23009</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi and a good day to you all, &amp;nbsp;I am using ArcGIS 4 with Chrome and Node Backend serving data via JSON/XHR&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration-line: underline;"&gt;&lt;STRONG&gt;Goal:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I need to place symbols (showing information via popup when clicked) on the map&lt;/LI&gt;&lt;LI&gt;Allow the user to add new symbols if it clicks on unused location where NO symbol is (yet) placed.&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration-line: underline;"&gt;&lt;STRONG&gt;Achieved so far:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;I have successfully created &amp;nbsp;a &lt;STRONG&gt;FeatureLayer&lt;/STRONG&gt; which renders data I fetch via Ajax this part is working very fine, If I click on a feature I get a correct popup that shows attributes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far so good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;For the "add new Feature" functionality I tried to use &lt;SPAN style="color: #ff0000;"&gt;MapView.on("click", ...)&lt;/SPAN&gt; which uses &lt;SPAN style="color: #ff0000;"&gt;&lt;EM&gt;view.popup.open(Options)&lt;/EM&gt;&lt;/SPAN&gt; etc &amp;nbsp; also this works well , BUT, now the &lt;STRONG&gt;problem&lt;/STRONG&gt; is that &amp;nbsp;&lt;STRONG&gt;IF&amp;nbsp;&lt;/STRONG&gt;I click on an item in the featurelayer the popup due to the featurelayer click is now replaced by the popup generated by MapView.on('click &amp;nbsp;process&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can I solve this problem?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards&lt;/P&gt;&lt;P&gt;Jacob Bogers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 11 Dec 2016 18:56:37 GMT</pubDate>
    <dc:creator>JacobBogers</dc:creator>
    <dc:date>2016-12-11T18:56:37Z</dc:date>
    <item>
      <title>Popup(Template) of featureLayer conflicting with MapView click events</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-template-of-featurelayer-conflicting-with/m-p/248445#M23009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi and a good day to you all, &amp;nbsp;I am using ArcGIS 4 with Chrome and Node Backend serving data via JSON/XHR&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration-line: underline;"&gt;&lt;STRONG&gt;Goal:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I need to place symbols (showing information via popup when clicked) on the map&lt;/LI&gt;&lt;LI&gt;Allow the user to add new symbols if it clicks on unused location where NO symbol is (yet) placed.&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration-line: underline;"&gt;&lt;STRONG&gt;Achieved so far:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;I have successfully created &amp;nbsp;a &lt;STRONG&gt;FeatureLayer&lt;/STRONG&gt; which renders data I fetch via Ajax this part is working very fine, If I click on a feature I get a correct popup that shows attributes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So far so good&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;Problem:&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;For the "add new Feature" functionality I tried to use &lt;SPAN style="color: #ff0000;"&gt;MapView.on("click", ...)&lt;/SPAN&gt; which uses &lt;SPAN style="color: #ff0000;"&gt;&lt;EM&gt;view.popup.open(Options)&lt;/EM&gt;&lt;/SPAN&gt; etc &amp;nbsp; also this works well , BUT, now the &lt;STRONG&gt;problem&lt;/STRONG&gt; is that &amp;nbsp;&lt;STRONG&gt;IF&amp;nbsp;&lt;/STRONG&gt;I click on an item in the featurelayer the popup due to the featurelayer click is now replaced by the popup generated by MapView.on('click &amp;nbsp;process&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can I solve this problem?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Regards&lt;/P&gt;&lt;P&gt;Jacob Bogers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 11 Dec 2016 18:56:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-template-of-featurelayer-conflicting-with/m-p/248445#M23009</guid>
      <dc:creator>JacobBogers</dc:creator>
      <dc:date>2016-12-11T18:56:37Z</dc:date>
    </item>
    <item>
      <title>Re: Popup(Template) of featureLayer conflicting with MapView click events</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-template-of-featurelayer-conflicting-with/m-p/248446#M23010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Get rid of the featurelayer's popup template and work with the view click event instead. &amp;nbsp;Then you can open the popup on any map click event and still check for any graphic click event with the view.hitTest function as described in this post:&amp;nbsp;&lt;A _jive_internal="true" class="link-titled" href="https://community.esri.com/message/609517#comment-609517" title="https://community.esri.com/message/609517#comment-609517" target="_blank"&gt;https://community.esri.com/message/609517#comment-609517&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your view.click event can work something like this:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;on&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"click"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;event&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; 
&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; lat &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; event&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapPoint&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;latitude&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;toFixed&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;6&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; lon &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; event&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapPoint&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;longitude&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;toFixed&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;6&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp; view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;hitTest&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;event&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;screenPoint&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;then&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;function&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;response&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;popup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;open&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; title&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Map click"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; location&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; event&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;mapPoint&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; content&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"Lat: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; lat &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" | Lon: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; lon
&amp;nbsp;&amp;nbsp;&amp;nbsp; &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;
&amp;nbsp;&amp;nbsp;&amp;nbsp; graphics &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; response&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;results&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; 
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;graphics&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;length &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; graphic &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; graphics&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; view&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;popup&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;content &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"&amp;lt;br&amp;gt;Value: "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; graphic&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;graphic&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;attributes&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'Value'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp; &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="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 12:21:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-template-of-featurelayer-conflicting-with/m-p/248446#M23010</guid>
      <dc:creator>FC_Basson</dc:creator>
      <dc:date>2021-12-11T12:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: Popup(Template) of featureLayer conflicting with MapView click events</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-template-of-featurelayer-conflicting-with/m-p/248447#M23011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry I should have closed this question ,&lt;BR /&gt;Hi I found the solution in the "code sample section" (link) &amp;gt;&amp;gt;&amp;nbsp;&lt;A class="link-titled" href="https://developers.arcgis.com/javascript/latest/sample-code/view-hittest/index.html" title="https://developers.arcgis.com/javascript/latest/sample-code/view-hittest/index.html"&gt;Access features with click events | ArcGIS API for JavaScript 4.1&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I still use the FeatureLayer, I have to show to kinds of popups, on his handled by the featurelayer (ReactJS popupTemplate), the other is based if click on the map but do not click on any feature, (this way you can add features dynamicly to the layer)&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I just test if I hit a graphic, if i do , I ignore it cause that part is handled by the featurelayer&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Many Thanks for taking the effort to post your answer&lt;BR /&gt;Jacob&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Dec 2016 09:19:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/popup-template-of-featurelayer-conflicting-with/m-p/248447#M23011</guid>
      <dc:creator>JacobBogers</dc:creator>
      <dc:date>2016-12-13T09:19:20Z</dc:date>
    </item>
  </channel>
</rss>

