zhitong.yu
2024-10-11 eb7075c41933b7d8043a66912631076eed13ae08
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<!DOCTYPE html>
<html lang="zh-CN">
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<head>
    <meta charset="utf-8">
    <title>地面图片叠加层</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <style>
        body,
        html,
        #container {
            overflow: hidden;
            width: 100%;
            height: 100%;
            margin: 0;
            font-family: "微软雅黑";
        }
    </style>
    <script src="//api.map.baidu.com/api?type=webgl&v=1.0&ak=zoVtgLNWuaZBjMAa32RZRFIagXxST0fm&callback"></script>
</head>
<body>
<div id="container"></div>
</body>
</html>
<script>
    var map = new BMapGL.Map('container');
    map.centerAndZoom(new BMapGL.Point(105.852737,37.238682),25);
    map.enableScrollWheelZoom(true);
    map.setDisplayOptions({
        poiText: false,  // 隐藏poi标注
        poiIcon: false,  // 隐藏poi图标
        building: false  // 隐藏楼块
    });
 
 
    var pStart = new BMapGL.Point(105.851133,37.238682);
    var pEnd = new BMapGL.Point(105.852737,37.237923);
    var bounds = new BMapGL.Bounds(new BMapGL.Point(pStart.lng, pEnd.lat), new BMapGL.Point(pEnd.lng, pStart.lat));
    var imgOverlay = new BMapGL.GroundOverlay(bounds, {
        type: 'image',
        url: '一层.png',
        opacity: 1
    });
    map.addOverlay(imgOverlay);
 
 
</script>