forked from tomojitakasu/RTKLIB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrtklib_gmap.htm
81 lines (72 loc) · 2.18 KB
/
rtklib_gmap.htm
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
79
80
81
<!------------------------------------------------------------------------------
* rtklib_gmap.htm: rtklib google map view
*
* history: 2013/01/20 1.0 new
*------------------------------------------------------------------------------>
<html>
<head>
<title>RTKLIB_GM</title>
<script src="http://maps.google.com/maps/api/js?v=3&sensor=false"
type="text/javascript" charset="UTF-8"></script>
<script type="text/javascript">
var map = null;
var marks = [];
var markh = null;
var markz = 0;
var info = null;
var icon0="http://maps.google.co.jp/mapfiles/ms/icons/red-dot.png";
var icon1="http://maps.google.co.jp/mapfiles/ms/icons/yellow-dot.png";
function init() {
var opt = {
center: new google.maps.LatLng(0,0),
zoom: 2, minZoom: 2,
streetViewControl: false,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById("map"),opt);
document.getElementById('state').value='1';
}
function ShowHome() {
if (map == null) return;
map.setCenter(new google.maps.LatLng(0,0));
map.setZoom(2);
}
function ClearMark(lat,lon,title) {
for (var i in marks) {
marks[i].setMap(null);
}
marks.length = 0;
markh = null;
}
function AddMark(lat,lon,title,msg) {
var pos = new google.maps.LatLng(lat,lon);
var opt = {map: map, position: pos, title: title, icon: icon1};
var mark = new google.maps.Marker(opt);
google.maps.event.addListener(mark,'click',function(event) {
if (info) {info.close();}
info = new google.maps.InfoWindow({content: msg});
info.open(mark.getMap(),mark);
});
marks.push(mark);
}
function HighlightMark(title) {
if (markh) {
markh.setIcon(icon1);
markh.setZIndex(markz);
}
for (var i in marks) {
if (marks[i].getTitle()==title) {
markz = marks[i].getZIndex();
marks[i].setIcon(icon0);
marks[i].setZIndex(google.maps.Marker.MAX_ZINDEX+1);
markh=marks[i];
}
}
}
</script>
</head>
<body style="margin: 0;"; scroll="no"; onload="init()">
<div id="map" style="height: 100%; width: 100%;"> </div>
<input id="state" type="hidden" value="0">
</body>
</html>