Yahoo! Maps Flex 2 Component - Preview
March 2nd, 2007
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:
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”.
Currently residing in Scituate, MA and working at
March 2nd, 2007 at 11:54 am
Hi Tim,
Very cool! Will this be open source? Also, your demo is missing the District of Columbia from the state combobox.
Mike
March 2nd, 2007 at 12:08 pm
Yes this will be an open source project.
Thanks for pointing out that DC was missing. I actually deleted it from my array because it was making my ComboBox too wide. I’ll put it back in.
March 2nd, 2007 at 12:11 pm
Awesome!!!
I was thinking of doing the same thing … can’t wait to get my hands on the source.
And .. if its ok with you … once you do have the source ready … I would like to get it up on FlexBox
Keep up the good work.
March 2nd, 2007 at 12:51 pm
Thanks man! I’ve been hoping to see something like this come along. Any ETA?
March 2nd, 2007 at 12:55 pm
I’ll be releasing the first version over the weekend. I want to document the code I have now and create a page to host the package along with examples.
March 2nd, 2007 at 2:22 pm
Very nice implementation, Tim, and I appreciate all the work you’ve done on Yahoo’s behalf.
So to put markers down, remove them, etc., that’s something we can call within Flex 2/AS3?
March 2nd, 2007 at 3:14 pm
Adding and removing of markers is the last thing I want to get in before the first release. So yes, you’ll be able to do all of that from Flex 2/AS3.
I’ll make sure to document what’s supported in the first release, along with a tentative roadmap for the features that I plan on adding. I haven’t really used the Yahoo! Maps API a lot myself, so I’d be interested to hear from people on the parts of the API they use the most.
March 2nd, 2007 at 3:17 pm
I have a hunch that Yahoo! will be releasing the official AS3 API on Monday at 360Flex. They are scheculed to demonstrate all the new AS3 API’s.
March 2nd, 2007 at 3:21 pm
Well then I better release mine before they do.
March 2nd, 2007 at 3:31 pm
I’m willing to bet that a Flex 2 version of the maps API is *not* released next week. There are already a number of Yahoo! API’s currently available to Flex 2 developers and I’m guessing that the sessions will be going over these.
March 2nd, 2007 at 4:05 pm
I’m using yahoo maps right now in a project and using localconnection to talk from Flex2. I use the setBounds and getBounds calls a lot to set my map extents.
As soon as you release the source, I’d be glad to dive in and help out.
thanks,
Ashif
March 3rd, 2007 at 9:54 am
This is very cool. I’m looking forward to your further updates! Great work.
March 3rd, 2007 at 10:50 am
This is exciting. I’ve been waiting to dive into playing with Flex mapping, hoping that Yahoo or Google would come out with a Flex 2.0 API soon. Now I can start to play now.
Thanks, Tim!
March 4th, 2007 at 12:44 pm
Hi, I’m really glad you are doing this. I started looking into getting Yahoo Maps working with Flex 2 just this weekend and it looks like you will be releasing this sometime today - is this right?
Now I don’t have to go through the other method of using the local connection .. yeah!
August 6th, 2007 at 10:25 am
Hey ,
Great work! I am also trying to make the Flex 1.5 map available to Flex 2. However, encountered few problems with the focus issues. Maybe your component do not have those problems.
Is this component open source? Where is the source code for it? If its open source and the source code is made available I would like to play with it.
May 5th, 2008 at 6:30 am
Yes, it’s open source. You can read more on the page for it.
http://timwalling.com/flexmap/
I’ve discontinued the project though as Yahoo ended up releasing an updated API to get maps working in Flex 2.