diff --git a/umap/static/umap/js/umap.controls.js b/umap/static/umap/js/umap.controls.js index c77746a8..b0c01c2a 100644 --- a/umap/static/umap/js/umap.controls.js +++ b/umap/static/umap/js/umap.controls.js @@ -1565,7 +1565,11 @@ L.U.Editable = L.Editable.extend({ }, _getDefaultProperties: function() { - return { geojson: { properties: { owner: this.map.options.user.id } } } + const result = {} + if (this.map.options.hasOwnProperty('user')) { + result.geojson = { properties: { owner: this.map.options.user.id } } + } + return result }, connectCreatedToMap: function (layer) { diff --git a/umap/static/umap/js/umap.features.js b/umap/static/umap/js/umap.features.js index 77e7e648..997218ff 100644 --- a/umap/static/umap/js/umap.features.js +++ b/umap/static/umap/js/umap.features.js @@ -105,15 +105,14 @@ L.U.FeatureMixin = { let property for (let i = 0; i < this.datalayer._propertiesIndex.length; i++) { property = this.datalayer._propertiesIndex[i] - if (L.Util.indexOf(['name', 'description', 'owner'], property) !== -1) { + if (L.Util.indexOf(['name', 'description'], property) !== -1) { continue } properties.push([`properties.${property}`, { label: property }]) } - // We always want name, description, owner for now (properties management to come) + // We always want name and description for now (properties management to come) properties.unshift('properties.description') properties.unshift('properties.name') - properties.unshift('properties.owner') builder = new L.U.FormBuilder(this, properties, { id: 'umap-feature-properties', callback: this._redraw, // In case we have dynamic options…