skyline移动端导航– 跳到指定位置
2019-09-26 本文已影响0人
Darshan
例子演示如何跳到指定位置,使用了 ICreator701 (CreatePosition) 和 INavigate701 (JumpTo) 方法。
private void JumpTo() {
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().JumpTo(newYork);
} else {
ISGWorld.getInstance().getNavigate().JumpTo(losAngeles);
}
_evenCall = !_evenCall;
} catch (Exception ex) {
}
}
});
}