OpenLayers OpenLayers

Changeset 1204

Show
Ignore:
Timestamp:
08/14/06 17:17:36 (2 years ago)
Author:
euzuro
Message:

cleaning up examples a little bit

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/openlayers/examples/wms.html

    r806 r1204  
    2323            map.addLayer(layer); 
    2424 
    25             markers = new OpenLayers.Layer.Markers("markers"); 
    26             map.addLayer(markers); 
    27  
    2825            map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); 
    2926            map.addControl( new OpenLayers.Control.LayerSwitcher() ); 
    3027        } 
    3128         
    32         function add() { 
    33             var icon = new OpenLayers.Icon('http://boston.openguides.org/markers/AQUA.png',new OpenLayers.Size(10,17)); 
    34             marker = new OpenLayers.Marker(new OpenLayers.LonLat(2, 41), icon); 
    35             markers.addMarker(marker); 
    36         } 
    37  
    38  
    39         function remove() { 
    40             markers.removeMarker(marker); 
    41         } 
    42          
    43  
    4429        // --> 
    4530    </script> 
     
    4732  <body onload="init()"> 
    4833    <div id="map"></div> 
    49     <div style="background-color:green" onclick="add()"> click to add the marker to the map</div> 
    50     <div style="background-color:red" onclick="remove()"> click to remove the marker from the map</div> 
    5134  </body> 
    5235</html>