From 97e2df0a8d698d1a9a531447db360187062a4843 Mon Sep 17 00:00:00 2001 From: Yohan Boniface Date: Sat, 25 Feb 2023 22:17:10 +0100 Subject: [PATCH] Prevent caching datalayer's data for owners/editors cf #1038 --- umap/static/umap/js/umap.layer.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/umap/static/umap/js/umap.layer.js b/umap/static/umap/js/umap.layer.js index a92faf29..2aa8929e 100644 --- a/umap/static/umap/js/umap.layer.js +++ b/umap/static/umap/js/umap.layer.js @@ -401,8 +401,11 @@ L.U.DataLayer = L.Evented.extend({ }, _dataUrl: function() { - var template = this.map.options.urls.datalayer_view; - return L.Util.template(template, {'pk': this.umap_id, 'map_id': this.map.options.umap_id}); + var template = this.map.options.urls.datalayer_view, + url = L.Util.template(template, {'pk': this.umap_id, 'map_id': this.map.options.umap_id}); + // No browser cache for owners/editors. + if (this.map.options.allowEdit) url = url + '?' + Date.now(); + return url; }, isRemoteLayer: function () {