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.
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.
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.
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.
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.
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.
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’.
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.