From 9b8f0fcc5c5ef3f5b76f7cad4a7ab00d919ed48c Mon Sep 17 00:00:00 2001 From: MatthewMuehlhauserNRCan Date: Tue, 3 Dec 2024 11:39:46 -0500 Subject: [PATCH] Slight adjustments --- .../event-processor-children/map-event-processor.ts | 2 +- packages/geoview-core/src/geo/map/map-viewer.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/geoview-core/src/api/event-processors/event-processor-children/map-event-processor.ts b/packages/geoview-core/src/api/event-processors/event-processor-children/map-event-processor.ts index c437f8c86ed..1ee0931f4be 100644 --- a/packages/geoview-core/src/api/event-processors/event-processor-children/map-event-processor.ts +++ b/packages/geoview-core/src/api/event-processors/event-processor-children/map-event-processor.ts @@ -1057,7 +1057,7 @@ export class MapEventProcessor extends AbstractEventProcessor { let configLayerEntryConfig; if (geoviewLayerConfig) { - configLayerEntryConfig = (geoviewLayerConfig as TypeGeoviewLayerConfig).listOfLayerEntryConfig.find( + configLayerEntryConfig = (geoviewLayerConfig as TypeGeoviewLayerConfig).listOfLayerEntryConfig?.find( (nextEntryConfig: TypeLayerEntryConfig) => nextEntryConfig.layerId === pathArray[1] ); for (let i = 2; i < pathArray.length; i++) { diff --git a/packages/geoview-core/src/geo/map/map-viewer.ts b/packages/geoview-core/src/geo/map/map-viewer.ts index 7f05d9dd76e..9a0d5ee7516 100644 --- a/packages/geoview-core/src/geo/map/map-viewer.ts +++ b/packages/geoview-core/src/geo/map/map-viewer.ts @@ -926,7 +926,7 @@ export class MapViewer { * * @param {TypeDisplayLanguage} displayLanguage - The language to use (en, fr) * @param {boolean} resetLayer - Optional flag to ask viewer to reload layers with the new localize language - * @returns {Promise<[void, void]>} + * @returns {Promise} */ async setLanguage(displayLanguage: TypeDisplayLanguage, reloadLayers?: boolean | false): Promise { // If the language hasn't changed don't do anything @@ -936,7 +936,9 @@ export class MapViewer { // if flag is true, reload GeoCore layers if (reloadLayers) { + // Reload just the Geocore Layers instead of the entire map this.layer.reloadGeocoreLayers(); + // this.reloadWithCurrentState(); } // Emit language changed event