Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

adding rotation to permalink #1576

Benjamin2d69378f0c4d
diff --git a/web/js/map/wv.map.model.js b/web/js/map/wv.map.model.js
index 39b75266b..dd1a8ae83 100644
--- a/web/js/map/wv.map.model.js
+++ b/web/js/map/wv.map.model.js
@@ -39,11 +39,17 @@ wv.map.model = wv.map.model || function(models, config) {
errors.push({message: "Extent outside of range"});
}
}
+ //get rotation if it exists
+ if(state.p === 'arctic' || state.p === 'antarctic')
+ if (!isNaN(state.r)) //convert to radians here
+ self.rotation = state.r * (Math.PI / 180.0);
};
//When models.link.toQueryString() is called, save extent and rotation
self.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)).toPrecision(6); //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.js
index e241fc650..032d9612d 100644
--- a/web/js/map/wv.map.ui.js
+++ b/web/js/map/wv.map.ui.js
@@ -438,7 +438,7 @@ wv.map.ui = wv.map.ui || function(models, config, Rotation) {
center: proj.startCenter,
zoom: proj.startZoom,
maxZoom: proj.numZoomLevels,
- enableRotation: false
+ enableRotation: true
}),
target: id,
renderer: ["canvas", "dom"],