Select to view content in your preferred language

Displaying multiple features in popup windows

1437
6
Jump to solution
11-30-2012 07:42 AM
NicholasRanicar
Emerging Contributor
Hi,
does anyone know how to hook into the popup window functionality that's built into the Flex 3.0 API?

The online documentation on popup configuration files (http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/Pop_up_configuration_files/01m3...) states, "This pop-up functionality is built in to the API and is not a separate widget."

Additionally, the "What's New" (http://resources.arcgis.com/en/help/flex-viewer/concepts/index.html#/What_s_new_in_ArcGIS_Viewer_3_0...) section states as one of the enhancements for the 3.0 pre-release, "Pop-up windows contain multiple features".

Given that a lot of effort has gone into providing this functionality and a lot of effort can also be expended on setup of the popup config XML files, it would be great to be able to make use of this throughout the Flex Viewer application.

I understand that setting the value of map.infoWindowRenderersEnabled true/false effectively turns on/off this functionality for when a user clicks on the map.

Is there any way to programatically access this functionality???

For example, I would like to be able to show a popup for all features found at the location of a graphic centerpoint when the user hovers the mouse over that graphic. I know I could configure my own infoWindowRenderers but this seems highly redundant if I've already defined the popup config for every layer in my map in the main configuration file and I would also have to find a way to implement the "multiple features in a popup" functionality myself.

thanks,
Nic
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus
Nic,

   Currently there is now way exposed in the Flex API for programmatically firing a popup. Many developer before you have tried... Also the map can only display one InfoWidow at a time (ultimately PopUps use the maps info window to display and the map is limited to one info window at a time).

View solution in original post

0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus
Nic,

   Currently there is now way exposed in the Flex API for programmatically firing a popup. Many developer before you have tried... Also the map can only display one InfoWidow at a time (ultimately PopUps use the maps info window to display and the map is limited to one info window at a time).
0 Kudos
NicholasRanicar
Emerging Contributor
Thanks Robert. Seems like a waste to do all that popup configuration and then not have it accessible. 😞


Nic,
Also the map can only display one InfoWidow at a time (ultimately PopUps use the maps info window to display and the map is limited to one info window at a time).


As for the above, I only want one infoWindow but the popups available through the API will display multiple features within a single infoWindow and allow you to scroll through them using the left/right arrows. See image below:

[ATTACH=CONFIG]19635[/ATTACH]
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nic,

   You do have access to it if you click on the map (as you know), just not programmatically. Having multiple graphics represented in one PopUp is done through the content navigator component in the API.
0 Kudos
NicholasRanicar
Emerging Contributor
Thanks Robert, you're a wealth of information, as usual!

I'm pretty sure I can get things figured out but if you know of any examples using the ContentNavigator in code that would be great. I found this posting:
http://forums.arcgis.com/threads/67964-Multipage-InfoPopup?p=236692&viewfull=1#post236692
...but Bjorn readily admits that the API docs are lacking and the 2 examples given just show declarative MXML.
0 Kudos
RhettZufelt
MVP Notable Contributor
Don't know if this could apply, but at the bottom of this post http://forums.arcgis.com/threads/57913-Popups-Viewer-3.0?highlight=popup+click+tolerance it says the popup extent sent to the server is twice the line symbol width for dynamic layers (not sure how it handles points/polys).

Not sure what you exact data and/or needs are, but maybe have a duplicate layer loaded with alpha="0" and a a symbol width large enough to cover your graphic extent.  Point your popupconfig at the invisible layer with large symbols, disable the selection symbology and it would appear as if the popup is coming from the original data, not the invisible, overlapping set and would have the scroll arrows for all features that overlap.

R_
0 Kudos
NicholasRanicar
Emerging Contributor
Thanks for your reply Rhett, wasn't exactly what I was looking for but it turned out to be easy enough to do anyway (to get multiple features in a single popup instance).

Here's a small code snippet that might help for anyone else who's wondering about it:

var popups:ArrayCollection = new ArrayCollection();
for each (var rsltObj:Object in allResults)
{
 var pr:PopUpRenderer = new PopUpRenderer();
 var gr:Graphic = (rsltObj as IdResult).graphic;
 pr.popUpInfo = configurePopUpInfo(...);
 pr.graphic = gr;
 popups.addItem(pr);
}
contentNavigator.dataProvider = popups;
map.infoWindow.content = contentNavigator;
...
0 Kudos