Dynamically add image content to the popuptemplate of feature layer

140
1
08-07-2019 03:07 AM
ShakyasinghMohapatra
New Contributor II

popupTemplate: {
title: "testImage",

content:[
{
type: "media",
mediaInfos: [
{
title: "<b>Test</b>",
type: "image",
caption: "test1",
value: {
sourceURL:"images/image1.JPG"
}
} ,
{
title: "<b>Test</b>",
caption: "test2",
value: {
sourceURL:"images/image1.JPG"
}
}
]
}]

}

After clicking on the layer ,I am geting the objectid , through the objectid I want to get the images dynamically stored in  folders having named with the  "id" . 

How can I get the images per each id dynamically

0 Kudos
1 Reply
RobertScheitlin__GISP
MVP Esteemed Contributor

Shakyasingh,

After clicking on the layer ,I am getting the objectid , through the objectid I want to get the images dynamically stored in  folders having named with the  "id" . 

Querying a folders contents is not something you can do in client side JS. You would have to have a field in the features attributes that lists the file names or create some web service that returns a list of file name strings.

0 Kudos