Skip to content

Commit

Permalink
Merge pull request #213 from dymaptic/bug/212_highlighting
Browse files Browse the repository at this point in the history
Clean up and revert bug-causing change to `featureLayerView.ts`
  • Loading branch information
TimPurdum authored Aug 4, 2023
2 parents 0e56901 + f981c67 commit d74ab28
Showing 1 changed file with 8 additions and 27 deletions.
35 changes: 8 additions & 27 deletions src/dymaptic.GeoBlazor.Core/Scripts/featureLayerView.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import FeatureLayerView from "@arcgis/core/views/layers/FeatureLayerView";
import FeatureEffect from "@arcgis/core/layers/support/FeatureEffect";
import FeatureFilter from "@arcgis/core/layers/support/FeatureFilter";
import Query from "@arcgis/core/rest/support/Query";
import {DotNetFeatureSet, DotNetGraphic, DotNetQuery, DotNetFeatureEffect, DotNetFeatureFilter} from "./definitions";
import {buildJsGraphic, buildJsQuery, buildJsFeatureEffect, buildJsFeatureFilter} from "./jsBuilder";
import {DotNetFeatureEffect, DotNetFeatureFilter, DotNetFeatureSet, DotNetGraphic, DotNetQuery} from "./definitions";
import {buildJsFeatureEffect, buildJsFeatureFilter, buildJsQuery} from "./jsBuilder";
import {blazorServer, dotNetRefs, graphicsRefs} from "./arcGisJsInterop";
import Handle = __esri.Handle;
import {buildDotNetGeometry, buildDotNetGraphic, buildDotNetSpatialReference} from "./dotNetBuilder";
import Graphic from "@arcgis/core/Graphic";
import FeatureEffect from "@arcgis/core/layers/support/FeatureEffect";
import FeatureFilter from "@arcgis/core/layers/support/FeatureFilter";
import Handle = __esri.Handle;

export default class FeatureLayerViewWrapper {
private featureLayerView: FeatureLayerView;
Expand All @@ -23,13 +22,11 @@ export default class FeatureLayerViewWrapper {
}

setFeatureEffect(dnfeatureEffect: DotNetFeatureEffect): void {
let featureEffect = buildJsFeatureEffect(dnfeatureEffect);
this.featureLayerView.featureEffect = featureEffect;
this.featureLayerView.featureEffect = buildJsFeatureEffect(dnfeatureEffect) as FeatureEffect;
}

setFilter(dnDeatureFilter: DotNetFeatureFilter): void {
let featureFilter = buildJsFeatureFilter(dnDeatureFilter);
this.featureLayerView.filter = featureFilter;
this.featureLayerView.filter = buildJsFeatureFilter(dnDeatureFilter) as FeatureFilter;
}

setMaximumNumberOfFeatures(maximumNumberOfFeatures: number): void {
Expand All @@ -45,23 +42,7 @@ export default class FeatureLayerViewWrapper {
}

highlight(target: any): Handle {
let graphics: Graphic[] = [];
if (Array.isArray(target)) {
target.forEach(t => {
if (graphicsRefs.hasOwnProperty(t.id)) {
graphics.push(graphicsRefs[t.id]);
} else {
graphics.push(buildJsGraphic(t, null) as Graphic);
}
});
} else {
if (graphicsRefs.hasOwnProperty(target.id)) {
graphics.push(graphicsRefs[target.id]);
} else {
graphics.push(buildJsGraphic(target, null) as Graphic);
}
}
return this.featureLayerView.highlight(graphics);
return this.featureLayerView.highlight(target);
}

async queryExtent(query: DotNetQuery, options: any): Promise<any> {
Expand Down

0 comments on commit d74ab28

Please sign in to comment.