aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/map-OpenLayers.js
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2015-09-11 12:36:57 +0100
committerMatthew Somerville <matthew@mysociety.org>2015-09-17 11:13:34 +0100
commit0a96422e2d83fd461d3867c52f5aaacf5fa41a6e (patch)
tree2204c16e3e3cedf29404d41391c3ce8637c641e5 /web/js/map-OpenLayers.js
parent70ab7d97702e2b1be8cf37120660a16daa99556c (diff)
Update JavaScript to handle right-to-left layout.
Diffstat (limited to 'web/js/map-OpenLayers.js')
-rw-r--r--web/js/map-OpenLayers.js10
1 files changed, 1 insertions, 9 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index 7b7bee7e8..63ef7324d 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -59,14 +59,6 @@ function fixmystreet_activate_drag() {
fixmystreet.drag.activate();
}
-// Need to try and fake the 'centre' being 75% from the left
-function fixmystreet_midpoint() {
- var $content = $('.content'), mb = $('#map_box'),
- q = ( $content.offset().left - mb.offset().left + $content.width() ) / 2,
- mid_point = q < 0 ? 0 : q;
- return mid_point;
-}
-
function fixmystreet_zoomToBounds(bounds) {
if (!bounds) { return; }
var center = bounds.getCenterLonLat();
@@ -659,7 +651,7 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
fixmystreet.map.getProjectionObject()
);
var p = fixmystreet.map.getViewPortPxFromLonLat(lonlat);
- p.x -= ( o.left - bo.left + w ) / 2;
+ p.x -= midpoint_box_excluding_column(o, w, bo, $map_boxx.width());
lonlat = fixmystreet.map.getLonLatFromViewPortPx(p);
fixmystreet.map.panTo(lonlat);
}