Query Feature Layer and Highlight the Feature

652
1
04-27-2019 02:49 AM
PavelK1
New Contributor

Hello everyone,

I am having issues adjusting an ESRI example script (see the image below and the link below) in the way, that after the user clicks on one of the census tracts the related feature (census tract) would be highlighted but no popup would be shown.  

Popup opens when view.goTo() is called:

view.goTo(result.geometry.extent.expand(2)).then(function() {
view.popup.open({
features: [result],
location: result.geometry.centroid
});
});

ESRI example code: Query features from a FeatureLayerView:

example Esri: https://developers.arcgis.com/javascript/latest/sample-code/featurelayerview-query/index.html

Link: https://developers.arcgis.com/javascript/latest/sample-code/featurelayerview-query/index.html 

Thank you in advance.

Pavel

Tags (1)
0 Kudos
1 Reply
DavidWilson3
Occasional Contributor

Pavel, 

I could not figure it out myself but I believe if you take a look at this sample code: https://developers.arcgis.com/javascript/latest/sample-code/highlight-features-by-geometry/index.htm... you might find that the answer may be to highlight the result (the feature) in the view.goTo() and to get rid of the view.popup.open.

0 Kudos