Deal with ol.global issues

This commit is contained in:
Tim Schaub
2016-08-31 07:42:35 -06:00
parent 9e1a3f59e3
commit ff8a84a220
10 changed files with 64 additions and 45 deletions
+5 -4
View File
@@ -1,11 +1,11 @@
goog.provide('ol.control.FullScreen');
goog.require('ol.events');
goog.require('ol.events.EventType');
goog.require('ol');
goog.require('ol.control.Control');
goog.require('ol.dom');
goog.require('ol.css');
goog.require('ol.dom');
goog.require('ol.events');
goog.require('ol.events.EventType');
/**
@@ -158,9 +158,10 @@ ol.control.FullScreen.prototype.handleFullScreenChange_ = function() {
* @api stable
*/
ol.control.FullScreen.prototype.setMap = function(map) {
var global = ol.global;
ol.control.Control.prototype.setMap.call(this, map);
if (map) {
this.listenerKeys.push(ol.events.listen(ol.global.document,
this.listenerKeys.push(ol.events.listen(global.document,
ol.control.FullScreen.getChangeType_(),
this.handleFullScreenChange_, this)
);
+2 -1
View File
@@ -181,13 +181,14 @@ ol.control.ZoomSlider.prototype.setMap = function(map) {
* @private
*/
ol.control.ZoomSlider.prototype.initSlider_ = function() {
var global = ol.global;
var container = this.element;
var containerSize = {
width: container.offsetWidth, height: container.offsetHeight
};
var thumb = container.firstElementChild;
var computedStyle = ol.global.getComputedStyle(thumb);
var computedStyle = global.getComputedStyle(thumb);
var thumbWidth = thumb.offsetWidth +
parseFloat(computedStyle['marginRight']) +
parseFloat(computedStyle['marginLeft']);