mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
feat: add a quick link to layer's permalink
This will open a new page with only this given layer shown.
This commit is contained in:
parent
fc6ea191cc
commit
df0faa75aa
2 changed files with 12 additions and 0 deletions
|
@ -640,6 +640,12 @@ class Feature {
|
|||
window.open(permalink)
|
||||
},
|
||||
})
|
||||
items.push({
|
||||
label: translate('Layer permalink'),
|
||||
action: () => {
|
||||
window.open(this.datalayer.getPermalink())
|
||||
},
|
||||
})
|
||||
}
|
||||
items.push({
|
||||
label: translate('Copy as GeoJSON'),
|
||||
|
|
|
@ -1174,6 +1174,12 @@ export class DataLayer extends ServerStored {
|
|||
return this.options.name || translate('Untitled layer')
|
||||
}
|
||||
|
||||
getPermalink() {
|
||||
return `${Utils.getBaseUrl()}?${Utils.buildQueryString({ datalayers: this.id })}${
|
||||
window.location.hash
|
||||
}`
|
||||
}
|
||||
|
||||
tableEdit() {
|
||||
if (!this.isVisible()) return
|
||||
const editor = new TableEditor(this._umap, this, this._leafletMap)
|
||||
|
|
Loading…
Reference in a new issue