Add support to specify CSS class name when creating ol.Overlay

This commit is contained in:
Bobo Häggström
2017-10-19 15:11:49 +02:00
parent 8d5a8665b2
commit 7a800d4b39
3 changed files with 16 additions and 2 deletions

View File

@@ -59,7 +59,8 @@ ol.Overlay = function(options) {
* @type {Element}
*/
this.element_ = document.createElement('DIV');
this.element_.className = 'ol-overlay-container ' + ol.css.CLASS_SELECTABLE;
this.element_.className = options.className !== undefined ?
options.className : 'ol-overlay-container ' + ol.css.CLASS_SELECTABLE;
this.element_.style.position = 'absolute';
/**