[GIS] Style OpenLayers 3 Attribution Control

attributionconfigurationopenlayers

I'm working on setting up the attributions for a map, and I'm wondering how to access more the styling options for the attribution control.

I've modified the .ol-attribution ul {} css property to display the items in a vertical list (display: table), but the default MapQuest attribution shows up on 3 lines instead of 1. Is this something I can fix? The line below is another layer I have. Also, is there a way to configure where the logos will be placed? I've read documentation but didn't find anything that gets so fine-grained. I also tried overwriting the ol.source.MapQuest({ attribution: …}) with all the same words/links in a single html line, but the stock attribution still shows up.

enter image description here

Also, when the MapQuest layer is removed, it text continues to wrap in a funny way:

enter image description here

Best Answer

You can override the look and feel of ol-attribution class in your CSS. Also you can provide your own CSS class:

var attribution = new ol.control.Attribution({
    className: "yolo"
});

Note that in this case, the ol-attribution class will not be added to the element.

For your problem with list you should not use display:table but display:block on the ul and display:list-item on the li. You will then get a vertical list that behave better.

Related Question