婷婷久久网-婷婷久久久久-婷婷久久久-婷婷久-国产微拍精品一区-国产网址在线观看

顯示源代碼
GIS畫(huà)線(xiàn)
 開(kāi)發(fā)文檔
            <!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;

    //起點(diǎn)經(jīng)緯度
    var startLatitude = 35;
    var startLongitude = -120;
    var endLongitude;
    //立即執(zhí)行
    var startTime = bmgl.JulianDate.now();

    // Add a polyline to the scene. Positions are dynamic.
    var isConstant = false;
    //添加線(xiàn)段
    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>                                                                                                                                                        
主站蜘蛛池模板: 告别信| 尹丽川| 在爱的名义下| 家庭理论电影| 高嘉慧| 欧美一级大胆视频| 四年级下册绿| 卖梦的两人| cctv17农业农村频道在线直播| 猛鬼差馆 电影| 电影白蛇传| 杨采钰电影| 《平凡之路》电影| 张俪作品| 案例分析100例| 拔萝卜电影| 女人香韩国电影| lanarhoades最经典电影| 黄姓的研究报告| 杨新鸣| 卧虎演员表| 神迹电影| 汤唯和梁朝伟拍戏原版视频在线观看| 住院吸氧是一天24小时算钱吗| 朱敏荷为艺术贡献的电影| 法证先锋2| 十一码复式22块钱中奖对照表| 杨门女将一级裸片免费观看| 高奇| 琉璃演员表全部演员介绍| 游泳池电影| 新生儿满月长几斤正常| 巴黎最后的探戈| 日本大片ppt免费ppt电影| 飞头魔女电影完整版免费观看| 极度俏郎君 电视剧| 四川经济频道节目表| 《魔鬼天使》电影| 免费头像图片| 买买提个人资料简历| 李洋演员|