-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnewhtml8.html
More file actions
29 lines (28 loc) · 1.08 KB
/
Copy pathnewhtml8.html
File metadata and controls
29 lines (28 loc) · 1.08 KB
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
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;}
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=13633ae8e4d58d659f2d06f14f81ac0c"></script>
<title>叠加魔兽地图</title>
</head>
<body>
<div id="allmap"></div>
</body>
</html>
<script type="text/javascript">
// 百度地图API功能
var tileLayer = new BMap.TileLayer();
tileLayer.getTilesUrl = function(tileCoord, zoom) {
var x = tileCoord.x;
var y = tileCoord.y;
var url = 'tiles/' + zoom + '/tile' + x + '_' + y + '.png'; //根据当前坐标,选取合适的瓦片图
return url;
};
var MyMap = new BMap.MapType('MyMap', tileLayer, {minZoom: 1, maxZoom: 4});
var map = new BMap.Map('allmap', {mapType: MyMap});
map.addControl(new BMap.NavigationControl({anchor: BMAP_ANCHOR_TOP_RIGHT, type: BMAP_NAVIGATION_CONTROL_SMALL}));
map.centerAndZoom(new BMap.Point(0, 0), 3);
</script>