Convert Flex pop-up to WAB - 2 questions

4409
16
Jump to solution
11-20-2015 11:55 AM
MegPeterson
New Contributor III

Hi all -

I have a popup from my old Flex site that I would like to re-create in WAB. It's displayed below and was configured using the <description> tag with <![CDATA[ {NAME}<br> <img src="assets'images\popup_icons\{I_bike}"> <img src="assets'images\popup_icons\{I_hike}">, etc etc.>

to pull in image icons referenced in the data table.

Question #1: I'm trying to configure the pop-up in the web map using the "custom attribute display" option, but I don't see a way to display the icons horizontally referencing an <img> tag, or via a virtual directory. Is that possible to do? And if not - egads, where would I begin to recreate the popup? The images represent Yes or No values for whether the activity is available at that location.

Question #2: Ideally I'd like to configure the popup to be queried for only the activities available at each location, similar to the Park Locator Local Government template. This seems more extensive with coding, but if anyone has suggestions on where to begin or what forums to read and get started, I'd appreciate the guidance.

Thank you. - Meg


Tags (2)
0 Kudos
16 Replies
MegPeterson
New Contributor III

Yes, definitely. It might be awhile before it goes public, but I'd be happy to post screen shots in the interim.

0 Kudos
MegPeterson
New Contributor III

quick question - is this url in the _setupParksPopup a virtual directory?

    retRslt = "<img src='http://gislap183/ParkIcons/" + value + "'/> ";

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Yes that is a virtual directory I set on my dev machine

0 Kudos
MegPeterson
New Contributor III

Hi Robert -

I've added the 3 new functions and the new line of code to the MapManager.js in my server/apps/3/etc directory, and have changed out your virtual directory for mine.

I fear I'm missing something elementary because on a map click, nothing appears. If I set popups to be enabled, I get the standard field attribute list so I know popups "work".

The only thing I see is in the _setupParksPopup this:

var boolTest = value.toLowerCase().indexOf('_no_') > 0 ? false : true;

seems to reference "no" whereas my data is Y / N. Could this be something? I'm totally blind...

Thanks++

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Meg,

   I am not using you Y or N fields to do this I am using the I_BIKE, etc, etc and checking for the existence of "_no_". You need to check the "layer title name that I am checking for as I know that is my layer title in my webmap but might not be yours.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Meg,

  Popups do have to be enabled in the web map. They will get overwritten by the setContent method in the code provided

0 Kudos
MegPeterson
New Contributor III

Eureka!! Robert - I can't thank you enough. What a great way to start the week.

I got the icons to display and am starting to look at the code to get a better understanding of how it all works. Next up for me is getting the attachment images to display, but this thread has been invaluable as a starting place for me to learn from.

If you know any sites/guides that specifically work with WAB customization please send them on. It will be a win-win as we all won't need to post so many questions.

I'm thrilled this works. Thanks again++!

0 Kudos