Add link support for source logos

This commit is contained in:
Antoine Abt
2014-07-21 17:27:47 +02:00
parent c1f7db9611
commit ba8077010a
5 changed files with 52 additions and 45 deletions

View File

@@ -1,6 +1,7 @@
goog.provide('ol.renderer.Layer');
goog.require('goog.Disposable');
goog.require('goog.asserts');
goog.require('ol.ImageState');
goog.require('ol.TileRange');
goog.require('ol.TileState');
@@ -160,7 +161,13 @@ ol.renderer.Layer.prototype.updateAttributions =
ol.renderer.Layer.prototype.updateLogos = function(frameState, source) {
var logo = source.getLogo();
if (goog.isDef(logo)) {
frameState.logos[logo] = '';
if (goog.isString(logo)) {
frameState.logos[logo] = '';
} else if (goog.isObject(logo)) {
goog.asserts.assertString(logo.href);
goog.asserts.assertString(logo.src);
frameState.logos[logo.src] = logo.href;
}
}
};