skyline for mobile(android)

skyline移动端导航– 创建一个飞到动作

2019-09-26  本文已影响0人  Darshan

例子演示如何飞到一个指定的位置。使用了 ICreator701 (CreatePosition) 和 INavigate701 (FlyTo) 方法。

    private void FlyTo() {
        UI.runOnRenderThread(new Runnable() {
            @Override
            public void run() {
                try {
                    // x,y,height, height type, yaw, pitch, roll, distance
                    IPosition newYork = ISGWorld.getInstance().getCreator().CreatePosition(-74, 40.717067, 1000, 0 /* AltitudeTypeCode.ATC_TERRAIN_RELATIVE*/, 0, -45, 0, 0);
                    // x,y,height, height type, yaw, pitch, roll, distance
                    IPosition losAngeles = ISGWorld.getInstance().getCreator().CreatePosition(-118.25, 34.05, 1000, 0 /*AltitudeTypeCode.ATC_TERRAIN_RELATIVE*/, 0, -45, 0, 0);
                    if (_evenCall) {

                        ISGWorld.getInstance().getNavigate().FlyTo(newYork);
                    } else {

                        ISGWorld.getInstance().getNavigate().FlyTo(losAngeles);
                    }
                    _evenCall = !_evenCall;
                } catch (Exception ex) {

                }
            }
        });
    }
上一篇下一篇

猜你喜欢

热点阅读