<?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: Displaying all attributes on click for features in Map Image Layers (JS 4.24) in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/displaying-all-attributes-on-click-for-features-in/m-p/1224191#M79077</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/572135"&gt;@moremeowbell&lt;/a&gt;,&amp;nbsp;unfortunately, MapImageLayer does not support&amp;nbsp;&lt;SPAN&gt;defaultPopupTemplateEnabled.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We have this on our roadmap for a future release, but currently, the workaround would be to create a FeatureLayer from each Sublayer to use defaultPopupTemplateEnabled.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#createFeatureLayer" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#createFeatureLayer&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I suppose the other option would be to loop through all the fields for each Sublayer once you're using the flattened collection with allSublayers and add those to the popup.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Oct 2022 10:43:27 GMT</pubDate>
    <dc:creator>Noah-Sager</dc:creator>
    <dc:date>2022-10-21T10:43:27Z</dc:date>
    <item>
      <title>Displaying all attributes on click for features in Map Image Layers (JS 4.24)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/displaying-all-attributes-on-click-for-features-in/m-p/1224137#M79076</link>
      <description>&lt;P&gt;I am using the ESRI JS 4.24 API to create a mapping application that pulls in a Map Image Layer that is hosted on ArcE Portal. I am having trouble getting attributes to show in my pop-up. I would like to display all attributes in the pop-up, not just a select few.&lt;/P&gt;&lt;P&gt;According to documentation the&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;outFields: ["*"]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;has been replaced with&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;defaultPopupTemplateEnabled: true&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;However, I am getting no content in my pop-up at the moment. Here's what I'm looking at currently:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="moremeowbell_0-1666309966806.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/54105i2C18E58780E1E84A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="moremeowbell_0-1666309966806.png" alt="moremeowbell_0-1666309966806.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code currently, any suggestions are welcome!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;require([
  "esri/config",
  "esri/WebMap",
  "esri/views/MapView",
  "esri/widgets/AreaMeasurement2D",
  "esri/widgets/Compass",
  "esri/widgets/Home",
  "esri/widgets/LayerList",
  "esri/widgets/ScaleBar",
  "esri/widgets/Search",
  "esri/widgets/BasemapToggle",
  "esri/widgets/Legend",
  "esri/widgets/Expand",
  "esri/core/reactiveUtils",
  "esri/widgets/Popup",
  "esri/Map",
  "esri/layers/MapImageLayer",
  "esri/PopupTemplate",

], function (esriConfig, WebMap, MapView, AreaMeasurement2D,
  Compass, Home, LayerList, ScaleBar, Search, BasemapToggle,
  Legend, Expand, reactiveUtils, Popup, Map, MapImageLayer,
  PopupTemplate) {

  esriConfig.portalUrl = "PORTAL_URL";

  const map = new Map({
    basemap: "gray-vector"
  });

  const view = new MapView({
      map: map,
      container: "viewDiv",
      center: [-95, 40],
      zoom: 4,
  });
 
  
  let layer = new MapImageLayer({
    portalItem: {
      id: "1acc2c72f17f44b0bd47ca31f63c9a95",
  },

  });
  map.add(layer);

  layer.when(() =&amp;gt; {
    layer.allSublayers.forEach((sublayer) =&amp;gt; {
        sublayer.popupEnabled = true;
        sublayer.popupTemplate = { 
          defaultPopupTemplateEnabled: true,    
          outFields: ["*"],                   
        }
    });
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 23:55:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/displaying-all-attributes-on-click-for-features-in/m-p/1224137#M79076</guid>
      <dc:creator>moremeowbell</dc:creator>
      <dc:date>2022-10-20T23:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying all attributes on click for features in Map Image Layers (JS 4.24)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/displaying-all-attributes-on-click-for-features-in/m-p/1224191#M79077</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/572135"&gt;@moremeowbell&lt;/a&gt;,&amp;nbsp;unfortunately, MapImageLayer does not support&amp;nbsp;&lt;SPAN&gt;defaultPopupTemplateEnabled.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-widgets-Popup.html#defaultPopupTemplateEnabled&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;We have this on our roadmap for a future release, but currently, the workaround would be to create a FeatureLayer from each Sublayer to use defaultPopupTemplateEnabled.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#createFeatureLayer" target="_blank"&gt;https://developers.arcgis.com/javascript/latest/api-reference/esri-layers-support-Sublayer.html#createFeatureLayer&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I suppose the other option would be to loop through all the fields for each Sublayer once you're using the flattened collection with allSublayers and add those to the popup.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 10:43:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/displaying-all-attributes-on-click-for-features-in/m-p/1224191#M79077</guid>
      <dc:creator>Noah-Sager</dc:creator>
      <dc:date>2022-10-21T10:43:27Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying all attributes on click for features in Map Image Layers (JS 4.24)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/displaying-all-attributes-on-click-for-features-in/m-p/1224595#M79098</link>
      <description>&lt;P&gt;I had the same challenge but with one map service layer, I applied like this&lt;/P&gt;&lt;P&gt;in the feature layer constructed from client side features, I have added the bellow code&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;outFields: ["*"],
// these are the fields, which i got from client side features
      fields:[{name:"KGISDistrictCode", alias:"KGISDistrictCode", type:"string"},
              {name:"KGISDistrictName", alias:"KGISDistrictName", type:"string"},
              {name:"MalePopulation", alias:"MalePopulation", type:"integer"},
              {name:"FemalePopulation", alias:"FemalePopulation", type:"integer"},
              {name:"TotalPopulation", alias:"TotalPopulation", type:"integer"}
      ],
// I have assigned the above to objectIdField
      objectIdField: "fields",
      renderer: districtRenderer5,
      popupTemplate: popupDistrict1,
// in popup template, called this like this
 const popupDistrict1 = {
      title: "The Stats",
      content: `&amp;lt;b&amp;gt;DisstrictCode:&amp;lt;/b&amp;gt; {KGISDistrictCode} &amp;lt;br&amp;gt; 
                &amp;lt;b&amp;gt;DistrictName: &amp;lt;/b&amp;gt; {KGISDistrictName} &amp;lt;br&amp;gt;`
    };&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Will it be helpful&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 07:17:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/displaying-all-attributes-on-click-for-features-in/m-p/1224595#M79098</guid>
      <dc:creator>JayakumarPD</dc:creator>
      <dc:date>2022-10-24T07:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Displaying all attributes on click for features in Map Image Layers (JS 4.24)</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/displaying-all-attributes-on-click-for-features-in/m-p/1228433#M79236</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/169842"&gt;@Noah-Sager&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've been able to iterate and flatten the collection, however, when I try calling Fields I'm getting a "null" and "undefined." For proof on concept, I've just been trying to call fields[0] to populate a pop-up. Do you know why it wouldn't be grabbing the field attributes? Here is the documentation I am currently following:&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// print the first Sublayer's first field to the console
console.log(mapImageLayer.sublayers.items[0].fields[0]);

// OUTPUT:
alias: "OBJECTID"
defaultValue: undefined
description: "the objectid"
domain: null
editable: false
length: -1
name: "objectid"
nullable: false
type: "oid"
valueType: null&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 03 Nov 2022 17:54:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/displaying-all-attributes-on-click-for-features-in/m-p/1228433#M79236</guid>
      <dc:creator>moremeowbell</dc:creator>
      <dc:date>2022-11-03T17:54:11Z</dc:date>
    </item>
  </channel>
</rss>

