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

顯示源代碼
截屏功能
 開(kāi)發(fā)文檔
            <!DOCTYPE html>

<html>

<head>
    <meta charset='UTF-8' />
    <meta name='viewport' content='initial-scale=1,maximum-scale=1,user-scalable=no' />
    <link  rel='stylesheet' />
    <script src='http://ua.bigemap.com:30081/bmsdk/bigemap-gl.js/v1.1.0/bigemap-gl.js'></script>
    <style>
        body {
            margin: 0;
            padding: 0;
        }

        #container {
            position: absolute;
            top: 0;
            bottom: 0;
            width: 100%;
        }

        .bmgl-widget-credits {
            display: none
        }

        .jietu {
            position: absolute;
            top: 30px;
            right: 100px;
        }
    </style>
    <title>part_test</title>
</head>

<body>
    <div id='container'></div>
    <button class='jietu' onclick="jietu()">截圖</button>
    <script>
        bmgl.Config.HTTP_URL = 'http://ua.bigemap.com:30081/bmsdk/';
        var viewer = new bmgl.Viewer('container', {
            mapId: 'bigemap.dc-satellite',
        });
        viewer.BMWidget.screenSpaceEventHandler.removeInputAction(bmgl.ScreenSpaceEventType.LEFT_CLICK);
       
        var promise = bmgl.GeoJsonDataSource.load('/Public/offline/chad/510000.geojson');
        promise.then(function (dataSource) {
            viewer.dataSources.add(dataSource);
            //Get the array of entities
            var entities = dataSource.entities.values;
            var colorHash = {};
            for (var i = 0; i < entities.length; i++) {
                //For each entity, create a random color based on the state name.
                //Some states have multiple entities, so we store the color in a
                //hash so that we use the same color for the entire state.
                var entity = entities[i];
                var name = entity.name;
                var color = colorHash[name];
                if (!color) {
                    color = bmgl.Color.fromRandom({
                        alpha: 1,
                    });
                    colorHash[name] = color;
                }
                //Set the polygon material to our random color.
                entity.polygon.material = color;
                //Remove the outlines.
                entity.polygon.outline = false;
                //Extrude the polygon based on the state's population.  Each entity
                //stores the properties for the GeoJSON feature it was created from
                //Since the population is a huge number, we divide by 50.
                entity.polygon.extrudedHeight = Math.floor(Math.random() * 600000 + 10000);
            }
            viewer.camera.flyTo({
                destination: bmgl.Cartesian3.fromDegrees(98.435314, 19.960521, 1500000.0), // 設(shè)置位置
                orientation: {
                  heading: bmgl.Math.toRadians(20.0), // 方向
                  pitch: bmgl.Math.toRadians(-50.0),// 傾斜角度
                  roll: bmgl.Math.toRadians(-20.0)
                }
            });
        }).otherwise(function (error) {
            //Display any errrors encountered while loading.
            window.alert(error);
        });

        function jietu() {
            viewer.scene.render()

            var dataUrl = viewer.scene.canvas.toDataURL("image/png");
            var url = dataUrl;
            var a = document.createElement('a');
            var event = new MouseEvent('click');
            a.download = 'map.png';
            a.href = url;
            a.dispatchEvent(event);
        }
    </script>
</body>

</html>                                                                                                                    
主站蜘蛛池模板: 长靴靴虐视频vk| 王瑞儿视频| 浙江卫视周一至周五节目表| 热爱 电影| 星际穿越影评| 社会好全部歌词| 董卿简历| jamie dornan| 湖南金鹰卡通节目表| 竹内纱里奈全部aⅴ在线看| 端午节手抄报一年级| 月亮电影| 译制片《桥》| 陈浩民演的电视剧大全| 会议议程模板| pulp fiction| 洪熙| 成人在线影片| 哈尔的移动城堡免费完整版| 艳女十八式无删除版| 青春之放纵作文免费阅读| 美女写真库| 欧美一级黄色录像| 电影《真爱》完整播放| 婴儿睡眠时间对照表| 复仇者联盟4免费完整版电影| 艳女十八式无删减版| 台湾电视台| 白浩| 视频999| 红日歌词中文谐音歌词| 女人香韩国电影| 小男孩王泓翔唱梨花颂| 凌晨晚餐| 二次元美女放屁| 沙漠里的鱼| 金燕子| 胡凯莉| 年会不能停免费观看完整版电影| 光棍电影| 陈奂生上城|