Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

merge

Benjamin9db42a766bda
diff --cc web/css/wv.map.css
index d1d1414b7,d1d1414b7..ef05f2e9d
--- a/web/css/wv.map.css
+++ b/web/css/wv.map.css
@@@ -28,6 -28,6 +28,14 @@@
z-index:10000;
}
++ .wv-map-zoom.ui-button-click-prevent {
++ pointer-events: none;
++ }
++
++ .wv-map-zoom.ui-button-click-prevent i {
++ opacity: 0.4;
++ }
++
.wv-map-zoom .ui-button-text{
padding:1em;
}
diff --cc web/js/map/wv.map.ui.js
index a589a48e9,61615b47b..3c55c4056
--- a/web/js/map/wv.map.ui.js
+++ b/web/js/map/wv.map.ui.js
@@@ -423,14 -418,6 +423,13 @@@ wv.map.ui = wv.map.ui || function(model
units: "imperial"
});
- //insert this to polar map views for desktop and mobile rotation
+ var rotateInteraction = new ol.interaction.DragRotate({
+ condition: ol.events.condition.altKeyOnly,
+ duration: animationDuration
+ }), mobileRotation = new ol.interaction.PinchRotate({
+ duration: animationDuration
+ });
+
var map = new ol.Map({
view: new ol.View({
maxResolution: proj.resolutions[0],
@@@ -475,13 -461,6 +473,16 @@@
createZoomButtons(map, proj);
createMousePosSel(map, proj);
+ //allow rotation by dragging for polar projections
+ if(proj.id !== 'geographic') {
+ rotation.createRotationWidget(map);
++ rotation.evts.on('rotate-left-max', function() {rotation.freezeClick('wv-map-rotate-left')})
++ rotation.evts.on('rotate-right-max', function() {rotation.freezeClick('wv-map-rotate-right')})
++ rotation.evts.on('remove-freeze', rotation.removeFreeze)
+ map.addInteraction(rotateInteraction);
+ map.addInteraction(mobileRotation);
+ }
+
//Set event listeners for changes on the map view (when rotated, zoomed, panned)
map.getView().on("change:center", updateExtent);
map.getView().on("change:resolution", updateExtent);
@@@ -490,6 -468,6 +491,7 @@@
return map;
};
++
var createZoomButtons = function(map, proj) {
var $map = $("#" + map.getTarget());