mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 03:42:37 +02:00
Merge pull request #2107 from umap-project/visible-vertexmarkers
wip: only show visible vertexmarkers and do not show when there are too much
This commit is contained in:
commit
ae09c343d1
7 changed files with 2114 additions and 1929 deletions
14
package-lock.json
generated
14
package-lock.json
generated
|
@ -19,7 +19,7 @@
|
||||||
"jsdom": "^24.0.0",
|
"jsdom": "^24.0.0",
|
||||||
"leaflet": "1.9.4",
|
"leaflet": "1.9.4",
|
||||||
"leaflet-contextmenu": "^1.4.0",
|
"leaflet-contextmenu": "^1.4.0",
|
||||||
"leaflet-editable": "^1.2.0",
|
"leaflet-editable": "^1.3.0",
|
||||||
"leaflet-editinosm": "0.2.3",
|
"leaflet-editinosm": "0.2.3",
|
||||||
"leaflet-formbuilder": "0.2.10",
|
"leaflet-formbuilder": "0.2.10",
|
||||||
"leaflet-fullscreen": "1.0.2",
|
"leaflet-fullscreen": "1.0.2",
|
||||||
|
@ -3015,9 +3015,9 @@
|
||||||
"integrity": "sha1-4r2kga8QJggOq6oymX5TH9RPYFw="
|
"integrity": "sha1-4r2kga8QJggOq6oymX5TH9RPYFw="
|
||||||
},
|
},
|
||||||
"node_modules/leaflet-editable": {
|
"node_modules/leaflet-editable": {
|
||||||
"version": "1.2.0",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/leaflet-editable/-/leaflet-editable-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/leaflet-editable/-/leaflet-editable-1.3.0.tgz",
|
||||||
"integrity": "sha512-wG11JwpL8zqIbypTop6xCRGagMuWw68ihYu4uqrqc5Ep0wnEJeyob7NB2Rt5t74Oih4rwJ3OfwaGbzdowOGfYQ=="
|
"integrity": "sha512-elXuUM6L3kjZsg3P6PV7SEYNBX0iDT3oG1vWVnfm5Axd2q8cUqDPQYkru++m7/bE4jL07OKeETdHE543K6zsbQ=="
|
||||||
},
|
},
|
||||||
"node_modules/leaflet-editinosm": {
|
"node_modules/leaflet-editinosm": {
|
||||||
"version": "0.2.3",
|
"version": "0.2.3",
|
||||||
|
@ -7154,9 +7154,9 @@
|
||||||
"integrity": "sha1-4r2kga8QJggOq6oymX5TH9RPYFw="
|
"integrity": "sha1-4r2kga8QJggOq6oymX5TH9RPYFw="
|
||||||
},
|
},
|
||||||
"leaflet-editable": {
|
"leaflet-editable": {
|
||||||
"version": "1.2.0",
|
"version": "1.3.0",
|
||||||
"resolved": "https://registry.npmjs.org/leaflet-editable/-/leaflet-editable-1.2.0.tgz",
|
"resolved": "https://registry.npmjs.org/leaflet-editable/-/leaflet-editable-1.3.0.tgz",
|
||||||
"integrity": "sha512-wG11JwpL8zqIbypTop6xCRGagMuWw68ihYu4uqrqc5Ep0wnEJeyob7NB2Rt5t74Oih4rwJ3OfwaGbzdowOGfYQ=="
|
"integrity": "sha512-elXuUM6L3kjZsg3P6PV7SEYNBX0iDT3oG1vWVnfm5Axd2q8cUqDPQYkru++m7/bE4jL07OKeETdHE543K6zsbQ=="
|
||||||
},
|
},
|
||||||
"leaflet-editinosm": {
|
"leaflet-editinosm": {
|
||||||
"version": "0.2.3",
|
"version": "0.2.3",
|
||||||
|
|
|
@ -47,7 +47,7 @@
|
||||||
"jsdom": "^24.0.0",
|
"jsdom": "^24.0.0",
|
||||||
"leaflet": "1.9.4",
|
"leaflet": "1.9.4",
|
||||||
"leaflet-contextmenu": "^1.4.0",
|
"leaflet-contextmenu": "^1.4.0",
|
||||||
"leaflet-editable": "^1.2.0",
|
"leaflet-editable": "^1.3.0",
|
||||||
"leaflet-editinosm": "0.2.3",
|
"leaflet-editinosm": "0.2.3",
|
||||||
"leaflet-formbuilder": "0.2.10",
|
"leaflet-formbuilder": "0.2.10",
|
||||||
"leaflet-fullscreen": "1.0.2",
|
"leaflet-fullscreen": "1.0.2",
|
||||||
|
|
|
@ -680,8 +680,8 @@ class Path extends Feature {
|
||||||
|
|
||||||
edit(event) {
|
edit(event) {
|
||||||
if (this.map.editEnabled) {
|
if (this.map.editEnabled) {
|
||||||
if (!this.ui.editEnabled()) this.ui.enableEdit()
|
|
||||||
super.edit(event)
|
super.edit(event)
|
||||||
|
if (!this.ui.editEnabled()) this.ui.makeGeometryEditable()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -288,6 +288,21 @@ const PathMixin = {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
makeGeometryEditable: function () {
|
||||||
|
if (this._map.editedFeature !== this.feature) {
|
||||||
|
this.disableEdit()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this._map.once('moveend', this.makeGeometryEditable, this)
|
||||||
|
const pointsCount = this._parts.reduce((acc, part) => acc + part.length, 0)
|
||||||
|
if (pointsCount > 100 && this._map.getZoom() < this._map.getMaxZoom()) {
|
||||||
|
this._map.tooltip.open({ content: L._('Please zoom in to edit the geometry') })
|
||||||
|
this.disableEdit()
|
||||||
|
} else {
|
||||||
|
this.enableEdit()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
addInteractions: function () {
|
addInteractions: function () {
|
||||||
FeatureMixin.addInteractions.call(this)
|
FeatureMixin.addInteractions.call(this)
|
||||||
this.on('editable:disable', this.onCommit)
|
this.on('editable:disable', this.onCommit)
|
||||||
|
@ -383,7 +398,7 @@ const PathMixin = {
|
||||||
getContextMenuEditItems: function (event) {
|
getContextMenuEditItems: function (event) {
|
||||||
const items = FeatureMixin.getContextMenuEditItems.call(this, event)
|
const items = FeatureMixin.getContextMenuEditItems.call(this, event)
|
||||||
if (
|
if (
|
||||||
this._map?.editedFeature !== this &&
|
this._map?.editedFeature !== this.feature &&
|
||||||
this.feature.isSameClass(this._map.editedFeature)
|
this.feature.isSameClass(this._map.editedFeature)
|
||||||
) {
|
) {
|
||||||
items.push({
|
items.push({
|
||||||
|
|
3978
umap/static/umap/vendors/editable/Leaflet.Editable.js
vendored
3978
umap/static/umap/vendors/editable/Leaflet.Editable.js
vendored
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
Loading…
Reference in a new issue