Skip to content

Commit

Permalink
adjusted binding of basemap and fixed removal of click listener
Browse files Browse the repository at this point in the history
  • Loading branch information
psch committed Feb 23, 2021
1 parent 2c8e6db commit b1c36a5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/main/js/bundles/dn_screenshot/ScreenshotControl.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class ScreenshotControl{
}

abortDrawing() {
if(this.canvas.onclick) {
if(this.canvas?.onclick) {
this.canvas.style.cursor = "default";
this.canvas.onclick = null;
}
Expand Down
6 changes: 3 additions & 3 deletions src/main/js/bundles/dn_screenshot/ScreenshotUI.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@
min="0"
/>
</div>
<h4 v-if="!basemap">{{ i18n.backgroundTitle }}</h4>
<h4 v-if="basemap == undefined">{{ i18n.backgroundTitle }}</h4>
<v-checkbox
v-if="!basemap"
v-if="basemap == undefined"
v-model="properties.ignoreBackground"
:label="i18n.background"
hide-details
Expand Down Expand Up @@ -130,7 +130,7 @@
captureFullMap: true,
possibleFormats: ["png", "jpg"],
areaDrawn: false,
basemap: false,
basemap: undefined,
toggle_exclusive: undefined
};
},
Expand Down
12 changes: 5 additions & 7 deletions src/main/js/bundles/dn_screenshot/ScreenshotUIFactory.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,11 @@ class ScreenshotUIFactory {
propertiesToViewBinding.bindTo(props, vm.properties);
// bind properties and view model
screenshotToViewBinding.bindTo(this, vm);
// bind basemap and vue
basemapToViewBinding.bindTo(this.basemap, vm);

// register methods to enable/disable binding
widget.enableBinding = () => {
// 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();
Expand Down Expand Up @@ -85,7 +81,9 @@ class ScreenshotUIFactory {
}
declareBasemapToVueBinding() {
return Binding.create()
.sync("basemap", ifDefined(), ifDefined());
.sync("selectedId" +
"" +
"", "basemap");
}
}

Expand Down
10 changes: 8 additions & 2 deletions src/main/js/bundles/dn_screenshot/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
{
"name": "model",
"providing": "map-widget.MapWidgetModel"
}, {
},
{
"name": "layerFactory",
"providing": "map-config-api.LayerFactory"
},
Expand Down Expand Up @@ -118,7 +119,12 @@
{
"name": "model",
"providing": "map-widget.MapWidgetModel"
}, {
},
{
"name": "basemap",
"providing": "map-basemaps-api.BasemapsModel"
},
{
"name": "layerFactory",
"providing": "map-config-api.LayerFactory"
},
Expand Down

0 comments on commit b1c36a5

Please sign in to comment.