aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/map-OpenLayers.js
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-03-29 15:21:42 +0100
committerStruan Donald <struan@exo.org.uk>2012-03-29 15:21:42 +0100
commit62469c91c9a5a7d3267fe4d943785d940c1186b4 (patch)
tree33e34f8d66827c9cfbdde0b399973c70bc3eaf64 /web/js/map-OpenLayers.js
parentb0a65005e25bd7c6a15f70f4e5db4a2dea99f176 (diff)
parent1ec34a47cf69f6dc440409da3a5c789f4cda581b (diff)
Merge remote-tracking branch 'origin/bromley' into bromley
Diffstat (limited to 'web/js/map-OpenLayers.js')
-rw-r--r--web/js/map-OpenLayers.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index 5f60a4437..e4859b590 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -236,7 +236,9 @@ $(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'), mb = $('#map_box'),
+ q = ( $content.offset().left - mb.offset().left + $content.width() ) / 2;
+ if (q < 0) { q = 0; }
// 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 +479,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 - bo.left + w ) / 2;
lonlat = fixmystreet.map.getLonLatFromViewPortPx(p);
fixmystreet.map.panTo(lonlat);
}