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