Fix #1741
This commit is contained in:
parent
b0d394797b
commit
ad9ca11c10
1 changed files with 1 additions and 12 deletions
|
@ -761,20 +761,9 @@ export default class ThemeViewState implements SpecialVisualizationState {
|
||||||
* Setup various services for which no reference are needed
|
* Setup various services for which no reference are needed
|
||||||
*/
|
*/
|
||||||
private initActors() {
|
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) => {
|
this.selectedElement.addCallback((selected) => {
|
||||||
if (selected === undefined) {
|
if (selected === undefined) {
|
||||||
|
console.trace("Unselected")
|
||||||
// We did _unselect_ an item - we always remove the lastclick-object
|
// We did _unselect_ an item - we always remove the lastclick-object
|
||||||
this.lastClickObject.features.setData([])
|
this.lastClickObject.features.setData([])
|
||||||
this.selectedLayer.setData(undefined)
|
this.selectedLayer.setData(undefined)
|
||||||
|
|
Loading…
Reference in a new issue