Skip to content
perrygeo edited this page Jun 7, 2012 · 11 revisions

Quick sketch of layer manager app

Models

class RadioGroupLayer(object):
    tilelayers = ManyToMany(TileLayer)

class TileLayer(object):
    name = CharField... # layer name
    order = FloatField... # higher number = on top
    description = TextField...
    tile_url = TextField... # use ${x}, ${y}, ${z} for url template
    theme = ForeignKey
    tags = TextField... # for search, etc

class Theme(object):
    name = CharField...
    blurb = TextField...

Views

Return a json structure describing the layout of the data

[
 {'theme': 'Fishing',
  'layers': [
     {'name': 'Layer1', 'url': 'http://server.arcgisonline.com/World_Physical_Map/${z}/${y}/${x}'},   
     {'name': 'Layer2', ...}
  ]
 },
 ...
]

templates

###(either client/knockout or server/django)

Represent the json as a collapsable/searchable accordion view

questions

  • Should probably be madrona.layermanager as it could be useful in other 2D maps?
  • Single-theme? or Tags or multiple nested themes?
  • How do UTFGrids fit into this?
Clone this wiki locally