suerprisePlus
2024-08-21 7d57b0fef0f220dfe7c868ce1113a7ce6eb6c468
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import WKT from 'terraformer-wkt-parser';
const mapConfig = {
    sertCameraTo(res) {
        earthCtrl.camera.jumpTo({
            destination: {
                x: res.x,
                y: res.y,
                z: res.z,
            },
            orientation: {
                heading:res.heading,
                pitch: res.pitch,
                roll: res.roll,
            },
        });
    },
    userSceneFlyTo(res) {
        const options = {
            duration: 2,
            offset: new SmartEarth.Cesium.HeadingPitchRange(1.0, -0.3, 1000),
        };
        earthCtrl.userScene.flyTo(res, options);
    },
    getModelMatrix(res) {
        var headingPitchRoll = new Cesium.HeadingPitchRoll(res.heading, res.pitch, res.roll);
        var position = Cesium.Cartesian3.fromDegrees(res.longitude, res.latitude, res.altitude);
        var modelMatrix = Cesium.Transforms.headingPitchRollToFixedFrame(position, headingPitchRoll, Cesium.Ellipsoid.WGS84, Cesium.Transforms.eastNorthUpToFixedFrame, new Cesium.Matrix4());
        return modelMatrix;
    },
    getWKTParse(res) {
        return WKT.parse(res);
    },
    getWKTConvert(res) {
        return WKT.convert(res);
    },
};
export default mapConfig;