yourcelf / olwidget

Javascript library to replace textareas that contain WKT data with editable OpenLayers maps, and a django app using it for django forms and admin.
Other
91 stars 44 forks source link

Add a hook that Map widget subclasses can use to provide more data to the #64

Closed slinkp closed 13 years ago

slinkp commented 13 years ago

Add a hook that Map widget subclasses can use to provide more data to the javascript... useful for eg. adding custom base layers

For example, I have mine return this dict; notice the value is a JSON string: {'extra_base_layers': '[{"url": "http://maps.opengeo.org/geowebcache/service/wms", "options": {"wrapDateLine": true}, "params": {"layers": "openstreetmap", "bgcolor": "#A1BDC4", "format": "image/png"}, "class": "WMS", "name": "OpenStreetMap (OpenGeo)"}]'}

And then my template looks like this: https://gist.github.com/1002867

This is a more general-purpose feature that could make #60 and #47 unnecessary.

yourcelf commented 13 years ago

Thanks -- added these changes to latest master.