Skip to content

Commit

Permalink
Build fix
Browse files Browse the repository at this point in the history
#layerSets
  • Loading branch information
Alex-NRCan committed May 28, 2024
1 parent 2371547 commit 8f32474
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 17 deletions.
10 changes: 10 additions & 0 deletions packages/geoview-core/src/core/components/layers/hooks/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ export function useLegendHelpers(): unknown {
layerName: 'TEST--TestLayer1',
type: CONST_LAYER_TYPES.GEOJSON,
layerStatus: 'loaded',
legendQueryStatus: 'queried',
querySent: true,
children: [],
items: layerItems,
Expand All @@ -70,6 +71,7 @@ export function useLegendHelpers(): unknown {
layerName: 'TEST--Layer with groups',
type: CONST_LAYER_TYPES.GEOJSON,
layerStatus: 'loaded',
legendQueryStatus: 'queried',
querySent: true,
children: [],
items: [],
Expand All @@ -81,6 +83,7 @@ export function useLegendHelpers(): unknown {
layerName: 'TEST--chrisparentlayer1',
type: CONST_LAYER_TYPES.GEOJSON,
layerStatus: 'loaded',
legendQueryStatus: 'queried',
querySent: true,
children: [
{
Expand All @@ -90,6 +93,7 @@ export function useLegendHelpers(): unknown {
layerName: 'TEST--chrisparentchild1',
type: CONST_LAYER_TYPES.GEOJSON,
layerStatus: 'loaded',
legendQueryStatus: 'queried',
querySent: true,
children: [
{
Expand All @@ -99,6 +103,7 @@ export function useLegendHelpers(): unknown {
layerName: 'TEST--chris parent child2',
type: CONST_LAYER_TYPES.GEOJSON,
layerStatus: 'error',
legendQueryStatus: 'init',
querySent: true,
children: [],
items: layerItems,
Expand All @@ -110,6 +115,7 @@ export function useLegendHelpers(): unknown {
layerName: 'TEST--chris parent child25555',
type: CONST_LAYER_TYPES.GEOJSON,
layerStatus: 'processing',
legendQueryStatus: 'init',
querySent: true,
children: [],
items: layerItems,
Expand All @@ -121,6 +127,7 @@ export function useLegendHelpers(): unknown {
layerName: 'TEST--chris parent child3',
type: CONST_LAYER_TYPES.GEOJSON,
layerStatus: 'newInstance',
legendQueryStatus: 'init',
querySent: true,
children: [],
items: layerItems,
Expand All @@ -135,6 +142,7 @@ export function useLegendHelpers(): unknown {
layerName: 'TEST--chirslyerss',
type: CONST_LAYER_TYPES.GEOJSON,
layerStatus: 'loaded',
legendQueryStatus: 'queried',
querySent: true,
children: [],
items: layerItems,
Expand All @@ -146,6 +154,7 @@ export function useLegendHelpers(): unknown {
layerName: 'TEST--chris-child32edd',
type: CONST_LAYER_TYPES.GEOJSON,
layerStatus: 'loaded',
legendQueryStatus: 'queried',
querySent: true,
children: [],
items: layerItems,
Expand Down Expand Up @@ -183,6 +192,7 @@ export function useLegendHelpers(): unknown {
layerName: `TEST---${setData.data?.layerName?.en ?? 'Unknown Layer name'}`,
type: setData.data?.type ?? CONST_LAYER_TYPES.IMAGE_STATIC,
layerStatus: setData.layerStatus,
legendQueryStatus: 'queried',
children: [],
items,
};
Expand Down
39 changes: 22 additions & 17 deletions packages/geoview-core/src/geo/layer/layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import { layerConfigIsXYZTiles, XYZTiles } from '@/geo/layer/geoview-layers/rast
import { layerConfigIsVectorTiles, VectorTiles } from '@/geo/layer/geoview-layers/raster/vector-tiles';
import { CSV, layerConfigIsCSV } from '@/geo/layer/geoview-layers/vector/csv';

import { AbstractLayerSet } from '@/geo/layer/layer-sets/abstract-layer-set';
import { HoverFeatureInfoLayerSet } from '@/geo/layer/layer-sets/hover-feature-info-layer-set';
import { AllFeatureInfoLayerSet } from '@/geo/layer/layer-sets/all-feature-info-layer-set';
import { LegendsLayerSet } from '@/geo/layer/layer-sets/legends-layer-set';
Expand Down Expand Up @@ -95,6 +96,24 @@ export class LayerApi {
// order to load layers
initialLayerOrder: Array<TypeOrderedLayerInfo> = [];

// used to access feature and bounding box highlighting
featureHighlight: FeatureHighlight;

// Legends layer set associated to the map
legendsLayerSet: LegendsLayerSet;

// Hover feature info layer set associated to the map
hoverFeatureInfoLayerSet: HoverFeatureInfoLayerSet;

// All feature info layer set associated to the map
allFeatureInfoLayerSet: AllFeatureInfoLayerSet;

// Feature info layer set associated to the map
featureInfoLayerSet: FeatureInfoLayerSet;

// All the layer sets
#allLayerSets: AbstractLayerSet[];

/** Layers with valid configuration for this map. */
#layerEntryConfigs: TypeRegisteredLayers = {};

Expand All @@ -113,21 +132,6 @@ export class LayerApi {
originalOpacity: undefined,
};

// used to access feature and bounding box highlighting
featureHighlight: FeatureHighlight;

// Legends layer set associated to the map
legendsLayerSet: LegendsLayerSet;

// Hover feature info layer set associated to the map
hoverFeatureInfoLayerSet: HoverFeatureInfoLayerSet;

// All feature info layer set associated to the map
allFeatureInfoLayerSet: AllFeatureInfoLayerSet;

// Feature info layer set associated to the map
featureInfoLayerSet: FeatureInfoLayerSet;

// Keep all callback delegates references
#onLayerAddedHandlers: LayerAddedDelegate[] = [];

Expand All @@ -144,6 +148,7 @@ export class LayerApi {
this.hoverFeatureInfoLayerSet = new HoverFeatureInfoLayerSet(this);
this.allFeatureInfoLayerSet = new AllFeatureInfoLayerSet(this);
this.featureInfoLayerSet = new FeatureInfoLayerSet(this);
this.#allLayerSets = [this.legendsLayerSet, this.hoverFeatureInfoLayerSet, this.featureInfoLayerSet, this.allFeatureInfoLayerSet];

this.geometry = new GeometryApi(this.mapViewer);
this.featureHighlight = new FeatureHighlight(this.mapViewer);
Expand Down Expand Up @@ -677,7 +682,7 @@ export class LayerApi {
// });

// Tell the layer sets about it
[this.legendsLayerSet, this.hoverFeatureInfoLayerSet, this.allFeatureInfoLayerSet, this.featureInfoLayerSet].forEach((layerSet) => {
this.#allLayerSets.forEach((layerSet) => {
// Register or Unregister the layer
layerSet.registerOrUnregisterLayer(layerConfig, 'add');
});
Expand Down Expand Up @@ -819,7 +824,7 @@ export class LayerApi {
this.#unregisterFromSwiper(layerConfig);

// Tell the layer sets about it
[this.legendsLayerSet, this.hoverFeatureInfoLayerSet, this.allFeatureInfoLayerSet, this.featureInfoLayerSet].forEach((layerSet) => {
this.#allLayerSets.forEach((layerSet) => {
// Register or Unregister the layer
layerSet.registerOrUnregisterLayer(layerConfig, 'remove');
});
Expand Down

0 comments on commit 8f32474

Please sign in to comment.