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

Last change on this file since 5301 was 5301, checked in by weber, 11 years ago

Dot size maximum introduced

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