aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/map-OpenLayers.js
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2012-03-29 12:40:10 +0100
committerMatthew Somerville <matthew@mysociety.org>2012-03-29 12:40:10 +0100
commite79d5800688c548ad462208dcc38396f1827f3d9 (patch)
tree210eeb6c044fa06040e24f7819a4f1563213f2d4 /web/js/map-OpenLayers.js
parente0fb5314a6479698d6b60d8ea9206d2755a1a292 (diff)
On map page, move overlay to left hand side of map (and adjust pans appropriately).
Diffstat (limited to 'web/js/map-OpenLayers.js')
-rw-r--r--web/js/map-OpenLayers.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index 5f60a4437..faa3d223e 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -236,7 +236,8 @@ $(function(){
if (fixmystreet.state_map && fixmystreet.state_map == 'full') {
// TODO Work better with window resizing, this is pretty 'set up' only at present
- var q = $('#map_box').width() / 4;
+ var $content = $('.content'),
+ q = ( $content.offset().left + $content.width() ) / 2;
// Need to try and fake the 'centre' being 75% from the left
fixmystreet.map.pan(-q, -25, { animate: false });
fixmystreet.map.events.register("movestart", null, function(e){
@@ -477,7 +478,7 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
fixmystreet.map.getProjectionObject()
);
var p = fixmystreet.map.getViewPortPxFromLonLat(lonlat);
- p.x -= $map_box.width() / 3;
+ p.x -= ( o.left + w ) / 2;
lonlat = fixmystreet.map.getLonLatFromViewPortPx(p);
fixmystreet.map.panTo(lonlat);
}