Prevent caching datalayer's data for owners/editors

cf #1038
This commit is contained in:
Yohan Boniface 2023-02-25 22:17:10 +01:00
parent 2bd4008f97
commit 97e2df0a8d

View file

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