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