diff options
author | Matthew Somerville <matthew@mysociety.org> | 2012-03-29 12:40:10 +0100 |
---|---|---|
committer | Matthew Somerville <matthew@mysociety.org> | 2012-03-30 17:26:56 +0100 |
commit | 5700e9cdc070bd62c0c82ab35dec61a34955fbaf (patch) | |
tree | 33728545f486d13ba36c71882fc0528a76eadfce | |
parent | 27b02dfb4bcf2fc84c3ffd15edc35ec84a8338ac (diff) |
On map page, move overlay to left hand side of map (and adjust pans appropriately).
-rw-r--r-- | web/cobrands/fixmystreet/_layout.scss | 3 | ||||
-rw-r--r-- | web/js/map-OpenLayers.js | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/web/cobrands/fixmystreet/_layout.scss b/web/cobrands/fixmystreet/_layout.scss index 534b285b1..687b3dbcc 100644 --- a/web/cobrands/fixmystreet/_layout.scss +++ b/web/cobrands/fixmystreet/_layout.scss @@ -222,6 +222,9 @@ h1 { // map page - has fixed header and different styling body.mappage { + .container { + width: auto; + } .content { float:left; } diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js index aa2b2b2eb..1574754c9 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){ @@ -473,7 +474,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); } |