[OpenLayers-Users] adding copyright text

Gary Nobles garynobles at yahoo.com
Thu Jun 30 05:50:36 EDT 2011


Hi list, me again, I can never seem to get these things to work by looking at
the examples


I have a layer
provincie_04 = new OpenLayers.Layer.WMS("Provinces",
"http://domain/geoserver/wms", {layers:"provincie_04"},options);

I want to add a copyright statement so I add {'attribution': 'Provided by
Gary'}

If I add this after the options variable I get the text but no map, if its
before the options I get the map but no attribution

I also add the:   map.addControl(new OpenLayers.Control.Attribution());

full (ish) code:

var map;
var options;

        
function init(){
    var bounds = new OpenLayers.Bounds(
        14000, 305900,
        277000, 610500
        );
                //WSEN
    var options = {
        controls: [],
        maxExtent: bounds,
        maxResolution: 1219.2140625,
        projection: "EPSG:28992",
        units: 'm'
        };

    map = new OpenLayers.Map('map', {controls: [
        new OpenLayers.Control.Navigation(),
        new OpenLayers.Control.ArgParser(),
        new OpenLayers.Control.Attribution(),
        new OpenLayers.Control.OverviewMap()
        ]
        }); 

provincie_04 = new OpenLayers.Layer.WMS("Provinces",
"http://domain/geoserver/wms", {layers:"provincie_04"},options);

map.addLayer(provincie_04);



map.addControl(new OpenLayers.Control.Attribution());
}

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/adding-copyright-text-tp6532522p6532522.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.


More information about the Users mailing list