Select to view content in your preferred language

TOC Widget, how to add info window popup when mouseover, mouseout? Thanks a lot!

3503
9
08-29-2011 10:10 AM
cristiBJ
Deactivated User
I am using Viewer 2.4, TOC widget (by Robert S. )

When I turn on a point layer, such as retail business, the feature point are all highlighted on the map.
Now I want it to do this: when mouse over a point, the business name and address is displayed in a infowindow.

How do I add a mouseover, or graphics rollover, rollout event listener? I am reading the code of TOC but do not see a graphicslayer to add event to.

Thanks for all clues!
Tags (2)
0 Kudos
9 Replies
cristiBJ
Deactivated User
After some research, I realized I should add event listener to the map layer, not on a graphics layer.
Seems that LayerList Widget can be used too.

Still I donot know how to attach mouseover events to the point layers turned on through TOC/LayerList. Is this a strange, not normal way of implementing the function?  Thanks.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Cristi,

   I think you a heading do a more difficult path than you need to be... All you need to do is configure a PopUp for the layers using the new standard PopUps.

http://help.arcgis.com/en/webapps/flexviewer/help/01m3/01m30000002q000000.htm

This can route is not dependent on the TOC Widget or the layerList Widget.
0 Kudos
cristiBJ
Deactivated User
Hi Robert, Thank you for helping me out again.

I am working on to hard code the layers, and config files for each layer. I can not think of a way to use the 11 separate config xmls for LayerList Widget. I am trying to hard code the list of layers, and add a check box for each one.

Is this the right way to go? Please shed some light on this if you get a little time.  I appreciate your time spent on this.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Cristi,

   Each layer can have it's own config file (i.e. PopUp_layer1.xml, PopUp_layer2.xml, etc.). The thing you are missing is where to put this info. You configure layers to have their own popup in the main config.xml file:

<operationallayers>
            <!-- Example of editable feature layer -->
            <layer label="San Francisco 3-1-1 Incidents" type="feature" visible="false" alpha="1.0"
                   popupconfig="popups/PopUp_311.xml"
                   url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/SanFrancisco/311Incidents/FeatureServer/0"/>
            <!-- Example time-aware feature layer -->
            <layer label="Earthquakes" type="feature" visible="true"
                   url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Earthquakes/Since_1970/MapServer/0"/>
            <!-- Example data used with data extract widget -->
            <layer label="Data Extract Incidents" type="dynamic" visible="false" alpha="0.6" autorefresh="10"
                   url="http://sampleserver4.arcgisonline.com/ArcGIS/rest/services/HomelandSecurity/Incident_Data_Extraction/MapServer"/>
        </operationallayers>


You need to do some reading here:

http://help.arcgis.com/en/webapps/flexviewer/help/01m3/01m30000002q000000.htm
0 Kudos
cristiBJ
Deactivated User
Robert, Oops I did not read carefully enough. Now I made it work with the pop-up.

There are two more things.

1. Is there way to change this to mouse-over, instead of click.  I looked at mapmanager.mxml,
    could not figure out.
  
    I also found your site is very neat.
    http://gis.calhouncounty.org/FlexViewer2.4/index.html?config=config-featuretips.xml
    If I can not do mouse-over, I will try your featurelayer widget.

2. The field name length is limited. User has to mouse over to see the full name.
    Please see attached screen. If I mouse over it, it says "Number of Employees"; otherwise
    it is cut short in display. How to fix the display?
0 Kudos
cristiBJ
Deactivated User
I have made both pop-up window and map tips work.

Pop-up window uses the configured xml. (A minor problem is the "Number of Employees" can not be displayed in full, see previous posting.)

map tips uses Robert's featurelayer widget.

All my credits go to Robert and this forum.
0 Kudos
FabioMarconi
New Contributor
was somebody able to make it by using mouseover instead of click ?! how ?!
what do I have to change in the widget to get it working with mouseover ?!
0 Kudos
SarahMyers
Occasional Contributor
I too am trying to get this to work with in the latest Flex viewer sample API. Ive tried to use the example "infoWindow on Mouseover" from the sample page(http://resources.arcgis.com/en/help/flex-api/samples/#/InfoWindow_on_MouseOver/01nq0000001q000000/) as a starting point, but i am not sure WHERE to put the listener. I read somewhere that i need to add it to the InfoPopup.mxml under init(), but i am not sure what method to call to get the familiar popup window to appear. Alternatively, Ive looked at MapManager.mxml as a possible place to put the MouseOver, but i am simply not sure what i am looking at and how to call the popup when i mouseover.

I have the popup working on a click, so my popup files exist and are working, now how do i get the mouseover to work??

Thanks
0 Kudos
RhettZufelt
MVP Notable Contributor
2. The field name length is limited. User has to mouse over to see the full name.
    Please see attached screen. If I mouse over it, it says "Number of Employees"; otherwise
    it is cut short in display. How to fix the display?


Not sure if it is supported in version 2.4, but this is now controlled in the popuprendererskin with width setting at the top of the skin code.

R_
0 Kudos