7

I have included an OpenLayers.Map in my site per JavaScript:

var map = new OpenLayers.Map();
var mapnik = new OpenLayers.Layer.OSM();
map.addLayer(mapnik);

All works fine. Expect the position of the attribution (OpenStreetMap contributors). Are there any option move the attribution in the lower right corner?

Here is what i got currently: OpenStreetMap example

2 Answers 2

9

You can override the default OL style for this component:

.olControlAttribution {
  left: 5px;
}

You can try this out by going to https://openlayers.org/en/latest/examples/attributions.html and executing the following JS code in your browser's console:

document.getElementsByClassName('olControlAttribution')[0].style.left='5px'
3

Not sure what version is being used in this question but I was using V3 and had to use the following class to change the attribution instead:

.ol-attribution

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.