Default message when drawing an existing line/shape

This commit is contained in:
David Larlet 2023-10-27 13:49:26 -04:00
parent 4250712741
commit 539175f89c
No known key found for this signature in database
GPG key ID: 3E2953A359E7E7BD

View file

@ -314,24 +314,23 @@ L.U.DrawToolbar = L.Toolbar.Control.extend({
}) })
L.U.DropControl = L.Class.extend({ L.U.DropControl = L.Class.extend({
initialize: function (map) { initialize: function (map) {
this.map = map this.map = map
this.dropzone = map._container this.dropzone = map._container
}, },
enable: function () { enable: function () {
L.DomEvent.on(this.dropzone, "dragenter", this.dragenter, this) L.DomEvent.on(this.dropzone, 'dragenter', this.dragenter, this)
L.DomEvent.on(this.dropzone, "dragover", this.dragover, this) L.DomEvent.on(this.dropzone, 'dragover', this.dragover, this)
L.DomEvent.on(this.dropzone, "drop", this.drop, this) L.DomEvent.on(this.dropzone, 'drop', this.drop, this)
L.DomEvent.on(this.dropzone, "dragleave", this.dragleave, this) L.DomEvent.on(this.dropzone, 'dragleave', this.dragleave, this)
}, },
disable: function () { disable: function () {
L.DomEvent.off(this.dropzone, "dragenter", this.dragenter, this) L.DomEvent.off(this.dropzone, 'dragenter', this.dragenter, this)
L.DomEvent.off(this.dropzone, "dragover", this.dragover, this) L.DomEvent.off(this.dropzone, 'dragover', this.dragover, this)
L.DomEvent.off(this.dropzone, "drop", this.drop, this) L.DomEvent.off(this.dropzone, 'drop', this.drop, this)
L.DomEvent.off(this.dropzone, "dragleave", this.dragleave, this) L.DomEvent.off(this.dropzone, 'dragleave', this.dragleave, this)
}, },
dragenter: function (e) { dragenter: function (e) {
@ -357,8 +356,7 @@ L.U.DropControl = L.Class.extend({
dragleave: function () { dragleave: function () {
this.map.scrollWheelZoom.enable() this.map.scrollWheelZoom.enable()
this.dropzone.classList.remove('umap-dragover') this.dropzone.classList.remove('umap-dragover')
} },
}) })
L.U.EditControl = L.Control.extend({ L.U.EditControl = L.Control.extend({
@ -1744,7 +1742,7 @@ L.U.Editable = L.Editable.extend({
return return
} }
let content let content = L._('Drawing')
let measure let measure
if (e.layer.editor._drawnLatLngs) { if (e.layer.editor._drawnLatLngs) {
// when drawing (a Polyline or Polygon) // when drawing (a Polyline or Polygon)