diff --git a/examples/iceberg/components/IcebergMap.vue b/examples/iceberg/components/IcebergMap.vue index 0282dab3f6..54917b4dd9 100644 --- a/examples/iceberg/components/IcebergMap.vue +++ b/examples/iceberg/components/IcebergMap.vue @@ -30,6 +30,7 @@ import type { PolarContainer } from '@polar/polar' import { addPlugins, getStore, subscribe } from '@polar/polar' import pluginAddressSearch from '@polar/polar/plugins/addressSearch' +import pluginFilter from '@polar/polar/plugins/filter' import pluginFullscreen from '@polar/polar/plugins/fullscreen' import pluginIconMenu from '@polar/polar/plugins/iconMenu' import pluginLayerChooser from '@polar/polar/plugins/layerChooser' @@ -56,6 +57,39 @@ watch(map, (map) => { displayComponent: true, layoutTag: 'TOP_RIGHT', menus: [ + [ + { + plugin: pluginFilter({ + layers: { + 6059: { + categories: [ + { + targetProperty: 'statu', + knownValues: [ + { + key: 'todo', + values: ['In Bearbeitung'], + icon: 'kern-icon--assignment', + }, + { + key: 'done', + values: ['abgeschlossen'], + icon: 'kern-icon--check', + }, + ], + }, + ], + time: { + targetProperty: 'start', + freeSelection: 'until', + last: [7], + pattern: 'YYYYMMDD', + }, + }, + }, + }), + }, + ], [ { plugin: pluginLayerChooser({}), diff --git a/examples/iceberg/stores/iceberg.ts b/examples/iceberg/stores/iceberg.ts index b719113108..eb8ce061df 100644 --- a/examples/iceberg/stores/iceberg.ts +++ b/examples/iceberg/stores/iceberg.ts @@ -64,6 +64,12 @@ export const useIcebergStore = defineStore('iceberg', () => { }, }, }, + { + id: '6059', + visibility: true, + type: 'mask', + name: 'snowbox.layers.mml', + }, ], startCenter: [565874, 5934140], layout: 'nineRegions', @@ -92,6 +98,30 @@ export const useIcebergStore = defineStore('iceberg', () => { displayComponent: true, layoutTag: 'TOP_RIGHT', }, + markers: { + layers: [ + { + id: '6059', + defaultStyle: { + stroke: '#FFFFFF', + fill: '#005CA9', + }, + hoverStyle: { + stroke: '#46688E', + fill: '#8BA1B8', + }, + selectionStyle: { + stroke: '#FFFFFF', + fill: '#E10019', + }, + unselectableStyle: { + stroke: '#FFFFFF', + fill: '#333333', + }, + }, + ], + clusterClickZoom: true, + }, pins: { coordinateSources: [{ plugin: 'addressSearch', key: 'chosenAddress' }], movable: 'drag', diff --git a/examples/iceberg/tsconfig.json b/examples/iceberg/tsconfig.json index 5579210965..4d7d536a36 100644 --- a/examples/iceberg/tsconfig.json +++ b/examples/iceberg/tsconfig.json @@ -8,6 +8,7 @@ "types": [ "vitest/importMeta", "vitest/jsdom", + "node", "../../src/@types/vite-env.d.ts", "../../src/@types/i18next.d.ts", "../../src/@types/pinia.d.ts", diff --git a/examples/snowbox/index.js b/examples/snowbox/index.js index 94510e7bdb..b0ee1be87a 100644 --- a/examples/snowbox/index.js +++ b/examples/snowbox/index.js @@ -8,6 +8,7 @@ import { updateState, } from '@polar/polar' import pluginAddressSearch from '@polar/polar/plugins/addressSearch' +import pluginFilter from '@polar/polar/plugins/filter' import pluginFooter from '@polar/polar/plugins/footer' import pluginFullscreen from '@polar/polar/plugins/fullscreen' import pluginGeoLocation from '@polar/polar/plugins/geoLocation' @@ -182,6 +183,30 @@ const map = await createMap( { type: 'de', resources: { + filter: { + layer: { + [reports]: { + category: { + skat: { + title: 'Schadensart', + knownValue: { + '1xx': 'Alle Wege- und Straßenschäden', + 100: 'Wege und Straßen', + 101: 'Schlagloch und Wegeschaden', + 102: 'Verunreinigung und Vandalismus', + }, + }, + statu: { + title: 'Bearbeitungsstatus', + knownValue: { + todo: 'In Bearbeitung', + done: 'Abgeschlossen', + }, + }, + }, + }, + }, + }, fullscreen: { button: { label_on: 'Mach groß', @@ -336,7 +361,6 @@ addPlugin( }, ], menus: [ - // TODO: Delete the mock plugins including the components once the correct plugins have been implemented [ { plugin: pluginFullscreen({}), @@ -345,6 +369,7 @@ addPlugin( plugin: pluginLayerChooser({}), }, ], + // TODO: Delete the mock plugins including the components once the correct plugins have been implemented [ { plugin: { @@ -355,6 +380,71 @@ addPlugin( icon: 'kern-icon-fill--share', }, ], + [ + { + plugin: pluginFilter({ + layers: { + [reports]: { + categories: [ + { + targetProperty: 'skat', + knownValues: [ + { + key: '100', + values: ['100'], + icon: 'kern-icon--road', + }, + { + key: '101', + values: ['101'], + icon: 'kern-icon--remove-road', + }, + { + key: '102', + values: ['102'], + icon: 'kern-icon--destruction', + }, + ], + selectAll: true, + }, + { + targetProperty: 'skat', + knownValues: [ + { + key: '1xx', + values: ['100', '101', '102'], + icon: 'kern-icon--road', + }, + ], + selectAll: true, + }, + { + targetProperty: 'statu', + knownValues: [ + { + key: 'todo', + values: ['In Bearbeitung'], + icon: 'kern-icon--assignment', + }, + { + key: 'done', + values: ['abgeschlossen'], + icon: 'kern-icon--check', + }, + ], + }, + ], + time: { + targetProperty: 'start', + freeSelection: 'until', + last: [0, 7, 30], + pattern: 'YYYYMMDD', + }, + }, + }, + }), + }, + ], [ { plugin: pluginGeoLocation({ diff --git a/src/architecture.spec.ts b/src/architecture.spec.ts index ff18b41f7a..ef5fba0cf8 100644 --- a/src/architecture.spec.ts +++ b/src/architecture.spec.ts @@ -33,7 +33,7 @@ describe('Architectural checks', () => { .matchingPattern('^plugins/.*$') .should() .matchPattern( - '^plugins/[^/]+/((index|locales|store|types)\\.ts|utils/.*\\.ts|components/.*\\.spec\\.ts)$' + '^plugins/[^/]+/((index|locales|store|types)\\.ts|utils/.*\\.ts|components/.*\\.spec\\.ts|stores/.*\\.ts)$' ) .check() expect(violations).toEqual([]) diff --git a/src/components/PolarCard.ce.vue b/src/components/PolarCard.ce.vue index 885b837c06..4243f49d79 100644 --- a/src/components/PolarCard.ce.vue +++ b/src/components/PolarCard.ce.vue @@ -1,5 +1,5 @@