Interactive interface for browsing global, full-resolution satellite imagery
Commented out rotation on polar views for 0.8.5 release
Taylor Gunnoe22527234b986
diff --git a/web/js/image/wv.image.rubberband.js b/web/js/image/wv.image.rubberband.jsindex 0c5824b15..eb3bf5e62 100644--- a/web/js/image/wv.image.rubberband.js+++ b/web/js/image/wv.image.rubberband.js@@ -135,7 +135,7 @@ wv.image.rubberband = wv.image.rubberband || function(models, ui, config) {});return;}-+ /*//Don't toggle area select UI for downloading image if image rotatedif(ui.map.selected.getView().getRotation() === 0.0)toggleOn();@@ -154,6 +154,7 @@ wv.image.rubberband = wv.image.rubberband || function(models, ui, config) {setTimeout(toggle, 500);}});+ */}else {state = "off";diff --git a/web/js/map/wv.map.model.js b/web/js/map/wv.map.model.jsindex e867fd2b4..8eca088e2 100644--- a/web/js/map/wv.map.model.js+++ b/web/js/map/wv.map.model.js@@ -19,7 +19,7 @@ wv.map.model = wv.map.model || function(models, config) {var self = {};self.extent = null;- self.rotation = 0; //initial rotation from url. This is shared amongst both polar rotations+ //self.rotation = 0; //initial rotation from url. This is shared amongst both polar rotationsself.events = wv.util.events();self.update = function(extent) {@@ -39,19 +39,23 @@ wv.map.model = wv.map.model || function(models, config) {self.extent = _.clone(proj.maxExtent);errors.push({message: "Extent outside of range"});}+ /*//get rotation if it existsif(state.p === 'arctic' || state.p === 'antarctic') {if (!isNaN(state.r)) //convert to radians hereself.rotation = state.r * (Math.PI / 180.0);}+ */}};//When models.link.toQueryString() is called, save extent and rotationself.save = function(state) {state.v = _.clone(self.extent);+ /*if(self.rotation !== 0.0 && self.rotation !== 0 && models.proj.selected.id !== 'geographic')state.r = self.rotation * (180.0 / Math.PI); //convert from radians to degrees+ */};self.getLeadingExtent = function() {diff --git a/web/js/map/wv.map.ui.js b/web/js/map/wv.map.ui.jsindex fa08c236b..be8e56af3 100644--- a/web/js/map/wv.map.ui.js+++ b/web/js/map/wv.map.ui.js@@ -68,11 +68,11 @@ wv.map.ui = wv.map.ui || function(models, config) {self.selected = self.proj[models.proj.selected.id];var map = self.selected;reloadLayers();-+ /*//Update the rotation buttons if polar projection to display correct valueif(models.proj.selected.id !== "geographic")self.updateRotation();-+ */// If the browser was resized, the inactive map was not notified of// the event. Force the update no matter what and reposition the center// using the previous value.@@ -402,7 +402,7 @@ wv.map.ui = wv.map.ui || function(models, config) {models.map.update(map.getView().calculateExtent(map.getSize()));triggerExtent();};-+ /*//Called as event listener when map is rotated. Update url to reflect rotation resetself.updateRotation = function() {models.map.rotation = self.selected.getView().getRotation();@@ -419,7 +419,7 @@ wv.map.ui = wv.map.ui || function(models, config) {else$(".wv-map-reset-rotation").find("span").attr("style","padding-left: 14px");};-+ */var createMap = function(proj) {var id = "wv-map-" + proj.id;var $map = $("<div></div>")@@ -438,7 +438,7 @@ wv.map.ui = wv.map.ui || function(models, config) {className: "wv-map-scale-imperial",units: "imperial"});-+ /*//insert this to polar map views for desktop and mobile rotationvar rotateInteraction = new ol.interaction.DragRotate({condition: ol.events.condition.altKeyOnly,@@ -446,17 +446,17 @@ wv.map.ui = wv.map.ui || function(models, config) {}), mobileRotation = new ol.interaction.PinchRotate({duration: animationDuration});-+ */var map = new ol.Map({view: new ol.View({maxResolution: proj.resolutions[0],projection: ol.proj.get(proj.crs),extent: proj.maxExtent,center: proj.startCenter,- rotation: proj.id === "geographic" ? 0.0 : models.map.rotation,+ //rotation: proj.id === "geographic" ? 0.0 : models.map.rotation,zoom: proj.startZoom,maxZoom: proj.numZoomLevels,- enableRotation: true+ enableRotation: false//true}),target: id,renderer: ["canvas", "dom"],@@ -490,18 +490,18 @@ wv.map.ui = wv.map.ui || function(models, config) {};createZoomButtons(map, proj);createMousePosSel(map, proj);-+ /*//allow rotation by dragging for polar projectionsif(proj.id !== 'geographic') {createRotationWidget(map);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);- map.getView().on("change:rotation", self.updateRotation);+ //map.getView().on("change:rotation", self.updateRotation);return map;};@@ -638,7 +638,7 @@ wv.map.ui = wv.map.ui || function(models, config) {});});};-+ /*//Create rotation buttons for polar viewsvar createRotationWidget = function(map) {var $map = $("#" + map.getTarget());@@ -714,7 +714,7 @@ wv.map.ui = wv.map.ui || function(models, config) {};};-+ */var zoomAction = function(map, amount) {return function() {var zoom = map.getView().getZoom();