OpenLayers OpenLayers

Changeset 6987

Show
Ignore:
Timestamp:
04/21/08 13:19:31 (5 months ago)
Author:
crschmidt
Message:

Add vector layer to attribution example, to demonstrate explicitly that
sometimes the 'options' hash for a layer is only the second arg, instead
of the third or fourth.

Files:

Legend:

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

    r6497 r6987  
    1212        </style> 
    1313        <script src="../lib/OpenLayers.js"></script> 
     14 
    1415        <script type="text/javascript"> 
    1516            var map; 
     
    2122                    {'attribution': 'Provided by <a href="http://labs.metacarta.com/">MetaCarta</a>'}); 
    2223 
    23             var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic", 
    24                 "http://t1.hypercube.telascience.org/cgi-bin/landsat7",  
    25                 {layers: "landsat7"},{attribution:"Provided by Telascience"}); 
     24                var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic", 
     25                    "http://t1.hypercube.telascience.org/cgi-bin/landsat7",  
     26                    {layers: "landsat7"},{attribution:"Provided by Telascience"}); 
    2627 
    27                 map.addLayers([ol_wms, jpl_wms]); 
     28                var vector = new OpenLayers.Layer.Vector("Simple Geometry", 
     29                              {attribution:"Vector Attibution in 2nd arg"}); 
     30 
     31                map.addLayers([ol_wms, jpl_wms, vector]); 
     32 
    2833                map.addControl(new OpenLayers.Control.LayerSwitcher()); 
    2934                map.addControl(new OpenLayers.Control.Attribution()); 
     
    3742 
    3843        <div id="tags"> 
     44            copyright watermark logo attribution 
    3945        </div> 
    4046 
     
    4854            This is an example of how to add an attribution block to the OpenLayers window.  In order to use an 
    4955            attribution block, an attribution parameter must be set in each layer that requires attribution. In 
    50             addition, an attribution control must be added to the map. 
     56            addition, an attribution control must be added to the map, though one is added to all OpenLayers Maps by default.  
     57            Be aware that this is a layer *option*: the options hash goes in 
     58            different places depending on the layer type you are using.   
    5159        </div> 
    5260    </body>