Skip to content

Commit

Permalink
Remove repeated drawing of circle and area
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasstein committed Jan 14, 2025
1 parent 0b0fe88 commit 22fe9a2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import { buffer } from "esri/geometry/geometryEngine";
export default class AreaSelectSpatialInputAction {

#binding = undefined;
#geometry = undefined;
#highlighter = undefined;
#serviceResolver = undefined;
#serviceRegistration = undefined;
Expand Down Expand Up @@ -88,9 +87,6 @@ export default class AreaSelectSpatialInputAction {
if (!this._mapWidgetModel) {
reject("MapWidgetModel not available!");
}
if (this.#geometry) {
this.addGraphicToView(this.#geometry);
}

const model = this._areaSelectSpatialInputWidgetModel;
const view = this._mapWidgetModel.get("view");
Expand All @@ -108,7 +104,6 @@ export default class AreaSelectSpatialInputAction {
if (model.buffer !== 0) {
featureGeometry = buffer(featureGeometry, model.buffer, model.unit);
}
this.#geometry = featureGeometry;
if (args.queryBuilderSelection) {
this.closeWidget();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import async from "apprt-core/async";
export default class CircleSpatialInputAction {

#binding = undefined;
#geometry = undefined;
#highlighter = undefined;
#serviceRegistration = undefined;
#bundleContext = undefined;
Expand Down Expand Up @@ -108,9 +107,6 @@ export default class CircleSpatialInputAction {
if (!this._mapWidgetModel) {
reject("MapWidgetModel not available!");
}
if (this.#geometry) {
this.addGraphicToView(this.#geometry);
}

const view = this._mapWidgetModel.get("view");

Expand All @@ -120,7 +116,7 @@ export default class CircleSpatialInputAction {
// prevent popup
evt.stopPropagation();
const point = view.toMap({x: evt.x, y: evt.y});
const circleGeometry = this.#geometry = this.createDonutOrCircle(point);
const circleGeometry = this.createDonutOrCircle(point);
if (args?.queryBuilderSelection) {
this.closeWidget();
} else {
Expand Down

0 comments on commit 22fe9a2

Please sign in to comment.