Skip to content

Commit

Permalink
pre rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
jolevesq committed Jan 17, 2025
1 parent 8250065 commit 91e92e6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 }[];
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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<Geometry>;

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());
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion packages/geoview-core/src/geo/map/feature-highlight.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 91e92e6

Please sign in to comment.