Trukz

Google Maps Mashup for Trukz

Google Maps Mashup for Trukz

Client Brief

Trukz is a online truck-driving game, which although being fairly simplisitic in nature is quite addictive. Part of their challenge is to get people signed up once they have arrived at the homepage. The client wanted to provide a set of data in JavaScript Object Notation (JSON) form and have points and routes added in real-time increments to show recent activity within the game.

Having played the game for a period of time, it was initially unclear why the client just wanted the routes on the map. With some careful questioning and guiding, the client agreed that adding a few more details to the JSON feed would mean a much richer experience for potential new users, as they got to see what other features the game had.

Solution

This was the first project I had done with this client, and I could see what sort of disorganisation the current front-end code was. To make later integration into the live site easier, it was felt that a namespaced JavaScript framework should be setup in addition to the original brief. This would help avoid function name conflicts with existing code on the site, and allow existing features to be converted to use the framework in the future at a time that suited the client.

One of the client’s developers set up the JSON feed, and once this was being output correctly, I was able to develop a system that looped through the values, plotting them on the map using markers and routes. As the client wanted to see a range of what was possible, I built in a range of options – number of routes to show in a group, delay between each group showing, etc.

One of the main problems was the asynchronous nature of the call to Google – each route had to be called individually (sometimes five at a time), AND kept in order so that the route would fade out at the right time. Add in a check that called a new batch of JSON results when the first batch had all been looped through, and it became quite a complicated bit code.

In the end, the client decided that the feature on the site was not required – too much of a hit on their server, and the fact that they chose not to show real-time data – and removed it.