aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--perllib/Page.pm15
-rw-r--r--web/js/map-OpenStreetMap.js6
2 files changed, 13 insertions, 8 deletions
diff --git a/perllib/Page.pm b/perllib/Page.pm
index 0aa06102d..130b5b301 100644
--- a/perllib/Page.pm
+++ b/perllib/Page.pm
@@ -672,13 +672,14 @@ sub mapit_check_error {
return _('That postcode was not recognised, sorry.') if $location->{code} =~ /^4/;
return $location->{error};
}
- return if mySociety::Config::get('COUNTRY') eq 'NO';
- my $island = $location->{coordsyst};
- if (!$island) {
- return _("Sorry, that appears to be a Crown dependency postcode, which we don't cover.");
- }
- if ($island eq 'I') {
- return _("We do not cover Northern Ireland, I'm afraid, as our licence doesn't include any maps for the region.");
+ if (mySociety::Config::get('COUNTRY') eq 'GB') {
+ my $island = $location->{coordsyst};
+ if (!$island) {
+ return _("Sorry, that appears to be a Crown dependency postcode, which we don't cover.");
+ }
+ if ($island eq 'I') {
+ return _("We do not cover Northern Ireland, I'm afraid, as our licence doesn't include any maps for the region.");
+ }
}
return 0;
}
diff --git a/web/js/map-OpenStreetMap.js b/web/js/map-OpenStreetMap.js
index 911d49d57..4f5bf6fdf 100644
--- a/web/js/map-OpenStreetMap.js
+++ b/web/js/map-OpenStreetMap.js
@@ -60,7 +60,11 @@ YAHOO.util.Event.onContentReady('map', function() {
);
var marker = new OpenLayers.Marker(loc, icon);
if (pin[3]) {
- marker.events.register('click', marker, function(evt) { window.location = '/report/' + pin[3]; OpenLayers.Event.stop(evt); });
+ marker.id = pin[3];
+ marker.events.register('click', marker, function(evt) {
+ window.location = '/report/' + this.id;
+ OpenLayers.Event.stop(evt);
+ });
}
fixmystreet.markers.addMarker(marker);
}