ckan/ckanext-spatial — pull request #93 by florianm (2014-12-19 07:22:29+00:00)
Title: 91 spatial form widget

Here's an attempt at providing a spatial widget, addressing #91 . There are implications and I'm not sure whether my percussive implementation approach (hitting it with a wrench until it works) was the most graceful way, so I'd be grateful for feedback and suggestions.

Main motivation: My end users love geo-referencing their datasets, and being able to search by map. But many (especially non-GIS-trained staff) struggle with GeoJSON, let alone a GeoJSON geometry. At the same time, my end users have expert knowledge about the true extent of their dataset. This means, letting them draw rather than paste or derive the extent would both make their lives easier ( actually, enable them to provide geo-reference at all), and capture the most accurate study extent.

So all we need is a map on which we can draw and edit polygons and rectangles, and the map needs to be data-bound to the "spatial" input.

* Update Leaflet to 0.8-dev and Leaflet.draw to 0.2.3 (is there any better way than overwriting files in /vendor/?)
* Updated spatial-query's interaction with Leaflet.draw (required due to breaking changes in Leaflet.draw)
* Provide new module spatial-form (added usage docs directly into the file, to be moved into a better place later)
and, over at ckanext-scheming, there's a new [spatial input widget](https://github.com/florianm/ckanext-scheming/blob/master/ckanext/scheming/templates/scheming/form_snippets/spatial.html) which will be a separate pull request for ckanext-scheming.

Screenshots of working examples are at [ckanext-scheming issue 11](https://github.com/open-data/ckanext-scheming/issues/11), but feel free to take my [sandbox](http://data-demo.dpaw.wa.gov.au/) for a whirl (user and password "ckan", editor of organisation "sandbox").