24 lines
		
	
	
		
			734 B
		
	
	
	
		
			HTML
		
	
	
	
		
		
			
		
	
	
			24 lines
		
	
	
		
			734 B
		
	
	
	
		
			HTML
		
	
	
	
| 
								 | 
							
								<!DOCTYPE html>
							 | 
						||
| 
								 | 
							
								<html>
							 | 
						||
| 
								 | 
							
								<head>
							 | 
						||
| 
								 | 
							
								<meta charset="utf-8">
							 | 
						||
| 
								 | 
							
								<title>自定义地图类型</title>
							 | 
						||
| 
								 | 
							
								<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.2"></script>
							 | 
						||
| 
								 | 
							
								</head>
							 | 
						||
| 
								 | 
							
								<body>
							 | 
						||
| 
								 | 
							
								<div id="map" style="width:800px;height:540px"></div>
							 | 
						||
| 
								 | 
							
								<script type="text/javascript">
							 | 
						||
| 
								 | 
							
								var tileLayer = new BMap.TileLayer();
							 | 
						||
| 
								 | 
							
								tileLayer.getTilesUrl = function(tileCoord, zoom) {
							 | 
						||
| 
								 | 
							
								    var x = tileCoord.x;
							 | 
						||
| 
								 | 
							
								    var y = tileCoord.y;
							 | 
						||
| 
								 | 
							
								    return 'SD1-PC-2023-001/tiles/' + zoom + '/tile-' + x + '_' + y + '.png';
							 | 
						||
| 
								 | 
							
								}
							 | 
						||
| 
								 | 
							
								var MyMap = new BMap.MapType('MyMap', tileLayer, {minZoom: 3, maxZoom: 8});
							 | 
						||
| 
								 | 
							
								var map = new BMap.Map('map', {mapType: MyMap});
							 | 
						||
| 
								 | 
							
								map.addControl(new BMap.NavigationControl());
							 | 
						||
| 
								 | 
							
								map.centerAndZoom(new BMap.Point(0, 0), 8);
							 | 
						||
| 
								 | 
							
								</script>
							 | 
						||
| 
								 | 
							
								</body>
							 | 
						||
| 
								 | 
							
								</html>
							 |