[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;
|
---|
[5246] | 17 | var useTrace;
|
---|
[5250] | 18 | var traceIcon;
|
---|
[5208] | 19 |
|
---|
[5246] | 20 | function initialize(lat, lon, trace) {
|
---|
[5208] | 21 |
|
---|
[5246] | 22 | useTrace = trace;
|
---|
| 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),
|
---|
| 45 | new google.maps.Size(2, 2)
|
---|
[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 |
|
---|
| 64 | if (useTrace == 1) {
|
---|
| 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>
|
---|