@regionerne/gis-komponent 0.0.118 → 0.0.119
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -2715,6 +2715,7 @@ class PrintHelperService {
|
|
|
2715
2715
|
setTimeout(() => {
|
|
2716
2716
|
html2canvas(htmlElement, {
|
|
2717
2717
|
useCORS: true,
|
|
2718
|
+
allowTaint: true,
|
|
2718
2719
|
}).then(originalCanvas => {
|
|
2719
2720
|
if (printSetting.printDimensions) {
|
|
2720
2721
|
const srcW = originalCanvas.width;
|
|
@@ -4757,6 +4758,7 @@ class ToolboxComponent {
|
|
|
4757
4758
|
this._printHelper.setVisibiltyOnDOMElements(htmlElement, false);
|
|
4758
4759
|
html2canvas(htmlElement, {
|
|
4759
4760
|
useCORS: true,
|
|
4761
|
+
allowTaint: true,
|
|
4760
4762
|
}).then(canvas => {
|
|
4761
4763
|
const imgData = canvas.toDataURL(this.format);
|
|
4762
4764
|
const link = document.createElement('a');
|
|
@@ -4770,8 +4772,11 @@ class ToolboxComponent {
|
|
|
4770
4772
|
}
|
|
4771
4773
|
link.download = download;
|
|
4772
4774
|
link.click();
|
|
4773
|
-
|
|
4774
|
-
|
|
4775
|
+
})
|
|
4776
|
+
.catch(error => {
|
|
4777
|
+
console.error("🚀 ~ ToolboxComponent ~ doPrint ~ error:", error);
|
|
4778
|
+
})
|
|
4779
|
+
.finally(() => this._printHelper.setVisibiltyOnDOMElements(htmlElement, true));
|
|
4775
4780
|
}
|
|
4776
4781
|
toggleSelectFeatureHighlight() {
|
|
4777
4782
|
if (this.activeMode === 'select-highlight') {
|
|
@@ -6308,8 +6313,8 @@ class GisKomponentComponent {
|
|
|
6308
6313
|
case 'WMS':
|
|
6309
6314
|
result = new ImageLayer({
|
|
6310
6315
|
source: new ImageWMS({
|
|
6316
|
+
crossOrigin: 'anonymous', // Print requires CORS-enabled sources
|
|
6311
6317
|
url: layer.baseUrl,
|
|
6312
|
-
// crossOrigin: 'anonymous', // This gives us CORS errors sometimes
|
|
6313
6318
|
params,
|
|
6314
6319
|
})
|
|
6315
6320
|
});
|
|
@@ -6318,7 +6323,7 @@ class GisKomponentComponent {
|
|
|
6318
6323
|
result = new TileLayer({
|
|
6319
6324
|
source: new TileWMS({
|
|
6320
6325
|
url: layer.baseUrl,
|
|
6321
|
-
|
|
6326
|
+
crossOrigin: 'anonymous', // Print requires CORS-enabled sources
|
|
6322
6327
|
params,
|
|
6323
6328
|
})
|
|
6324
6329
|
});
|
|
@@ -6328,7 +6333,7 @@ class GisKomponentComponent {
|
|
|
6328
6333
|
const options = optionsFromCapabilities(wmtsOptions[layer.baseUrl], {
|
|
6329
6334
|
layer: layer.layers,
|
|
6330
6335
|
matrixSet: layer.projection || projection,
|
|
6331
|
-
crossOrigin: 'anonymous'
|
|
6336
|
+
crossOrigin: 'anonymous' // Print requires CORS-enabled sources
|
|
6332
6337
|
});
|
|
6333
6338
|
result = new TileLayer({
|
|
6334
6339
|
source: new WMTS(options)
|