aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/map-OpenLayers.js
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-03-16 13:38:53 +0000
committerMatthew Somerville <matthew@mysociety.org>2012-03-16 13:38:53 +0000
commit257d609b986b5f70282c68b75858cc5f2323a400 (patch)
tree3bc172aa1e96b9c0902dbc45accd13f731d5db51 /web/js/map-OpenLayers.js
parentce6daecdf96955aab2f1d528d3fdc2f56213f400 (diff)
Return an error if map clicked outside boundary, fixes #270.
Diffstat (limited to 'web/js/map-OpenLayers.js')
-rw-r--r--web/js/map-OpenLayers.js5
1 files changed, 5 insertions, 0 deletions
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('<h1>Reporting a problem</h1><p>' + data.error + '</p>');
+ return;
+ }
$('#councils_text').html(data.councils_text);
$('#form_category_row').html(data.category);
});