diff --git a/umap/static/umap/js/modules/data/features.js b/umap/static/umap/js/modules/data/features.js index 84529407..cc45dc30 100644 --- a/umap/static/umap/js/modules/data/features.js +++ b/umap/static/umap/js/modules/data/features.js @@ -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'), diff --git a/umap/static/umap/js/modules/data/layer.js b/umap/static/umap/js/modules/data/layer.js index dee5dd5b..281c6e02 100644 --- a/umap/static/umap/js/modules/data/layer.js +++ b/umap/static/umap/js/modules/data/layer.js @@ -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)