Skip to content
Snippets Groups Projects
Commit e0e42434 authored by Sébastien DA ROCHA's avatar Sébastien DA ROCHA :bicyclist:
Browse files

Merge branch 'redmine-issue/13365' into 'develop'

REDMINE_ISSUE-13365

See merge request !347
parents 63da2d85 47a157b8
No related branches found
No related tags found
2 merge requests!424version 3.1.0,!347REDMINE_ISSUE-13365
...@@ -195,9 +195,9 @@ ...@@ -195,9 +195,9 @@
<option value="GeoJSON"> <option value="GeoJSON">
GeoJSON GeoJSON
</option> </option>
<!-- <option value="CSV"> <option value="CSV">
CSV CSV
</option> --> </option>
</select> </select>
<button <button
type="button" type="button"
...@@ -773,14 +773,18 @@ export default { ...@@ -773,14 +773,18 @@ export default {
}, },
exportFeatures() { exportFeatures() {
const url = `${this.$store.state.configuration.VUE_APP_DJANGO_API_BASE}projects/${this.slug}/feature-type/${this.$route.params.feature_type_slug}/export/`; const url = `
${this.$store.state.configuration.VUE_APP_DJANGO_API_BASE}projects/${this.slug}/feature-type/${this.$route.params.feature_type_slug}/export/?format_export=${this.exportFormat.toLowerCase()}
`;
featureAPI.getFeaturesBlob(url).then((blob) => { featureAPI.getFeaturesBlob(url).then((blob) => {
if (blob) { if (blob) {
const link = document.createElement('a'); const link = document.createElement('a');
link.href = URL.createObjectURL(blob); link.href = URL.createObjectURL(blob);
link.download = `${this.project.title}-${this.structure.title}.${this.exportFormat === 'GeoJSON' ? 'json' : 'csv'}`; link.download = `${this.project.title}-${this.structure.title}.${this.exportFormat === 'GeoJSON' ? 'json' : 'csv'}`;
link.click(); link.click();
URL.revokeObjectURL(link.href); setTimeout(function(){
URL.revokeObjectURL(link.href);
}, 1000);
} }
}); });
}, },
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment