Hello,
I'm trying to open the feature popup when my map is recieving a message:
window.addEventListener("message", function (event) {
if (event?.data?.type === "external") {
console.log(_getAllFeaturesRecursive(featureLayer,[]));
}
});
By doing this, I know that I need to open my popup...
I was using a function "getAllFeaturesRecursives" that get all the features:
const _getAllFeaturesRecursive = (layer, featuresSoFar) => {
return layer
.queryFeatures({
start: featuresSoFar.length,
num: layer.capabilities.query.maxRecordCount,
outFields: ['*']
})
.then((results) => {
if (
results.exceededTransferLimit &&
results.exceededTransferLimit === true
) {
return _getAllFeaturesRecursive(layer, [
...featuresSoFar,
...results.features
]);
} else {
var p = Promise.resolve([...featuresSoFar, ...results.features]).then((feat) => {
console.log(feat[0]);
feat[0].layer.popupEnabled = false;
feat[0].layer.popupEnabled = true;
});
}
});
};

So I tried to put popupenable to true, but it seems to be true foreach layers...
Do you have any ideas to open the feature popup (with focus) manually (without direct events on the map?)
Thanks 🙂