OpenLayers OpenLayers

Changeset 6491

Show
Ignore:
Timestamp:
03/11/08 14:14:18 (6 months ago)
Author:
crschmidt
Message:

Clean up google example.

Files:

Legend:

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

    r6145 r6491  
    4040                         layers: 'factbook', 'format':'png'}, {'reproject': true} ); 
    4141            map.addLayer(twms); 
    42             markers = new OpenLayers.Layer.Markers("markers"); 
    43             map.addLayer(markers); 
    4442 
    4543            map.setCenter(new OpenLayers.LonLat(10.205188,48.857593), 5); 
    4644            map.addControl( new OpenLayers.Control.LayerSwitcher() ); 
    4745            map.addControl( new OpenLayers.Control.PanZoomBar() ); 
    48  
    4946        } 
    50  
    51         function add() { 
    52  
    53             var url = 'http://boston.openguides.org/markers/AQUA.png'; 
    54             var sz = new OpenLayers.Size(10, 17); 
    55             var calculateOffset = function(size) { 
    56                                 return new OpenLayers.Pixel(-(size.w/2), -size.h); 
    57                              }; 
    58             var icon = new OpenLayers.Icon(url, sz, null, calculateOffset); 
    59             var barcelona = new OpenLayers.LonLat(2.13134765625, 
    60                                                   41.37062534198901); 
    61             marker = new OpenLayers.Marker(barcelona, icon); 
    62             markers.addMarker(marker); 
    63         } 
    64  
    65         function remove() { 
    66             markers.removeMarker(marker); 
    67         } 
    68  
    6947    </script> 
    7048  </head> 
     
    7553 
    7654    <p id="shortdesc"> 
    77         Demonstrate a Google basemap used with boundary and marker overlay layers
     55        Demonstrate a Google basemap used with boundary overlay layer
    7856    </p> 
    7957 
    8058    <div id="map"></div> 
    8159 
    82     <div style="width:512px"> 
    83         <div style="background-color:green" onclick="add()"> click to add a marker to the map</div> 
    84         <div style="background-color:red" onclick="remove()"> click to remove the marker from the map</div> 
    85     </div> 
    86  
    8760    <div id="docs"></div> 
    8861  </body>