mirror of
https://github.com/umap-project/umap.git
synced 2025-04-29 11:52:38 +02:00
chore: from switch with unique case to if/else
This commit is contained in:
parent
04c50c4453
commit
b5cb092cd4
1 changed files with 6 additions and 8 deletions
|
@ -88,14 +88,12 @@ export class FeatureUpdater extends BaseUpdater {
|
||||||
if (feature === undefined) {
|
if (feature === undefined) {
|
||||||
console.error(`Unable to find feature with id = ${metadata.id}.`)
|
console.error(`Unable to find feature with id = ${metadata.id}.`)
|
||||||
}
|
}
|
||||||
switch (key) {
|
if (key === 'geometry') {
|
||||||
case 'geometry': {
|
const datalayer = this.getDataLayerFromID(metadata.layerId)
|
||||||
const datalayer = this.getDataLayerFromID(metadata.layerId)
|
datalayer.geoJSONToLeaflet({ geometry: value, id: metadata.id, feature })
|
||||||
datalayer.geoJSONToLeaflet({ geometry: value, id: metadata.id, feature })
|
} else {
|
||||||
}
|
this.updateObjectValue(feature, key, value)
|
||||||
default:
|
feature.datalayer.indexProperties(feature)
|
||||||
this.updateObjectValue(feature, key, value)
|
|
||||||
feature.datalayer.indexProperties(feature)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
feature.render([key])
|
feature.render([key])
|
||||||
|
|
Loading…
Reference in a new issue