Merge pull request #5274 from samuellapointe/logofix
Allow using elements in logo attribution options
This commit is contained in:
@@ -1449,7 +1449,7 @@ ol.Map.prototype.unskipFeature = function(feature) {
|
||||
* @typedef {{controls: ol.Collection.<ol.control.Control>,
|
||||
* interactions: ol.Collection.<ol.interaction.Interaction>,
|
||||
* keyboardEventTarget: (Element|Document),
|
||||
* logos: Object.<string, string>,
|
||||
* logos: (Object.<string, (string|Element)>),
|
||||
* overlays: ol.Collection.<ol.Overlay>,
|
||||
* rendererConstructor:
|
||||
* function(new: ol.renderer.Map, Element, ol.Map),
|
||||
@@ -1489,6 +1489,8 @@ ol.Map.createOptionsInternal = function(options) {
|
||||
var logo = options.logo;
|
||||
if (typeof logo === 'string') {
|
||||
logos[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