Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Fix initial wrong GIF dimensions #823

Benjamin King52e634d367d1
diff --git a/web/js/animation/gif.js b/web/js/animation/gif.js
index 4c3072c93..5db04e0bc 100644
--- a/web/js/animation/gif.js
+++ b/web/js/animation/gif.js
@@ -18,6 +18,15 @@ import uiIndicator from '../ui/indicator';
const conversionConstant = 3.6; // we are saying that the gif compresses each total by about 3.6x
const maxGifSize = 40;
+const GRATICULE_WARNING =
+ 'The graticule layer cannot be used to take a snapshot. Would you ' +
+ 'like to hide this layer?';
+const PALETTE_WARNING =
+ 'One or more layers on the map have been modified (changed palette, ' +
+ 'thresholds, etc.). These modifications cannot be used to take a ' +
+ 'snapshot. Would you like to temporarily revert to the original ' +
+ 'layer(s)?';
+const ROTATE_WARNING = 'Image may not be downloaded when rotated. Would you like to reset rotation?';
const resolutionsGeo = {
values: [
{ value: '0.125', text: '30m' },
@@ -58,16 +67,6 @@ export function animationGif(models, config, ui) {
var throttleSetDownloadButton;
var lastRequestedDimensions = {};
- var GRATICULE_WARNING =
- 'The graticule layer cannot be used to take a snapshot. Would you ' +
- 'like to hide this layer?';
- var PALETTE_WARNING =
- 'One or more layers on the map have been modified (changed palette, ' +
- 'thresholds, etc.). These modifications cannot be used to take a ' +
- 'snapshot. Would you like to temporarily revert to the original ' +
- 'layer(s)?';
- var ROTATE_WARNING = 'Image may not be downloaded when rotated. Would you like to reset rotation?';
-
var renderPanel = function(options, mountEl) {
return ReactDOM.render(
React.createElement(GifResSelection, options),
@@ -143,15 +142,10 @@ export function animationGif(models, config, ui) {
stateObj = animModel.rangeState;
numDays = util.getNumberOfDays(new Date(stateObj.startDate), new Date(stateObj.endDate), ui.anim.ui.getInterval());
- if (!resolution) {
- resolution = calcRes(0);
- imgWidth = animationCoordinates.w;
- imgHeight = animationCoordinates.h;
- } else {
- dimensions = getDimensions(lonlats, models.proj.selected.id, resolution);
- imgWidth = dimensions[0];
- imgHeight = dimensions[1];
- }
+ if (!resolution) resolution = calcRes(0);
+ dimensions = getDimensions(lonlats, models.proj.selected.id, resolution);
+ imgWidth = dimensions[0];
+ imgHeight = dimensions[1];
requestSize = calulateFileSize(resolution, lonlats[0], lonlats[1], numDays, imgWidth, imgHeight);
updatePanel(getUpdatedProps());
diff --git a/web/js/image/rubberband.js b/web/js/image/rubberband.js
index 63d95e7d0..98037779c 100644
--- a/web/js/image/rubberband.js
+++ b/web/js/image/rubberband.js
@@ -25,20 +25,20 @@ const dialogConfig = {
autoOpen: false
};
-export function imageRubberband (models, ui, config) {
- var self = {};
+const PALETTE_WARNING =
+ 'One or more layers on the map have been modified (changed palette, ' +
+ 'thresholds, etc.). These modifications cannot be used to take a ' +
+ 'snapshot. Would you like to temporarily revert to the original ' +
+ 'layer(s)?';
- var PALETTE_WARNING =
- 'One or more layers on the map have been modified (changed palette, ' +
- 'thresholds, etc.). These modifications cannot be used to take a ' +
- 'snapshot. Would you like to temporarily revert to the original ' +
- 'layer(s)?';
+const GRATICLE_WARNING =
+ 'The graticule layer cannot be used to take a snapshot. Would you ' +
+ 'like to hide this layer?';
- var GRATICLE_WARNING =
- 'The graticule layer cannot be used to take a snapshot. Would you ' +
- 'like to hide this layer?';
+const ROTATE_WARNING = 'Image may not be downloaded when rotated. Would you like to reset rotation?';
- var ROTATE_WARNING = 'Image may not be downloaded when rotated. Would you like to reset rotation?';
+export function imageRubberband (models, ui, config) {
+ var self = {};
var containerId = 'wv-image-button';
var container;