99} from '@polar/polar'
1010import pluginAddressSearch from '@polar/polar/plugins/addressSearch'
1111import pluginAttributions from '@polar/polar/plugins/attributions'
12+ import pluginDraw from '@polar/polar/plugins/draw'
1213import pluginExport from '@polar/polar/plugins/export'
1314import pluginFilter from '@polar/polar/plugins/filter'
1415import pluginFullscreen from '@polar/polar/plugins/fullscreen'
@@ -33,6 +34,7 @@ const ausgleichsflaechen = '1454'
3334const reports = '6059'
3435const denkmal = 'denkmaelerWMS'
3536const hamburgBorder = '6074'
37+ const flurstuecke = 'flurstuecke'
3638
3739let 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 */
0 commit comments