Select to view content in your preferred language

Possible to use icons instead of attribute values in Popuprenderer? FlexViewer 3.0

1375
6
Jump to solution
07-25-2013 08:54 AM
MegPeterson
Regular Contributor
I have a map-click popup using a custom Popuprenderer.mxml that returns records for recreational activities at a given site.

Instead of displaying the standard field name and value (Figure1), I'd like to display icons, which would also link to recreational homepages.

I'm a Flex newbie and am wondering if this is possible to do in the keyvaluegroup of the popuprenderer.msml? Or somehow code it in the search.mxml that references the <field> tags in the corresponding .xml?

Figure 1 is the default popup result.
Figure 2 is the "look" I'm going for, but without the functionality. I used the <description> tag to get it this far.

Many thanks from a beginning Flex programmer --

Meg
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable
Original User: ad_giles@hotmail.com

Meg,

I would guess that all you need to put in your field is i_biking.png not \\servername\pv_icons\i_biking.png as this string is going to get appended to the end of your http://servername/pv_icons/ URL

Regards

Anthony

View solution in original post

0 Kudos
6 Replies
AnthonyGiles
Honored Contributor
Meg,

Instead of storing yes or no against each activity could you store a link to the image you want to show instead (have a default image of 1x1 pixel transparent for those attributes that would be No) then have mutliple media tags that show the image for each field.

Just an idea

Regards

Anthony
0 Kudos
by Anonymous User
Not applicable
Original User: MegPeterson

!! Thanks for the reply. Will give it a go -!
0 Kudos
MegPeterson
Regular Contributor
Hi Anthony -

I�??m getting a little stuck on the media tag route �?? can you take a quick look and see if I�??m missing a step.

I added a field in my feature class for the icon �??I_BIKE�?� which references an image on a drive that is in the data store. The field value looks like this "\\servername\pv_icons\i_biking.png", and I can view the image in the mxd if I set up a hyperlink.

I set up a virtual directory on my webserver and can also view the directory and image by entering http://servername/pv_icons/i_biking.png

In the popupconfig.xml, I�??ve added the new �??I_BIKE�?� field to my field list and the media tag looks like this:

<medias>
<media type="image" imagesource="http://servername/pv_icons/{I_BIKE}"></media>
</medias>

But when I click the point on the map, I get a blank image (See attached). Any ideas?
0 Kudos
by Anonymous User
Not applicable
Original User: ad_giles@hotmail.com

Meg,

I would guess that all you need to put in your field is i_biking.png not \\servername\pv_icons\i_biking.png as this string is going to get appended to the end of your http://servername/pv_icons/ URL

Regards

Anthony
0 Kudos
MegPeterson
Regular Contributor
Anthony - it worked!

Now I just need to figure out how to style the media section...

A million thank yous! - Meg
0 Kudos
by Anonymous User
Not applicable
Original User: MegPeterson

Hi Anthony -

The transparent 1x1 pixel for 'No' values works well! But since the media images are displaying in an array, the user has to click though the transparent images to reach the next icon "Yes" value.

Any idea on how to remove an array and simply display all the media images side by side? That way the yes icons of 40x40 would display next to the no transparent icons of 1x1 and the viewer would not know the difference.

I'm editing the PopUpRendererSkin and PopUpMediaBrowser Skin and saw your suggestion on adding the alpha="0" parameter to hide the border - that was very helpful.

Clear as mud? Any suggestions?

I've looked through the posts but have not found anything on removing the array style.

Thanks again. - Meg
0 Kudos