Select to view content in your preferred language

RSS feed for a Bus Route and display route in Flex viewer

2554
9
04-14-2010 04:26 AM
ClancyFinmand
Emerging Contributor
We are working in 9.3.1 with Flex 3 and api 1.3.  We want to create a RSS feed, which we have done, for a specific or group of School Bus Routes.  Next we want our Flex Viewer to read and display the bus routes.  We have added some code to the 'Reading GeoRSS feeds' sample and the route/s display, however we now want to incorporate this into our Flex Viewer we are developing for the District Emergency Management Office.  Where we are having a challenge is with the line feature of the routes and displaying the route.
Any suggestions / starting points would be appreciated!
Thanks
Clancy Finmand
Sean Moss
Washoe County School District
Reno, NV
Tags (2)
0 Kudos
9 Replies
SeanMoss
Deactivated User
I think that the GEORSSWidget struggles to parse anything except the example...
0 Kudos
BjornSvensson
Esri Regular Contributor
Not answering your question ... but any chance you could post an example of your bus route RSS?
0 Kudos
SeanMoss
Deactivated User
Hi!  Here is an example of the GeoRSS we pieced together using some flight path as a line example.  In order to make this work (I'm no developer, so I'm ghuessing this is sloppy, don't judge me) we took the GeoRSS sample from resources.esri.com.  We copied the flickr() function and just added two graphics, one point, and one line, and also created some symbol for it below. We also had to change the GoeRSSUtil in the API samples to return a polyline if the type was <GeoRSS:line>.   Actionscript is making me want to cry.   Anyways, we ended up with this, which plots the georss EXACTLY how we want, and does it live!

http://www.seanisfat.com/EOCMap.html

So the test.xml file has an entry for the route which is a <georss:line>, and after that a seperate  <georss:point> for each stop on that route with some HTML attributes.

The problem is that we'd like to add this to the Flex Sample Viewer, who's setup is completely different than the example.  Basically I'd like to rune the exact same function, but I can't seem to figure out how this would work completely seperate from the GeoRSS Widget.
0 Kudos
SeanMoss
Deactivated User
Okay, I have taken the functions and elements from the GeoRSS Feed Sample that is provided in the Flex Samples, and got them into the various parts of the Sample Flex Viewer.  Now I am trying to add a graphic to the map, but there is no map in the Sample Flex Viewer!  Where on earth would I put

        <esri:GraphicsLayer graphicProvider="{georss.result}"/>

?   There is no <esri:map> for this to appear in.  I can watch the GeoRSSUtil iterate through my feed, and I know it's creating graphics, but where do the graphics go!!

Help me Jack!
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
somedeadguy,

   The map is part of the MapManager.mxml and is declared in ActionScript and not MXML as you are use to it seems. Every Widget has access to a map variable or if you are not doing your code from a widget then you can always get access to the map component from this line of code
SiteContainer.getInstance().controller.map
If you are going to code in the Sample Flex Viewer you will have to get use to using ActionScript.
0 Kudos
SeanMoss
Deactivated User
Thank you much sir! This is tough learning two different syntax's at once!   So I have noticed that some things are added through mxml, and other's not.  So I'm trying something like this:

                SiteContainer.getInstance().controller.map.addLayer(georss.Result,0)

Is that what you mean?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
somedeadguy,

    No something more like this
var gLayer:GraphicsLayer = new GraphicsLayer()
       gLayer.id = "myGL";
       gLayer.graphicProvider = georss.result;
    SiteContainer.getInstance().controller.map.addLayer(gLayer);


That is if georss.result is valid in your code.
0 Kudos
ClancyFinmand
Emerging Contributor
Sean is out today, we are meeting early Monday AM and will go back to work.
As always, Thanks so much for the work and effort you expend, especially to those of us who are just getting started.
Your efforts and knowledge are so welcomed
Clancy
0 Kudos
sangeethaunni
Emerging Contributor
Hi,

You can put this business login in GeoRsswidget.mxml , u definitly it wil work out..

thanks
sk
0 Kudos