-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlocalisedPuer.html
More file actions
executable file
·78 lines (65 loc) · 2.33 KB
/
localisedPuer.html
File metadata and controls
executable file
·78 lines (65 loc) · 2.33 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Google Map Offline Demo</title>
<style>
#map_canvas{
background-color: #CCC;
width:100%;
height: 95%;
position: absolute;
bottom:0px;
left:0;
right:0;
top:20;
margin: 0;
padding: 0;
}
</style>
<!-- 離線版 -->
<script type="text/javascript" src="mapapi.js"></script>
<!-- 當然你也可以用線上版的 Lib 配合離線版的圖資 -->
<!-- <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?v=3.exp"></script> -->
<script type="text/javascript">
var map;
var myCenter = new google.maps.LatLng(6.416317, 2.430855);
function CoordMapType() {
}
CoordMapType.prototype.tileSize = new google.maps.Size(256,256);
CoordMapType.prototype.maxZoom = 7;
CoordMapType.prototype.getTile = function(coord, zoom, ownerDocument) {
var div = ownerDocument.createElement('div');
div.innerHTML = '<img name="" src="./scott_tile/gm_' + coord.x +'_'+ coord.y + '_' + zoom + '.png" onerror="errpic(this)"/>';
div.style.width = this.tileSize.width + 'px';
div.style.height = this.tileSize.height + 'px';
div.style.fontSize = '10';
div.style.borderStyle = 'solid';
div.style.borderWidth = '1px';
div.style.borderColor = '#AAAAAA';
return div;
};
//实现更换图片功能
var web_url="./";
function errpic(thepic){
thepic.src=web_url+"undefined.jpg";
}
CoordMapType.prototype.name = "Tile #s";
CoordMapType.prototype.alt = "Tile Coordinate Map Type";
var coordinateMapType = new CoordMapType();
function initialize() {
var mapOptions = {
zoom: 9,
center: myCenter,
mapTypeId: "coordinate"
};
map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
map.mapTypes.set('coordinate',coordinateMapType);
}
</script>
</head>
<body onLoad="initialize()">
<div></div>
<div id="map_canvas"></div>
</body>
</html>