Creating Launchpad group maps

Standard

I’m part of a neat couple of launchpad groups, in the past I’ve seen some contribution maps in open source projects, and I though it would be cool to have some of those for lp groups. What follows is the process for creating static (google) maps for your launchpad group.

map

Marker

You’ll need a marker (those ubuntu icons in the map), the featured one is in png 24px × 32px format

Google Account

A google account is required, data will be saved in a Fusion table

Web Hosting

You’ll need web hosting if you want your map going online, otherwise, this process can be replicated locally (for taking screenshots?)


Map capabilities are possible due to launchpad supporting Time Zone through its API, it’s not quite exact but it’s better that nothing (if you know a better place from grabbing localization data please let me know).

I first grab Time Zones from all current members of an specific lp group, these TZ are sent to a google geocoder (using the great geopy library) and saved in a cvs file. The cvs file can then be uploaded to a Fusion table and requested through javascript (to draw the marks). Hint: I first tried running everything using only javascript but with large groups (>10 members) the process took too much time.

wget https://raw.githubusercontent.com/chilicuil/learn/master/sh/tools/lp-g9n-team
sh lp-g9n-team your-lp-group #~ubuntumembers by default

These two steps will create a file called lp-g9n-team.csv containing the name, city, latitude and longitude of all your lp group members. Now it can be uploaded to google, go to docs.google.com and create a new FusionTable:

Fusion Tablets can draw by themselves maps using data from a column of your data, however I couldn’t find a method to customize the marker art.

For this to work, your dataset will need to be shared to everyone, by default is private:

You’ll need to grab the unique ID (will be used in the javascript code):

Finally, once your data is online, you can grab this html code:

And change the default dataset 1zq9pJyRjZB1FqOcqDhd8lKgCFov6VEDdag4tigQ for your own.

About these ads

4 responses »

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s