轨迹运动模拟

可以把轨迹运动理解成一个随时间运动的模型标注

1. 创建标注集

let markers = new Motor.MarkerCollection({
    viewer: viewer,//Motor.Viewer实例
    animated: true,//是否开启动画
    interval: "2019-08-04T04:00:00Z/2019-08-04T04:00:20Z",//动画时间
    loop: true//循环播放
})

2. 添加模型标注

markers.add({
    //标注id
    id: "bus1",
    //标注位置
    position: {
        epoch: "2019-08-04T04:00:00Z",//该标注动画的起始时间
        //轨迹点:时间, 经度, 纬度, 高度...
        cartographicDegrees: [
            0,121.49148382491559,31.28774986949839,-0.28424984806776515,
            1,121.49262290722703,31.287783226923647,-0.27129414132704177,
            2,121.49331654003763,31.28805500024847,-0.26837196930409696,
            3,121.4943079035422,31.288719542508808,-0.2697707060253312,
            4,121.49557311505708,31.289339887459473,-0.2673121624351026,
            5,121.49659217114248,31.289479730690086,-0.2570380171087626,
            6,121.49836191258868,31.289450851001156,-0.2829703838166316,
            7,121.50025747532432,31.289229684923043,-0.26262332573157393,
            8,121.50205953359912,31.288647415896058,-0.29882307489934606,
            9,121.50335254727025,31.288219455522082,-0.2724039340748176,
            10,121.50507724921444,31.287647834660106,-0.23566673187871473,
            11,121.50683781162864,31.286972844909478,-0.2762536064641528,
            12,121.50800866904946,31.286735083124032,-0.2565031116645886,
            13,121.50876947107183,31.286645767524753,-0.2432785522758558,
            14,121.50974749205,31.286753667779532,-0.2340063180670456,
            15,121.51101672544745,31.286994677962596,-0.24906716695172004,
            16,121.51200459177991,31.287239745813153,-0.2423308274437946,
            17,121.51268393692511,31.287399953986945,-0.24925298544630775,
            18,121.51349574543232,31.287574612020506,-0.2412647431451428,
            19,121.51427227444412,31.287810390582987,-0.23598464629859467]
    },
    //标注中的模型文件
    model:{
        gltf:'./assets/data/model/car1.glb',
        scale:10
    },
    //模型的朝向
    orientation:{
        velocityReference:"bus1#position",//设置模型朝向与标注的速度方向一致
    },
    properties:{
        "名称":"黄色出租车",
        "车牌号":"888888"
    }
})