diff --git a/packages/geoview-core/src/geo/layer/gv-layers/raster/gv-esri-dynamic.ts b/packages/geoview-core/src/geo/layer/gv-layers/raster/gv-esri-dynamic.ts index 00b7ddc0915..f1e7b9b7987 100644 --- a/packages/geoview-core/src/geo/layer/gv-layers/raster/gv-esri-dynamic.ts +++ b/packages/geoview-core/src/geo/layer/gv-layers/raster/gv-esri-dynamic.ts @@ -32,8 +32,6 @@ import { TypeEsriImageLayerLegend } from './gv-esri-image'; import { TypeJsonObject } from '@/api/config/types/config-types'; import { FetchEsriWorkerPool } from '@/core/workers/fetch-esri-worker-pool'; import { QueryParams } from '@/core/workers/fetch-esri-worker-script'; -import { Circle, Point } from 'ol/geom'; -import { delay } from '@/core/utils/utilities'; type TypeFieldOfTheSameValue = { value: string | number | Date; nbOccurence: number }; type TypeQueryTree = { fieldValue: string | number | Date; nextField: TypeQueryTree }[]; @@ -368,7 +366,7 @@ export class GVEsriDynamic extends AbstractGVRaster { const oidField = layerConfig.source.featureInfo.outfields ? layerConfig.source.featureInfo.outfields.filter((field) => field.type === 'oid')[0].name : 'OBJECTID'; - const objectIds = identifyJsonResponse.results.map((result: TypeJsonObject) => result.attributes[oidField].replace(',', '')); + const objectIds = identifyJsonResponse.results.map((result: TypeJsonObject) => String(result.attributes[oidField]).replace(',', '')); // Get meters per pixel to set the maxAllowableOffset to simplify return geometry const maxAllowableOffset = queryGeometry ? getMetersPerPixel(mapViewer, lnglat[1]) : 0; @@ -400,19 +398,19 @@ export class GVEsriDynamic extends AbstractGVRaster { this.getFeatureInfoGeometryWorker(layerConfig, objectIds, true, mapViewer.getMapState().currentProjection, maxAllowableOffset) .then((featuresJSON) => { - featuresJSON.features.forEach((feat, index) => { + (featuresJSON.features as unknown as TypeFeatureInfoEntry[]).forEach((feat: TypeFeatureInfoEntry, index: number) => { const geom = new EsriJSON().readFeature(feat, { dataProjection: `EPSG:${mapViewer.getMapState().currentProjection}`, featureProjection: `EPSG:${mapViewer.getMapState().currentProjection}`, }) as Feature; if ( - arrayOfFeatureInfoEntries[index] && - arrayOfFeatureInfoEntries[index].geometry && - arrayOfFeatureInfoEntries[index].geometry instanceof Feature + arrayOfFeatureInfoEntries![index] && + arrayOfFeatureInfoEntries![index].geometry && + arrayOfFeatureInfoEntries![index].geometry instanceof Feature ) { - arrayOfFeatureInfoEntries[index].extent = geom.getGeometry()?.getExtent(); - arrayOfFeatureInfoEntries[index].geometry.setGeometry(geom.getGeometry()); + arrayOfFeatureInfoEntries![index].extent = geom.getGeometry()?.getExtent(); + arrayOfFeatureInfoEntries![index].geometry.setGeometry(geom.getGeometry()); } }); diff --git a/packages/geoview-core/src/geo/layer/layer-sets/hover-feature-info-layer-set.ts b/packages/geoview-core/src/geo/layer/layer-sets/hover-feature-info-layer-set.ts index 3dfdd74927e..9662e2051a4 100644 --- a/packages/geoview-core/src/geo/layer/layer-sets/hover-feature-info-layer-set.ts +++ b/packages/geoview-core/src/geo/layer/layer-sets/hover-feature-info-layer-set.ts @@ -107,7 +107,7 @@ export class HoverFeatureInfoLayerSet extends AbstractLayerSet { // If layer was found if (layer && layer instanceof AbstractGVLayer) { // If state is not queryable - return; // if (!AbstractLayerSet.isStateQueryable(layer)) return; + if (!AbstractLayerSet.isStateQueryable(layer)) return; // Flag processing this.resultSet[layerPath].feature = undefined; diff --git a/packages/geoview-core/src/geo/map/feature-highlight.ts b/packages/geoview-core/src/geo/map/feature-highlight.ts index 298d0e1d5cd..827b9d2215d 100644 --- a/packages/geoview-core/src/geo/map/feature-highlight.ts +++ b/packages/geoview-core/src/geo/map/feature-highlight.ts @@ -185,7 +185,7 @@ export class FeatureHighlight { } } else if (feature.extent) { const { height, width } = feature.featureIcon; - const radius = 7; // Math.min(height, width) / 2 - 2 < 7 ? 7 : Math.min(height, width) / 2 - 2; + const radius = Math.min(height, width) / 2 - 2 < 7 ? 7 : Math.min(height, width) / 2 - 2; const center = getCenter(feature.extent); const newPoint = new Point(center); const newFeature = new Feature(newPoint);