diff --git a/js/places.js b/js/places.js index aebbb17..85c44f8 100644 --- a/js/places.js +++ b/js/places.js @@ -108,6 +108,11 @@ export class PlaceDatabase extends EventTarget { console.warn(`Warning: a feature with ID "${feature.id}" already exists in database`) } + if(!feature.geometry){ + console.warn(`Geometry ${feature.id} does not have a geometry, it will not be included`) + return + } + this.featuresById[feature.id] = feature let event = new Event("newfeature") @@ -244,9 +249,6 @@ export class MapFeature { asPoint(){ if(!this[POINT_FEATURE]){ - if(!this.geometry){ - debugger; - } if(this.geometry.type != "Point"){ let point_feature = turf.centerOfMass(this) point_feature.properties = this.properties