When we load a feature layer on map, user needs to click on some graphic of that feature to get it highlighted and open the feature. How can we pass the particular object id to that layer so that the graphic automatically gets highlighted as soon as the feature loads, without user interaction?
Can someone please help?
You can use the popup's open method by passing in the feature you want to highlight.
view.popup.open({
features: [pointGraphic],
location: pointGraphic.geometry
});
Actually this is my feature I am retrieving:
and then when I try this:
view.popup.open({
features:feature,
location:feature.geometry
})
I am getting this error:
Please help me with this.
you need here to pass "centroid" to the location property
view.popup.open({
features:feature,
location:feature.geometry.centroid
})