Google Maps API for Flash + AIR: How did we ever breathe before?
November 18th, 2008 | Published in Google Maps
Just a little over six months ago our team announced the release of the Google Maps API for Flash. Flash developers around the world welcomed this new API with excitement... and a barrage of feature requests. By far the most popular one in the past six months has been the compatibility with Adobe AIR.
Throughout its three years of existence, the Google Maps API has become one of the most popular online APIs for creating web mapping applications at a time when web was the hot new thing. Well, in the past year, Adobe has taken web apps back to the desktop, with their innovative AIR product.
There were both technical and legal challenges blocking AIR support in our API. AIR has a different security model, which required a number of changes to the "internal plumbing" of the API in order to implement our delayed-loading model, where the actual implementation of the map's functionality loads dynamically from Google's servers once the application launches. Also, our Terms of Service used to specify that the Maps API could only be used for online web applications.
Now that both the API and Terms of Service have undergone a facelift, we are releasing the first version of the API that will allow Flash/Flex developers to bring Google Maps to the AIR runtime.
Developers who are already familiar with creating online applications with the Google Maps API for Flash will find it easy to start using the API for their AIR apps. Just about the only difference is the use of the url
parameter of the map class. Developers creating normal online applications sign up for a key corresponding to the URL of the SWF, but developers creating AIR applications must sign up for a key corresponding to the URL of the page that the application can be downloaded from. While instantiating a map, AIR developers will need to provide both the key and that url in the key
and url
parameters of the map, respectively. For more information (and screenshots!), read through our snazzy new tutorial on developing AIR apps in Flex Builder.
For a few examples of using the API with AIR, check out the demo gallery. One example is the "Map CSV Parser", which is based on the great text-file editor example from the Adobe docs. This AIR app lets you open or drag a CSV file, and then it parses it into draggable markers on to the map. The new positions of the markers can be saved into the same or new CSV file on the file system. It's just a few lines of code, but should give you an idea of the kind of powerful interaction possible between a Map and a Desktop. Click the screenshot or here to view and download the source for that example.
We are looking forward to seeing your ideas and your AIR apps! As always, please follow up with your suggestions and questions in the forum.