iClient3D如何设置飞行路线

0 投票
不通过配置文件,而是通过geoLine3D对象设置路线
12月 29, 2016 分类:  1141次浏览 | 用户: 王大锤 牛刀小试 (204 分)

1个回答

0 投票
首先你需要将三维线获取到节点,然后通过下面的代码

function TestFreeFly()
{
    var  listXY = [{"longitude":114.09533937,"latitude":22.56983689},
        {"longitude":114.09554749,"latitude":22.56959892},
        {"longitude":114.0955031,"latitude":22.56946074},
        {"longitude":114.0954814,"latitude":22.56961318},
        {"longitude":114.09551804,"latitude":22.56963345},
        {"longitude":114.09552056,"latitude":22.56962687}];
    FreeFly(listXY,10);
}
function FreeFly(listXY,speed)
{

    var flyRoutes = flyManager.get_routes();
    var flyRoute = new SuperMap.Web.Realspace.FlyRoute();
    var routestops=flyRoute.get_routeStops();
    for (var m = 0; m < listXY.length; m++) {
        var lon = listXY[m].longitude;
        var alt = scene.getHeight(listXY[m].longitude, listXY[m].latitude);
        var routestop=new SuperMap.Web.Realspace.RouteStop();
        var camera= new SuperMap.Web.Realspace.Camera(listXY[m].longitude, listXY[m].latitude, alt+ 30);
        routestop.set_name("stop"+m);
        routestop.set_camera(camera);
        routestops.add(routestop);
    }

    flyRoute.set_isHeadingFixed(true);
    flyRoute.set_isFlyAlongTheRoute(true);
    // flyRoute.set_isLinesVisible(false);
    //  flyRoute.set_isStopsVisible(false);
    flyRoute.set_speed(speed);
    flyRoutes.add(flyRoute);
    //设置当前飞行路线是否可见
    //flyRoute.set_isLinesVisible();
    //开始飞行
    flyManager.play();
12月 29, 2016 用户: 宋翔 学富五车 (532 分)
...