Skip to content

Commit 1f311a4

Browse files
authored
refactor: disable automatically tack data source clocks (#110)
1 parent 55c538d commit 1f311a4

2 files changed

Lines changed: 3 additions & 28 deletions

File tree

src/engines/Cesium/Feature/Resource/index.tsx

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,6 @@ export default function Resource({
111111
[layer, viewer, onComputedFeatureFetch, type, requestRender],
112112
);
113113

114-
const initialClock = useRef({
115-
start: timelineManagerRef?.current?.timeline?.start,
116-
stop: timelineManagerRef?.current?.timeline?.stop,
117-
current: timelineManagerRef?.current?.timeline?.current,
118-
});
119114
const handleLoad = useCallback(
120115
(ds: DataSource) => {
121116
ds.entities.values.forEach(e =>
@@ -128,28 +123,7 @@ export default function Resource({
128123
});
129124
}),
130125
);
131-
if (!updateClock) {
132-
if (
133-
initialClock.current.current &&
134-
initialClock.current.start &&
135-
initialClock.current.stop
136-
) {
137-
timelineManagerRef?.current?.commit({
138-
cmd: "SET_TIME",
139-
payload: {
140-
start: initialClock.current.start,
141-
stop: initialClock.current.stop,
142-
current: initialClock.current.current,
143-
},
144-
committer: {
145-
source: "featureResource",
146-
id: layer?.id,
147-
},
148-
});
149-
}
150-
return;
151-
}
152-
if (ds.clock) {
126+
if (updateClock && ds.clock) {
153127
timelineManagerRef?.current?.commit({
154128
cmd: "SET_TIME",
155129
payload: {

src/engines/Cesium/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ const Cesium: React.ForwardRefRenderFunction<EngineRef, EngineProps> = (
160160
onMouseMove={mouseEventHandles.mouseMove}
161161
onMouseEnter={mouseEventHandles.mouseEnter}
162162
onMouseLeave={mouseEventHandles.mouseLeave}
163-
onWheel={mouseEventHandles.wheel}>
163+
onWheel={mouseEventHandles.wheel}
164+
automaticallyTrackDataSourceClocks={false}>
164165
<Event onMount={handleMount} onUnmount={handleUnmount} />
165166
<Clock timelineManagerRef={timelineManagerRef} />
166167
<ImageryLayers

0 commit comments

Comments
 (0)