Added spatial searching
This adds a spatial search map to the search interface. This is visible on all catalogues except the EIDC catalogue, where it has been hidden.
Useful starting pages: localhost:8080/osdp/documents - you should see the search interface beneath the facet filters localhost:8080/eidc/documents - the search interface should be hidden and not available!
Things to note:
- SpatialFilterView.js is the main UI and is used in SearchAppView.js, where it is attached to an element with class 'spatial-filter' coming from templates/html/search.ftlh
- SpatialFilterView contains a leaflet map with a drawing toolbar configured to just allow drawing/deleting a single rectangle. Some of the drawing buttons are hidden using css in web/less/search.less > .spatial-filter.
- When a rectangle is added or removed the backbone model is updated via the setBbox() and clearBbox() methods, which triggers an update of the search results. This rectangle is a comma separated string of the form: minX, maxX, maxY, minY that is expected by the backend catalogue.search.SearchQuery.java. SearchQuery.java in turn creates a solr rectlangle query of the form 'ENVELOPE(minX, maxX, maxY, minY)'
- the bounding box and within/intersects options are persisted to the url as backbone fragments via the backbone router (which didn't need any changes) - these appear in the querystring after a leading '#'. Unfortunately, the facet filter urls displayed on the search page were not 'fragment' enabled, so to get around this a '#' was added to the start of the facet filter querystrings in the facet links to make them backbone fragments. Facets and spatial filtering now work as one. This simple change is line 274 of catalogue/search/SearchQuery.java
- spatial filtering is enabled on all catalogues by default, however, it is disabled on the EIDC catalogue. This is done using the css in the changes to web/less/style-eidc.less.