<?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: img src in FeatureLayer popupTemplate in ArcGIS JavaScript Maps SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/img-src-in-featurelayer-popuptemplate/m-p/1591803#M86619</link>
    <description>&lt;P&gt;This is the result I get:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohnDMorgan_0-1741110166651.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/126916i1D0B056227D8FF5F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohnDMorgan_0-1741110166651.png" alt="JohnDMorgan_0-1741110166651.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 04 Mar 2025 17:43:01 GMT</pubDate>
    <dc:creator>JohnDMorgan</dc:creator>
    <dc:date>2025-03-04T17:43:01Z</dc:date>
    <item>
      <title>img src in FeatureLayer popupTemplate</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/img-src-in-featurelayer-popuptemplate/m-p/1591775#M86618</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to point to an&amp;nbsp;img src that is a string/path on a&amp;nbsp;FeatureLayer, but it always comes through as a broken image. Can anyone point me to how to get this to work? I think I must bypass the popup template class or something to this effect.&amp;nbsp;Here is my code snippet:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;const featureLayer = new FeatureLayer({
url: "https://services.arcgis.com/eoP5lsTDzcIUyaQZ/arcgis/rest/services/.../FeatureServer",
popupTemplate: {
title: "{Name}", // Field from the feature attributes
content: `
&amp;lt;b&amp;gt;Image Path:&amp;lt;/b&amp;gt; {ImagePath}&amp;lt;br&amp;gt;
&amp;lt;a href="{ImagePath}" target="_blank"&amp;gt;URL&amp;lt;/a&amp;gt;
&amp;lt;img src="{ImagePath}"&amp;gt;
`
}
})&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 17:12:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/img-src-in-featurelayer-popuptemplate/m-p/1591775#M86618</guid>
      <dc:creator>JohnDMorgan</dc:creator>
      <dc:date>2025-03-04T17:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: img src in FeatureLayer popupTemplate</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/img-src-in-featurelayer-popuptemplate/m-p/1591803#M86619</link>
      <description>&lt;P&gt;This is the result I get:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JohnDMorgan_0-1741110166651.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/126916i1D0B056227D8FF5F/image-size/medium?v=v2&amp;amp;px=400" role="button" title="JohnDMorgan_0-1741110166651.png" alt="JohnDMorgan_0-1741110166651.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 17:43:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/img-src-in-featurelayer-popuptemplate/m-p/1591803#M86619</guid>
      <dc:creator>JohnDMorgan</dc:creator>
      <dc:date>2025-03-04T17:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: img src in FeatureLayer popupTemplate</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/img-src-in-featurelayer-popuptemplate/m-p/1591897#M86621</link>
      <description>&lt;P&gt;It appears the sanitized HTML may be the issue? I found this &lt;A href="https://www.esri.com/arcgis-blog/products/js-api-arcgis/mapping/using-html-with-popups-in-the-arcgis-api-for-javascript/" target="_blank"&gt;https://www.esri.com/arcgis-blog/products/js-api-arcgis/mapping/using-html-with-popups-in-the-arcgis-api-for-javascript/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Mar 2025 19:15:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/img-src-in-featurelayer-popuptemplate/m-p/1591897#M86621</guid>
      <dc:creator>JohnDMorgan</dc:creator>
      <dc:date>2025-03-04T19:15:00Z</dc:date>
    </item>
    <item>
      <title>Re: img src in FeatureLayer popupTemplate</title>
      <link>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/img-src-in-featurelayer-popuptemplate/m-p/1592635#M86635</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/774460"&gt;@JohnDMorgan&lt;/a&gt;&amp;nbsp;-&lt;/P&gt;&lt;P&gt;In case you haven't gotten this working yet, you can use a function to format the popup content and that should get links working for you. You'll just need to pass the feature into the function so that you can access the attribute that contains the image src path.&lt;/P&gt;&lt;P&gt;Check out this example:&amp;nbsp;&lt;A href="https://codepen.io/laurenb14/pen/zYJqzYp" target="_blank"&gt;https://codepen.io/laurenb14/pen/zYJqzYp&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope this helps!&lt;/P&gt;</description>
      <pubDate>Thu, 06 Mar 2025 05:56:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-javascript-maps-sdk-questions/img-src-in-featurelayer-popuptemplate/m-p/1592635#M86635</guid>
      <dc:creator>LaurenBoyd</dc:creator>
      <dc:date>2025-03-06T05:56:35Z</dc:date>
    </item>
  </channel>
</rss>

