mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
feat: allow to star a map from query string
Some users hide the star button from their map (to keep the UI clean I guess), but as a uMap instance administrator I may want to star it anyway, to make it appear on the home, when using the "starred" feed, or to save a good showcase. That's an hidden feature, but we may use it to star a map from a list at some point.
This commit is contained in:
parent
8c7ff52f5f
commit
76606947bd
1 changed files with 7 additions and 6 deletions
|
@ -306,6 +306,13 @@ U.Map = L.Map.extend({
|
||||||
if (this.options.noControl) return
|
if (this.options.noControl) return
|
||||||
if (L.Util.queryString('share')) {
|
if (L.Util.queryString('share')) {
|
||||||
this.share.open()
|
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') {
|
} else if (this.options.onLoadPanel === 'databrowser') {
|
||||||
this.panel.setDefaultMode('expanded')
|
this.panel.setDefaultMode('expanded')
|
||||||
this.openBrowser('data')
|
this.openBrowser('data')
|
||||||
|
@ -331,12 +338,6 @@ U.Map = L.Map.extend({
|
||||||
url.searchParams.delete('edit')
|
url.searchParams.delete('edit')
|
||||||
history.pushState({}, '', url)
|
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
|
// Merge the given schema with the default one
|
||||||
|
|
Loading…
Reference in a new issue