Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

fixed polar image download / GIF bugs #204

Benjamin87eaf42927a7
diff --git a/web/js/animation/wv.anim.gif.js b/web/js/animation/wv.anim.gif.js
index 7771fd785..0a7f654d7 100644
--- a/web/js/animation/wv.anim.gif.js
+++ b/web/js/animation/wv.anim.gif.js
@@ -418,11 +418,10 @@ wv.anim.gif = wv.anim.gif || function(models, config, ui) {
*
*/
var resetRotation = function() {
- ui.map.selected.beforeRender(ol.animation.rotate({
+ ui.map.selected.getView().animate({
duration: 400,
- rotation: ui.map.selected.getView().getRotation()
- }));
- ui.map.selected.getView().rotate(0);
+ rotation: 0
+ });
};
/*
@@ -596,7 +595,8 @@ wv.anim.gif = wv.anim.gif || function(models, config, ui) {
$("#wv-map").insertAfter('#productsHolder'); //retain map element before disabling jcrop
animCoords = undefined;
jcropAPI.destroy();
- ui.map.events.trigger('selectiondone');
+ if(models.proj.selected.id === "geographic")
+ ui.map.events.trigger('selectiondone');
};
/*
@@ -665,7 +665,8 @@ wv.anim.gif = wv.anim.gif || function(models, config, ui) {
destoryCheckboxListeners($checkBox);
$("#wv-map").insertAfter('#productsHolder'); //retain map element before disabling jcrop
jcropAPI.destroy();
- ui.map.events.trigger('selectiondone');
+ if(models.proj.selected.id === "geographic")
+ ui.map.events.trigger('selectiondone');
}
});
return $dialogBox;
@@ -797,8 +798,8 @@ wv.anim.gif = wv.anim.gif || function(models, config, ui) {
else
previousCoords = [previousCoords.x, previousCoords.y, previousCoords.x2, previousCoords.y2];
-
- ui.map.events.trigger('selecting');
+ if(models.proj.selected.id === "geographic")
+ ui.map.events.trigger('selecting');
starterWidth = previousCoords[0] - previousCoords[2];
//Start the image cropping. Show the dialog
$("#wv-map").Jcrop({
diff --git a/web/js/image/wv.image.rubberband.js b/web/js/image/wv.image.rubberband.js
index 2d5f9fde5..65956cb21 100644
--- a/web/js/image/wv.image.rubberband.js
+++ b/web/js/image/wv.image.rubberband.js
@@ -82,7 +82,7 @@ wv.image.rubberband = wv.image.rubberband || function(models, ui, config) {
var toggle = function(){
var checked = $("#wv-image-button-check").prop("checked");
-
+ var geographic = models.proj.selected.id === "geographic";
//Enables UI to select an area on the map while darkening the view
var toggleOn = function() {
state = "on";
@@ -97,11 +97,10 @@ wv.image.rubberband = wv.image.rubberband || function(models, ui, config) {
draw();
};
var resetRotation = function() {
- ui.map.selected.beforeRender(ol.animation.rotate({
+ ui.map.selected.getView().animate({
+ rotation: 0,
duration: 400,
- rotation: ui.map.selected.getView().getRotation()
- }));
- ui.map.selected.getView().rotate(0);
+ });
};
var disablePalettes = function() {
@@ -116,10 +115,8 @@ wv.image.rubberband = wv.image.rubberband || function(models, ui, config) {
models.layers.setVisibility("Graticule", false);
toggle();
};
-
if(state == "off") {
var layers = models.layers.get({renderable: true});
- var geographic = models.proj.selected.id === "geographic";
var on = true;
if ( _.find(layers, {id: "Graticule"}) && geographic ) {
wv.ui.ask({
@@ -165,8 +162,8 @@ wv.image.rubberband = wv.image.rubberband || function(models, ui, config) {
$cropee
.insertAfter('#productsHolder');
jcropAPI.destroy();
-
- ui.map.events.trigger('selectiondone');
+ if(geographic)
+ ui.map.events.trigger('selectiondone');//Should be a changed to a image event
if (previousPalettes) {
models.palettes.restore(previousPalettes);
previousPalettes = null;
@@ -208,7 +205,8 @@ wv.image.rubberband = wv.image.rubberband || function(models, ui, config) {
});
jcropAPI = $cropee.data('Jcrop');
- ui.map.events.trigger('selecting');
+ if(models.proj.selected.id === "geographic")
+ ui.map.events.trigger('selecting');//Should be a changed to a image event
if(coords) {
jcropAPI.setSelect([coords.x, coords.y,coords.x2,coords.y2]);
}