Select to view content in your preferred language

view multiple pictures

3009
42
03-17-2011 06:03 AM
RandellMcGlynn
Emerging Contributor
Hi, I'm trying to create a web app with the flex viewer, but I need to show multiple pictures for one point. I've used the enhanced identify widget, to show one picture, but is there a way to view more than one (For this project, I only need to show 2 images, but it would be nice to show more than 2). I don't have to use the identify widget, I would just prefer it, but if there is no other way I would be alright with that.

Thanks in advance.
Tags (2)
0 Kudos
42 Replies
RobertScheitlin__GISP
MVP Emeritus
Rhett,

   For the thumbnail to appear instead of the picture icon you have to have a link with these image file extensions:

if ((sfx == ".jpg") || (sfx == ".png") || (sfx == ".gif"))
If you have a url that produces and image through a url query or something than it will appear as an icon instead.
0 Kudos
RhettZufelt
MVP Notable Contributor
Thanks much for the help,

My string was forming a UNC path, not a URL.

With the URL, the images preview just fine and works great.

However, I would like to use the multi image option, but have ran into a snag.

I have an images folder with my jpegs in it, but, they are in sub-folders within.  Way to many to have all in a single folder.

I do have a field that has the full path, one with name of the single folder that the images are in, as well as a field with comma separated filenames.

Is there some way to have it append a "post" prefix prefix that is coming from a field so that it knows which sub-folder to load the jpegs from?

something like

<multiimagefield linkprefix="http://server/images/" linkpostprefix=FOLDER (plus a slash) linksuffix="" nexttooltip="Next" prevtooltip="Prev">PHOTOS</multiimagefield >


Where FOLDER is a field containing the folder the images reside in
PHOTOS is the field with CSV filenames.

Thanks again for the help,

R_
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Rhett,

   As you are probably aware there is nothing in place to make this work currently. There is also some major issues you will run into trying to use to fields for the link. The way the code is setup it loops through the fields to find a match for the link field name and then grabs that attribute value and passes it to the MultiImageControl. If you want it to use two different fields than when you find the link field you would have to loop though the fields list again to capture the other field. I definitely don't have free time to assist with this right now even if I was making updates to this widget.

This is the block of the code where you will need to look and add a second field loop: AttRelateInfoWinWidget

                            if (multiImgField && fields == multiImgField)
                            {
                                linkFound = true;
                                mInfoImageC.multiImgPre = multiImgPre;
                                mInfoImageC.multiImgSuf = multiImgSuf;
                                iArray = attrvalue.split(",");
                                mInfoImageC.iArray = iArray;
                                mInfoImageC.visible = true;
                                mInfoImageC.includeInLayout = true;
                            }
0 Kudos
RhettZufelt
MVP Notable Contributor
Thanks Robert,

I had looked at the code some and appreciate you showing me where to look/modify.  However, I am new enough to this, I can't seem to figure out how the different pages work together.  Not sure how args/variables are passed from one module to the other, since variable names are not the same, etc.  Think I will need a little more "practice" before I take this on.

For now, I have just made a copy of the images to a single folder to get it working.  However, i can not seem to get the multiimage to work.

I have tried to remove the linkfield line in case it only allows one or the other, but no joy.
If I put the multiimagefield as one of the <fields>, it identifies it and even lists all the comma separated jpeg files, but I do not see any Next/Prev buttons or a preview.

If I use both the link and multiimage lines, the link works just fine and has a preview for the features that only have a single photo (features can have zero to 8 photo names in the multiimage field).  If there is more than one photo, it will put the entire CSV string in the browser line, so I know it is getting the values but have yet to see the multi image option.  Does this only work if ALL features have multiple images or something?

Below are my two lines of code.  have tried with both, one, or the other.

<linkfield icon_or_text_or_img="img" icon="" linkalias="Photo" linkprefix="http://gis01.wch-rcc.com/rkz/images/" linksuffix="">PHOTOS</linkfield>
<multiimagefield linkprefix="http://gis01.wch-rcc.com/rkz/images/" linksuffix="" nexttooltip="Next" prevtooltip="Prev">PHOTOS</multiimagefield >


Do you see anything obvious that I am missing or have any ideas?

Thanks again,

Rhett
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Rhett,

  Your PHOTOS field should contain values like this:
derby_1.jpg,derby_2.jpg,derby_3.jpg,derby_4.jpg
unless
you also use the linkfuffix=".jpg" then your field data can be:
derby_1,derby_2,derby_3,derby_4


My example setup is:

<multiimagefield linkprefix="http://gis.calhouncounty.org/FlexViewer2.4/assets/images/" linksuffix="" nexttooltip="Next" prevtooltip="Prev">URL</multiimagefield>


You do not use both the multiimagefield and the linkfield
0 Kudos
RhettZufelt
MVP Notable Contributor
Thanks again,

Couple things going on here.  My data looked like

derby_1.jpg, derby_2.jpg,derby_3.jpg, derby_4.jpg


and it does not like spaces in front of the filenames.

Also, I had the <multiimagefield> inside the <links> tag.
Moved it below the <links> tab and is working.  Now just need to remove the spaces from my list.

Thanks again,

R_

Also, some of my attributes that I have in the <fields> area have pretty long text strings.  Since this popup resizes to fit the data, on the features with a large "comment", the info window gets so large it goes off the screen/map.

is there a way to have this keep the info window a specific size and wrap the text inside the window, instead of resize window to fit text?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Rhett,

   I don't have any experience with that scenario, but I would look at the InfoContentItemRenderer.mxml and this label:

<s:Label id="value"
             width="100%"
             maxDisplayedLines="-1"/>
0 Kudos
RhettZufelt
MVP Notable Contributor
Thanks again,  I will look into that and see how it compares to the standard popup window (which resizes the data to the window).

Also, I have found a workaround for the multiple paths to images.

It appears as if I can code the sub-folder into the filename and seems to be working.

folder1\derby_1.jpg,folder1\derby_2.jpg,derby_3.jpg,folder3\derby_4.jpg


Thanks again,

R_
0 Kudos
RhettZufelt
MVP Notable Contributor
Hi Robert,

Any other ideas as to which mxml is handling the popups from your modified InfoTemplates?
I can completely comment out this section in the InfoContenetItemRenderer file and no change.  So, apperantly, it is not calling that at all.  Must be "hidden" somewhere else.

Rhett,

   I don't have any experience with that scenario, but I would look at the InfoContentItemRenderer.mxml and this label:

<s:Label id="value"
             width="100%"
             maxDisplayedLines="-1"/>


thanks again,

R_
0 Kudos
RhettZufelt
MVP Notable Contributor
Hi Robert,

When I look at my FlashBuilder 4.5 problems window, I get the following error:

The required skin state 'queryAttachmentInfosWithList' is missing. AttachmentInspectorReadOnlySkin.mxml      /hanf/src/widgets/InfoTemplates

and a couple warnings:
(for every widget xml config file )
No grammar constraints (DTD or XML schema) detected for the document.

and then, for a bunch of the InfoTemplate.mxml(s):
This compilation unit did not have a factoryClass specified in Frame metadata to load the configured runtime shared libraries.

Could the missing skin have something to do with the formatting issues?
And, more importatly, any ideas as to how I go about "fixing" the error?

Thanks again,

Rhett
0 Kudos