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

顯示源代碼
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>                                                                                                                                                        
主站蜘蛛池模板: 国产精品免费综合一区视频 | 欧美一卡2卡三卡4卡5卡免费观看 | 青青青视频蜜桃一区二区 | 黑人日白人 | 国产专区视频在线观看 | 午夜福利在线观看6080 | 初尝黑人巨大h文 | 日本成熟| 四虎影院在线免费观看视频 | 亚州精品永久观看视频 | 国产精品天天看特色大片不卡 | v视界影院成片 | 王小军怎么了最新消息 | 农夫69小说恋老妇小说 | a级毛片毛片免费很很综合 a级黄色视屏 | www.av网站| 我的家教老师 | 亚洲精选在线观看 | 视频在线精品 | 免费看伦理片 | 亚洲日本免费 | 99精品国产综合久久久久 | 国产精品第一区揄拍 | 亚洲视频一区网站 | 韩国美女vip内部2020 | 日韩一级精品视频在线观看 | 18岁的老处女 | 太大了轻点阿受不了小说h 四色6677最新永久网站 | 国产欧美日韩精品高清二区综合区 | 国产三级自拍 | 国语刺激对白勾搭视频在线观看 | 丝袜足控免费网站xx动漫漫画 | 精品一区二区三区免费视频 | 帅小伙和警官同性3p | 国产精品亚洲专区在线播放 | 视频免费观看在线播放高清 | 国产51社区精品视频资源 | 男人日女人p | 美女gif趴跪式抽搐动态图 | 色先锋影音先锋 | 热久久最新地址 |