From 1c8e56274ad94f75915ec0e9713c1cb3148aaf91 Mon Sep 17 00:00:00 2001 From: Rajnikant Lodhi Date: Thu, 25 Aug 2022 10:44:36 +0530 Subject: [PATCH] Resolve stroke dasharray value get undefined issue on web ui --- .../map/map-drawing-to-svg-converter.ts | 22 +++++++++++++++---- .../style-editor/style-editor.component.ts | 4 ++-- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/app/cartography/converters/map/map-drawing-to-svg-converter.ts b/src/app/cartography/converters/map/map-drawing-to-svg-converter.ts index 4e7b7432..b6c974bd 100644 --- a/src/app/cartography/converters/map/map-drawing-to-svg-converter.ts +++ b/src/app/cartography/converters/map/map-drawing-to-svg-converter.ts @@ -14,12 +14,26 @@ export class MapDrawingToSvgConverter implements Converter { let elem = ``; if (mapDrawing.element instanceof RectElement) { - elem = ``; + elem = ``; } else if (mapDrawing.element instanceof EllipseElement) { - elem = ``; + elem = ``; } else if (mapDrawing.element instanceof LineElement) { - elem = ``; - } else if (mapDrawing.element instanceof TextElement ) { + elem = ``; + } else if (mapDrawing.element instanceof TextElement) { elem = `${mapDrawing.element.text}`; } else return ''; diff --git a/src/app/components/project-map/drawings-editors/style-editor/style-editor.component.ts b/src/app/components/project-map/drawings-editors/style-editor/style-editor.component.ts index 2bccfaf4..f7b66c4e 100644 --- a/src/app/components/project-map/drawings-editors/style-editor/style-editor.component.ts +++ b/src/app/components/project-map/drawings-editors/style-editor/style-editor.component.ts @@ -60,13 +60,13 @@ export class StyleEditorDialogComponent implements OnInit { if (this.drawing.element instanceof RectElement || this.drawing.element instanceof EllipseElement) { this.element.fill = this.drawing.element.fill; this.element.stroke = this.drawing.element.stroke; - let dasharray_value = this.drawing.element.stroke_dasharray; + let dasharray_value = this.drawing.element.stroke_dasharray ?? 'none'; this.borderTypes.map((_) => { if (_.qt == dasharray_value || _.value == dasharray_value) { dasharray_find_value = _.value; } }); - this.element.stroke_dasharray = dasharray_find_value ?? 'none'; + this.element.stroke_dasharray = dasharray_find_value; this.element.stroke_width = this.drawing.element.stroke_width; } else if (this.drawing.element instanceof LineElement) { this.element.stroke = this.drawing.element.stroke;