Skip to content

Commit f620323

Browse files
authored
Merge pull request #251 from Dataport/refactor/multiple-diplan-clients
prepare diplan example folder for multiple prod instances
2 parents 0531076 + 5686fce commit f620323

File tree

12 files changed

+385
-14
lines changed

12 files changed

+385
-14
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"bgw:dev": "nx dev @polar/client-bgw",
2626
"generic:build": "nx build @polar/client-generic",
2727
"diplan:build": "nx build @polar/client-diplan",
28-
"diplan:build:serve": "http-server ./packages/clients/diplan -o /example/prod-example.html",
28+
"diplan:build:serve": "http-server ./packages/clients/diplan -o /example/overview.html",
2929
"diplan:dev": "nx dev @polar/client-diplan",
3030
"dish:build": "nx build @polar/client-dish",
3131
"dish:build:serve": "http-server ./packages/clients/dish -o /dist/index.html",

packages/clients/diplan/API.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This document describes the `@polar/client-diplan`-specific configuration option
44

55
For all additional details, check the [full documentation](https://dataport.github.io/polar/docs/diplan/client-diplan.html) that is also delivered as part of the package within the `./docs` folder.
66

7-
For our example client, [see here](./example/prod-example.html).
7+
For our example clients, [see here](./example/overview.html).
88

99
## Configuration
1010

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Example structure
2+
3+
## `.`
4+
5+
The root folder holds files used in all clients. Modify with care. If you need wildly different files for an example, create new files in the relevant example folder.
6+
7+
## `dev`
8+
9+
This folder holds the development example used during development time. You may put anything in here as long as it serves the testing purposes. The client is not required to look good, but is a technical playground.
10+
11+
## all others
12+
13+
All other folders are examples used in the documentation deployed on the [GitHub page](https://dataport.github.io/polar/docs/diplan/example/overview.html). They are supposed to display usage variants and should be understandable/clean. These are supposed to be viewn both by the customer and integrators alike so that they can easily lift from the usage scenarios. They're also useful for testing PRs in build mode.
Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
// service id map to avoid typos, ease renames
2+
const basemap = 'basemapde_farbe'
3+
const xplanwms = 'xplanwms'
4+
const xplanwfs = 'xplanwfs'
5+
const flurstuecke = 'flurstuecke'
6+
const bstgasleitung = 'bst_gasleitung'
7+
8+
export default {
9+
startResolution: 264.583190458,
10+
startCenter: [561210, 5932600],
11+
extent: [
12+
248651.73157077, 5227198.20287631, 928366.12236557, 6118661.62507136,
13+
],
14+
locales: [
15+
{
16+
type: 'de',
17+
resources: {
18+
diplan: {
19+
layers: {
20+
[basemap]: 'BasemapDE',
21+
[xplanwms]: 'XPlanWMS',
22+
[xplanwfs]: 'XPlanSynWFS',
23+
[flurstuecke]: 'Flurstücke',
24+
[bstgasleitung]: 'BST Gasleitung',
25+
},
26+
attributions: {
27+
[basemap]: `$t(diplan.layers.${basemap}) © GeoBasis-DE / BKG <YEAR> CC BY 4.0`,
28+
[xplanwms]: `$t(diplan.layers.${xplanwms}) © ???`,
29+
[xplanwfs]: `$t(diplan.layers.${xplanwfs}) © ???`,
30+
[flurstuecke]: `$t(diplan.layers.${flurstuecke}) © ???`,
31+
[bstgasleitung]: `$t(diplan.layers.${bstgasleitung}) © ???`,
32+
},
33+
},
34+
},
35+
},
36+
],
37+
addressSearch: {
38+
displayComponent: true,
39+
searchMethods: [
40+
{
41+
queryParameters: {
42+
searchAddress: true,
43+
searchStreets: true,
44+
searchHouseNumbers: true,
45+
},
46+
type: 'mpapi',
47+
url: 'https://geodienste.hamburg.de/HH_WFS_GAGES?service=WFS&request=GetFeature&version=2.0.0',
48+
},
49+
],
50+
minLength: 3,
51+
waitMs: 300,
52+
},
53+
layers: [
54+
{
55+
id: basemap,
56+
visibility: true,
57+
type: 'background',
58+
name: `diplan.layers.${basemap}`,
59+
},
60+
{
61+
id: xplanwms,
62+
visibility: true,
63+
type: 'mask',
64+
name: `diplan.layers.${xplanwms}`,
65+
},
66+
{
67+
id: xplanwfs,
68+
visibility: false,
69+
type: 'mask',
70+
name: `diplan.layers.${xplanwfs}`,
71+
},
72+
{
73+
id: flurstuecke,
74+
visibility: false,
75+
// TODO available from 7, but only starts loading from 8 - bug or skill issue?
76+
minZoom: 7,
77+
type: 'mask',
78+
name: `diplan.layers.${flurstuecke}`,
79+
},
80+
{
81+
id: bstgasleitung,
82+
visibility: false,
83+
type: 'mask',
84+
name: `diplan.layers.${bstgasleitung}`,
85+
},
86+
],
87+
attributions: {
88+
layerAttributions: [
89+
{
90+
id: basemap,
91+
title: `diplan.attributions.${basemap}`,
92+
},
93+
{
94+
id: xplanwms,
95+
title: `diplan.attributions.${xplanwms}`,
96+
},
97+
{
98+
id: xplanwfs,
99+
title: `diplan.attributions.${xplanwfs}`,
100+
},
101+
{
102+
id: flurstuecke,
103+
title: `diplan.attributions.${flurstuecke}`,
104+
},
105+
{
106+
id: bstgasleitung,
107+
title: `diplan.attributions.${bstgasleitung}`,
108+
},
109+
],
110+
},
111+
draw: {
112+
enableOptions: true,
113+
lassos: [
114+
{
115+
id: flurstuecke,
116+
},
117+
{
118+
id: xplanwfs,
119+
},
120+
],
121+
measureOptions: {
122+
metres: true,
123+
kilometres: true,
124+
hectares: true,
125+
},
126+
selectableDrawModes: ['Point', 'LineString', 'Circle', 'Text', 'Polygon'],
127+
snapTo: [xplanwfs, flurstuecke],
128+
textStyle: {
129+
font: {
130+
size: [10, 20, 30],
131+
family: 'Arial',
132+
},
133+
},
134+
style: {
135+
fill: { color: 'rgb(51 117 212 / 50%)' },
136+
stroke: {
137+
color: '#3375d4',
138+
width: 2,
139+
},
140+
circle: {
141+
radius: 7,
142+
fillColor: 'rgb(51 117 212 / 50%)',
143+
},
144+
},
145+
},
146+
export: {
147+
displayComponent: true,
148+
showJpg: false,
149+
showPdf: false,
150+
},
151+
gfi: {
152+
mode: 'bboxDot',
153+
layers: {
154+
[xplanwms]: {
155+
geometry: true,
156+
window: true,
157+
properties: ['xpPlanName'],
158+
},
159+
[xplanwfs]: {
160+
geometry: true,
161+
window: true,
162+
properties: ['name'],
163+
},
164+
},
165+
coordinateSources: [
166+
'plugin/pins/transformedCoordinate',
167+
'plugin/pins/coordinatesAfterDrag',
168+
],
169+
},
170+
pins: {
171+
toZoomLevel: 9,
172+
movable: 'drag',
173+
appearOnClick: {
174+
show: true,
175+
atZoomLevel: 0,
176+
},
177+
},
178+
}

packages/clients/diplan/example/index.html renamed to packages/clients/diplan/example/dev/index.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!DOCTYPE html>
22
<html>
3-
<!-- test page -->
3+
<!-- test page used during development -->
44
<head>
55
<meta charset="utf-8" />
66
<title>@polar/client-diplan</title>
7-
<link rel="stylesheet" href="./style.css">
7+
<link rel="stylesheet" href="../style.css">
88
</head>
99
<body>
1010
<nav></nav>
@@ -102,8 +102,8 @@ <h2>Informationen aus Kartenklient</h2>
102102
</main>
103103
<footer>At solmen va esser necessi far uniform grammatica, pronunciation e plu sommun paroles.</footer>
104104
<script type="module">
105-
import client from '../src/polar-client.ts'
106-
import services from './services.js'
105+
import client from '../../src/polar-client.ts'
106+
import services from '../services.js'
107107
import config from './config.js'
108108

109109
import setup from './setup.js'
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<!-- test page -->
4+
<head>
5+
<meta charset="utf-8" />
6+
<title>@polar/client-diplan – Übersicht</title>
7+
<link rel="stylesheet" href="./style.css">
8+
</head>
9+
<body>
10+
<nav></nav>
11+
<header>
12+
<h1>Testseite @polar/client-diplan – Übersicht</h1>
13+
</header>
14+
<div id="somethingnice"></div>
15+
<main>
16+
<section>
17+
<h2 class="padded-x">Beispielübersicht</h2>
18+
<div class="padded-x">
19+
<li><a href="./polar-ui">POLAR UI test client</a></li>
20+
<li>DiPlan UI test client <span class="todo">TODO</span></li>
21+
<li>Login test client <span class="todo">TODO</span></li>
22+
<li>Data source test client <span class="todo">TODO</span></li>
23+
</div>
24+
</section>
25+
</main>
26+
<footer>At solmen va esser necessi far uniform grammatica, pronunciation e plu sommun paroles.</footer>
27+
</body>
28+
</html>

packages/clients/diplan/example/prod-example.html renamed to packages/clients/diplan/example/polar-ui/index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
<head>
55
<meta charset="utf-8" />
66
<title>@polar/client-diplan</title>
7-
<link rel="stylesheet" href="./style.css">
7+
<link rel="stylesheet" href="../style.css">
88
</head>
99
<body>
1010
<nav></nav>
1111
<header>
12-
<h1>Testseite <code>@polar/client-diplan</code> (build)</h1>
12+
<h1>Testseite <code>@polar/client-diplan</code> (POLAR UI)</h1>
1313
</header>
1414
<div id="somethingnice"></div>
1515
<main>
@@ -102,14 +102,14 @@ <h2>Informationen aus Kartenklient</h2>
102102
</main>
103103
<footer>At solmen va esser necessi far uniform grammatica, pronunciation e plu sommun paroles.</footer>
104104
<!-- Example without build tools. Most frameworks will allow importing this. (Try "* as PolarClientDiPlan".) -->
105-
<script src="../dist/polar-client.js"></script>
105+
<script src="../../dist/polar-client.js"></script>
106106
<!-- → window.PolarClientDiPlan is now available. -->
107-
<link rel="stylesheet" src="../dist/polar-client.css">
107+
<link rel="stylesheet" src="../../dist/polar-client.css">
108108
<script type="module">
109-
import services from './services.js'
109+
import services from '../services.js'
110110
import config from './config.js'
111-
112111
import setup from './setup.js'
112+
113113
setup(PolarClientDiPlan, services, config)
114114
</script>
115115
</body>

0 commit comments

Comments
 (0)