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

Last change on this file since 5297 was 5297, checked in by weber, 9 years ago

Trace map function modified

File size: 2.4 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 traceIcon;
19
20 function initialize(lat, lon, mapWinSize) {
21 dotSize = mapWinSize;
22
23 var myOptions = {
24 center: new google.maps.LatLng(lat, lon),
25 zoom: 3,
26 mapTypeId: google.maps.MapTypeId.SATELLITE,
27 panControl: true
28 };
29
30 map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
31 zoom = 0;
32
33 var image = new google.maps.MarkerImage("qrc:///map/crosshair.png",
34 null,
35 null,
36 new google.maps.Point(20, 20),
37 new google.maps.Size(40,40)
38 );
39
40 traceIcon = new google.maps.MarkerImage("qrc:///map/reddot.png",
41 null,
42 null,
43 new google.maps.Point(1, 1),
44 new google.maps.Size(dotSize, dotSize)
45 );
46
47 marker = new google.maps.Marker({
48 map: map,
49 position: new google.maps.LatLng(lat, lon),
50 icon: image,
51 });
52 }
53
54 function gotoLocation(lat, lon) {
55 if (zoom == 0) {
56 zoom = 17;
57 map.setZoom(zoom);
58 }
59 var position = new google.maps.LatLng(lat, lon);
60 map.setCenter(position);
61 marker.setPosition(position);
62
63 if (dotSize > 0) {
64 var trace = new google.maps.Marker({
65 map: map,
66 position: position,
67 icon: traceIcon,
68 });
69 }
70 }
71 </script>
72
73 <script type="text/javascript"
74 src="http://maps.googleapis.com/maps/api/js?sensor=false">
75 </script>
76
77 </head>
78 <body>
79 <div id="map_canvas">Waiting for data...</div>
80 </body>
81</html>
Note: See TracBrowser for help on using the repository browser.