source: ntrip/trunk/BNC/src/map/map_gm.html@ 5322

Last change on this file since 5322 was 5322, checked in by mervart, 11 years ago
File size: 2.9 KB
Line 
1<!DOCTYPE html>
2<html>
3 <head>
4 <meta name="viewport" content="initial-scale=1.0, user-scalable=yes" />
5
6 <style type="text/css">
7 * { margin: 0; padding: 0; }
8 html { width: 100%; height: 100%; }
9 body { width: 100%; height: 100%; }
10 #map_canvas { width: 100%; height: 100%; background-color: gray; }
11 </style>
12
13 <script>
14 var map;
15 var marker;
16 var zoom;
17 var dotSize;
18 var dotColor;
19 var traceIcon;
20
21 function initialize(lat, lon, mapWinDotSize, mapWinDotColor) {
22 dotSize = mapWinDotSize;
23 dotColor = mapWinDotColor;
24 if (dotSize > 10) dotSize = 10;
25
26 var myOptions = {
27 center: new google.maps.LatLng(lat, lon),
28 zoom: 3,
29 panControl: true
30 };
31
32 map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
33 zoom = 0;
34
35 var image = new google.maps.MarkerImage("qrc:///map/crosshair.png",
36 null,
37 null,
38 new google.maps.Point(20, 20),
39 new google.maps.Size(40,40)
40 );
41
42 if (dotColor == 1) {
43 traceIcon = new google.maps.MarkerImage("qrc:///map/reddot.png",
44 null,
45 null,
46 new google.maps.Point(dotSize/2, dotSize/2),
47 new google.maps.Size(dotSize, dotSize)
48 );
49 }
50
51
52 if (dotColor == 2) {
53 traceIcon = new google.maps.MarkerImage("qrc:///map/yellowdot.png",
54 null,
55 null,
56 new google.maps.Point(dotSize/2, dotSize/2),
57 new google.maps.Size(dotSize, dotSize)
58 );
59 }
60
61 marker = new google.maps.Marker({
62 map: map,
63 position: new google.maps.LatLng(lat, lon),
64 icon: image,
65 });
66 }
67
68 function gotoLocation(lat, lon) {
69 if (zoom == 0) {
70 zoom = 17;
71 map.setZoom(zoom);
72 }
73 var position = new google.maps.LatLng(lat, lon);
74 map.setCenter(position);
75 marker.setPosition(position);
76
77 if (dotSize > 0) {
78 var trace = new google.maps.Marker({
79 map: map,
80 position: position,
81 icon: traceIcon,
82 });
83 }
84 }
85 </script>
86
87 <script type="text/javascript"
88 src="http://maps.googleapis.com/maps/api/js?sensor=false">
89 </script>
90
91 </head>
92 <body>
93 <div id="map_canvas">Waiting for data...</div>
94 </body>
95</html>
Note: See TracBrowser for help on using the repository browser.