Skip to content

Commit

Permalink
Merge pull request #146 from openearth/feat/download-file-name
Browse files Browse the repository at this point in the history
Replaced layer.zip folder and file name with name of layer
  • Loading branch information
luisrodriguezgalvez authored Jan 29, 2025
2 parents 67c7037 + 14d09ff commit 0ca4674
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/views/DownloadGeoserver.vue
Original file line number Diff line number Diff line change
Expand Up @@ -337,14 +337,10 @@
//TODO: find a better solution for layers that don't have workspace
// the below if statement checks for workspace in layer name
let layerName
if (this.selectedLayerData.layer.includes(':')) {
layerName = this.selectedLayerData.layer.split(':')[1]
} else {
layerName = this.selectedLayerData.layer
}
const layerName = this.getLayerName()
const filename = `${ layerName }.${ fileType }`
console.log("filename: "+ filename)
return JSZipUtils.getBinaryContent(url)
.then(data => zip.file(filename, data, { binary: true }))
Expand All @@ -366,8 +362,8 @@
this.generateZipFile(downloadProps)
.then((content) => {
this.$trackEvent('download', 'geoServer')
saveAs(content, 'layer.zip')
const layerName = this.getLayerName()
saveAs(content, layerName)
})
.catch(err => {
console.log(err)
Expand All @@ -393,6 +389,10 @@
}
},
getLayerName() {
const layerName = this.selectedLayerData.name.split(' ').join('_')
return layerName
}
},
}
</script>

3 comments on commit 0ca4674

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 Published on https://nl2120.netlify.app as production
🚀 Deployed on https://679a39c9f7b02a14cb0118ab--nl2120.netlify.app

Please sign in to comment.