Image does not display in infotemplate

566
6
06-08-2020 10:43 PM
FaryalSafdar
New Contributor

I have added image in attribute table. It looks like this: 

Now I want to display this image into infotemplate.

so far I am doing like this:

var content = "<b>Name</b>: ${name}" +                            "<br><b>Picture</b>: ${Pic}" +                  "<br><b>Last Name</b>: ${lname}" ;    var infoTemplate = new InfoTemplate("${FIELD_NAME}", content);

But it does not display image. It is empty. image is showing in identity window in ArcGis. but not in infotemplate

0 Kudos
6 Replies
Noah-Sager
Esri Regular Contributor

What version of the JS API are you using? If 4x, here is a really nice sample that shows how to use various elements in a popup: Multiple popup elements | ArcGIS API for JavaScript 4.15 

0 Kudos
FaryalSafdar
New Contributor

i am using 3.20 version.

0 Kudos
FaryalSafdar
New Contributor

how we display image in info template from attribute table of the feature layer?

0 Kudos
Noah-Sager
Esri Regular Contributor

This sample shows how to use the InfoWindowBase class to create a custom info window. 

Custom info window | ArcGIS API for JavaScript 3.32 

This sample shows how to format the content of an info window using formatting functions.

Format info window content | ArcGIS API for JavaScript 3.32 

This sample creates and use a popup template that references fields from a relationship.

Popup with related fields | ArcGIS API for JavaScript 3.32 

0 Kudos
FaryalSafdar
New Contributor

thanks for your reply . but it seems nobody understand my problem. all these examples shows manual adding of images in infotemplate. my problem is this i have to add image in attribute table then show that image in infotemplate along with attributes of the feature layer

0 Kudos
RobertScheitlin__GISP
MVP Emeritus
0 Kudos