This commit is contained in:
Pieter Vander Vennet 2024-01-29 18:14:02 +01:00
parent b0d394797b
commit ad9ca11c10

View file

@ -761,20 +761,9 @@ export default class ThemeViewState implements SpecialVisualizationState {
* Setup various services for which no reference are needed
*/
private initActors() {
// Unselect the selected element if it is panned out of view
this.mapProperties.bounds.stabilized(250).addCallbackD((bounds) => {
const selected = this.selectedElement.data
if (selected === undefined) {
return
}
const bbox = BBox.get(selected)
if (!bbox.overlapsWith(bounds)) {
this.selectedElement.setData(undefined)
}
})
this.selectedElement.addCallback((selected) => {
if (selected === undefined) {
console.trace("Unselected")
// We did _unselect_ an item - we always remove the lastclick-object
this.lastClickObject.features.setData([])
this.selectedLayer.setData(undefined)