I knew I ran the risk of releasing something that would be replaced soon enough. I think less than 24 hours might be a record though.

The Yahoo! team released a set of AS3 API Libraries and they addressed the need for a map solution with the Yahoo! Maps AS3 Communication Kit. One of my blog commentors pointed out that these AS3 libraries would be released today and I responded by my willingness to bet that they wouldn’t release an updated map component for Flex 2. Technically I think we both were right. The communication kit that was released follows the same basic approach of loading a Flash 8 SWF which contains the Yahoo! Flash map component, only it uses a nice ExternalInterface service, not to mention the API is much more complete than what I had whipped up so far.

The great thing about the libraries is that, at least for the moment, they’re distributed as source code. Personally I always like to get the source and its nice to see the trend of releasing source code continue with big companies like Yahoo!

FlexMap, it was fun while it lasted. Am I bummed? No! I’m happy that Yahoo! has released a sweet AS3 library and addressed the need for a Flex 2 map API. Yahoo! continues to provide the Flash community with tools to make interesting web applications.

I’m still happy I followed through with it for a few reasons:

1. You never know when the official solution for something will actually come out. You can either suck it up and just write it or just keep delaying until it finally comes out.

2. It was an interesting problem to address. I like hacking, so coming up with a solution that worked was rewarding.

3. I followed through with something, which isn’t something I’m always good at when it comes to personal projects (ie. projects that don’t pay the rent).

4. I setup a project site on code.google.com (which is a really great service) and actually “released” something which in my mind means packaging something up with some basic documentation and release notes. Usually I just slap my code up as is and say have fun.

I have some other ideas for things that I’d like to work on but maybe this time I’ll try to stick to something that’s a little more unique and has less risk of being defunct after a few hours.

I packaged up the first release of FlexMap over the weekend. The source code is being hosted by Google Code but I’ll maintain a page for the project here as well. As soon as Yahoo! releases an updated maps API, this will obviously become defunct, but I wanted to follow through with it anyway. It was an interesting challenge to create a Flex 2 component which exposed much of the same API as the Flex 1.5 version, while doing all of the communication via LocalConnection to a Flash 8 SWF.

I plan on adding some more features so I’ve dubbed this the 0.4 release (I’m guessing I’m about 40% done). Hopefully this is useful for anyone looking to quickly get started with the maps API in Flex 2.

Project home and documentation:
http://www.timwalling.com/flexmap/

Source code:
http://code.google.com/p/flexmap/

My sample application has been updated and the source code is available along with the component source. Some more things might need to be documented, especially my MapEvent addition but hopefully it’s apparent in the sample app.

FlexMap Example

I’ve been working on a Flex 2 component which exposes the Yahoo! Maps API similar to the official Flex 1.5 version. There seems to be a lot of interest in getting an official, updated version of the maps API and in the meantime several people have blogged about ways of communicating to a Flash 8 SWF which contains the Yahoo! Maps Flash component.

I played around with this a while back going with the ExternalInterface approach. I’ve since dumped that approach in favor of using LocalConnection. I’ve encapsulated all the communication into a Flex 2 component which you can just drop into your Flex application. I’m going to be finishing up a few things on it this weekend after which I’ll release the component, along with source. I’m posting a preview of it now to see how much interest there is in the project. The first release of the component will only expose the most common API elements and then I’ll plan out a roadmap for adding more of the Flex 1.5 API.

You can view the demo here:
http://timwalling.com/sandbox/flexmap/preview/

The code for the demo:

XML
<view:YahooMap id="map"
    width="500" height="400"
    source="flash/map.swf"
    mapViewType="{com.timwalling.maps.MapViews.MAP}"
    zoomLevel="6"
    latitude="37.77159"
    longitude="-122.451714"
    mapInitialize="onInit(event)"
/>

Since all of the communication is taken care of by the component, you should be able to use the component just like the Flex 1.5 version using all of the standard map events and map methods.

Update:
I’m open to project name ideas. For obvious reasons, I won’t be keeping the component name “YahooMap”.