国产久_亚欧精品一区_久久亚洲美女_99精品在线观看_日韩成人三级_久久精品久久久久

顯示源代碼
GIS畫線
 開發文檔
            <!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link  rel='stylesheet' />
    <script src='http://bigemap.com:9000/bigemap-gl.js/v1.1.0/bigemap-gl.js'></script>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
    }

    #container {
        position: absolute;
        top: 0;
        bottom: 0;
        width: 100%;
    }
</style>

<body>
    <div id="container"></div>
    <div id="loadingOverlay">
        <h1>Loading...</h1>
    </div>
</body>
<script>

    bmgl.Config.HTTP_URL = 'http://bigemap.com:9000';
    var viewer = new bmgl.Viewer('container',{mapId: 'bigemap.zhongkexingtu'});
    viewer.clock.shouldAnimate = true;

    //起點經緯度
    var startLatitude = 35;
    var startLongitude = -120;
    var endLongitude;
    //立即執行
    var startTime = bmgl.JulianDate.now();

    // Add a polyline to the scene. Positions are dynamic.
    var isConstant = false;
    //添加線段
    var redLine = viewer.entities.add({
        polyline: {
            // This callback updates positions each frame.
            positions: new bmgl.CallbackProperty(function (time, result) {
                endLongitude =
                    startLongitude +
                    0.001 * bmgl.JulianDate.secondsDifference(time, startTime);
                return bmgl.Cartesian3.fromDegreesArray(
                    [startLongitude, startLatitude, endLongitude, startLatitude],
                    bmgl.Ellipsoid.WGS84,
                    result
                );
            }, isConstant),
            width: 5,
            material: bmgl.Color.RED,
        },
    });

    var startCartographic = bmgl.Cartographic.fromDegrees(
        startLongitude,
        startLatitude
    );

    // use scratch object to avoid new allocations per frame.
    var endCartographic = new bmgl.Cartographic();
    var scratch = new bmgl.Cartographic();
    var geodesic = new bmgl.EllipsoidGeodesic();

    // Calculate the length of the line
    function getLength(time, result) {
        // Get the end position from the polyLine's callback.
        var endPoint = redLine.polyline.positions.getValue(time, result)[1];
        endCartographic = bmgl.Cartographic.fromCartesian(endPoint);

        geodesic.setEndPoints(startCartographic, endCartographic);
        var lengthInMeters = Math.round(geodesic.surfaceDistance);
        return (lengthInMeters / 1000).toFixed(1) + " km";
    }

    function getMidpoint(time, result) {
        // Get the end position from the polyLine's callback.
        var endPoint = redLine.polyline.positions.getValue(time, result)[1];
        endCartographic = bmgl.Cartographic.fromCartesian(endPoint);

        geodesic.setEndPoints(startCartographic, endCartographic);
        var midpointCartographic = geodesic.interpolateUsingFraction(
            0.5,
            scratch
        );
        return bmgl.Cartesian3.fromRadians(
            midpointCartographic.longitude,
            midpointCartographic.latitude
        );
    }

    // Label the polyline with calculated length.
    var label = viewer.entities.add({
        position: new bmgl.CallbackProperty(getMidpoint, isConstant),
        label: {
            // This callback updates the length to print each frame.
            text: new bmgl.CallbackProperty(getLength, isConstant),
            font: "20px sans-serif",
            pixelOffset: new bmgl.Cartesian2(0.0, 20),
        },
    });

    // Keep the view centered.
    viewer.trackedEntity = label;

</script>

</html>                                                                                                                                                        
主站蜘蛛池模板: www.狠狠插| 狠狠色狠狠色综合人人 | 日本理论在线观看 | 欧美日韩国产在线 | 精品日本一区二区 | 欧美日韩成人一区二区 | 7m视频成人精品分类 | 韩日在线| 91精品一区二区中文字幕 | 免费国产一区 | 国产欧美日韩成人 | 少妇一级淫片免费放播放 | xx在线视频 | 亚色影视 | 成人做爰高潮尖叫声免费观看 | 四虎影视成人精品国库在线观看 | 午夜免费视频 | 成人毛片在线免费观看 | 日本免费三片免费观看 | 免费看一级毛片 | 日本中文字幕在线免费观看 | 91久久国产综合久久91精品网 | 欧美日韩成人精品 | 特黄一级视频 | 伊人网在线视频 | 国产特黄一级毛片 | 黄页网站在线看 | 少妇一级淫片免费放播放 | 欧美日韩免费网站 | 亚洲成人免费视频 | 精品免费在线观看 | 亚洲成人www| 日韩电影一区 | 色婷婷久 | 国产视频网站在线观看 | 免费在线看黄 | 日韩精品一区二区三区在线观看视频网站 | 亚洲在线电影 | 国产黄a| 一区小视频| 先锋资源站 |