Changeset 5247 in ntrip for trunk


Ignore:
Timestamp:
Jun 17, 2013, 10:35:40 AM (11 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/map/map_osm.html

    r5212 r5247  
    2121      var fromProjection;
    2222      var toProjection;
     23      var useTrace;
     24      var zoom;
    2325
    24       function initialize(lat, lon) {
     26      function initialize(lat, lon, trace) {
     27        useTrace = trace;
     28
    2529        map = new OpenLayers.Map("basicMap",
    2630                                 {controls:[
     
    2933        fromProjection = new OpenLayers.Projection("EPSG:4326");   // WGS 1984
    3034        toProjection   = new OpenLayers.Projection("EPSG:900913"); // Spherical Mercator
     35        zoom           = 0;
    3136
    3237        var mapnik   = new OpenLayers.Layer.OSM();
    3338        var position = new OpenLayers.LonLat(lon, lat).transform(fromProjection, toProjection);
    34         var zoom     = 15;
    3539 
    3640        map.addLayer(mapnik);
     
    4650        map.addLayer(markers);
    4751
    48         map.setCenter(position, zoom);
     52        map.setCenter(position, 3);
    4953      }
    5054
    5155      function gotoLocation(lat, lon) {
    5256        var position = new OpenLayers.LonLat(lon, lat).transform(fromProjection, toProjection);
    53         map.setCenter(position);
     57        if (zoom == 0) {
     58          zoom = 15;
     59          map.setCenter(position, zoom);
     60        }
     61        else {
     62          map.setCenter(position);
     63        }
    5464        markers.removeMarker(marker);
    5565        marker = new OpenLayers.Marker(position, icon);
Note: See TracChangeset for help on using the changeset viewer.