1 <html xmlns="http://www.w3.org/1999/xhtml">
3 <title>OpenLayers Attribution Example</title>
4 <link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
5 <link rel="stylesheet" href="style.css" type="text/css" />
6 <script src="../lib/OpenLayers.js"></script>
8 <script type="text/javascript">
11 map = new OpenLayers.Map('map');
13 var ol_wms = new OpenLayers.Layer.WMS( "OpenLayers WMS",
14 "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'},
15 {'attribution': 'Provided by <a href="http://labs.metacarta.com/">MetaCarta</a>'});
17 var jpl_wms = new OpenLayers.Layer.WMS( "NASA Global Mosaic",
18 "http://t1.hypercube.telascience.org/cgi-bin/landsat7",
19 {layers: "landsat7"},{attribution:"Provided by Telascience"});
21 var vector = new OpenLayers.Layer.Vector("Simple Geometry",
22 {attribution:"Vector Attibution in 2nd arg"});
24 map.addLayers([ol_wms, jpl_wms, vector]);
26 map.addControl(new OpenLayers.Control.LayerSwitcher());
27 map.addControl(new OpenLayers.Control.Attribution());
28 // map.setCenter(new OpenLayers.LonLat(0, 0), 0);
29 map.zoomToMaxExtent();
33 <body onload="init()">
34 <h1 id="title">Attribution Example</h1>
37 copyright watermark logo attribution
41 Shows the use of the attribution layer option on a number of layer types.
44 <div id="map" class="smallmap"></div>
47 This is an example of how to add an attribution block to the OpenLayers window. In order to use an
48 attribution block, an attribution parameter must be set in each layer that requires attribution. In
49 addition, an attribution control must be added to the map, though one is added to all OpenLayers Maps by default.
50 Be aware that this is a layer *option*: the options hash goes in
51 different places depending on the layer type you are using.