diff --git a/umap/static/umap/js/umap.js b/umap/static/umap/js/umap.js index 8c402fbd..e63c898d 100644 --- a/umap/static/umap/js/umap.js +++ b/umap/static/umap/js/umap.js @@ -306,6 +306,13 @@ U.Map = L.Map.extend({ if (this.options.noControl) return if (L.Util.queryString('share')) { this.share.open() + } else if (L.Util.queryString('download')) { + const download_url = this.urls.get('map_download', { + map_id: this.options.umap_id, + }) + window.location = download_url + } else if (L.Util.queryString('star')) { + await this.star() } else if (this.options.onLoadPanel === 'databrowser') { this.panel.setDefaultMode('expanded') this.openBrowser('data') @@ -331,12 +338,6 @@ U.Map = L.Map.extend({ url.searchParams.delete('edit') history.pushState({}, '', url) } - if (L.Util.queryString('download')) { - const download_url = this.urls.get('map_download', { - map_id: this.options.umap_id, - }) - window.location = download_url - } }, // Merge the given schema with the default one