From b1c36a5b6cbe714a4f06d432f30110f05d0d64a5 Mon Sep 17 00:00:00 2001 From: psch Date: Tue, 23 Feb 2021 16:39:13 +0100 Subject: [PATCH] adjusted binding of basemap and fixed removal of click listener --- .../js/bundles/dn_screenshot/ScreenshotControl.js | 2 +- src/main/js/bundles/dn_screenshot/ScreenshotUI.vue | 6 +++--- .../js/bundles/dn_screenshot/ScreenshotUIFactory.js | 12 +++++------- src/main/js/bundles/dn_screenshot/manifest.json | 10 ++++++++-- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/main/js/bundles/dn_screenshot/ScreenshotControl.js b/src/main/js/bundles/dn_screenshot/ScreenshotControl.js index e158910..cb08e5e 100644 --- a/src/main/js/bundles/dn_screenshot/ScreenshotControl.js +++ b/src/main/js/bundles/dn_screenshot/ScreenshotControl.js @@ -96,7 +96,7 @@ class ScreenshotControl{ } abortDrawing() { - if(this.canvas.onclick) { + if(this.canvas?.onclick) { this.canvas.style.cursor = "default"; this.canvas.onclick = null; } diff --git a/src/main/js/bundles/dn_screenshot/ScreenshotUI.vue b/src/main/js/bundles/dn_screenshot/ScreenshotUI.vue index fc500a7..86aef5c 100644 --- a/src/main/js/bundles/dn_screenshot/ScreenshotUI.vue +++ b/src/main/js/bundles/dn_screenshot/ScreenshotUI.vue @@ -81,9 +81,9 @@ min="0" /> -

{{ i18n.backgroundTitle }}

+

{{ i18n.backgroundTitle }}

{ - // bind basemap and vue - let temp = { - basemap: this.model.map.basemap != undefined - } - basemapToViewBinding.bindTo(temp, vm); - propertiesToViewBinding.enable().syncToRightNow(); screenshotToViewBinding.enable().syncToLeftNow(); basemapToViewBinding.enable().syncToRightNow(); @@ -85,7 +81,9 @@ class ScreenshotUIFactory { } declareBasemapToVueBinding() { return Binding.create() - .sync("basemap", ifDefined(), ifDefined()); + .sync("selectedId" + + "" + + "", "basemap"); } } diff --git a/src/main/js/bundles/dn_screenshot/manifest.json b/src/main/js/bundles/dn_screenshot/manifest.json index 42cf6ca..3c148a9 100644 --- a/src/main/js/bundles/dn_screenshot/manifest.json +++ b/src/main/js/bundles/dn_screenshot/manifest.json @@ -41,7 +41,8 @@ { "name": "model", "providing": "map-widget.MapWidgetModel" - }, { + }, + { "name": "layerFactory", "providing": "map-config-api.LayerFactory" }, @@ -118,7 +119,12 @@ { "name": "model", "providing": "map-widget.MapWidgetModel" - }, { + }, + { + "name": "basemap", + "providing": "map-basemaps-api.BasemapsModel" + }, + { "name": "layerFactory", "providing": "map-config-api.LayerFactory" },