Show image of a point infowindown

2645
11
Jump to solution
09-01-2014 11:34 PM
lasinh
by
New Contributor III

i used query and querytask and  return of type point(only one point), I showed this point with infowindown on the map

how to show the image of a point in the  infowindown from the results returned by querytask ?

0 Kudos
1 Solution

Accepted Solutions
RiyasDeen
Occasional Contributor III

Hi Ia,

You need to set mediaInfos in popup template, in the below sample IMAGEURL will be the attribute which contains the url of the associated image for your points.

  var template = new PopupTemplate({

          title: "Boston Marathon 2013",

          description: "{STATE_NAME}:  {Percent_Fi} of starters finished",

          fieldInfos: [{ //define field infos so we can specify an alias

            fieldName: "Number_Ent",

            label: "Entrants"

          },{

            fieldName: "Number_Sta",

            label: "Starters"

          },{

            fieldName: "Number_Fin",

            label: "Finishers"

          }],

          mediaInfos:[{ //define the bar chart

            caption: "",

            type:"image",

            value: {

              sourceURL: "{IMAGEURL}"

            }

            }]

        });

View solution in original post

0 Kudos
11 Replies
RiyasDeen
Occasional Contributor III

Hi Ia,

What do you mean by showing image of the point, is it an image associated to the point or image of the point location on the map?

0 Kudos
lasinh
by
New Contributor III

Thanks Riyas!!!! showing image of the point which is an image associated to the point!!!. examples I have  5 image associated to the point. how to show image with infowindow

0 Kudos
RiyasDeen
Occasional Contributor III

Hi Ia,

You need to set mediaInfos in popup template, in the below sample IMAGEURL will be the attribute which contains the url of the associated image for your points.

  var template = new PopupTemplate({

          title: "Boston Marathon 2013",

          description: "{STATE_NAME}:  {Percent_Fi} of starters finished",

          fieldInfos: [{ //define field infos so we can specify an alias

            fieldName: "Number_Ent",

            label: "Entrants"

          },{

            fieldName: "Number_Sta",

            label: "Starters"

          },{

            fieldName: "Number_Fin",

            label: "Finishers"

          }],

          mediaInfos:[{ //define the bar chart

            caption: "",

            type:"image",

            value: {

              sourceURL: "{IMAGEURL}"

            }

            }]

        });

0 Kudos
lasinh
by
New Contributor III

thanks Riyas so much

0 Kudos
JakeSkinner
Esri Esteemed Contributor

Hi Ia,

If your image is an attachment, you can do this using the AttachmentEditor class.  You can see an example of this here.

0 Kudos
lasinh
by
New Contributor III

thanks jake!!

0 Kudos
lasinh
by
New Contributor III

storing image data as to how to best access in this case

please give me a proposal

0 Kudos
RiyasDeen
Occasional Contributor III

I prefer storing my images within a folder in my web site and storing relative location URL as an attribute in feature class.

This way I have flexibility to update / replace the images anytime without touching my data or code.

0 Kudos
lasinh
by
New Contributor III

Is attribute in feature class while map editor with ArcGIS desktop?

0 Kudos