BIGEMPA Js API示例中心

航拍图离线发布源代码展示

代码编辑区 运行 下载 还原
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8" />
        <meta
            name="viewport"
            content="initial-scale=1,maximum-scale=1,user-scalable=no"
        />
        <link
            href="http://bigemap.com:9000/bigemap.js/v2.1.0/bigemap.css"
            rel="stylesheet"
        />
        <script src="http://bigemap.com:9000/bigemap.js/v2.1.0/bigemap.js"></script>
        <style>
            body {
                margin: 0;
                padding: 0;
            }
            #map {
                position: absolute;
                top: 0;
                bottom: 0;
                width: 100%;
            }
        </style>
        <title>中科星图</title>
    </head>
    <body>
        <div id="map"></div>

        <script>
            BM.Config.HTTP_URL = "http://bigemap.com:9000";
            var overlevel = false;
            var map = BM.map("map", null, {
                center: [23.038867165613535, 113.47956021551684],
                zoom: 16,
                zoomControl: true,
                minZoom: 3,
                maxZoom: 22,
            });
            // 底图图层
            var newMarker = BM.marker(map.getCenter()).addTo(map);
            // 叠加航拍图层
            var baseMap = BM.tileLayer("bigemap.zhongkexingtu").addTo(map);
            baseMap.on("loading", function () {
                // console.log(`11111`);
                var options = { maxNativeZoom: 18, maxZoom: 22,opacity:0.6};
                Object.assign(baseMap.options, options);
            });

            var topMap = BM.tileLayer("bigemap.773nfa3w").addTo(map);

        </script>
    </body>
</html>