Add link support for source logos
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ goog.require('ol.source.Source');
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* extent: (null|ol.Extent|undefined),
|
||||
* logo: (string|undefined),
|
||||
* logo: (string|Object|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
* resolutions: (Array.<number>|undefined),
|
||||
* state: (ol.source.State|string|undefined)}}
|
||||
|
||||
@@ -23,7 +23,7 @@ ol.source.State = {
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* extent: (ol.Extent|undefined),
|
||||
* logo: (string|undefined),
|
||||
* logo: (string|Object|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
* state: (ol.source.State|string|undefined)}}
|
||||
*/
|
||||
@@ -69,7 +69,7 @@ ol.source.Source = function(options) {
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {string|undefined}
|
||||
* @type {string|Object|undefined}
|
||||
*/
|
||||
this.logo_ = options.logo;
|
||||
|
||||
@@ -115,7 +115,7 @@ ol.source.Source.prototype.getExtent = function() {
|
||||
|
||||
|
||||
/**
|
||||
* @return {string|undefined} Logo.
|
||||
* @return {string|Object|undefined} Logo.
|
||||
*/
|
||||
ol.source.Source.prototype.getLogo = function() {
|
||||
return this.logo_;
|
||||
@@ -162,7 +162,7 @@ ol.source.Source.prototype.setExtent = function(extent) {
|
||||
|
||||
|
||||
/**
|
||||
* @param {string|undefined} logo Logo.
|
||||
* @param {string|Object|undefined} logo Logo.
|
||||
*/
|
||||
ol.source.Source.prototype.setLogo = function(logo) {
|
||||
this.logo_ = logo;
|
||||
|
||||
@@ -13,7 +13,7 @@ goog.require('ol.tilegrid.TileGrid');
|
||||
/**
|
||||
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
|
||||
* extent: (ol.Extent|undefined),
|
||||
* logo: (string|undefined),
|
||||
* logo: (string|Object|undefined),
|
||||
* opaque: (boolean|undefined),
|
||||
* tilePixelRatio: (number|undefined),
|
||||
* projection: ol.proj.ProjectionLike,
|
||||
|
||||
Reference in New Issue
Block a user