fix ReplayButton
This commit is contained in:
parent
6eb4831866
commit
71b0025e5a
@ -31,7 +31,11 @@ function CustomFlyTo() {
|
||||
const barotorpic = {
|
||||
destination: Cartesian3.fromDegrees(60, 15, 15000000),
|
||||
duration: 7,
|
||||
complete: () => {},
|
||||
complete: () => {
|
||||
setTimeout(() => {
|
||||
viewer.clock.shouldAnimate = false;
|
||||
}, 3000);
|
||||
},
|
||||
easingFunction: EasingFunction.LINEAR_NONE,
|
||||
orientation: {
|
||||
heading: 6.283,
|
||||
@ -69,7 +73,6 @@ function CustomFlyTo() {
|
||||
cameraFlyToLine();
|
||||
|
||||
useEffect(() => {
|
||||
viewer.clock.shouldAnimate = false;
|
||||
viewer.clock.currentTime = viewer.clock.startTime.clone();
|
||||
cameraFlyToLine();
|
||||
}, [replayVersion]);
|
||||
|
@ -1,14 +1,17 @@
|
||||
import { useCallback } from "react";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { Button } from "antd";
|
||||
import { useCesium } from "resium";
|
||||
import styles from "./index.module.less";
|
||||
|
||||
export default function ReplayButton() {
|
||||
const dispatch = useDispatch();
|
||||
const { viewer } = useCesium();
|
||||
|
||||
const playHandler = useCallback(() => {
|
||||
if (!viewer.clock.shouldAnimate)
|
||||
dispatch.data.update({ replayVersion: Date.now() });
|
||||
}, []);
|
||||
}, [viewer]);
|
||||
|
||||
return (
|
||||
<div className={styles.replayButton}>
|
||||
|
@ -87,6 +87,11 @@ export default function CustomFlyTo() {
|
||||
pitch: -1.3,
|
||||
roll: 0,
|
||||
},
|
||||
complete: () => {
|
||||
setTimeout(() => {
|
||||
viewer.clock.shouldAnimate = false;
|
||||
}, 3000);
|
||||
},
|
||||
easingFunction: EasingFunction.LINEAR_NONE,
|
||||
};
|
||||
|
||||
@ -95,7 +100,6 @@ export default function CustomFlyTo() {
|
||||
cameraFlyToLine();
|
||||
|
||||
useEffect(() => {
|
||||
viewer.clock.shouldAnimate = false;
|
||||
viewer.clock.currentTime = viewer.clock.startTime.clone();
|
||||
cameraFlyToLine();
|
||||
}, [replayVersion]);
|
||||
|
@ -1,14 +1,17 @@
|
||||
import { useCallback } from "react";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { Button } from "antd";
|
||||
import { useCesium } from "resium";
|
||||
import styles from "./index.module.less";
|
||||
|
||||
export default function ReplayButton() {
|
||||
const dispatch = useDispatch();
|
||||
const { viewer } = useCesium();
|
||||
|
||||
const playHandler = useCallback(() => {
|
||||
if (!viewer.clock.shouldAnimate)
|
||||
dispatch.data.update({ replayVersion: Date.now() });
|
||||
}, []);
|
||||
}, [viewer]);
|
||||
|
||||
return (
|
||||
<div className={styles.replayButton}>
|
||||
|
@ -114,6 +114,11 @@ function CustomFlyTo() {
|
||||
roll: -6,
|
||||
},
|
||||
easingFunction: EasingFunction.LINEAR_NONE,
|
||||
complete: () => {
|
||||
setTimeout(() => {
|
||||
viewer.clock.shouldAnimate = false;
|
||||
}, 3000);
|
||||
},
|
||||
};
|
||||
|
||||
camera.flyTo(area1Options);
|
||||
@ -121,7 +126,6 @@ function CustomFlyTo() {
|
||||
cameraFlyToLine();
|
||||
|
||||
useEffect(() => {
|
||||
viewer.clock.shouldAnimate = false;
|
||||
viewer.clock.currentTime = viewer.clock.startTime.clone();
|
||||
cameraFlyToLine();
|
||||
}, [replayVersion]);
|
||||
|
@ -1,14 +1,17 @@
|
||||
import { useCallback } from "react";
|
||||
import { useDispatch } from "react-redux";
|
||||
import { Button } from "antd";
|
||||
import { useCesium } from "resium";
|
||||
import styles from "./index.module.less";
|
||||
|
||||
export default function ReplayButton() {
|
||||
const dispatch = useDispatch();
|
||||
const { viewer } = useCesium();
|
||||
|
||||
const playHandler = useCallback(() => {
|
||||
if (!viewer.clock.shouldAnimate)
|
||||
dispatch.data.update({ replayVersion: Date.now() });
|
||||
}, []);
|
||||
}, [viewer]);
|
||||
|
||||
return (
|
||||
<div className={styles.replayButton}>
|
||||
|
Loading…
x
Reference in New Issue
Block a user