Closed freezingjune closed 1 year ago
Thanks for the suggestion, I'll be considering this on the next release as soon as possible.
What's the expected timeline for next release?
Here is a quick workaround https://codepen.io/themustafaomar/pen/oNQLXQY
Thanks that works! Can you also add a function to add Region (addRegion)?
For anyone looking to add this feature: Use the following code, it'll add two functions addSelectedRegion and removeSelectedRegion.
map.extend("removeSelectedRegion", function (code) {
for (const key in this.regions) {
if (this.regions[key].element.isSelected) {
if (key === code) {
this.regions[key]
.element.select(false)
}
}
}
})
map.extend("addSelectedRegion", function (code) {
for (const key in this.regions) {
if (key === code) {
this.regions[key]
.element.select(true)
}
}
})
Can you please add support for adding and removing regions individually after the map is initialized?
Currently, the only option is to call clearSelectedRegions() and then add all needed regions again, which causes flickering in the map and scrolls the page as well.