Skip to content

Interactive interface for browsing global, full-resolution satellite imagery

make sure selected file type is properly accounted for and world file can be selected

Jason Kent4d2547fd3e73
diff --git a/web/js/components/image-download/panel.js b/web/js/components/image-download/panel.js
index 8cabb8284..e3cd9ca02 100644
--- a/web/js/components/image-download/panel.js
+++ b/web/js/components/image-download/panel.js
@@ -56,6 +56,7 @@ export default class ImageResSelection extends React.Component {
lonlats,
{ width, height },
time,
+ fileType,
isWorldfile
);
@@ -87,7 +88,7 @@ export default class ImageResSelection extends React.Component {
});
} else if (type === 'worldfile') {
this.setState({
- isWorldfile: value
+ isWorldfile: Boolean(Number(value))
});
} else {
this.setState({
@@ -128,8 +129,8 @@ export default class ImageResSelection extends React.Component {
value={this.state.isWorldfile}
onChange={e => this.handleChange('worldfile', e.target.value)}
>
- <option value={false}>No</option>
- <option value={true}>Yes</option>
+ <option value={0}>No</option>
+ <option value={1}>Yes</option>
</select>
)}
Worldfile (.zip)
diff --git a/web/js/modules/image-download/util.js b/web/js/modules/image-download/util.js
index b905519b0..eb6c2eae2 100644
--- a/web/js/modules/image-download/util.js
+++ b/web/js/modules/image-download/util.js
@@ -36,12 +36,12 @@ export function getLatestIntervalTime(layerDefs, dateTime) {
* @param {Date} dateTime
* @param {Boolean} isWorldfile
*/
-export function getDownloadUrl(url, proj, layerDefs, lonlats, dimensions, dateTime, isWorldfile) {
+export function getDownloadUrl(url, proj, layerDefs, lonlats, dimensions, dateTime, fileType, isWorldfile) {
const { crs } = proj.selected;
const layersArray = imageUtilGetLayers(layerDefs, proj.id);
const layerWraps = imageUtilGetLayerWrap(layerDefs);
const opacities = imageUtilGetLayerOpacities(layerDefs);
- const imgFormat = 'image/jpeg';
+ const imgFormat = fileType || 'image/jpeg';
const { height, width } = dimensions;
const snappedDateTime = getLatestIntervalTime(layerDefs, dateTime);
const params = [