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;