diff --git a/packages/geoview-core/src/api/eventProcessors/abstract-event-processor.ts b/packages/geoview-core/src/api/event-processors/abstract-event-processor.ts similarity index 100% rename from packages/geoview-core/src/api/eventProcessors/abstract-event-processor.ts rename to packages/geoview-core/src/api/event-processors/abstract-event-processor.ts diff --git a/packages/geoview-core/src/api/eventProcessors/app-event-processor.ts b/packages/geoview-core/src/api/event-processors/event-processor-children/app-event-processor.ts similarity index 93% rename from packages/geoview-core/src/api/eventProcessors/app-event-processor.ts rename to packages/geoview-core/src/api/event-processors/event-processor-children/app-event-processor.ts index e9abbed665f..2015a1076b7 100644 --- a/packages/geoview-core/src/api/eventProcessors/app-event-processor.ts +++ b/packages/geoview-core/src/api/event-processors/event-processor-children/app-event-processor.ts @@ -1,5 +1,5 @@ import { GeoViewStoreType } from '@/core/stores/geoview-store'; -import { AbstractEventProcessor } from './abstract-event-processor'; +import { AbstractEventProcessor } from '../abstract-event-processor'; import { getGeoViewStore } from '@/core/stores/stores-managers'; import { NotificationDetailsType } from '@/core/types/cgpv-types'; diff --git a/packages/geoview-core/src/api/eventProcessors/feature-info-event-processor.ts b/packages/geoview-core/src/api/event-processors/event-processor-children/feature-info-event-processor.ts similarity index 96% rename from packages/geoview-core/src/api/eventProcessors/feature-info-event-processor.ts rename to packages/geoview-core/src/api/event-processors/event-processor-children/feature-info-event-processor.ts index 73f26bfc4f7..a4a4a2c0b86 100644 --- a/packages/geoview-core/src/api/eventProcessors/feature-info-event-processor.ts +++ b/packages/geoview-core/src/api/event-processors/event-processor-children/feature-info-event-processor.ts @@ -1,5 +1,5 @@ import { GeoViewStoreType } from '@/core/stores/geoview-store'; -import { AbstractEventProcessor } from './abstract-event-processor'; +import { AbstractEventProcessor } from '../abstract-event-processor'; import { EVENT_NAMES } from '@/api/events/event-types'; import { TypeFeatureInfoResultSets, diff --git a/packages/geoview-core/src/api/eventProcessors/legend-event-processor.ts b/packages/geoview-core/src/api/event-processors/event-processor-children/legend-event-processor.ts similarity index 93% rename from packages/geoview-core/src/api/eventProcessors/legend-event-processor.ts rename to packages/geoview-core/src/api/event-processors/event-processor-children/legend-event-processor.ts index 0fe9441cea4..6db9dcab9ed 100644 --- a/packages/geoview-core/src/api/eventProcessors/legend-event-processor.ts +++ b/packages/geoview-core/src/api/event-processors/event-processor-children/legend-event-processor.ts @@ -1,5 +1,5 @@ import { GeoViewStoreType } from '@/core/stores/geoview-store'; -import { AbstractEventProcessor } from './abstract-event-processor'; +import { AbstractEventProcessor } from '../abstract-event-processor'; import { EVENT_NAMES } from '@/api/events/event-types'; import { payloadIsLegendsLayersetUpdated } from '@/api/events/payloads/get-legends-payload'; import { api } from '@/app'; diff --git a/packages/geoview-core/src/api/eventProcessors/map-event-processor.ts b/packages/geoview-core/src/api/event-processors/event-processor-children/map-event-processor.ts similarity index 99% rename from packages/geoview-core/src/api/eventProcessors/map-event-processor.ts rename to packages/geoview-core/src/api/event-processors/event-processor-children/map-event-processor.ts index f612c6ed6d1..e999d88ac29 100644 --- a/packages/geoview-core/src/api/eventProcessors/map-event-processor.ts +++ b/packages/geoview-core/src/api/event-processors/event-processor-children/map-event-processor.ts @@ -3,7 +3,7 @@ import Overlay from 'ol/Overlay'; import { fromLonLat } from 'ol/proj'; import { GeoViewStoreType } from '@/core/stores/geoview-store'; -import { AbstractEventProcessor } from './abstract-event-processor'; +import { AbstractEventProcessor } from '../abstract-event-processor'; import { api, NORTH_POLE_POSITION, TypeClickMarker } from '@/app'; import { CustomAttribution } from '@/geo/utils/custom-attribution'; import { diff --git a/packages/geoview-core/src/api/eventProcessors/index.ts b/packages/geoview-core/src/api/event-processors/index.ts similarity index 62% rename from packages/geoview-core/src/api/eventProcessors/index.ts rename to packages/geoview-core/src/api/event-processors/index.ts index 12f4e44be89..efd88cd6e93 100644 --- a/packages/geoview-core/src/api/eventProcessors/index.ts +++ b/packages/geoview-core/src/api/event-processors/index.ts @@ -1,8 +1,8 @@ -import { AppEventProcessor } from '@/api/eventProcessors/app-event-processor'; -import { FeatureInfoEventProcessor } from '@/api/eventProcessors/feature-info-event-processor'; +import { AppEventProcessor } from '@/api/event-processors/event-processor-children/app-event-processor'; +import { FeatureInfoEventProcessor } from '@/api/event-processors/event-processor-children/feature-info-event-processor'; import { GeoViewStoreType } from '@/core/stores/geoview-store'; -import { LegendEventProcessor } from '@/api/eventProcessors/legend-event-processor'; -import { MapEventProcessor } from '@/api/eventProcessors/map-event-processor'; +import { LegendEventProcessor } from '@/api/event-processors/event-processor-children/legend-event-processor'; +import { MapEventProcessor } from '@/api/event-processors/event-processor-children/map-event-processor'; const appEventProcessor = new AppEventProcessor(); const featureInfoEventProcessor = new FeatureInfoEventProcessor(); diff --git a/packages/geoview-core/src/core/stores/store-interface-and-intial-values/layer-state.ts b/packages/geoview-core/src/core/stores/store-interface-and-intial-values/layer-state.ts index 930b8fdfda0..676a5f817a5 100644 --- a/packages/geoview-core/src/core/stores/store-interface-and-intial-values/layer-state.ts +++ b/packages/geoview-core/src/core/stores/store-interface-and-intial-values/layer-state.ts @@ -108,6 +108,7 @@ export function initializeLayerState(set: TypeSetStore, get: TypeGetStore): ILay layer.allItemsChecked = visibility; layer.isVisible = visibility; } + set({ legendState: { ...get().legendState, @@ -116,7 +117,7 @@ export function initializeLayerState(set: TypeSetStore, get: TypeGetStore): ILay }); }, }, - }; + } as ILayerState; return init; } diff --git a/packages/geoview-core/src/core/stores/store-interface-and-intial-values/map-state.ts b/packages/geoview-core/src/core/stores/store-interface-and-intial-values/map-state.ts index 7953af0a55c..81244c7ea1f 100644 --- a/packages/geoview-core/src/core/stores/store-interface-and-intial-values/map-state.ts +++ b/packages/geoview-core/src/core/stores/store-interface-and-intial-values/map-state.ts @@ -97,7 +97,7 @@ export function initializeMapState(set: TypeSetStore, get: TypeGetStore): IMapSt fixNorth: false, mapLoaded: false, northArrow: false, - northArrowElement: { degreeRotation: '180.0', isNorthVisible: true }, + northArrowElement: { degreeRotation: '180.0', isNorthVisible: true } as TypeNorthArrow, overviewMap: false, overviewMapHideZoom: 0, pointerPosition: undefined, @@ -338,7 +338,7 @@ export function initializeMapState(set: TypeSetStore, get: TypeGetStore): IMapSt api.maps[get().mapId].zoomToExtent(extent, options); }, }, - }; + } as IMapState; return init; } diff --git a/packages/geoview-core/src/core/stores/store-interface-and-intial-values/ui-state.ts b/packages/geoview-core/src/core/stores/store-interface-and-intial-values/ui-state.ts index a105f5cbfce..d7a55feadb1 100644 --- a/packages/geoview-core/src/core/stores/store-interface-and-intial-values/ui-state.ts +++ b/packages/geoview-core/src/core/stores/store-interface-and-intial-values/ui-state.ts @@ -35,7 +35,7 @@ export function initializeUIState(set: TypeSetStore, get: TypeGetStore): IUIStat }); }, }, - }; + } as IUIState; return init; } diff --git a/packages/geoview-core/src/core/stores/stores-managers.ts b/packages/geoview-core/src/core/stores/stores-managers.ts index 0f601000add..ce3acebef7d 100644 --- a/packages/geoview-core/src/core/stores/stores-managers.ts +++ b/packages/geoview-core/src/core/stores/stores-managers.ts @@ -3,7 +3,7 @@ import { useContext } from 'react'; import { create, createStore } from 'zustand'; import { mountStoreDevtool } from 'simple-zustand-devtools'; -import { initializeEventProcessors } from '@/api/eventProcessors'; +import { initializeEventProcessors } from '@/api/event-processors'; import { TypeMapFeaturesConfig } from '../types/global-types'; import { IGeoViewState, GeoViewStoreType, geoViewStoreDefinitionWithSubscribeSelector } from './geoview-store'; import { MapContext } from '@/core/app-start'; diff --git a/packages/geoview-core/src/core/utils/utilities.ts b/packages/geoview-core/src/core/utils/utilities.ts index 27662ed59b0..eb6e64f1142 100644 --- a/packages/geoview-core/src/core/utils/utilities.ts +++ b/packages/geoview-core/src/core/utils/utilities.ts @@ -57,7 +57,7 @@ function _addNotification(mapId: string, type: NotificationType = 'info', messag }; // ? Need to do lazy import, if not viewer crashes (AppEventProcessor.addAppNotification(mapId, notification)); - import('@/api/eventProcessors/app-event-processor').then((mod) => mod.AppEventProcessor.addAppNotification(mapId, notification)); + import('@/api/event-processors/event-processor-children/app-event-processor').then((mod) => mod.AppEventProcessor.addAppNotification(mapId, notification)); } /** diff --git a/packages/geoview-core/src/geo/layer/geoview-layers/abstract-geoview-layers.ts b/packages/geoview-core/src/geo/layer/geoview-layers/abstract-geoview-layers.ts index bd86de709c7..acd45628288 100644 --- a/packages/geoview-core/src/geo/layer/geoview-layers/abstract-geoview-layers.ts +++ b/packages/geoview-core/src/geo/layer/geoview-layers/abstract-geoview-layers.ts @@ -87,7 +87,7 @@ export interface TypeWmsLegend extends Omit { /** * type guard function that redefines a TypeLegend as a TypeImageStaticLegend - * if the event attribute of the verifyIfPayload parameter is valid. The type ascention + * if the type attribute of the verifyIfLegend parameter is valid. The type ascention * applies only to the true block of the if clause. * * @param {TypeLegend} verifyIfLegend object to test in order to determine if the type ascention is valid @@ -101,17 +101,17 @@ export interface TypeImageStaticLegend extends Omit { legend: HTMLCanvasElement; } -const validEvents: TypeGeoviewLayerType[] = ['GeoJSON', 'esriDynamic', 'esriFeature', 'ogcFeature', 'ogcWfs', 'GeoPackage']; +const validVectorLayerLegendTypes: TypeGeoviewLayerType[] = ['GeoJSON', 'esriDynamic', 'esriFeature', 'ogcFeature', 'ogcWfs', 'GeoPackage']; /** * type guard function that redefines a TypeLegend as a TypeVectorLegend - * if the event attribute of the verifyIfPayload parameter is valid. The type ascention + * if the type attribute of the verifyIfLegend parameter is valid. The type ascention * applies only to the true block of the if clause. * * @param {TypeLegend} verifyIfLegend object to test in order to determine if the type ascention is valid * @returns {boolean} returns true if the payload is valid */ export const isVectorLegend = (verifyIfLegend: TypeLegend): verifyIfLegend is TypeVectorLegend => { - return validEvents.includes(verifyIfLegend?.type); + return validVectorLayerLegendTypes.includes(verifyIfLegend?.type); }; export interface TypeVectorLegend extends TypeLegend { diff --git a/packages/geoview-core/src/geo/map/map-viewer.ts b/packages/geoview-core/src/geo/map/map-viewer.ts index d9163682f2f..5d74f6455a1 100644 --- a/packages/geoview-core/src/geo/map/map-viewer.ts +++ b/packages/geoview-core/src/geo/map/map-viewer.ts @@ -46,7 +46,7 @@ import { generateId, getValidConfigFromString } from '@/core/utils/utilities'; import { TypeListOfGeoviewLayerConfig, TypeDisplayLanguage, TypeViewSettings } from '@/geo/map/map-schema-types'; import { TypeMapFeaturesConfig, TypeHTMLElement } from '@/core/types/global-types'; import { layerConfigIsGeoCore } from '@/geo/layer/other/geocore'; -import { MapEventProcessor } from '@/api/eventProcessors/map-event-processor'; +import { MapEventProcessor } from '@/api/event-processors/event-processor-children/map-event-processor'; interface TypeDcoument extends Document { webkitExitFullscreen: () => void; diff --git a/packages/geoview-core/src/geo/utils/feature-info-layer-set.ts b/packages/geoview-core/src/geo/utils/feature-info-layer-set.ts index b6fb2eb6521..6744fdf0858 100644 --- a/packages/geoview-core/src/geo/utils/feature-info-layer-set.ts +++ b/packages/geoview-core/src/geo/utils/feature-info-layer-set.ts @@ -12,7 +12,7 @@ import { } from '@/api/events/payloads'; import { api, getLocalizedValue } from '@/app'; import { LayerSet } from './layer-set'; -import { FeatureInfoEventProcessor } from '@/api/eventProcessors/feature-info-event-processor'; +import { FeatureInfoEventProcessor } from '@/api/event-processors/event-processor-children/feature-info-event-processor'; /** *************************************************************************************************************************** * A class to hold a set of layers associated with an array of TypeArrayOfFeatureInfoEntries. When this class is instantiated, diff --git a/packages/geoview-core/src/geo/utils/utilities.ts b/packages/geoview-core/src/geo/utils/utilities.ts index cf64dc8bedb..1c15bc262f9 100644 --- a/packages/geoview-core/src/geo/utils/utilities.ts +++ b/packages/geoview-core/src/geo/utils/utilities.ts @@ -18,7 +18,7 @@ import { xmlToJson } from '@/core/utils/utilities'; import { TypeLayerEntryConfig, TypeListOfLayerEntryConfig, layerEntryIsGroupLayer } from '@/geo/map/map-schema-types'; import { AbstractGeoViewLayer } from '@/geo/layer/geoview-layers/abstract-geoview-layers'; import { Layer } from '@/geo/layer/layer'; -import { AppEventProcessor } from '@/api/eventProcessors/app-event-processor'; +import { AppEventProcessor } from '@/api/event-processors/event-processor-children/app-event-processor'; import { NORTH_POLE_POSITION } from '@/core/utils/constant'; /**