aboutsummaryrefslogtreecommitdiffstats
path: root/web/cobrands/angus/position_map.js
diff options
context:
space:
mode:
authorMatthew Somerville <matthew-github@dracos.co.uk>2016-07-11 16:40:22 +0100
committerMatthew Somerville <matthew-github@dracos.co.uk>2016-07-11 16:40:22 +0100
commit74ce84b43c0e714849d7ad021fb0400356ce2fa8 (patch)
treed96ad51f8cd6f14a6526ec282ad7e70d3eec25c6 /web/cobrands/angus/position_map.js
parent0c5549a60ef3d86d672926d6e71c00cafff8326b (diff)
parent03ad5de783ac71695b1ce0d377dde549fc7311cb (diff)
Merge branch '1351-report-list-ajax'
Diffstat (limited to 'web/cobrands/angus/position_map.js')
-rw-r--r--web/cobrands/angus/position_map.js32
1 files changed, 13 insertions, 19 deletions
diff --git a/web/cobrands/angus/position_map.js b/web/cobrands/angus/position_map.js
index 31ca1c09a..d5d3c942f 100644
--- a/web/cobrands/angus/position_map.js
+++ b/web/cobrands/angus/position_map.js
@@ -52,14 +52,7 @@ var add_streetlights = (function() {
fixmystreet.markers.features[0].move(lonlat);
// Need to ensure the correct coords are used for the report
- // We can't call fixmystreet_update_pin because that refreshes the category list,
- // clobbering the value we stored in the #form_column_id field.
- lonlat.transform(
- fixmystreet.map.getProjectionObject(),
- new OpenLayers.Projection("EPSG:4326")
- );
- document.getElementById('fixmystreet.latitude').value = lonlat.lat || lonlat.y;
- document.getElementById('fixmystreet.longitude').value = lonlat.lon || lonlat.x;
+ fixmystreet.maps.update_pin(lonlat);
// Make sure the marker that was clicked is drawn on top of its neighbours
var layer = e.feature.layer;
@@ -318,18 +311,19 @@ var add_streetlights = (function() {
streetlight_fault_layer.setVisibility(false);
}
});
-
- // Make sure the streetlights get hidden if the back button is pressed
- $(window).on('hashchange', function() {
- if (location.hash === '') {
- streetlight_layer.setVisibility(false);
- streetlight_fault_layer.setVisibility(false);
- fixmystreet.markers.setVisibility(true);
- fixmystreet.bbox_strategy.activate();
- fixmystreet.markers.refresh( { force: true } );
- }
- });
}
+
+ // Make sure the streetlights get hidden if the back button is pressed
+ fixmystreet.maps.display_around = (function(original) {
+ function hide_streetlights() {
+ streetlight_layer.setVisibility(false);
+ streetlight_fault_layer.setVisibility(false);
+ fixmystreet.markers.setVisibility(true);
+ original.apply(fixmystreet.maps);
+ }
+ return hide_streetlights;
+ })(fixmystreet.maps.display_around);
+
return add_streetlights;
})();