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 | marker = new google.maps.Marker({
|
---|
17 | map: map,
|
---|
18 | position: new google.maps.LatLng(lat, lon),
|
---|
19 | title: "X",
|
---|
20 | // animation: google.maps.Animation.DROP,
|
---|
21 | // icon: jsonObj.icon
|
---|
22 | });
|
---|
23 |
|
---|
24 | //google.maps.event.addListener(map, "click", function() {} )
|
---|
25 | }
|
---|
26 |
|
---|
27 | function gotoLocation(lat, lon) {
|
---|
28 | var position = new google.maps.LatLng(lat, lon);
|
---|
29 | map.setCenter(position);
|
---|
30 | marker.setPosition(position);
|
---|
31 | }
|
---|
32 |
|
---|
33 | // function appendMarker(jsonObj)
|
---|
34 | // {
|
---|
35 | // var marker = new google.maps.Marker({
|
---|
36 | // position: new google.maps.LatLng( jsonObj.geometry.location.lat, jsonObj.geometry.location.lng ),
|
---|
37 | // map: map,
|
---|
38 | // title: jsonObj.name,
|
---|
39 | // animation: google.maps.Animation.DROP,
|
---|
40 | // icon: jsonObj.icon
|
---|
41 | // });
|
---|
42 | //
|
---|
43 | // google.maps.event.addListener(marker, 'click', function() {
|
---|
44 | // QtPlaces.markerClicked( jsonObj['reference'] )
|
---|
45 | // });
|
---|
46 | //
|
---|
47 | // markers.push(marker)
|
---|
48 | // }
|
---|
49 | //
|
---|
50 | // function gotoPlace(json, zoom)
|
---|
51 | // {
|
---|
52 | // map.setCenter( new google.maps.LatLng( json.geometry.location.lat, json.geometry.location.lng ) )
|
---|
53 | // map.setZoom(zoom)
|
---|
54 | // }
|
---|
55 |
|
---|