mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 11:32:38 +02:00
chore: remove unused isDirty flags
This commit is contained in:
parent
626b669d89
commit
6c8046456a
4 changed files with 2 additions and 34 deletions
|
@ -22,7 +22,6 @@ class Feature {
|
|||
constructor(umap, datalayer, geojson = {}, id = null) {
|
||||
this._umap = umap
|
||||
this.sync = umap.syncEngine.proxy(this)
|
||||
this._isDirty = false
|
||||
this._ui = null
|
||||
|
||||
// DataLayer the feature belongs to
|
||||
|
@ -54,17 +53,6 @@ class Feature {
|
|||
}
|
||||
}
|
||||
|
||||
set isDirty(status) {
|
||||
this._isDirty = status
|
||||
if (this.datalayer) {
|
||||
this.datalayer.isDirty = status
|
||||
}
|
||||
}
|
||||
|
||||
get isDirty() {
|
||||
return this._isDirty
|
||||
}
|
||||
|
||||
get ui() {
|
||||
if (!this._ui) this.makeUI()
|
||||
return this._ui
|
||||
|
@ -367,7 +355,6 @@ class Feature {
|
|||
}
|
||||
|
||||
del(sync) {
|
||||
this.isDirty = true
|
||||
this._umap._leafletMap.closePopup()
|
||||
if (this.datalayer) {
|
||||
this.datalayer.removeFeature(this, sync)
|
||||
|
@ -412,13 +399,11 @@ class Feature {
|
|||
|
||||
changeDataLayer(datalayer) {
|
||||
if (this.datalayer) {
|
||||
this.datalayer.isDirty = true
|
||||
this.datalayer.removeFeature(this)
|
||||
}
|
||||
|
||||
datalayer.addFeature(this)
|
||||
this.sync.upsert(this.toGeoJSON())
|
||||
datalayer.isDirty = true
|
||||
this.redraw()
|
||||
}
|
||||
|
||||
|
@ -485,7 +470,6 @@ class Feature {
|
|||
|
||||
deleteProperty(property) {
|
||||
delete this.properties[property]
|
||||
this.isDirty = true
|
||||
}
|
||||
|
||||
renameProperty(from, to) {
|
||||
|
@ -578,7 +562,6 @@ class Feature {
|
|||
delete geojson.id
|
||||
delete geojson.properties.id
|
||||
const feature = this.datalayer.makeFeature(geojson)
|
||||
feature.isDirty = true
|
||||
feature.edit()
|
||||
return feature
|
||||
}
|
||||
|
@ -1053,7 +1036,6 @@ export class LineString extends Path {
|
|||
this.pullGeometry()
|
||||
if (!this.ui.editEnabled()) this.edit()
|
||||
this.ui.editor.reset()
|
||||
this.isDirty = true
|
||||
}
|
||||
|
||||
isMulti() {
|
||||
|
|
|
@ -109,7 +109,6 @@ const PointMixin = {
|
|||
addInteractions() {
|
||||
FeatureMixin.addInteractions.call(this)
|
||||
this.on('dragend', (event) => {
|
||||
this.isDirty = true
|
||||
this.feature.edit(event)
|
||||
})
|
||||
if (!this.feature.isReadOnly()) this.on('mouseover', this._enableDragging)
|
||||
|
|
|
@ -640,7 +640,6 @@ export default class Umap {
|
|||
|
||||
createDirtyDataLayer(options) {
|
||||
const datalayer = this.createDataLayer(options, true)
|
||||
datalayer.isDirty = true
|
||||
return datalayer
|
||||
}
|
||||
|
||||
|
@ -1218,12 +1217,8 @@ export default class Umap {
|
|||
})
|
||||
}
|
||||
} else {
|
||||
if (!this.permissions.isDirty) {
|
||||
// Do not override local changes to permissions,
|
||||
// but update in case some other editors changed them in the meantime.
|
||||
this.permissions.setProperties(data.permissions)
|
||||
this.permissions.commit()
|
||||
}
|
||||
this.permissions.setProperties(data.permissions)
|
||||
this.permissions.commit()
|
||||
this._leafletMap.once('saved', () => {
|
||||
Alert.success(data.info || translate('Map has been saved!'))
|
||||
})
|
||||
|
|
|
@ -159,7 +159,6 @@ U.Search = L.PhotonSearch.extend({
|
|||
event.stopPropagation()
|
||||
const datalayer = this.map._umap.defaultEditDataLayer()
|
||||
const marker = datalayer.makeFeature(feature)
|
||||
marker.isDirty = true
|
||||
marker.edit()
|
||||
})
|
||||
geom.addEventListener('mousedown', async (event) => {
|
||||
|
@ -300,14 +299,8 @@ U.Editable = L.Editable.extend({
|
|||
if (event.layer instanceof U.LeafletMarker) event.layer.feature.del()
|
||||
})
|
||||
this.on('editable:drawing:commit', function (event) {
|
||||
event.layer.feature.isDirty = true
|
||||
if (this._umap.editedFeature !== event.layer) event.layer.feature.edit(event)
|
||||
})
|
||||
this.on('editable:editing', (event) => {
|
||||
const feature = event.layer.feature
|
||||
feature.isDirty = true
|
||||
// feature.pullGeometry(false)
|
||||
})
|
||||
this.on('editable:vertex:ctrlclick', (event) => {
|
||||
const index = event.vertex.getIndex()
|
||||
if (
|
||||
|
@ -361,7 +354,6 @@ U.Editable = L.Editable.extend({
|
|||
// Overrided from Leaflet.Editable
|
||||
const datalayer = this._umap.defaultEditDataLayer()
|
||||
datalayer.addFeature(layer.feature)
|
||||
layer.isDirty = true
|
||||
return layer
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue