Interactive interface for browsing global, full-resolution satellite imagery
Place swiper under map overlays #1182
Benjamin Kingcb39f75b9f39
diff --git a/web/css/map.css b/web/css/map.cssindex 7cf3c1b19..ebd012f1d 100644--- a/web/css/map.css+++ b/web/css/map.css@@ -91,11 +91,13 @@.wv-map-scale-imperial {position: absolute;+ z-index: 10;right: 10px;bottom: 130px;color: #fff;background-color: rgba(40, 40, 40, 0.85);- text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;+ text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000,+ 1px 1px 0 #000;padding: 3px;border-top: 2px solid #fff;border-left: 2px solid #fff;@@ -104,11 +106,13 @@.wv-map-scale-metric {position: absolute;+ z-index: 10;right: 10px;bottom: 149px;color: #fff;background-color: rgba(40, 40, 40, 0.85);- text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;+ text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000,+ 1px 1px 0 #000;padding: 3px;border-bottom: 2px solid #fff;border-left: 2px solid #fff;@@ -127,7 +131,8 @@white-space: pre;outline: none;color: #fff;- text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;+ text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000,+ 1px 1px 0 #000;font-size: 100%;border: none;border-radius: 0;@@ -194,6 +199,6 @@margin-left: -7px;width: 14px;height: 13px;- background: url('../images/map/latlon.png') no-repeat;+ background: url("../images/map/latlon.png") no-repeat;background-position: -14px;}diff --git a/web/js/map/compare/swipe.js b/web/js/map/compare/swipe.jsindex 91b537c48..b691af31e 100644--- a/web/js/map/compare/swipe.js+++ b/web/js/map/compare/swipe.js@@ -130,7 +130,8 @@ var addLineOverlay = function(map) {var iconEl = document.createElement('i');var firstLabel = document.createElement('span');var secondLabel = document.createElement('span');- mapCase = document.getElementById('wv-map');+ var windowWidth = util.browser.dimensions[0];+ mapCase = map.getTargetElement();firstLabel.className = 'ab-swipe-span left-label';secondLabel.className = 'ab-swipe-span right-label';firstLabel.appendChild(document.createTextNode('A'));@@ -145,8 +146,8 @@ var addLineOverlay = function(map) {lineCaseEl.appendChild(draggerEl);mapCase.appendChild(lineCaseEl);swipeOffset = percentSwipe- ? mapCase.offsetWidth * percentSwipe- : swipeOffset || mapCase.offsetWidth / 2;+ ? windowWidth * percentSwipe+ : swipeOffset || windowWidth / 2;lineCaseEl.style.transform = 'translateX( ' + swipeOffset + 'px)';// Add event listeners to Elements