diff --git a/umap/static/umap/js/umap.controls.js b/umap/static/umap/js/umap.controls.js index 696e7c3f..c77746a8 100644 --- a/umap/static/umap/js/umap.controls.js +++ b/umap/static/umap/js/umap.controls.js @@ -1553,16 +1553,19 @@ L.U.Editable = L.Editable.extend({ }, createPolyline: function (latlngs) { - return new L.U.Polyline(this.map, latlngs) + return new L.U.Polyline(this.map, latlngs, this._getDefaultProperties()) }, createPolygon: function (latlngs) { - const polygon = new L.U.Polygon(this.map, latlngs) - return polygon + return new L.U.Polygon(this.map, latlngs, this._getDefaultProperties()) }, createMarker: function (latlng) { - return new L.U.Marker(this.map, latlng) + return new L.U.Marker(this.map, latlng, this._getDefaultProperties()) + }, + + _getDefaultProperties: function() { + return { geojson: { properties: { owner: this.map.options.user.id } } } }, connectCreatedToMap: function (layer) { diff --git a/umap/static/umap/js/umap.features.js b/umap/static/umap/js/umap.features.js index 997218ff..77e7e648 100644 --- a/umap/static/umap/js/umap.features.js +++ b/umap/static/umap/js/umap.features.js @@ -105,14 +105,15 @@ 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'], property) !== -1) { + if (L.Util.indexOf(['name', 'description', 'owner'], property) !== -1) { continue } properties.push([`properties.${property}`, { label: property }]) } - // We always want name and description for now (properties management to come) + // We always want name, description, owner 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… diff --git a/umap/static/umap/js/umap.forms.js b/umap/static/umap/js/umap.forms.js index 587549a5..085f0518 100644 --- a/umap/static/umap/js/umap.forms.js +++ b/umap/static/umap/js/umap.forms.js @@ -939,6 +939,10 @@ L.U.FormBuilder = L.FormBuilder.extend({ defaultOptions: { name: { label: L._('name') }, + owner: { + label: 'owner', +// handler: 'BlurInput', // this field should be hidden, not sure if blur does it. + }, description: { label: L._('description'), handler: 'Textarea',