From 7b837d74355b05e3a82d8be846a4be33d54af59c Mon Sep 17 00:00:00 2001 From: pietervdvn Date: Thu, 24 Feb 2022 03:09:30 +0100 Subject: [PATCH] Fix GRB theme --- Logic/BBox.ts | 4 ++-- UI/Popup/ImportButton.ts | 13 +++++++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Logic/BBox.ts b/Logic/BBox.ts index 1aa9d08827..aa8e699356 100644 --- a/Logic/BBox.ts +++ b/Logic/BBox.ts @@ -209,9 +209,9 @@ export class BBox { } - private check() { + private check() { if (isNaN(this.maxLon) || isNaN(this.maxLat) || isNaN(this.minLon) || isNaN(this.minLat)) { - console.log(this); + console.trace("BBox with NaN detected:", this); throw "BBOX has NAN"; } } diff --git a/UI/Popup/ImportButton.ts b/UI/Popup/ImportButton.ts index 1f96829e31..f6f5337aa7 100644 --- a/UI/Popup/ImportButton.ts +++ b/UI/Popup/ImportButton.ts @@ -504,14 +504,23 @@ export class ImportWayButton extends AbstractImportButton implements AutoAction mergeConfigs, "import" ) - } else { - + } else if(feature.geometry.type === "Polygon"){ + const outer = coors[0] + return new CreateWayWithPointReuseAction( + args.newTags.data, + outer, + state, + mergeConfigs + ) + }else if(feature.geometry.type === "LineString"){ return new CreateWayWithPointReuseAction( args.newTags.data, coors, state, mergeConfigs ) + }else{ + throw "Unsupported type" } } }