aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/map-OpenLayers.js
diff options
context:
space:
mode:
Diffstat (limited to 'web/js/map-OpenLayers.js')
-rw-r--r--web/js/map-OpenLayers.js12
1 files changed, 12 insertions, 0 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index 55afeabb1..6c99ee1f4 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -619,6 +619,18 @@ OpenLayers.Strategy.FixMyStreet = OpenLayers.Class(OpenLayers.Strategy.BBOX, {
bounds = new OpenLayers.Bounds(bounds.toArray());
}
return bounds;
+ },
+ // The above isn't enough, however, because Strategy.BBOX's getMapBounds
+ // and calculateBounds work out the bounds in different ways, the former by
+ // transforming the map's extent to the layer projection, the latter by
+ // adding or subtracting from the centre. As we have a ratio of 1, rounding
+ // errors can still occur. This override makes calculateBounds always equal
+ // getMapBounds (so no movement means no update).
+ calculateBounds: function(mapBounds) {
+ if (!mapBounds) {
+ mapBounds = this.getMapBounds();
+ }
+ this.bounds = mapBounds;
}
});