Hello, everyone,
I have a problem in the map that I cannot understand,
I recently upgraded to version 4.29 and had to download all the modules locally,
since then in the map I get that wherever I click a popup opens, whereas before it only opened when I clicked on a single element of a featureLayer, and of course when I click outside an element it opens an empty popup
Is there anything I can do to avoid this behaviour?
or at least that it doesn't open popups if they are empty
thanks in advance
Solved! Go to Solution.
I had the same issue. I wrote this snippet to fix the bug for now -- hopefully it won't be needed in a later release.
I'm not using this fix in production yet and is specific to the popup event loop my map uses (which is a pretty standard one), so definitely test it in your application.
reactiveUtils.watch(
() => view.popup?.viewModel?.active,
(active) => {
if (active && !view.popup.selectedFeature) {
view.closePopup();
}
}
);
i discovered that with my version of angular (15) and consequently also the libraries were not up to date, so i had various problems after having put all the modules locally. i updated angular to version 17, and fixed all the bugs apart from the only error i saw that is known is the zoom's button not working
Could you provide a codepen, github repo, stackblitz, or codesandbox to repro case to look at. It's possible there is data on the map with empty popup template, or some logic in the app to open the popup on click, but not way to tell otherwise.
I had the same issue. I wrote this snippet to fix the bug for now -- hopefully it won't be needed in a later release.
I'm not using this fix in production yet and is specific to the popup event loop my map uses (which is a pretty standard one), so definitely test it in your application.
reactiveUtils.watch(
() => view.popup?.viewModel?.active,
(active) => {
if (active && !view.popup.selectedFeature) {
view.closePopup();
}
}
);
i discovered that with my version of angular (15) and consequently also the libraries were not up to date, so i had various problems after having put all the modules locally. i updated angular to version 17, and fixed all the bugs apart from the only error i saw that is known is the zoom's button not working
mainly the zone.js library was giving problems