Skip to content

Commit 6b32c32

Browse files
committed
feat: big bang ๐Ÿ’ฅ, but ๐Ÿ‡ผ๐Ÿ‡ฎ๐Ÿ‡ต๐Ÿ› ๏ธ
1 parent 1d95494 commit 6b32c32

91 files changed

Lines changed: 4445 additions & 3238 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

โ€Žeslint.config.tsโ€Ž

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ export default defineConfig([
171171
{
172172
ignores: [
173173
'vue2/',
174+
'src/plugins/draw/old_Draw', // TODO: @doPenguin remind me to delete this :3
174175
'node_modules/',
175176
'docs/assets/',
176177
'docs-html/',

โ€Žexamples/snowbox/index.jsโ€Ž

Lines changed: 112 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import {
99
} from '@polar/polar'
1010
import pluginAddressSearch from '@polar/polar/plugins/addressSearch'
1111
import pluginAttributions from '@polar/polar/plugins/attributions'
12+
import pluginDraw from '@polar/polar/plugins/draw'
1213
import pluginExport from '@polar/polar/plugins/export'
1314
import pluginFilter from '@polar/polar/plugins/filter'
1415
import pluginFullscreen from '@polar/polar/plugins/fullscreen'
@@ -33,6 +34,7 @@ const ausgleichsflaechen = '1454'
3334
const reports = '6059'
3435
const denkmal = 'denkmaelerWMS'
3536
const hamburgBorder = '6074'
37+
const flurstuecke = 'flurstuecke'
3638

3739
let colorScheme = 'light'
3840
// eslint-disable-next-line no-unused-vars
@@ -119,19 +121,25 @@ const map = await createMap(
119121
name: 'Anliegen (MML)',
120122
visibility: false,
121123
},
124+
{
125+
id: flurstuecke,
126+
type: 'mask',
127+
name: 'Flurstรผcke',
128+
visibility: false,
129+
},
122130
{
123131
id: ausgleichsflaechen,
124132
type: 'mask',
125133
name: 'Ausgleichsflรคchen',
126134
styleId: 'panda',
127-
visibility: true,
135+
visibility: false,
128136
minZoom: 5,
129137
},
130138
{
131139
id: denkmal,
132140
type: 'mask',
133141
name: 'Kulturdenkmale',
134-
visibility: true,
142+
visibility: false,
135143
options: {
136144
layers: {
137145
order: '6,24,25,4,3,2,1,0',
@@ -149,6 +157,11 @@ const map = await createMap(
149157
},
150158
},
151159
},
160+
{
161+
id: 'lgv_multipolygons',
162+
type: 'WFS-T',
163+
name: 'LGV WFS-T Multipolygone (P)',
164+
},
152165
],
153166
layout: 'nineRegions',
154167
checkServiceAvailability: true,
@@ -399,7 +412,7 @@ addPlugin(
399412
pluginIconMenu({
400413
displayComponent: true,
401414
layoutTag: 'TOP_RIGHT',
402-
initiallyOpen: 'layerChooser',
415+
initiallyOpen: 'draw',
403416
menus: [
404417
[
405418
{
@@ -474,6 +487,86 @@ addPlugin(
474487
}),
475488
},
476489
],
490+
[
491+
{
492+
plugin: pluginDraw({
493+
// showLoader: true, // defaultValue: true
494+
// showToasts: true, // defaultValue: true
495+
showMeasure: true, // defaultValue: false
496+
showStyling: true, // defaultValue: false
497+
layers: [
498+
{
499+
id: 'localLayer',
500+
name: 'Lokale Zeichenebene',
501+
selectableDrawModes: [
502+
'Point',
503+
'LineString',
504+
'Polygon',
505+
'Circle',
506+
'Text',
507+
],
508+
snapTo: [flurstuecke],
509+
style: {
510+
fill: {
511+
hatch: {
512+
pattern: 'diagonal',
513+
lineWidth: 10,
514+
size: 30,
515+
backgroundColor: [100, 100, 255, 0.5],
516+
patternColor: [255, 255, 255, 1.0],
517+
},
518+
},
519+
stroke: {
520+
color: '#3375d4',
521+
width: 2,
522+
},
523+
imageCircle: {
524+
radius: 7,
525+
fill: {
526+
color: 'rgb(51 117 212 / 100%)',
527+
},
528+
},
529+
},
530+
textStyle: {
531+
font: {
532+
size: [10, 20, 30],
533+
family: 'Consolas',
534+
},
535+
textColor: '#16161D',
536+
},
537+
lassos: [{ id: flurstuecke }],
538+
revision: {
539+
autofix: true,
540+
mergeToMultiGeometries: true,
541+
metaServices: [
542+
{
543+
id: flurstuecke,
544+
propertyNames: [
545+
'land',
546+
'gemarkung',
547+
'regbezirk',
548+
'kreis',
549+
'gemeinde',
550+
],
551+
aggregationMode: 'unequal',
552+
},
553+
],
554+
validate: true,
555+
},
556+
},
557+
558+
/* TODO: support WFS-T layers for selection
559+
{
560+
id: 'lgv_multipolygons',
561+
name: 'LGV WFS-T Multipolygone (P)',
562+
selectableDrawModes: ['MultiPolygon'],
563+
saving: {}, // ยปif ID matches a WFS-T config, we may need some save parameters and then are good to goยซ โ€“ partially copyable from FDB, also use the OL methods provided; please mind that saving (esp. of styles) should be written in an adaptable fashion, i.e. adapters should be planned, since people will make up formats wherever they go
564+
},
565+
*/
566+
],
567+
}),
568+
},
569+
],
477570
[
478571
{
479572
plugin: pluginGeoLocation({
@@ -562,6 +655,22 @@ subscribe(
562655
JSON.stringify(coordinates))
563656
)
564657

658+
subscribe(map, 'draw', 'featureCollection', (featureCollection) =>
659+
// eslint-disable-next-line no-console
660+
console.info(
661+
'Feature Collection was updated: ',
662+
JSON.stringify(featureCollection, null, 2)
663+
)
664+
)
665+
666+
subscribe(map, 'draw', 'revisedFeatureCollection', (revisedFeatureCollection) =>
667+
// eslint-disable-next-line no-console
668+
console.info(
669+
'Revised Feature Collection was updated: ',
670+
JSON.stringify(revisedFeatureCollection, null, 2)
671+
)
672+
)
673+
565674
/* simple language switcher attached for demo purposes;
566675
* language switching is considered a global concern and
567676
* should be handled by the leading application */

โ€Žexamples/snowbox/services.jsโ€Ž

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,4 +86,24 @@ export default [
8686
featureNS: 'http://www.deegree.org/app',
8787
featurePrefix: 'app',
8888
},
89+
{
90+
id: 'flurstuecke',
91+
typ: 'OAF',
92+
name: 'Flurstueck',
93+
url: 'https://api.hamburg.de/datasets/v1/alkis_vereinfacht',
94+
collection: 'Flurstueck',
95+
crs: 'http://www.opengis.net/def/crs/EPSG/0/25832',
96+
bboxCrs: 'http://www.opengis.net/def/crs/EPSG/0/25832',
97+
},
98+
// NOTE: Here be WFS-T ๐Ÿ‰
99+
{
100+
id: 'lgv_multipolygons',
101+
name: 'LGV WFS-T Multipolygone',
102+
url: 'https://masterportal.schulung.deegree.pro/core-services/services/wfstlgv',
103+
typ: 'WFS',
104+
featurePrefix: 'sf',
105+
featureType: 'wfstlgv',
106+
version: '1.1.0',
107+
featureNS: 'http://cite.opengeospatial.org/gmlsf',
108+
},
89109
]

0 commit comments

Comments
ย (0)