chore: from switch with unique case to if/else

This commit is contained in:
David Larlet 2024-06-26 11:29:20 -04:00
parent 04c50c4453
commit b5cb092cd4
No known key found for this signature in database
GPG key ID: 3E2953A359E7E7BD

View file

@ -88,12 +88,10 @@ 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 {
default:
this.updateObjectValue(feature, key, value) this.updateObjectValue(feature, key, value)
feature.datalayer.indexProperties(feature) feature.datalayer.indexProperties(feature)
} }