Flex: flexTraffic 0.0.3

New version of flexTraffic site.

I wanted to add in the camera data sets so I started implementing a combo-box control to let the user select them. This led (as these things innevitably do) to a massive round of re-factoring the data handling component of the site. After a marathon day of programming I have the code-base looking something like a reasonable professional job which can be extended easily.

New features:

  • Combo box control to allow user to select cameras for London area.
  • I should point out that the positions of some of these are likely to be off the mark or potentially completely wrong. The BBC do provide the images but do not specify lats and longs. I had to identify the position of these by hand. Anything doubtful is marked with a (*) next to it.

    This new feature can be extended to other data as well I just need to decide what to put on the site.

  • Url Links on about page to this site and BBC Backstage.
  • The columns for the graph view can now be sorted correctly.
  • My opinion of this feature has gone up somewhat as I think it is genuinely usefull if you are interesting in a particular road and want to check you are not about to get into traffic chaos.

  • Data sets once fetched are cached so that they load quicker on the second selection.
  • If you are switching between data on the map you will find that navigating between sets you have already viewed is quicker as they aren’t refetched from the server each time.

  • Selecting a marker jumps to item in right-hand list.
  • Zoom in and Zoom out functionality added to info window popups.
  • For some reason this version of the Google Map clears the info window after a zoom which is not how the old gTraffic map works. I can’t decide if I think it’s a good idea or not now.

    I hope to put some more code up soon. I am wanting to find a way to seperate the application graphics (icons etc) into a seperate module or SWC. Don’t know that I’ll do yet but that seems like an interesting avenue to follow.

    Bug #1

    I have just noticed a bug. If you resort the situation or camera list and then select a map item it doesn’t scroll to and highlight the target item. I’ll fix this as soon as I get time.

    Flex: IFrame Communication Demo

    I have created a simple demo to show how to communicate with an embedded html page using FABridge.

    Data is passed to the page using a Flex Event. The page registers an event handler through FABridge for the DirectionEvent. When the application creates and dispatches the event it is received along with the attached data. Note how FABridge creates the getter functions from the public member variable names ‘toValue’ and ‘fromValue’.

    Data is received from the page by calling a function defined in the application from the javascript. Note that the IFrame has to be hidden when the alert box is displayed otherwise it cannot receive focus to close (try it out by commenting out the line to reset the visibility).

    The demo is here. Right click to see the source code.

    Full zipped project here.

    The zipped project is setup to run with my local install of Apache. You will have to adjust it accordingly to get it to run under your own setup.