-
Hello, Previously, in v7, we used the events In my attempt to hook these up, I encountered a problem. In |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Already reported in #4752. You probably can use mobx observables to get out around that. I used a combination of constructor() {
reaction(
() => this.cesiumViewer,
() => this.addUpdateSubscription(),
{
equals: (a, b) => {
return isDefined(b);
}
}
);
reaction(
() => this.leafletViewer,
() => this.addUpdateSubscription(),
{
equals: (a, b) => {
return isDefined(b);
}
}
);
when(
() => isDefined(this.cesiumViewer),
() => this.addUpdateSubscription()
);
when(
() => isDefined(this.leafletViewer),
() => this.addUpdateSubscription()
);
} @computed
get cesiumViewer() {
return this.terria.cesium;
}
@computed
get leafletViewer() {
return this.terria.leaflet;
} Inside |
Beta Was this translation helpful? Give feedback.
Already reported in #4752. You probably can use mobx observables to get out around that. I used a combination of
reaction
andwhen
(not sure why both were needed, long time since it's implemented) to create manual subscribtion to viewer events and it seems to work fine.