Select to view content in your preferred language

Re: Weather Underground Widget Error (cont)

1063
11
08-23-2011 06:44 AM
DonaldCatanzaro
Emerging Contributor
Hi All,

Sorry for posting in the wrong forum (thanks Robert).

As I stated in my original post, I did add the mxml to my Flex Modules so I do not think that is the problem. 

I get a Error #2036 when the SFV starts up and the little Weather Underground Button does show up in the SFV.  However, it is not open like it should (i.e. preload="open") and nothing happens when you click the widget button.

Instead, the error is saying that AppEvent.addListener(AppEvent.DATA_PUBLISH, sharedDataUpdated) is an undefined method.

Thanks again !

-Don
Tags (2)
0 Kudos
11 Replies
RobertScheitlin__GISP
MVP Emeritus
Don,
   Sounds like you did not notice the part of the widget title that says for Flex Viewer 2.4
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Don,

   Reading my response that I sent you from my BlackBerry it reads a little short and irritated but I did not mean it to come across this way. If you want to change the code to work for 2.3.1 for your testing and figuring out how to get your XML service data, then all you have to do is change that line to:
ViewerContainer.addEventListener(AppEvent.DATA_PUBLISH, sharedDataUpdated);

Which is the old Flex Viewer 2.3.1 way. So any time you see
AppEvent.addListener
change it to
ViewerContainer.addEventListener
0 Kudos
philippschnetzer
Frequent Contributor
Robert,

Noticing that when you minimize the widget the first time it doesn't behave as intended...

http://gis.calhouncounty.org/FlexViewer2.5/index.html?config=config-weather.xml


After minimizing it the first time it does behave properly for subsequent 'minimizations'...

Also, in your example the data results are shown on screen automatically, but in my app I can wait and nothing happens until I click on the searchState state or searchResults state and then the results instantly appear....(all I did was change the airport code to yyg in the xml - it's Charlottetown, PEI, CAN).

Awesome widget, Robert!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Phillip,

   Thanks for reporting the minimize bug.

You will want to use this configuration:

<configuration>
    <apquery>http://api.wunderground.com/auto/wui/geo/WXCurrentObXML/index.xml?query=[value]</apquery>
    <obquery>http://api.wunderground.com/auto/wui/geo/GeoLookupXML/index.xml?query=[value]</obquery>
    <pwsquery>http://api.wunderground.com/weatherstation/WXCurrentObXML.asp?ID=[value]</pwsquery>
    <forcastquery>http://api.wunderground.com/auto/wui/geo/ForecastXML/index.xml?query=[value]</forcastquery>
    <zoomscale>10000</zoomscale>
    <geometryservice>http://tasks.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer</geometryservice>
    <!-- valid values are f for Fahrenheit and c for Celsius -->
    <tempdefault>c</tempdefault>
    <!-- enter either the zip code, airport code, or city and state to 
    enter in the search textbox when widget is opened. -->
    <defaultsearch>CYYG</defaultsearch>
    <!-- if a defaultsearch value is entered do you want to automatically search for it? -->
    <autosearchdefault>true</autosearchdefault>
    <!-- if you do not want to allow the user to change the search then set to false. -->
    <showsearchoption>true</showsearchoption>
    <!-- if you want to show personal weather station observations by default. -->
    <showpwsdefault>true</showpwsdefault>
    <!-- if you want to show current temp at the observations along with the weather 
    condition icon by default. -->
    <showtempsdefault>true</showtempsdefault>
    <labels>
        <loadinglabel1>Retrieving List Of Weather Stations...</loadinglabel1>
        <loadinglabel2>Retrieving Airport Weather Observations...</loadinglabel2>
        <loadinglabel3>Retrieving Personal Weather Observations...</loadinglabel3>
    </labels>
</configuration>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Phillip,

   Version 2.5.0.1 now fixes the minimize issue.
0 Kudos
philippschnetzer
Frequent Contributor
Great that did the trick, thanks Robert!

On another note - the popups appear on a mouseOverGraphic function and I like that the user does not need to click on it to see the info.  How could I set it so that it disappears after a certain amount of time...or on a mouseOutGraphic event? - ratther than having to hit the x button to close it.

What I have done is made the entire widget hidden from the map...so that the user does not have to do anything at all - but the icons are always present on the map - so it gets kind of annoying when you keep accidentally touching an icon and the popup appears and does not go away on its own.

Your time is much appreciated, good sir!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Philipp,

   Version 2.5.0.2 has this new feature and the time is configurable in the xml.
0 Kudos
philippschnetzer
Frequent Contributor
Absolutely perfect, thank you so much!
0 Kudos
xiaoyizhang
Deactivated User
Robert,

Can you please point to me that where I can download Weather Underground widget v 2.5?
Thanks,

Xiaoyi Zhang
0 Kudos