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

Last change on this file since 9045 was 5323, checked in by mervart, 11 years ago
File size: 2.9 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;
[5306]18 var dotColor;
[5250]19 var traceIcon;
[5208]20
[5306]21 function initialize(lat, lon, mapWinDotSize, mapWinDotColor) {
22 dotSize = mapWinDotSize;
23 dotColor = mapWinDotColor;
[5301]24 if (dotSize > 10) dotSize = 10;
[5246]25
[5208]26 var myOptions = {
27 center: new google.maps.LatLng(lat, lon),
[5245]28 zoom: 3,
[5323]29 mapTypeId: google.maps.MapTypeId.SATELLITE,
[5208]30 panControl: true
31 };
32
[5245]33 map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
34 zoom = 0;
35
[5212]36 var image = new google.maps.MarkerImage("qrc:///map/crosshair.png",
[5208]37 null,
38 null,
39 new google.maps.Point(20, 20),
40 new google.maps.Size(40,40)
41 );
[5250]42
[5306]43 if (dotColor == 1) {
44 traceIcon = new google.maps.MarkerImage("qrc:///map/reddot.png",
[5250]45 null,
46 null,
[5313]47 new google.maps.Point(dotSize/2, dotSize/2),
[5297]48 new google.maps.Size(dotSize, dotSize)
[5306]49 );
50 }
51
[5250]52
[5306]53 if (dotColor == 2) {
54 traceIcon = new google.maps.MarkerImage("qrc:///map/yellowdot.png",
55 null,
56 null,
[5316]57 new google.maps.Point(dotSize/2, dotSize/2),
[5306]58 new google.maps.Size(dotSize, dotSize)
59 );
60 }
61
[5208]62 marker = new google.maps.Marker({
63 map: map,
64 position: new google.maps.LatLng(lat, lon),
65 icon: image,
66 });
67 }
68
69 function gotoLocation(lat, lon) {
[5245]70 if (zoom == 0) {
71 zoom = 17;
72 map.setZoom(zoom);
73 }
[5208]74 var position = new google.maps.LatLng(lat, lon);
75 map.setCenter(position);
76 marker.setPosition(position);
[5246]77
[5297]78 if (dotSize > 0) {
[5246]79 var trace = new google.maps.Marker({
80 map: map,
[5256]81 position: position,
[5250]82 icon: traceIcon,
[5246]83 });
84 }
[5208]85 }
86 </script>
87
88 <script type="text/javascript"
89 src="http://maps.googleapis.com/maps/api/js?sensor=false">
90 </script>
91
92 </head>
93 <body>
94 <div id="map_canvas">Waiting for data...</div>
95 </body>
96</html>
Note: See TracBrowser for help on using the repository browser.