Show image of a point infowindown

2151
11
Jump to solution
09-01-2014 11:34 PM
Highlighted
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 ?

Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Regular Contributor

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

Reply
0 Kudos
11 Replies
Highlighted
Regular Contributor

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?

Reply
0 Kudos
Highlighted
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

Reply
0 Kudos
Highlighted
Regular Contributor

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

Reply
0 Kudos
Highlighted
by
New Contributor III

thanks Riyas so much

Reply
0 Kudos
Highlighted
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.

Reply
0 Kudos
Highlighted
by
New Contributor III

thanks jake!!

Reply
0 Kudos
Highlighted
by
New Contributor III

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

please give me a proposal

Reply
0 Kudos
Highlighted
Regular Contributor

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.

Reply
0 Kudos
Highlighted
by
New Contributor III

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

Reply
0 Kudos