feat: add a quick link to layer's permalink (#2529)

This will open a new page with only this given layer shown.


![image](https://github.com/user-attachments/assets/4db637b9-03f4-4b05-9ce3-6656aba11786)
This commit is contained in:
Yohan Boniface 2025-02-27 15:36:45 +01:00 committed by GitHub
commit 14e90a1a0f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 0 deletions

View file

@ -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'),

View file

@ -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)