Here’s a short screencast of a quick demo of the realtime shared Google Map based on XMPP4MOZ that I’m working on.
The demo shows some of the current features:
London weather is wet as usual, showers everywhere. I leaved Milan with a shirt and I had to wear my coat just out the plane.
Fortunately a weekend in Tuscany waits for me. Lorenzo did a great job by organizing a relaxing break with a couple of friends in a fantastic place near Florence. It will be much fun!
For a university exam (Human Computer Interaction) I’m developing a realtime shared map that you can use to plan a travel with your friends in realtime while you chat with them.
The map will be interactive and it will have some shared widgets that will provide the user with:
All these widgets are shared across the user, their position and their content gets replicated on the browsers in realtime and every user can interact and change the information.
The application logic is composed of two entities: the map application and the agent application.
The map application will run completely on the user’s browser, his responsibilities are:
The agent application can run anywhere as long at it can have an XMPP link, his responsibilities are:
The user interface is created from HTML and javascript is used to manage the page updates and the interaction events.
A google map is used as the main page widget and other small windows are created on the map and can be dragged over the page by the user.
The comunication link between the map application and the agent application is created by using the XMPP4MOZ extension for Firefox.
The map application encapsulates JSON objects describing map events into XMPP messages that are sent to the agent application in realtime.
The map application also receives JSON objects coming from the agent application describing map updates.
Any XMPP (Jabber) account can be used for users and the agent. I used Google Mail accounts that can be used with the very fast and reliable Google Talk XMPP server.
The backend application (agent application) is made in Ruby using the XMPP4R to manage the XMPP communication link and the Ruby JSON library to encode and decode JSON objects.
The backend will keep the status of the map and the widgets so everytime a new user joins the frontend can show the current status of the map.
I was able to hack a quick prototype of the frontend and the backend on Friday afternoon.
Everything is working fine so far.
I was able to run the agent application and two users on the map application each on one different laptop (yeah I have three laptops… actually four
) and watching map moving in realtime from one laptop to the other.
I also had time to create a simple widget that enables a user to put landmarks on the map that can be dragged around by any user. The agent keeps the position of the map and of each landmark so when a new user logs in he will see the landmarks created by other users and he will be able to interact with them.
I want to refactor a bit the frontend code to separate the core of the application that manages the messaging with the backend with the widgets that let the user interact with the map. Ideally you should be able to plug functionality into the core application by including self contained modules.
I’ll plan to share some of the code once I feel it’s kinda useful…
Annuncio con immenso piacere che sul numero di Giugno di Computer Programming potete trovare il primo dei miei tre articoli su Erlang. In questo numero ho trattato principalmente la parte sintattica del linguaggio, facendo qualche esempio e introducendo il lettore alla programmazione funzionale. Correte in edicola!
Translation for all the non-italian readers: in the June issue of Computer Programming, the leading italian programming magazine, you can find the first of three articles I wrote about Erlang. It’s a great introduction to the language, so if you have an italian friend who wants to know more about this language, tell him to buy the magazine!