source: ntrip/trunk/BNC/src/map/html/mapview.js@ 5171

Last change on this file since 5171 was 5171, checked in by mervart, 11 years ago
File size: 1.7 KB
Line 
1var map;
2var markers= [];
3var QtPlaces;
4
5var searchCircle;
6
7function initialize(x, y)
8{
9 var myOptions = {
10 center: new google.maps.LatLng(x, y),
11 zoom: 17,
12 mapTypeId: google.maps.MapTypeId.SATELLITE,
13 panControl: true
14 };
15 map = new google.maps.Map(document.getElementById("map_canvas"), myOptions)
16 //google.maps.event.addListener(map, "click", function() {} )
17}
18
19function getCurrentPointOfView() {
20 return map.getBounds().getCenter().toUrlValue(6);
21}
22
23function removeMarkers()
24{
25 while(markers.length)
26 markers.pop().setMap(null)
27}
28
29// function appendMarker(jsonObj)
30// {
31// var marker = new google.maps.Marker({
32// position: new google.maps.LatLng( jsonObj.geometry.location.lat, jsonObj.geometry.location.lng ),
33// map: map,
34// title: jsonObj.name,
35// animation: google.maps.Animation.DROP,
36// icon: jsonObj.icon
37// });
38//
39// google.maps.event.addListener(marker, 'click', function() {
40// QtPlaces.markerClicked( jsonObj['reference'] )
41// });
42//
43// markers.push(marker)
44// }
45//
46// function gotoPlace(json, zoom)
47// {
48// map.setCenter( new google.maps.LatLng( json.geometry.location.lat, json.geometry.location.lng ) )
49// map.setZoom(zoom)
50// }
51
52function gotoLocation( lat, lng, zoom )
53{
54 map.setCenter( new google.maps.LatLng( lat, lng ) )
55 map.setZoom(zoom)
56}
57
58function recreateSearchCircle(lat, lng, radius)
59{
60 var searchCircleOptions = {
61 strokeColor: "#000000",
62 strokeOpacity: 0.75,
63 strokeWeight: 1,
64 fillColor: "#000000",
65 fillOpacity: 0.35,
66 map: map,
67 center: new google.maps.LatLng( lat, lng ),
68 radius: radius
69 };
70 searchCircle = new google.maps.Circle(searchCircleOptions);
71}
Note: See TracBrowser for help on using the repository browser.