From 257d609b986b5f70282c68b75858cc5f2323a400 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Fri, 16 Mar 2012 13:38:53 +0000 Subject: Return an error if map clicked outside boundary, fixes #270. --- web/js/map-OpenLayers.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'web/js/map-OpenLayers.js') diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index 7522ae7d6..272fd6c12 100644 --- a/web/js/map-OpenLayers.js +++ b/web/js/map-OpenLayers.js @@ -433,6 +433,11 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, { latitude: $('#fixmystreet\\.latitude').val(), longitude: $('#fixmystreet\\.longitude').val() }, function(data) { + if (data.error) { + // XXX If they then click back and click somewhere in the area, this error will still show. + $('#side-form').html('

Reporting a problem

' + data.error + '

'); + return; + } $('#councils_text').html(data.councils_text); $('#form_category_row').html(data.category); }); -- cgit v1.2.3