<?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: hitTest on MapImageLayer in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-on-mapimagelayer/m-p/1017813#M71423</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/214134"&gt;@anuragmittal&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Wildcard is no supported from version 4.12&amp;nbsp;&lt;/P&gt;&lt;P&gt;Refer to this reference -&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It mentioned you can use defaultTemplatePopupEnabled property of the view popup widget.&lt;/P&gt;&lt;P&gt;However, so far map image layer is not supported yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my opinion, you have two options&lt;/P&gt;&lt;P&gt;Option 1. When you publish map image layer, enable all popup for all layers and use the portal item id.&lt;/P&gt;&lt;P&gt;e.g.&amp;nbsp;&lt;A href="https://codepen.io/thanhtetaung/pen/yLaZZQg" target="_blank"&gt;https://codepen.io/thanhtetaung/pen/yLaZZQg&lt;/A&gt;&lt;/P&gt;&lt;P&gt;To enable all layer, below items might help you and save time.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-enterprise-questions/turn-on-all-pop-ups-for-map-image-layer-via-arcgis-online/m-p/376378" target="_blank"&gt;https://community.esri.com/t5/arcgis-enterprise-questions/turn-on-all-pop-ups-for-map-image-layer-via-arcgis-online/m-p/376378&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Option 2: downgrade to 4.11 or use jsapi 3.xxx with wildcard&lt;/P&gt;&lt;P&gt;e.g. &lt;A href="https://codepen.io/thanhtetaung/pen/OJRddyd" target="_blank"&gt;https://codepen.io/thanhtetaung/pen/OJRddyd&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope these will help you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Jan 2021 01:16:22 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2021-01-19T01:16:22Z</dc:date>
    <item>
      <title>hitTest on MapImageLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-on-mapimagelayer/m-p/1017590#M71415</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am trying to show a popup template whenever users click on the map. It works fine when I use&amp;nbsp;FeatureLayer but doesn't work if I use&amp;nbsp;MapImageLayer (to show all sub features layer).&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is much appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2021 06:12:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-on-mapimagelayer/m-p/1017590#M71415</guid>
      <dc:creator>anuragmittal</dc:creator>
      <dc:date>2021-01-18T06:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: hitTest on MapImageLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-on-mapimagelayer/m-p/1017609#M71417</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/214134"&gt;@anuragmittal&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Here is the codepen sample for you.&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/thanhtetaung/pen/bGwzWEX?editors=1000" target="_blank"&gt;https://codepen.io/thanhtetaung/pen/bGwzWEX?editors=1000&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Basically you need to define popup template for each sublayer as in&lt;/P&gt;&lt;P&gt;sublayers: [&lt;BR /&gt;{&lt;BR /&gt;id: 3,&lt;BR /&gt;visible: true,&lt;BR /&gt;popupTemplate:{&lt;BR /&gt;title:"County: {name}",&lt;BR /&gt;content: "State name {state_name}"&lt;BR /&gt;}&lt;BR /&gt;}, {&lt;BR /&gt;id: 2,&lt;BR /&gt;visible: true,&lt;BR /&gt;popupTemplate:{&lt;BR /&gt;title:"State: {state_name}",&lt;BR /&gt;content: "Sub Region {sub_region}"&lt;BR /&gt;}&lt;BR /&gt;}...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me know how it is go.&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;Than&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2021 08:18:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-on-mapimagelayer/m-p/1017609#M71417</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-01-18T08:18:31Z</dc:date>
    </item>
    <item>
      <title>Re: hitTest on MapImageLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-on-mapimagelayer/m-p/1017789#M71422</link>
      <description>&lt;P&gt;Thank you Than. But this won't work in my case as we have 100s of features layer. Defining sublayer with ID and template for all feature layers will be difficult to maintain in future.&lt;/P&gt;&lt;P&gt;Is there any way I can loop over each layer and create a popup template to show all feature content (*)?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jan 2021 22:26:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-on-mapimagelayer/m-p/1017789#M71422</guid>
      <dc:creator>anuragmittal</dc:creator>
      <dc:date>2021-01-18T22:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: hitTest on MapImageLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-on-mapimagelayer/m-p/1017813#M71423</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/214134"&gt;@anuragmittal&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Wildcard is no supported from version 4.12&amp;nbsp;&lt;/P&gt;&lt;P&gt;Refer to this reference -&lt;/P&gt;&lt;P&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-PopupTemplate.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It mentioned you can use defaultTemplatePopupEnabled property of the view popup widget.&lt;/P&gt;&lt;P&gt;However, so far map image layer is not supported yet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my opinion, you have two options&lt;/P&gt;&lt;P&gt;Option 1. When you publish map image layer, enable all popup for all layers and use the portal item id.&lt;/P&gt;&lt;P&gt;e.g.&amp;nbsp;&lt;A href="https://codepen.io/thanhtetaung/pen/yLaZZQg" target="_blank"&gt;https://codepen.io/thanhtetaung/pen/yLaZZQg&lt;/A&gt;&lt;/P&gt;&lt;P&gt;To enable all layer, below items might help you and save time.&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/t5/arcgis-enterprise-questions/turn-on-all-pop-ups-for-map-image-layer-via-arcgis-online/m-p/376378" target="_blank"&gt;https://community.esri.com/t5/arcgis-enterprise-questions/turn-on-all-pop-ups-for-map-image-layer-via-arcgis-online/m-p/376378&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Option 2: downgrade to 4.11 or use jsapi 3.xxx with wildcard&lt;/P&gt;&lt;P&gt;e.g. &lt;A href="https://codepen.io/thanhtetaung/pen/OJRddyd" target="_blank"&gt;https://codepen.io/thanhtetaung/pen/OJRddyd&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope these will help you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Jan 2021 01:16:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-on-mapimagelayer/m-p/1017813#M71423</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2021-01-19T01:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: hitTest on MapImageLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-on-mapimagelayer/m-p/1018396#M71443</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can enable popupTemplate on sublayers by calling &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-FeatureLayer.html#createPopupTemplate" target="_self"&gt;FeatureLayer.createPopupTemplate&lt;/A&gt;&amp;nbsp;and setting the &lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled" target="_self"&gt;view.popup.defaultPopupTemplatedEnabled&lt;/A&gt; property to true.&lt;/P&gt;&lt;P&gt;&lt;A href="https://codepen.io/U_B_U/pen/YzGgodz?editors=1000" target="_self"&gt;This simple test app&lt;/A&gt; shows you how to show the default popup for all sublayers in a MapImageLayer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;P&gt;-Undral&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 17:19:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-on-mapimagelayer/m-p/1018396#M71443</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2021-01-20T17:19:50Z</dc:date>
    </item>
    <item>
      <title>Re: hitTest on MapImageLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-on-mapimagelayer/m-p/1018447#M71446</link>
      <description>&lt;P&gt;Thank you Undral. This might work for me. But how can I highlight the selected feature layer? And how can I show the popup if a pin is dropped on the map? Currently I am suing hitTest whenever a pin is dropped and it works perfectly fine with direct feature layer but not with &lt;SPAN&gt;MapImageLayer.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Jan 2021 20:12:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-on-mapimagelayer/m-p/1018447#M71446</guid>
      <dc:creator>anuragmittal</dc:creator>
      <dc:date>2021-01-20T20:12:14Z</dc:date>
    </item>
    <item>
      <title>Re: hitTest on MapImageLayer</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-on-mapimagelayer/m-p/1018519#M71450</link>
      <description>&lt;P&gt;I updated the app to showcase what are you asking. You will need to tweak it meet your needs. With this said, the application performance will be bad if you are dealing with hundreds of sublayers, lots of fields for each layer, and large geometries... as the application needs to make bunch of server side calls whenever user clicks on the map.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2021 00:08:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/hittest-on-mapimagelayer/m-p/1018519#M71450</guid>
      <dc:creator>UndralBatsukh</dc:creator>
      <dc:date>2021-01-21T00:08:19Z</dc:date>
    </item>
  </channel>
</rss>

