Mapuntu

Project

Mapuntu is the project for maps.ubuntu.com. Currenly it let us map the location of ubuntu servers, but in further versions al types of location based items should be visible on the map.

Mapuntu should provide an API to add,remove and update markers on the map, show additional information on the markers when clicked upon.

The different markers should be structurable, searchable for Ubuntu users.

API

GeoIP

http://maps.ubuntu.com/API/geoip/

POST params optional:

HttpResponse (JSON):

Register an item

http://maps.ubuntu.com/API/register/

POST params required:

POST params optional:

HttpResponse (JSON):

(--csenger There seems to be no way to call unregister/update if the returned secret got lost. I'd not expect users to keep track of hashes. It should accept a (hashed) secret and an email address to retrieve a lost secret as optional parameters.)

Unregister an item

http://maps.ubuntu.com/API/unregister/<secret>/

HttpResponse (JSON):

Update an item

http://maps.ubuntu.com/API/update/<secret>/

POST params:

HttpResponse (JSON):

List of active marker Types

http://maps.ubuntu.com/API/types/

HttpResponse (JSON): List of

Django Implementation

class Tag(models.Model):
    tag = models.CharField(max_length=25)

class TypeAttribute(models.Model):
    attribute = models.CharField(max_length=50)    

class Type(models.Model):
    name = models.CharField(max_length=25)
    description = models.TextField()
    active = models.BooleanField(default=True)
    marker_icon = models.ImageField(upload_to='markers')
    template = models.FileField(upload_to='templates')
    allowed_attibutes = models.ManyToManyField(TypeAttribute)
    default_lifetime = models.DateField(default=datetime.timedelta(weeks=52))
    max_lifetime = models.DateField(default=datetime.timedelta(weeks=3*52))

class Marker(models.Model):
    lat = models.FloatField()
    lng = models.FloatField()
    marker_type = models.ForeignKey(Type)
    tags = models.ManyToManyField(Tag)
    title = models.CharField(max_length=50)
    content = models.TextField(verbose_name=_('Content')) # Pickled dictionary
    more_info_url = models.URLField(null=True, blank=True)
    secret = models.CharField(max_length=16)
    creation_date = models.DateField(auto_now_add=True)
    update_date = models.DateField(auto_now=True)
    expiration_date = models.DateField(blank=False)

Marker Types

Ubuntu Server

Ubuntu User

Design Questions

The map could become overloaded with 'deprecated' markers, how to prevent this

I was thinking about adding a enddate/lifetime the the request. If the lifetime is past, the marker will be hidden on the map. Should there be a maximum lifetime? -- ronnie.vd.c (-- kim0 +1 on lifetime) (--csenger Wouldn't it be good to have different defaults for lifetime? I'd not expect that my Ubuntu User marker will expire (by default))

Markers can contain additional information when clicked upon, should we add restrictions

There are several methods to include information to the marker (link->iframe to external site, HTML, HTML-template+json-data, plain text). Should we add restrictions to this? -- ronnie.vd.c (-- kim0 AFAICT data should be minimal, I'd go for simply HTML)

In what extend should we allow customization of the markers

Should we allow different icons, should we standarize the information content for different types of markers (Persons, Events, etc)? This involves from our side to have a lot of types available, but have much consistency. If users can infuence the content information, its possible to create items for items even we cant think of (both in the good and bad way). -- ronnie.vd.c (-- kim0 Let's keep us in control of the types, anyone having a valid new type can file a bug to add it (like Global Jam marker or so)

mapuntu/API (last edited 2011-04-19 21:52:11 by ip5456cf16)