diff --git a/css/ol.css b/css/ol.css index 390298a0ea..0af4ace477 100644 --- a/css/ol.css +++ b/css/ol.css @@ -21,7 +21,12 @@ font-size: 10px; text-align: center; margin: 1px; + will-change: contents, width; } +.ol-overlay-container { + will-change: left,right,top,bottom; +} + .ol-unsupported { display: none; } @@ -101,6 +106,7 @@ display: block; font-weight: normal; font-size: 1.2em; + will-change: transform; } .ol-touch .ol-control button { font-size: 1.5em; diff --git a/src/ol/overlay.js b/src/ol/overlay.js index 5d3a30fe18..759fe0f348 100644 --- a/src/ol/overlay.js +++ b/src/ol/overlay.js @@ -90,7 +90,9 @@ ol.Overlay = function(options) { * @private * @type {Element} */ - this.element_ = goog.dom.createElement(goog.dom.TagName.DIV); + this.element_ = goog.dom.createDom(goog.dom.TagName.DIV, { + 'class': 'ol-overlay-container' + }); this.element_.style.position = 'absolute'; /**