-
Notifications
You must be signed in to change notification settings - Fork 8
Layer manager App
Should probably be
madrona.layermanager
as it could be useful in other 2D maps?
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
utfgrid_url = TextField... # use ${x}, ${y}, ${z} for url
utfgrid_template = TextField... # mustache template for utfgrid rendering
utfgrid_event = CharField... # move or click?
theme = ManyToMany # a layer can show up in > 1 theme.
link = ManyToMany...
tags = TextField... # for search, etc
legend = ImageField...
abstract = TextField...
thumbnail = ImageField...
bookmark_url = URLField...
class Link(object):
name = CharField # ie "KML" or "Shapefile" or "Source Site" or "FGDC metadata"
url = URLField...
class Theme(object):
name = CharField...
blurb = TextField...
Return a json structure describing the layout of the data
[
'layers': [
{'name': 'Layer1',
'themes': ['Fishing', 'Conservation'],
'tile_url': 'http://server.arcgisonline.com/World_Physical_Map/${z}/${y}/${x}',
'tags': 'Retro food truck qui nostrud banksy occaecat polaroid tempor sriracha adipisicing labore vegan",
'links': ['KML': 'http://blah.kml', 'FGDC XML': 'http://blah.xml', ...]
},
{'name': 'Layer2', ...},
...
]
]
-
maybe a simple djangotemplate-based openlayers html view for testing only.
-
Actual client side would hook into openlayers API (add the layer, create collapsable/searchable accordion layer switcher)
-
Client side could also parse the list in "catalog" mode and display as an accordion data catalog with links.
we'd need one.. maybe just vanilla django for now?
If the UTFGrid fields are set, load the utfgrid tiles and create a callback that will fill in the mustache templates for each visible layer and do whatever with the text (probably just stuff it in a div somewhere). Probably need a control and callback for both move and click events. The layer switcher would need to control the "visibility" of the utfgrid layer along with the tile layer so that interactivity is turned off when the associated tiles are not visible.