Select to view content in your preferred language

Selected feature's generalized geometry does not recalculate on zoom

306
1
01-03-2023 05:24 AM
ViktorSafar
Occasional Contributor II

JS API v3

When I select a feature on a zoomed-out map and then zoom in, the selected feature still has the generalized geometry from when the map was zoomed out. All other features in the layer get their geometry recalculated. If I unselect the feature and trigger a zoom-end event, the geometry of that feature gets recalculated again. What am I doing wrong?

I have tried to set maxAllowableOffset to 0 on the query used for selection but no change.

ViktorSafar_0-1672751916705.png

This is how I select features:

var query = new Query();
query.geometry = evt.mapPoint;
query.returnGeometry = true;
query.outSpatialReference = theMap.spatialReference
query.maxAllowableOffset = 0;

probedLayer.clearSelection();
probedLayer.selectFeatures(query, FeatureLayer.SELECTION_NEW,
  (features) => {
     mapClickSearchFeaturesResultsHandler(features, probedLayer)
   },
   err => {
     console.log(err);
     debugger;
   })

 

 

0 Kudos
1 Reply
ViktorSafar
Occasional Contributor II

I have made a sample replicating the bug

https://github.com/safarviktor/arcgis-js3-selected-feature-bug

0 Kudos