顯示源代碼
                GIS畫線
                 開發(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;
                
                    //起點經(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;
                    //添加線段
                    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>                                                                                                                                                        
                主站蜘蛛池模板: 欧美伊久线香蕉线新在线| 高清在线精品一区二区| 美女扒开尿口让男生捅| 性欧美18-19sex性高清播放 | 日韩精品一区二区三区视频| 偷看农村妇女牲交| 蜜桃视频无码区在线观看| 国产精品情侣呻吟对白视频| yellow字幕网在线| 男人j进入女人j内部免费网站| 国产成人精品午夜视频'| 丰满人妻熟妇乱又伦精品视| 理论亚洲区美一区二区三区| 国产免费一期二期三期四期| 91久久香蕉国产线看| 日韩三级电影在线播放| 亚洲男人的天堂在线播放| 翁虹一级毛片手机观看| 夜夜爽免费888视频| 久久er99热精品一区二区| 欧美乱妇狂野欧美在线视频| 他强行给我开了苞| 国产自产视频在线观看香蕉| 女教师合集乱500篇小说| 久久久久久亚洲精品无码| 男人精品网站一区二区三区| 国产精品伦一区二区三级视频 | 四虎影视永久地址www成人| 免费足恋视频网站女王| 成人国产激情福利久久精品| 久久青草免费91观看| 精品免费久久久久久成人影院| 国产女人乱子对白AV片| 2022麻豆福利午夜久久| 无码av专区丝袜专区| 亚洲综合色成在线播放| 精品欧美一区二区三区久久久| 国产又爽又黄又无遮挡的激情视频| c的你走不了路sb医生| 我把小yi子cao了小说| 亚洲欧美18v中文字幕高清|