亚洲动漫在线观看-亚洲动漫第一页-亚洲丁香婷婷-亚洲丶国产丶欧美一区二区三区-亚洲第一综合网站-亚洲第一永久色

顯示源代碼
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://ua.bigemap.com:30081/bmsdk/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://ua.bigemap.com:30081/bmsdk/';
    var viewer = new bmgl.Viewer('container',{mapId: 'bigemap.dc-satellite'});
    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>                                                                                                                                                        
主站蜘蛛池模板: 亚洲AV午夜福利精品香蕉麻豆 | 2021国产精品露脸在线 | 欧美高清乌克兰精品另类 | tolove第一季动画在线看 | 日本人成在线视频免费播放 | 亚洲小视频在线 | 高h喷水荡肉爽文np肉色文 | 国产真实一区二区三区 | 草莓视频榴莲视频 | 成人网址大全 | 日韩欧美不卡视频 | 万域之王动漫在线观看全集免费播放 | 男人搡女人视频免费看 | 手机看片一区二区 | 996免费视频国产在线播放 | 日韩精品一区二区 | 亚欧美色 | www.羞羞视频| 黑人开嫩苞 | 免费黄色片在线观看 | 色吧五月婷婷 | 欧美一级片免费看 | 惩罚狠h调教灌满 | 91视频国产精品 | 欧美日一级片 | 污影院 | 深夜福利影院在线观看 | 人人爱操 | 激情视频激情小说 | 桃花岛在线 | 公交车强校花系列小说 | 久久亚洲伊人 | 亚洲国产成人久久99精品 | lubuntu网页版在线 | 无人知晓小说姜璟免费阅读 | 99ri国产精品| 国产亚洲福利一区二区免费看 | 禁漫H天堂免费A漫 | 91香蕉影院 | 禁忌第一季第3季 | 亚洲 欧美 国产 视频二区 |