DAGLI ESPERTI DI COMTASTE

Immagini

Immagine 1

Google Maps API for Flex and Flash: some tips and notes
Posted by Francesco Rapanà - f.rapana@comtaste.com

Finally the official version of Google Maps for Flash is arrived.
Google has just released the Actionscript API (http://code.google.com/apis/maps/documentation/flash/)
that provides map functionalities to web applications in a way really similar to the Javascript version (http://code.google.com/apis/maps/ ).
You can follow the instructions in the Setup or Tutorial pages on Google Code to easily build your web map application (http://code.google.com/apis/maps/documentation/flash/intro.html )

Here is a sample application based on data from Yubuk (Immagine 1)

And now some hints that can be useful when creating your first Flex application with Google Maps:

1) Remember to add the .swc library provided by Google in their SDK in your compiler options. If you are using Flex Builder you can do that simply going in the project properties, under Flex Build Path, then Library Path and click Add SWC.

Otherwise, if you like to use the command line, you can use the -library-path command as explained in the Google tutorial
(http://code.google.com/apis/maps/documentation/flash/basics.html#Compili...).

2) Pay attention to the events: you can’t use the standard Flex events but you need that ones provided by the Google SDK, such as MapMouseEvent.CLICK.

3) Custom markers have a bug in the version 1.3. To avoid this bug there’s a workaround in Google Code. The example has a small error in the marker event listener, the event should be MapMouseEvent.CLICK (as explained above).

I think that Google made a great work porting their Google Maps API to Flash. It is still incomplete but it’s already possible to see the huge potential provided by the cooperation between Google Maps and Flex.
I’m sure that in the near future there will be many interesting RIA based on these technologies.

____________________________________________________________

Francesco Rapanà
f.rapana@comtaste.com
Laureando in Ingegneria informatica, si è specializzato nello sviluppo di applicazioni Web 2.0 attraverso l’uso di tecnologie quali Ajax e Zend. Appassionato delle ultime novità tecnologiche si è occupato di esplorare le possibilità di interazione tra Ajax e Flex e l’ integrazione di Google Maps con basi di dati per ottenere una migliore user experience.

E’ RIA Developer di Comtaste.