| 1 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
|---|
| 2 |
<head> |
|---|
| 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> |
|---|
| 7 |
|
|---|
| 8 |
<script type="text/javascript"> |
|---|
| 9 |
var map; |
|---|
| 10 |
function init(){ |
|---|
| 11 |
map = new OpenLayers.Map('map'); |
|---|
| 12 |
|
|---|
| 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>'}); |
|---|
| 16 |
|
|---|
| 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"}); |
|---|
| 20 |
|
|---|
| 21 |
var vector = new OpenLayers.Layer.Vector("Simple Geometry", |
|---|
| 22 |
{attribution:"Vector Attibution in 2nd arg"}); |
|---|
| 23 |
|
|---|
| 24 |
map.addLayers([ol_wms, jpl_wms, vector]); |
|---|
| 25 |
|
|---|
| 26 |
map.addControl(new OpenLayers.Control.LayerSwitcher()); |
|---|
| 27 |
map.addControl(new OpenLayers.Control.Attribution()); |
|---|
| 28 |
|
|---|
| 29 |
map.zoomToMaxExtent(); |
|---|
| 30 |
} |
|---|
| 31 |
</script> |
|---|
| 32 |
</head> |
|---|
| 33 |
<body onload="init()"> |
|---|
| 34 |
<h1 id="title">Attribution Example</h1> |
|---|
| 35 |
|
|---|
| 36 |
<div id="tags"> |
|---|
| 37 |
copyright watermark logo attribution |
|---|
| 38 |
</div> |
|---|
| 39 |
|
|---|
| 40 |
<p id="shortdesc"> |
|---|
| 41 |
Shows the use of the attribution layer option on a number of layer types. |
|---|
| 42 |
</p> |
|---|
| 43 |
|
|---|
| 44 |
<div id="map" class="smallmap"></div> |
|---|
| 45 |
|
|---|
| 46 |
<div id="docs"> |
|---|
| 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. |
|---|
| 52 |
</div> |
|---|
| 53 |
</body> |
|---|
| 54 |
</html> |
|---|