aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--web/cobrands/fixmystreet/base.scss25
-rw-r--r--web/cobrands/fixmystreet/layout.scss4
-rw-r--r--web/js/map-OpenLayers.js14
3 files changed, 38 insertions, 5 deletions
diff --git a/web/cobrands/fixmystreet/base.scss b/web/cobrands/fixmystreet/base.scss
index 480d7b21f..25157c0f1 100644
--- a/web/cobrands/fixmystreet/base.scss
+++ b/web/cobrands/fixmystreet/base.scss
@@ -885,12 +885,35 @@ a:hover.button-left {
height: 10em;
@extend .full-width;
margin-bottom: 1em;
+ overflow: hidden;
#map {
width:100%;
height:100%;
}
}
+/* Drag is only present in noscript form. XXX Copy from core. */
+#drag {
+ input, img {
+ position: absolute;
+ border: none;
+ }
+ input {
+ cursor: crosshair;
+ background-color: #cccccc;
+ }
+ img {
+ cursor: move;
+ }
+ img.pin {
+ z-index: 100;
+ background-color: inherit;
+ }
+ a img.pin {
+ cursor: pointer;
+ cursor: hand;
+ }
+}
// only on mobile, this is a sidebar on desk (#report-a-problem-sidebar)
a.rap-notes-trigger,
@@ -1061,4 +1084,4 @@ a:hover.rap-notes-trigger {
border-bottom:none;
margin-bottom:0;
}
-} \ No newline at end of file
+}
diff --git a/web/cobrands/fixmystreet/layout.scss b/web/cobrands/fixmystreet/layout.scss
index 5b64bc1f8..a9bbb1394 100644
--- a/web/cobrands/fixmystreet/layout.scss
+++ b/web/cobrands/fixmystreet/layout.scss
@@ -357,10 +357,10 @@ body.twothirdswidthpage {
// will have fullscreen map)
#map_box{
position: absolute;
- height: 25em;
+ height: 29em;
width: 29em;
right: 1em;
- top: 0;
+ top: 3em;
z-index:1;
}
diff --git a/web/js/map-OpenLayers.js b/web/js/map-OpenLayers.js
index 3d1d725f2..4a5e8ed54 100644
--- a/web/js/map-OpenLayers.js
+++ b/web/js/map-OpenLayers.js
@@ -216,7 +216,7 @@ $(function(){
fixmystreet.map.moveStart = { zoom: this.getZoom(), center: this.getCenter() };
});
fixmystreet.map.events.register("zoomend", null, function(e){
- if ( !this.getCenter().equals(fixmystreet.map.moveStart.center) ) {
+ if ( !fixmystreet.map.moveStart || !this.getCenter().equals(fixmystreet.map.moveStart.center) ) {
// Centre has moved, e.g. by double-click. Same whether zoom in or out
fixmystreet.map.pan(-q, -25, { animate: false });
return;
@@ -414,10 +414,20 @@ OpenLayers.Control.Click = OpenLayers.Class(OpenLayers.Control, {
$('#side').hide();
$('#sub_map_links').hide();
heightFix('#report-a-problem-sidebar:visible', '.content', 26);
+
+ // If we clicked the map somewhere inconvenient
var sidebar = $('#report-a-problem-sidebar');
if (sidebar.css('position') == 'absolute') {
var w = sidebar.width(), h = sidebar.height(), o = sidebar.offset();
- if (e.xy.x >= o.left && e.xy.x <= o.left + w && e.xy.y >= o.top && e.xy.y <= o.top + h) {
+ if (e.xy.y <= o.top) {
+ // top of the page, pin hidden by header
+ lonlat.transform(
+ new OpenLayers.Projection("EPSG:4326"),
+ fixmystreet.map.getProjectionObject()
+ );
+ fixmystreet.map.setCenter(lonlat, fixmystreet.map.getZoom(), true, true);
+ } else if (e.xy.x >= o.left && e.xy.x <= o.left + w + 24 && e.xy.y >= o.top && e.xy.y <= o.top + h + 64) {
+ // underneath where the new sidebar will appear
fixmystreet.map.pan(-w, 0, { animate: false });
}
}