Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

Fixed image download bug: 'extent of downloaded image does not always reflect selection'. Now image download always reflects the selection.

Tilak Joshi5998c27f9dba
diff --git a/js/ext/jcrop/jcrop.js b/js/ext/jcrop/jcrop.js
index 1ee5b4b17..8bec9098a 100644
--- a/js/ext/jcrop/jcrop.js
+++ b/js/ext/jcrop/jcrop.js
@@ -318,7 +318,7 @@
$origimg.after($img).hide();
} else {
- $img = $origimg.clone().css(img_css).show();
+ $img = $origimg.clone().removeAttr('id').css(img_css).show();
$img.width($origimg.width());
$img.height($origimg.height());
diff --git a/js/imageDownload.js b/js/imageDownload.js
index f76b47ff2..098135a7a 100644
--- a/js/imageDownload.js
+++ b/js/imageDownload.js
@@ -37,7 +37,7 @@ SOTE.widget.ImageDownload = function(containerId, config){
this.alignTo = config.alignTo;
this.id = containerId;
- this.map = config.m.map;
+ this.m = config.m;
this.WMTSLayer = null;
if (config.baselayer === undefined)
@@ -139,8 +139,8 @@ SOTE.widget.ImageDownload.prototype.updateComponent = function(qs){
var px = pixels.split(",");
var x1 = px[0]; var y1= px[1]; var x2 = px[2]; var y2=px[3];
- var lonlat1 = this.map.getLonLatFromViewPortPx(new OpenLayers.Pixel(x1, y2));
- var lonlat2 = this.map.getLonLatFromViewPortPx(new OpenLayers.Pixel(x2, y1));
+ var lonlat1 = this.m.map.getLonLatFromViewPortPx(new OpenLayers.Pixel(x1, y2));
+ var lonlat2 = this.m.map.getLonLatFromViewPortPx(new OpenLayers.Pixel(x2, y1));
var dlURL = "http://map2.vis.earthdata.nasa.gov/imagegen/?";