Line | |
---|
1 |
|
---|
2 | var map;
|
---|
3 | var marker;
|
---|
4 |
|
---|
5 | function initialize(lat, lon) {
|
---|
6 |
|
---|
7 | var myOptions = {
|
---|
8 | center: new google.maps.LatLng(lat, lon),
|
---|
9 | zoom: 17,
|
---|
10 | mapTypeId: google.maps.MapTypeId.SATELLITE,
|
---|
11 | panControl: true
|
---|
12 | };
|
---|
13 |
|
---|
14 | map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
|
---|
15 |
|
---|
16 | var image = new google.maps.MarkerImage("qrc:///map/html/crosshair.png",
|
---|
17 | null,
|
---|
18 | new google.maps.Point(0,0),
|
---|
19 | new google.maps.Point(117,117)
|
---|
20 | );
|
---|
21 | marker = new google.maps.Marker({
|
---|
22 | map: map,
|
---|
23 | position: new google.maps.LatLng(lat, lon),
|
---|
24 | icon: image,
|
---|
25 | });
|
---|
26 | }
|
---|
27 |
|
---|
28 | function gotoLocation(lat, lon) {
|
---|
29 | var position = new google.maps.LatLng(lat, lon);
|
---|
30 | map.setCenter(position);
|
---|
31 | marker.setPosition(position);
|
---|
32 | }
|
---|
33 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.