Reduce closure dependency, fix GET issue
This commit is contained in:
@@ -303,15 +303,16 @@ ol.control.Attribution.prototype.insertLogos_ = function(frameState) {
|
||||
|
||||
var image, logoElement, logoKey;
|
||||
for (logoKey in logos) {
|
||||
var logoValue = logos[logoKey];
|
||||
if (logoValue instanceof HTMLElement) {
|
||||
this.logoLi_.appendChild(logoValue);
|
||||
logoElements[logoKey] = logoValue;
|
||||
}
|
||||
if (!(logoKey in logoElements)) {
|
||||
image = new Image();
|
||||
image.src = logoKey;
|
||||
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
|
||||
|
||||
@@ -1490,8 +1490,8 @@ ol.Map.createOptionsInternal = function(options) {
|
||||
var logo = options.logo;
|
||||
if (typeof logo === 'string') {
|
||||
logos[logo] = '';
|
||||
} else if (goog.dom.isElement(logo)) {
|
||||
logos['logo'] = logo;
|
||||
} else if (logo instanceof HTMLElement) {
|
||||
logos[goog.getUid(logo).toString()] = logo;
|
||||
} else if (goog.isObject(logo)) {
|
||||
goog.asserts.assertString(logo.href, 'logo.href should be a string');
|
||||
goog.asserts.assertString(logo.src, 'logo.src should be a string');
|
||||
|
||||
Reference in New Issue
Block a user