Allow using elements in logo attribution options

This commit lets the user use an element object instead of a {src: href} object for an attribution logo when creating a map. This opens a lot of possibilities for that logo, for example setting the target to force the logo to open in a new tab when clicked.
This commit is contained in:
Samuel Lapointe
2016-04-26 15:30:09 -04:00
parent ed6ac93222
commit 3a1ff59cfb
5 changed files with 47 additions and 5 deletions

View File

@@ -309,6 +309,9 @@ ol.control.Attribution.prototype.insertLogos_ = function(frameState) {
var logoValue = logos[logoKey];
if (logoValue === '') {
logoElement = image;
} else if (goog.dom.isElement(logoValue)) {
goog.asserts.assertElement(logoValue);
logoElement = logoValue;
} else {
logoElement = goog.dom.createDom('A', {
'href': logoValue