
Google recently released the Google Maps API for Flash. I took the opportunity to create a Google version of the MapRooms sample application I posted recently. MapRooms works like Chat Rooms. You can create a room, or join an existing one. In addition to chatting, MapRooms allows you to collaborate on a map: the application leverages the real time capabilities of BlazeDS or LCDS to provide map synchronization between users in the room, and allow you to “whiteboard” on top of a map.
Testing the hosted version
Disclaimer: I’m currently hosting the application on the server I use to host this blog (basic PHP and Tomcat hosting plan). I don’t know much about the characteristics of my server, but I’m probably sharing it with a few dozens of other domains and the resources allocated to me are obviously limited in that shared environment. This is clearly not the ideal environment to host a potentially large scale real time application and I’m investigating other hosting solutions. In the meantime, if you experience difficulties running the app, you can install it locally using the instructions provided below (in “Local installation instructions”). The hosted version tries to connect using RTMP by default (available only as part of LCDS) and falls back to “long AMF polling” or regular AMF polling if the RTMP connection fails.
- Access http://coenraets.org/apps/gmaprooms/gmaprooms.html on two different machines or in two browser windows on the same machine.
- Make sure you logon with two different user names and the same room name.
- Move the map in one browser and notice that the position of the map is synchronized in the other browser.
- You can also search an address in one browser and the resulting map position will appear in the two browsers.
- The zoom level and the map type are also synchronized between users.
- Click the “Whiteboard” button in one browser, pick a color to draw on the map (upper left corner), and start drawing.
Note: you can right-click the application and select View Source or click here to see the source code of the application.
Local installation instructions:
- Install BlazeDS. You can download the BlazeDS turnkey server (a version of Tomcat with BlazeDS preinstalled) here.
- Open {blazeds-install-dir}/tomcat/webapps/samples/WEB-INF/flex/services-config.xml and add an AMF long polling channel defined as follows:
<channel-definition id="my-longpolling-amf" class="mx.messaging.channels.AMFChannel"> <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amflongpolling" class="flex.messaging.endpoints.AMFEndpoint"/> <properties> <polling-enabled>true</polling-enabled> <polling-interval-seconds>5</polling-interval-seconds> <wait-interval-millis>60000</wait-interval-millis> <client-wait-interval-millis>1</client-wait-interval-millis> <max-waiting-poll-requests>200</max-waiting-poll-requests> </properties> </channel-definition> - Open WEB-INF/messaging-config.xml and add the following destination:
<destination id="gmaprooms"> <properties> <server> <allow-subtopics>true</allow-subtopics> <subtopic-separator>.</subtopic-separator> </server> </properties> <channels> <channel ref="my-longpolling-amf"/> <channel ref="my-polling-amf"/> </channels> </destination>
- (Re)start the BlazeDS turnkey server.
- Download the source code of the Google Maps Application here.
- Create a Flex Builder project for the Flex application (gmaprooms). Make sure you configure your Flex Builder project to work with BlazeDS. To read instructions on how to set up a Flex Builder project that works with BlazeDS, make sure your BlazeDS turnkey server is started, and click here.
- Download the Google Maps ActionScript 3 API here, and add the swc file in the libs folder of your project.
- Get a Google Maps API key and assign it to map.key in the initMap() function in MapArea.mxml.
- Compile the application.
- Open the Flex application in two browser windows (to simulate two users in different locations) and test the application as described above (in “Testing the hosted version”).


59 Comments
Nice article! Thank you.
I use BlazeDS to create exceptional rich applications with Flex and Java BlazeDS is a popular, open source web application that can successfully be deployed into a Java application server, making it an ideal option for Flex and Java integration. With this comprehensive resource, you’ll walk through the process of creating Rich Internet Applications (RIA) using BlazeDS. After a look at BlazeDS basics, the book then moves on to explain how to configure, customize, and extend BlazeDS in order to integrate with new and existing Java data sources and applications with Flex-based RIA. * Explains how to install BlazeDS from source as well as its compiled distributions * Demonstrates ways to make user interfaces engaging and effective * Introduces techniques for intercepting for control and management
Hello,
I have followed the steps to create the sample application of Google Map whiteboard , but I am getting the following error message when I click in “Join Room”
[MessagingError message='Destination 'gmaprooms' either does not exist or the destination has no channels defined (and the application does not define any default channels.)']
Can you please help me in sorting out this please?
Thanks
Poonam Jaju
poonam.mantri@gmail.com
güzel.
Hallo Leute,
eine wirklich gelungene Homepage!!! Weiter so. Viele Grüße vom Schönberger Strand an der Ostsee.
_____ \\\!!!///____
______( ô ô )_____
___ooO-(_)-Ooo_ __
Great article! Thank you for posting. Best Regards from Germany :-)
güzel
eline sağlık
Great article :-) Thank you for posting and best regards!!!
12 Trackbacks
[...] Coenraets, Senior Technical Evangelist chez Adobe, a développé à l’aide de cette API un outil de “cartes collaboratives” qui permet de commenter à plusieurs dans une “chat room” une carte Google Maps en lui ajoutant [...]
[...] Sitio Web: MapRooms [...]
[...] mashup avec Google Maps API Flash MapRooms est un mashup créé par Christophe Coenraets à partir de Google Maps API Flash. Il propose des "Chat Rooms" accompagnées [...]
[...] nouvel API de google maps dédié à Flash simplifie la vie du développeur et voici cette démonstration avec BlazeDS, le serveur Adobe Open source de Push Data – c’est le serveur qui pousse les [...]
aarpprovideronline…
incumbent!therewith parenthetical,sophomores …
[...] Google Maps Collaboration Using Google’s New ActionScript API, Flex, and BlazeDSa> [...]
SOG knives…
Interesting ideas… I wonder how the Hollywood media would portray this?…
gratis internet texas holdem…
beggary aerials abolishers?electrocuting mainframe Demeter …
[...] Links: The Google Maps Flash API An Example Application [...]
[...] this year Christophe Coenraets, a colleague on the Platform Evangelism team, created an example application which combined Google’s ActionScript API, Flex and BlazeDS to provide a real-time [...]
[...] this year Christophe Coenraets, a colleague on the Platform Evangelism team, created an example application which combined Google’s ActionScript API, Flex and BlazeDS to provide a real-time [...]
[...] Zend, Google Maps, AS3 and BlazeDS: http://coenraets.org/blog/2008/05/google-maps-collaboration-using-googles-new-actionscript-api-and-b... [...]