From 26ecb78ed51d70a46b1fcb09c2c536e5044e6897 Mon Sep 17 00:00:00 2001 From: bruehlca Date: Mon, 27 Jan 2025 12:02:49 +0100 Subject: [PATCH 01/12] make unselectableStyle optional --- packages/types/custom/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/custom/core.ts b/packages/types/custom/core.ts index 365456883..9a9f2429d 100644 --- a/packages/types/custom/core.ts +++ b/packages/types/custom/core.ts @@ -590,7 +590,7 @@ export interface ExtendedMasterportalapiMarkers { defaultStyle: MarkerStyle hoverStyle: MarkerStyle selectionStyle: MarkerStyle - unselectableStyle: MarkerStyle + unselectableStyle?: MarkerStyle clusterClickZoom?: boolean dispatchOnMapSelect?: string isSelectable?: ExtendedMasterportalapiMarkersIsSelectableFunction From 181c6bfaa21c410eb52ae307e496949ea5b4fae8 Mon Sep 17 00:00:00 2001 From: bruehlca Date: Mon, 27 Jan 2025 12:03:22 +0100 Subject: [PATCH 02/12] edit type for dispatchOnMapSelect --- packages/types/custom/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/custom/core.ts b/packages/types/custom/core.ts index 9a9f2429d..fb2c658ca 100644 --- a/packages/types/custom/core.ts +++ b/packages/types/custom/core.ts @@ -592,7 +592,7 @@ export interface ExtendedMasterportalapiMarkers { selectionStyle: MarkerStyle unselectableStyle?: MarkerStyle clusterClickZoom?: boolean - dispatchOnMapSelect?: string + dispatchOnMapSelect?: [string, any] isSelectable?: ExtendedMasterportalapiMarkersIsSelectableFunction } From 5d02c6fa1e4dfd63cd62cfd88c7e5334909aa1cc Mon Sep 17 00:00:00 2001 From: bruehlca Date: Mon, 27 Jan 2025 12:04:11 +0100 Subject: [PATCH 03/12] edit dispatchOnMapSelect documentation --- packages/core/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/README.md b/packages/core/README.md index 77aac6c89..df6a6faa3 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -183,7 +183,7 @@ To figure out the name of the locales to override, inspect the matching plugin i | layers | string[] | List of layer ids. The effect will only be applied to these layers. | | clusterClickZoom | boolean? | If `true`, clicking a cluster feature will zoom into the clustered features' bounding box (with padding) so that the cluster is "resolved". This happens until the maximum zoom level is reached, at which no further zooming can take place. Defaults to `false`. | | defaultStyle | MarkerStyle? | Used as the default marker style. The default fill color for these markers is `'#005CA9'`. | -| dispatchOnMapSelect | string[]? | If set, the parameters will be spread to dispatchment on map selection. `['target', 'value']` will `dispatch(...['target', 'value'])`. This can be used to open the iconMenu's GFI with `['plugin/iconMenu/openMenuById', 'gfi']`, should the IconMenu exist and the gfi plugin be in it with this id. | +| dispatchOnMapSelect | [string, any]? | If set, the parameters will be spread to dispatchment on map selection. `['target', 'value']` will `dispatch(...['target', 'value'])`. This can be used to open the iconMenu's GFI with `['plugin/iconMenu/openMenuById', 'gfi']`, should the IconMenu exist and the gfi plugin be in it with this id. | | hoverStyle | MarkerStyle? | Used as map marker style for hovered features. The default fill color for these markers is `'#7B1045'`. | | isSelectable | ((feature: GeoJsonFeature) => boolean)? | If undefined, all features are selectable. If defined, this can be used to sort out features to be unselectable, and such features will be styled different and won't react on click. | | selectionStyle | MarkerStyle? | Used as map marker style for selected features. The default fill color for these markers is `'#679100'`. | From 00b3d0755ae4f0c9305f235daf76a9e7aa43b854 Mon Sep 17 00:00:00 2001 From: bruehlca Date: Mon, 27 Jan 2025 12:04:45 +0100 Subject: [PATCH 04/12] make defaultStyle optional --- packages/types/custom/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/custom/core.ts b/packages/types/custom/core.ts index fb2c658ca..05cbd31c9 100644 --- a/packages/types/custom/core.ts +++ b/packages/types/custom/core.ts @@ -587,7 +587,7 @@ export interface MarkerStyle { export interface ExtendedMasterportalapiMarkers { layers: string[] - defaultStyle: MarkerStyle + defaultStyle?: MarkerStyle hoverStyle: MarkerStyle selectionStyle: MarkerStyle unselectableStyle?: MarkerStyle From 77a8d52b71044009844155ee83761e59b4e5e8a9 Mon Sep 17 00:00:00 2001 From: bruehlca Date: Mon, 27 Jan 2025 12:05:25 +0100 Subject: [PATCH 05/12] make hooverStyle optional --- packages/types/custom/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/custom/core.ts b/packages/types/custom/core.ts index 05cbd31c9..0264a9f54 100644 --- a/packages/types/custom/core.ts +++ b/packages/types/custom/core.ts @@ -588,7 +588,7 @@ export interface MarkerStyle { export interface ExtendedMasterportalapiMarkers { layers: string[] defaultStyle?: MarkerStyle - hoverStyle: MarkerStyle + hoverStyle?: MarkerStyle selectionStyle: MarkerStyle unselectableStyle?: MarkerStyle clusterClickZoom?: boolean From cfa787bf3e0c8d1353fee5cf8a8ee1d1d00dddcd Mon Sep 17 00:00:00 2001 From: bruehlca Date: Mon, 27 Jan 2025 12:06:37 +0100 Subject: [PATCH 06/12] make selectionStyle optional --- packages/types/custom/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/custom/core.ts b/packages/types/custom/core.ts index 0264a9f54..82e01b877 100644 --- a/packages/types/custom/core.ts +++ b/packages/types/custom/core.ts @@ -589,7 +589,7 @@ export interface ExtendedMasterportalapiMarkers { layers: string[] defaultStyle?: MarkerStyle hoverStyle?: MarkerStyle - selectionStyle: MarkerStyle + selectionStyle?: MarkerStyle unselectableStyle?: MarkerStyle clusterClickZoom?: boolean dispatchOnMapSelect?: [string, any] From 4dadf22af23106b51b78778f1139b661b688025b Mon Sep 17 00:00:00 2001 From: bruehlca Date: Mon, 27 Jan 2025 12:18:52 +0100 Subject: [PATCH 07/12] update changelog --- packages/types/custom/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/types/custom/CHANGELOG.md b/packages/types/custom/CHANGELOG.md index a866250e2..bfbd69637 100644 --- a/packages/types/custom/CHANGELOG.md +++ b/packages/types/custom/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## unpublished + +- Fix: Make `selectionStyle`, `hooverStyle` and `defaultStyle` optional and edit type for `dispatchOnMapSelect` in interface `ExtendedMasterportalapiMarkers`. + ## 1.5.0 - Feature: Add `selectedCoordinate` to core store getters; it returns `null` or the `selected` feature's point coordinates. From 3d2d91e5f7ac82cb66b0342991ccdbd03f2ac1aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carina=20Br=C3=BChl?= <151126989+jedi-of-the-sea@users.noreply.github.com> Date: Mon, 27 Jan 2025 17:38:17 +0100 Subject: [PATCH 08/12] Update packages/types/custom/CHANGELOG.md Co-authored-by: Dennis Sen <108349707+warm-coolguy@users.noreply.github.com> --- packages/types/custom/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/custom/CHANGELOG.md b/packages/types/custom/CHANGELOG.md index bfbd69637..1b36b9883 100644 --- a/packages/types/custom/CHANGELOG.md +++ b/packages/types/custom/CHANGELOG.md @@ -2,7 +2,7 @@ ## unpublished -- Fix: Make `selectionStyle`, `hooverStyle` and `defaultStyle` optional and edit type for `dispatchOnMapSelect` in interface `ExtendedMasterportalapiMarkers`. +- Fix: Make `selectionStyle`, `hoverStyle`, `defaultStyle` and `unselectableStyle` optional and edit type for `dispatchOnMapSelect` in interface `ExtendedMasterportalapiMarkers`. ## 1.5.0 From 58b540e27ad6ea564428e140dbaea219230a71e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carina=20Br=C3=BChl?= <151126989+jedi-of-the-sea@users.noreply.github.com> Date: Mon, 27 Jan 2025 17:38:33 +0100 Subject: [PATCH 09/12] Update packages/core/README.md Co-authored-by: Dennis Sen <108349707+warm-coolguy@users.noreply.github.com> --- packages/core/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/README.md b/packages/core/README.md index df6a6faa3..ea3cf9b58 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -183,7 +183,7 @@ To figure out the name of the locales to override, inspect the matching plugin i | layers | string[] | List of layer ids. The effect will only be applied to these layers. | | clusterClickZoom | boolean? | If `true`, clicking a cluster feature will zoom into the clustered features' bounding box (with padding) so that the cluster is "resolved". This happens until the maximum zoom level is reached, at which no further zooming can take place. Defaults to `false`. | | defaultStyle | MarkerStyle? | Used as the default marker style. The default fill color for these markers is `'#005CA9'`. | -| dispatchOnMapSelect | [string, any]? | If set, the parameters will be spread to dispatchment on map selection. `['target', 'value']` will `dispatch(...['target', 'value'])`. This can be used to open the iconMenu's GFI with `['plugin/iconMenu/openMenuById', 'gfi']`, should the IconMenu exist and the gfi plugin be in it with this id. | +| dispatchOnMapSelect | [string, unknown]? | If set, the parameters will be spread to dispatchment on map selection. `['target', 'value']` will `dispatch(...['target', 'value'])`. This can be used to open the iconMenu's GFI with `['plugin/iconMenu/openMenuById', 'gfi']`, should the IconMenu exist and the gfi plugin be in it with this id. | | hoverStyle | MarkerStyle? | Used as map marker style for hovered features. The default fill color for these markers is `'#7B1045'`. | | isSelectable | ((feature: GeoJsonFeature) => boolean)? | If undefined, all features are selectable. If defined, this can be used to sort out features to be unselectable, and such features will be styled different and won't react on click. | | selectionStyle | MarkerStyle? | Used as map marker style for selected features. The default fill color for these markers is `'#679100'`. | From 23e205e9e1178c59c6182a8e65a3e5464bed20f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carina=20Br=C3=BChl?= <151126989+jedi-of-the-sea@users.noreply.github.com> Date: Mon, 27 Jan 2025 17:48:30 +0100 Subject: [PATCH 10/12] Update packages/types/custom/core.ts Co-authored-by: Dennis Sen <108349707+warm-coolguy@users.noreply.github.com> --- packages/types/custom/core.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/types/custom/core.ts b/packages/types/custom/core.ts index 82e01b877..e73171d35 100644 --- a/packages/types/custom/core.ts +++ b/packages/types/custom/core.ts @@ -592,7 +592,7 @@ export interface ExtendedMasterportalapiMarkers { selectionStyle?: MarkerStyle unselectableStyle?: MarkerStyle clusterClickZoom?: boolean - dispatchOnMapSelect?: [string, any] + dispatchOnMapSelect?: [string, unknown] isSelectable?: ExtendedMasterportalapiMarkersIsSelectableFunction } From 5d65a92f86da3219e6387f907cd1bcf07b2653bb Mon Sep 17 00:00:00 2001 From: bruehlca Date: Tue, 28 Jan 2025 09:37:58 +0100 Subject: [PATCH 11/12] use ExtendedMasterportalapiMarkers as return type --- .../useExtendedMasterportalapiMarkers/index.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/packages/core/src/vuePlugins/actions/useExtendedMasterportalapiMarkers/index.ts b/packages/core/src/vuePlugins/actions/useExtendedMasterportalapiMarkers/index.ts index 12bf015bd..37efbc4e2 100644 --- a/packages/core/src/vuePlugins/actions/useExtendedMasterportalapiMarkers/index.ts +++ b/packages/core/src/vuePlugins/actions/useExtendedMasterportalapiMarkers/index.ts @@ -2,7 +2,7 @@ import { Feature, MapBrowserEvent } from 'ol' import { CoreGetters, CoreState, - ExtendedMasterportalapiMarkersIsSelectableFunction, + ExtendedMasterportalapiMarkers, MarkerStyle, PolarActionContext, PolarStore, @@ -80,15 +80,7 @@ export function useExtendedMasterportalapiMarkers( layers, clusterClickZoom = false, dispatchOnMapSelect, - }: { - hoverStyle?: MarkerStyle - selectionStyle?: MarkerStyle - unselectableStyle?: MarkerStyle - isSelectable?: ExtendedMasterportalapiMarkersIsSelectableFunction - layers: string[] - clusterClickZoom: boolean - dispatchOnMapSelect?: string[] - } + }: ExtendedMasterportalapiMarkers ) { localSelectionStyle = selectionStyle const { map } = getters From 9728e67ac384eed07360bbcd61d894183eb359df Mon Sep 17 00:00:00 2001 From: bruehlca Date: Tue, 28 Jan 2025 09:41:27 +0100 Subject: [PATCH 12/12] remove comment for suppressing linting error --- .../actions/useExtendedMasterportalapiMarkers/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/core/src/vuePlugins/actions/useExtendedMasterportalapiMarkers/index.ts b/packages/core/src/vuePlugins/actions/useExtendedMasterportalapiMarkers/index.ts index 37efbc4e2..633d97197 100644 --- a/packages/core/src/vuePlugins/actions/useExtendedMasterportalapiMarkers/index.ts +++ b/packages/core/src/vuePlugins/actions/useExtendedMasterportalapiMarkers/index.ts @@ -199,7 +199,6 @@ export function useExtendedMasterportalapiMarkers( setLayerId(map, feature) selected = feature if (dispatchOnMapSelect) { - // @ts-expect-error | May be one or two elements, no fixed tuple. dispatch(...dispatchOnMapSelect) } hovered?.setStyle?.(undefined)