Changeset 5172 in ntrip for trunk


Ignore:
Timestamp:
Jun 8, 2013, 12:06:41 PM (11 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/map/html/mapview.js

    r5171 r5172  
     1
    12var map;
    2 var markers= [];
    3 var QtPlaces;
     3var marker;
    44
    5 var searchCircle;
     5function initialize(lat, lon) {
    66
    7 function 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() {} )
     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() {} )
    1725}
    1826
    19 function getCurrentPointOfView() {
    20     return map.getBounds().getCenter().toUrlValue(6);
    21 }
    22 
    23 function removeMarkers()
    24 {
    25     while(markers.length)
    26         markers.pop().setMap(null)
     27function gotoLocation(lat, lon) {
     28  var position = new google.maps.LatLng(lat, lon);
     29  map.setCenter(position);
     30  marker.setPosition(position);
    2731}
    2832
    2933// function appendMarker(jsonObj)
    3034// {
    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 //     });
     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//   });
    3842//
    39 //     google.maps.event.addListener(marker, 'click', function() {
    40 //         QtPlaces.markerClicked( jsonObj['reference'] )
    41 //     });
     43//   google.maps.event.addListener(marker, 'click', function() {
     44//     QtPlaces.markerClicked( jsonObj['reference'] )
     45//   });
    4246//
    43 //     markers.push(marker)
     47//   markers.push(marker)
    4448// }
    4549//
    4650// function gotoPlace(json, zoom)
    4751// {
    48 //     map.setCenter( new google.maps.LatLng( json.geometry.location.lat, json.geometry.location.lng ) )
    49 //     map.setZoom(zoom)
     52//   map.setCenter( new google.maps.LatLng( json.geometry.location.lat, json.geometry.location.lng ) )
     53//   map.setZoom(zoom)
    5054// }
    5155
    52 function gotoLocation( lat, lng, zoom )
    53 {
    54     map.setCenter( new google.maps.LatLng( lat, lng ) )
    55     map.setZoom(zoom)
    56 }
    57 
    58 function 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 TracChangeset for help on using the changeset viewer.