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

BIGEMPA Js API示例中心

圖層適配源代碼展示

代碼編輯區(qū) 運(yùn)行 下載 還原
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <meta
            name="viewport"
            content="initial-scale=1,maximum-scale=1,user-scalable=no"
        />
        <!--
        以下CSS地址請(qǐng)?jiān)诎惭b軟件了替換成本地的地址
        CSS地址請(qǐng)使用:
        http://localhost:9000/bigemap.js/v2.1.0/bigemap.css
        軟件下載地址 http://m.bjxdny.cn/reader/download/detail201802017.html
    -->
        <link
            href="http://m.bjxdny.cn:9000/bigemap.js/v2.1.0/bigemap.css"
            rel="stylesheet"
        />
        <link
            href="http://m.bjxdny.cn/Public/css/button.min.css"
            rel="stylesheet"
        />
        <!--
        JS地址請(qǐng)使用:
        http://localhost:9000/bigemap.js/v2.1.0/bigemap.js
    -->
        <script src="http://m.bjxdny.cn:9000/bigemap.js/v2.1.0/bigemap.js"></script>
        <style>
            body {
                margin: 0;
                padding: 0;
            }
            #map {
                position: absolute;
                top: 0;
                bottom: 0;
                width: 100%;
            }
            .tool {
                position: absolute;
                z-index: 10;
                right: 10px;
                top: 40px;
            }
        </style>
        <title>圖層適配</title>
    </head>
    <body>
        <p class="tool">
            <a
                id="point"
                class="button button-tiny button-rounded button-primary"
                href="javascript:void (0);"
                >適配點(diǎn)</a
            >
            <a
                id="line"
                class="button button-tiny button-rounded button-primary"
                href="javascript:void (0);"
                >適配線</a
            >
            <a
                id="polygon"
                class="button button-tiny button-rounded button-primary"
                href="javascript:void (0);"
                >適配面</a
            >
            <a
                id="all"
                class="button button-tiny button-rounded button-primary"
                href="javascript:void (0);"
                >適配所有</a
            >
        </p>
        <div id="map"></div>
        <script type="text/javascript">
            // 軟件配置信息地址,軟件安裝完成之后使用本地地址,如:http://localhost:9000
            BM.Config.HTTP_URL = "http://m.bjxdny.cn:9000";
            // 在ID為map的元素中實(shí)例化一個(gè)地圖,不要設(shè)置地圖ID,ID號(hào)程序自動(dòng)生成,無(wú)需手動(dòng)配置,設(shè)置中心點(diǎn),默認(rèn)的級(jí)別和顯示級(jí)別控件
            var map = BM.map("map", null, {
                center: [0, 0],
                zoom: 2,
                zoomControl: true,
                attributionControl: false,
                minZoom: 3,
            });
            let marker = BM.marker([60, 104]).addTo(map);
            let line = BM.polyline([
                [30, 102],
                [28, 104],
            ]).addTo(map);
            let polygon = BM.polygon([
                [10, 102],
                [12, 104],
                [20, 100],
            ]).addTo(map);
            // 創(chuàng)建一個(gè)圖層組,可以用于存放點(diǎn),線,面數(shù)據(jù)
            let group = BM.featureGroup();
            var arcgis_satellite = BM.tileLayer("bigemap.zhongkexingtu");
            arcgis_satellite.addTo(map);
            // 適配點(diǎn)
            document
                .querySelector("#point")
                .addEventListener("click", function () {
                    // map.fitBounds(marker.getLatLng());
                    map.setView(marker.getLatLng(), map.getZoom());
                });
            // 適配線
            document
                .querySelector("#line")
                .addEventListener("click", function () {
                    map.fitBounds(line.getBounds());
                });
            //適配面
            document
                .querySelector("#polygon")
                .addEventListener("click", function () {
                    map.fitBounds(polygon.getBounds());
                });
            //適配所有
            document
                .querySelector("#all")
                .addEventListener("click", function () {
                    group.clearLayers();
                    group.addLayer(marker);
                    group.addLayer(line);
                    group.addLayer(polygon);
                    map.fitBounds(group.getBounds());
                });
        </script>
    </body>
</html>
            
主站蜘蛛池模板: 国产日韩欧美在线一二三四 | 亚洲天堂2015 | 国产毛片在线高清视频 | 日韩综合网 | 教室眠催白丝美女校花 | 国产麻豆成91 | 毛片网站免费观看 | 四虎麻豆国产精品 | 青草久久精品亚洲综合专区 | 久久足恋网 | 操到翻白眼 | 亚洲羞羞裸色私人影院 | 视频大全在线观看免费 | 动漫美女强行被吸乳做羞羞事 | 国产区成人综合色在线 | 成人久久18网站 | 千金奴隶在线 | 男人影院在线观看 | 草草免费观看视频在线 | 亚洲视频一区网站 | 免费观看国产大片资源视频 | 无码欧美喷潮福利XXXX | 亚洲看片lutube在线入口 | 日韩欧美在线观看综合网另类 | 国产男技师 | 视频大全在线观看免费 | 学校捏奶揉下面污文h | h卡通第一页 | 精品视频免费在线观看 | 美女全身无遮挡 | 小早川怜子亚洲综合中文字幕 | 亚洲国内精品 | 国产色司机在线视频免费观看 | 国产精品视频一区二区三区不卡 | 93版高校教师 | 久久re6热在线视频 久久AV喷吹AV高潮欧美 | 超级碰碰青草免费视频92 | 出轨同学会免费观看 | 国产精品极品 | 男女乱淫真视频播放网站 | 草莓绿巨人香蕉茄子芭乐 |