diff --git a/package-lock.json b/package-lock.json
index f65a7401c..c26c6e991 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -17849,6 +17849,7 @@
"@polar/plugin-address-search": "^3.0.0",
"@polar/plugin-attributions": "^1.4.0",
"@polar/plugin-draw": "^3.0.0",
+ "@polar/plugin-export": "^1.2.2",
"@polar/plugin-gfi": "^3.0.0",
"@polar/plugin-icon-menu": "^1.3.1",
"@polar/plugin-layer-chooser": "^2.0.0",
diff --git a/packages/clients/diplan/example/config.js b/packages/clients/diplan/example/config.js
index 27afa3064..4a0f29368 100644
--- a/packages/clients/diplan/example/config.js
+++ b/packages/clients/diplan/example/config.js
@@ -80,6 +80,11 @@ export default {
},
],
},
+ export: {
+ displayComponent: true,
+ showJpg: false,
+ showPdf: false,
+ },
gfi: {
mode: 'bboxDot',
layers: {
diff --git a/packages/clients/diplan/example/index.html b/packages/clients/diplan/example/index.html
index c040d182d..da825af18 100644
--- a/packages/clients/diplan/example/index.html
+++ b/packages/clients/diplan/example/index.html
@@ -36,6 +36,11 @@
Informationen aus Kartenklient
uninitialized |
Zoomstufe der OpenLayers/View als Number |
+
+ plugin/export/exportedMap |
+ ![]() |
+ Screenshot des aktuellen Kartenausschnitts. Produzierbar durch Klick auf den unteren linken "Export"-Button. |
+
plugin/gfi/featureInformation |
uninitialized |
diff --git a/packages/clients/diplan/example/prod-example.html b/packages/clients/diplan/example/prod-example.html
index 5871067ad..8f01efd3f 100644
--- a/packages/clients/diplan/example/prod-example.html
+++ b/packages/clients/diplan/example/prod-example.html
@@ -36,6 +36,11 @@ Informationen aus Kartenklient
uninitialized |
Zoomstufe der OpenLayers/View als Number |
+
+ plugin/export/exportedMap |
+ ![]() |
+ Screenshot des aktuellen Kartenausschnitts. Produzierbar durch Klick auf den unteren linken "Export"-Button. |
+
plugin/gfi/featureInformation |
uninitialized |
diff --git a/packages/clients/diplan/example/setup.js b/packages/clients/diplan/example/setup.js
index 047512dc4..edbb65104 100644
--- a/packages/clients/diplan/example/setup.js
+++ b/packages/clients/diplan/example/setup.js
@@ -42,6 +42,8 @@ export default (client, layerConf, config) => {
const htmlZoom = document.getElementById('subscribed-zoom')
const htmlGfi = document.getElementById('subscribed-gfi')
+ const htmlExportA = document.getElementById('subscribed-export-a')
+ const htmlExportImg = document.getElementById('subscribed-export-img')
mapInstance.subscribe(
'plugin/zoom/zoomLevel',
@@ -51,6 +53,17 @@ export default (client, layerConf, config) => {
'plugin/gfi/featureInformation',
(v) => (htmlGfi.innerHTML = JSON.stringify(v, null, 2))
)
+ mapInstance.subscribe('plugin/export/exportedMap', (screenshot) => {
+ htmlExportImg.setAttribute('src', screenshot)
+ if (navigator.userAgent.toLowerCase().includes('firefox')) {
+ htmlExportImg.onclick = function () {
+ window.open(this.src, '_blank')
+ }
+ htmlExportA.onclick = () => false
+ } else {
+ htmlExportA.setAttribute('href', screenshot)
+ }
+ })
window.mapInstance = mapInstance
})
diff --git a/packages/clients/diplan/example/style.css b/packages/clients/diplan/example/style.css
index 31aed502e..c5d952959 100644
--- a/packages/clients/diplan/example/style.css
+++ b/packages/clients/diplan/example/style.css
@@ -63,6 +63,12 @@ h2 {
width: 100%;
}
+.styled-table img {
+ cursor: pointer;
+ width: 400px;
+ height: auto;
+}
+
.styled-table thead tr {
background-color: #2b3980;
color: #ecf4ff;
diff --git a/packages/clients/diplan/package.json b/packages/clients/diplan/package.json
index c56f5932a..1b32d8e53 100644
--- a/packages/clients/diplan/package.json
+++ b/packages/clients/diplan/package.json
@@ -38,6 +38,7 @@
"@polar/plugin-address-search": "^3.0.0",
"@polar/plugin-attributions": "^1.4.0",
"@polar/plugin-draw": "^3.0.0",
+ "@polar/plugin-export": "^1.2.2",
"@polar/plugin-gfi": "^3.0.0",
"@polar/plugin-icon-menu": "^1.3.1",
"@polar/plugin-layer-chooser": "^2.0.0",
diff --git a/packages/clients/diplan/src/polar-client.ts b/packages/clients/diplan/src/polar-client.ts
index 5be266639..04fb3b613 100644
--- a/packages/clients/diplan/src/polar-client.ts
+++ b/packages/clients/diplan/src/polar-client.ts
@@ -2,6 +2,7 @@ import polarCore, { setLayout, NineLayout, NineLayoutTag } from '@polar/core'
import AddressSearch from '@polar/plugin-address-search'
import Attributions from '@polar/plugin-attributions'
import Draw from '@polar/plugin-draw'
+import Export from '@polar/plugin-export'
import Gfi from '@polar/plugin-gfi'
import IconMenu from '@polar/plugin-icon-menu'
import LayerChooser from '@polar/plugin-layer-chooser'
@@ -91,6 +92,14 @@ polarCore.addPlugins([
coordinateSources: [],
layers: {},
}),
+ Export({
+ layoutTag: NineLayoutTag.BOTTOM_LEFT,
+ /*
+ * icons: Currently not implemented, provided icon set has no fitting icon
+ * atm. Suggestion: Searching for "picture" on icomoon yields nice results.
+ * We should ask implementors of diplanung-style to add them eventually.
+ */
+ }),
Scale({
displayComponent: true,
layoutTag: NineLayoutTag.BOTTOM_RIGHT,