标签: webworldwind

WebWorldWind可渲染位置更新

我试图在一段时间内围绕网络世界风地球"移动"可渲染物.为了说明我遇到的问题,我做了一个小例子.

这有效(但效率低下):

    var myVar = setInterval(myTimer, 5000);

    function myTimer() {


        shapesLayer.removeRenderable(shape);
        shape = new WorldWind.SurfaceCircle(new WorldWind.Location(shape.center.latitude+1, shape.center.longitude), 200e3, attributes);
        shapesLayer.addRenderable(shape);

        console.log(" new pos "+shape.center.latitude + " "+shape.center.longitude);

        wwd.redraw();
    }
Run Code Online (Sandbox Code Playgroud)

这是我想做的,但形状不动:

    var myVar = setInterval(myTimer, 5000);

    function myTimer() {

        shape.center = new WorldWind.Location(shape.center.latitude+1, shape.center.longitude);

        console.log(" new pos "+shape.center.latitude + " "+shape.center.longitude);

        wwd.redraw();
    }
Run Code Online (Sandbox Code Playgroud)

我需要在渲染上设置一个标志以使其刷新吗?

下面是完整的SurfaceShapes.js文件我一直在玩(在此基础上http://worldwindserver.net/webworldwind/examples/Sur​​faceShapes.html):

/*
 * Copyright (C) 2014 United States Government as represented by the Administrator of the
 * National Aeronautics and Space Administration. All Rights Reserved. …
Run Code Online (Sandbox Code Playgroud)

javascript worldwind webworldwind

14
推荐指数
1
解决办法
406
查看次数

标签 统计

javascript ×1

webworldwind ×1

worldwind ×1