Merge pull request #5274 from samuellapointe/logofix

Allow using elements in logo attribution options
This commit is contained in:
Andreas Hocevar
2016-05-09 13:46:11 +02:00
5 changed files with 50 additions and 7 deletions

View File

@@ -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');