Changeset 5205 in ntrip


Ignore:
Timestamp:
Jun 10, 2013, 4:26:22 PM (8 years ago)
Author:
mervart
Message:
 
File:
1 edited

Legend:

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

    r5204 r5205  
    1717      var map;
    1818      var markers;
     19      var marker;
    1920      var icon; 
    2021      var fromProjection;
     
    4041        icon    = new OpenLayers.Icon("qrc:///map/html/crosshair.png", size, offset);
    4142        markers = new OpenLayers.Layer.Markers("Markers");
    42 
    43         markers.addMarker(new OpenLayers.Marker(position, icon));
     43        marker  = new OpenLayers.Marker(position, icon);
     44        markers.addMarker(marker);
    4445       
    4546        map.addLayer(markers);
     
    5152        var position = new OpenLayers.LonLat(lon, lat).transform(fromProjection, toProjection);
    5253        map.setCenter(position);
     54        markers.removeMarker(marker);
     55        marker = new OpenLayers.Marker(position, icon);
     56        markers.addMarker(marker);
    5357      }
    5458
Note: See TracChangeset for help on using the changeset viewer.