Remove use of goog.dispose()
This commit is contained in:
@@ -70,7 +70,7 @@ ol.ImageTile.prototype.disposeInternal = function() {
|
|||||||
this.unlistenImage_();
|
this.unlistenImage_();
|
||||||
}
|
}
|
||||||
if (this.interimTile) {
|
if (this.interimTile) {
|
||||||
goog.dispose(this.interimTile);
|
this.interimTile.dispose();
|
||||||
}
|
}
|
||||||
goog.base(this, 'disposeInternal');
|
goog.base(this, 'disposeInternal');
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -285,7 +285,7 @@ ol.MapBrowserEventHandler.prototype.handlePointerUp_ = function(pointerEvent) {
|
|||||||
this.dragListenerKeys_.length = 0;
|
this.dragListenerKeys_.length = 0;
|
||||||
this.dragging_ = false;
|
this.dragging_ = false;
|
||||||
this.down_ = null;
|
this.down_ = null;
|
||||||
goog.dispose(this.documentPointerEventHandler_);
|
this.documentPointerEventHandler_.dispose();
|
||||||
this.documentPointerEventHandler_ = null;
|
this.documentPointerEventHandler_ = null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -416,11 +416,11 @@ ol.MapBrowserEventHandler.prototype.disposeInternal = function() {
|
|||||||
this.dragListenerKeys_.length = 0;
|
this.dragListenerKeys_.length = 0;
|
||||||
|
|
||||||
if (this.documentPointerEventHandler_) {
|
if (this.documentPointerEventHandler_) {
|
||||||
goog.dispose(this.documentPointerEventHandler_);
|
this.documentPointerEventHandler_.dispose();
|
||||||
this.documentPointerEventHandler_ = null;
|
this.documentPointerEventHandler_ = null;
|
||||||
}
|
}
|
||||||
if (this.pointerEventHandler_) {
|
if (this.pointerEventHandler_) {
|
||||||
goog.dispose(this.pointerEventHandler_);
|
this.pointerEventHandler_.dispose();
|
||||||
this.pointerEventHandler_ = null;
|
this.pointerEventHandler_ = null;
|
||||||
}
|
}
|
||||||
goog.base(this, 'disposeInternal');
|
goog.base(this, 'disposeInternal');
|
||||||
|
|||||||
@@ -257,8 +257,6 @@ ol.renderer.canvas.VectorLayer.prototype.prepareFrame = function(frameState, lay
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME dispose of old replayGroup in post render
|
|
||||||
goog.dispose(this.replayGroup_);
|
|
||||||
this.replayGroup_ = null;
|
this.replayGroup_ = null;
|
||||||
|
|
||||||
this.dirty_ = false;
|
this.dirty_ = false;
|
||||||
|
|||||||
@@ -216,8 +216,6 @@ ol.renderer.canvas.VectorTileLayer.prototype.createReplayGroup = function(tile,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME dispose of old replayGroup in post render
|
|
||||||
goog.dispose(replayState.replayGroup);
|
|
||||||
replayState.replayGroup = null;
|
replayState.replayGroup = null;
|
||||||
replayState.dirty = false;
|
replayState.dirty = false;
|
||||||
|
|
||||||
|
|||||||
@@ -268,8 +268,6 @@ ol.renderer.dom.VectorLayer.prototype.prepareFrame = function(frameState, layerS
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME dispose of old replayGroup in post render
|
|
||||||
goog.dispose(this.replayGroup_);
|
|
||||||
this.replayGroup_ = null;
|
this.replayGroup_ = null;
|
||||||
|
|
||||||
this.dirty_ = false;
|
this.dirty_ = false;
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ goog.provide('ol.renderer.Map');
|
|||||||
|
|
||||||
goog.require('goog.Disposable');
|
goog.require('goog.Disposable');
|
||||||
goog.require('goog.asserts');
|
goog.require('goog.asserts');
|
||||||
goog.require('goog.dispose');
|
|
||||||
goog.require('goog.functions');
|
goog.require('goog.functions');
|
||||||
goog.require('goog.vec.Mat4');
|
goog.require('goog.vec.Mat4');
|
||||||
goog.require('ol');
|
goog.require('ol');
|
||||||
@@ -95,7 +94,7 @@ ol.renderer.Map.prototype.createLayerRenderer = goog.abstractMethod;
|
|||||||
*/
|
*/
|
||||||
ol.renderer.Map.prototype.disposeInternal = function() {
|
ol.renderer.Map.prototype.disposeInternal = function() {
|
||||||
for (var id in this.layerRenderers_) {
|
for (var id in this.layerRenderers_) {
|
||||||
goog.dispose(this.layerRenderers_[id]);
|
this.layerRenderers_[id].dispose();
|
||||||
}
|
}
|
||||||
goog.base(this, 'disposeInternal');
|
goog.base(this, 'disposeInternal');
|
||||||
};
|
};
|
||||||
@@ -340,7 +339,7 @@ ol.renderer.Map.prototype.removeUnusedLayerRenderers_ = function(map, frameState
|
|||||||
var layerKey;
|
var layerKey;
|
||||||
for (layerKey in this.layerRenderers_) {
|
for (layerKey in this.layerRenderers_) {
|
||||||
if (!frameState || !(layerKey in frameState.layerStates)) {
|
if (!frameState || !(layerKey in frameState.layerStates)) {
|
||||||
goog.dispose(this.removeLayerRendererByKey_(layerKey));
|
this.removeLayerRendererByKey_(layerKey).dispose();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -311,7 +311,7 @@ ol.renderer.webgl.Map.prototype.disposeInternal = function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
goog.dispose(this.context_);
|
this.context_.dispose();
|
||||||
goog.base(this, 'disposeInternal');
|
goog.base(this, 'disposeInternal');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -13,12 +13,12 @@ describe('ol.control.Control', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(map);
|
map.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('dispose', function() {
|
describe('dispose', function() {
|
||||||
it('removes the control element from its parent', function() {
|
it('removes the control element from its parent', function() {
|
||||||
goog.dispose(control);
|
control.dispose();
|
||||||
expect(control.element.parentNode).to.be(null);
|
expect(control.element.parentNode).to.be(null);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -32,7 +32,7 @@ describe('ol.control.Control\'s target', function() {
|
|||||||
document.body.appendChild(target);
|
document.body.appendChild(target);
|
||||||
var ctrl = new ol.control.Control({target: 'mycontrol'});
|
var ctrl = new ol.control.Control({target: 'mycontrol'});
|
||||||
expect(ctrl.target_.id).to.equal('mycontrol');
|
expect(ctrl.target_.id).to.equal('mycontrol');
|
||||||
goog.dispose(ctrl);
|
ctrl.dispose();
|
||||||
});
|
});
|
||||||
it('accepts element for target', function() {
|
it('accepts element for target', function() {
|
||||||
var target = document.createElement('div');
|
var target = document.createElement('div');
|
||||||
@@ -40,16 +40,15 @@ describe('ol.control.Control\'s target', function() {
|
|||||||
document.body.appendChild(target);
|
document.body.appendChild(target);
|
||||||
var ctrl = new ol.control.Control({target: target});
|
var ctrl = new ol.control.Control({target: target});
|
||||||
expect(ctrl.target_.id).to.equal('mycontrol');
|
expect(ctrl.target_.id).to.equal('mycontrol');
|
||||||
goog.dispose(ctrl);
|
ctrl.dispose();
|
||||||
});
|
});
|
||||||
it('ignores non-existing target id', function() {
|
it('ignores non-existing target id', function() {
|
||||||
var ctrl = new ol.control.Control({target: 'doesnotexist'});
|
var ctrl = new ol.control.Control({target: 'doesnotexist'});
|
||||||
expect(ctrl.target_).to.equal(null);
|
expect(ctrl.target_).to.equal(null);
|
||||||
goog.dispose(ctrl);
|
ctrl.dispose();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
goog.require('goog.dispose');
|
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.control.Control');
|
goog.require('ol.control.Control');
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ describe('ol.control.OverviewMap', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(map);
|
map.dispose();
|
||||||
document.body.removeChild(target);
|
document.body.removeChild(target);
|
||||||
map = null;
|
map = null;
|
||||||
target = null;
|
target = null;
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ describe('ol.control.ZoomSlider', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(zoomslider);
|
zoomslider.dispose();
|
||||||
goog.dispose(map);
|
map.dispose();
|
||||||
document.body.removeChild(target);
|
document.body.removeChild(target);
|
||||||
zoomslider = null;
|
zoomslider = null;
|
||||||
map = null;
|
map = null;
|
||||||
@@ -68,7 +68,7 @@ describe('ol.control.ZoomSlider', function() {
|
|||||||
var horizontal = ol.control.ZoomSlider.direction.HORIZONTAL;
|
var horizontal = ol.control.ZoomSlider.direction.HORIZONTAL;
|
||||||
expect(control.direction_).to.be(horizontal);
|
expect(control.direction_).to.be(horizontal);
|
||||||
|
|
||||||
goog.dispose(control);
|
control.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('is vertical for tall containers', function() {
|
it('is vertical for tall containers', function() {
|
||||||
@@ -81,7 +81,7 @@ describe('ol.control.ZoomSlider', function() {
|
|||||||
var vertical = ol.control.ZoomSlider.direction.VERTICAL;
|
var vertical = ol.control.ZoomSlider.direction.VERTICAL;
|
||||||
expect(control.direction_).to.be(vertical);
|
expect(control.direction_).to.be(vertical);
|
||||||
|
|
||||||
goog.dispose(control);
|
control.dispose();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -178,7 +178,6 @@ describe('ol.control.ZoomSlider', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
goog.require('goog.Disposable');
|
goog.require('goog.Disposable');
|
||||||
goog.require('goog.dispose');
|
|
||||||
goog.require('goog.dom.classlist');
|
goog.require('goog.dom.classlist');
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ describe('ol.interaction.DragZoom', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(map);
|
map.dispose();
|
||||||
document.body.removeChild(target);
|
document.body.removeChild(target);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -82,7 +82,6 @@ describe('ol.interaction.DragZoom', function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
goog.require('goog.dispose');
|
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
goog.require('ol.extent');
|
goog.require('ol.extent');
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ describe('ol.interaction.Draw', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(map);
|
map.dispose();
|
||||||
document.body.removeChild(target);
|
document.body.removeChild(target);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -811,7 +811,6 @@ describe('ol.interaction.Draw', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
goog.require('goog.dispose');
|
|
||||||
goog.require('ol.events');
|
goog.require('ol.events');
|
||||||
goog.require('ol.Feature');
|
goog.require('ol.Feature');
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ describe('ol.interaction.Modify', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(map);
|
map.dispose();
|
||||||
document.body.removeChild(target);
|
document.body.removeChild(target);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -375,7 +375,6 @@ describe('ol.interaction.Modify', function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
goog.require('goog.dispose');
|
|
||||||
goog.require('ol.events');
|
goog.require('ol.events');
|
||||||
goog.require('ol.Collection');
|
goog.require('ol.Collection');
|
||||||
goog.require('ol.Feature');
|
goog.require('ol.Feature');
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ describe('ol.interaction.Select', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(map);
|
map.dispose();
|
||||||
document.body.removeChild(target);
|
document.body.removeChild(target);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -391,7 +391,6 @@ describe('ol.interaction.Select', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
goog.require('goog.dispose');
|
|
||||||
goog.require('ol.Collection');
|
goog.require('ol.Collection');
|
||||||
goog.require('ol.Feature');
|
goog.require('ol.Feature');
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ describe('ol.interaction.Snap', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(map);
|
map.dispose();
|
||||||
document.body.removeChild(target);
|
document.body.removeChild(target);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ describe('ol.interaction.Translate', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(map);
|
map.dispose();
|
||||||
document.body.removeChild(target);
|
document.body.removeChild(target);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -108,7 +108,6 @@ describe('ol.interaction.Translate', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
goog.require('goog.dispose');
|
|
||||||
goog.require('ol.Collection');
|
goog.require('ol.Collection');
|
||||||
goog.require('ol.Feature');
|
goog.require('ol.Feature');
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ describe('ol.layer.Layer', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(layer);
|
layer.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('creates an instance', function() {
|
it('creates an instance', function() {
|
||||||
@@ -86,7 +86,7 @@ describe('ol.layer.Layer', function() {
|
|||||||
minResolution: 0.25
|
minResolution: 0.25
|
||||||
});
|
});
|
||||||
|
|
||||||
goog.dispose(layer);
|
layer.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -103,7 +103,7 @@ describe('ol.layer.Layer', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(layer);
|
layer.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns false if layer is not visible', function() {
|
it('returns false if layer is not visible', function() {
|
||||||
@@ -153,7 +153,7 @@ describe('ol.layer.Layer', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(layer);
|
layer.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns a layerState from the properties values', function() {
|
it('returns a layerState from the properties values', function() {
|
||||||
@@ -323,7 +323,7 @@ describe('ol.layer.Layer', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(layer);
|
layer.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('accepts a positive number', function() {
|
it('accepts a positive number', function() {
|
||||||
@@ -353,7 +353,7 @@ describe('ol.layer.Layer', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(layer);
|
layer.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('sets visible property', function() {
|
it('sets visible property', function() {
|
||||||
@@ -432,7 +432,6 @@ describe('ol.layer.Layer', function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
goog.require('goog.dispose');
|
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.ObjectEventType');
|
goog.require('ol.ObjectEventType');
|
||||||
goog.require('ol.layer.Layer');
|
goog.require('ol.layer.Layer');
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ describe('ol.layer.Group', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(layerGroup);
|
layerGroup.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('creates an instance', function() {
|
it('creates an instance', function() {
|
||||||
@@ -63,8 +63,8 @@ describe('ol.layer.Group', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(group);
|
group.dispose();
|
||||||
goog.dispose(layer);
|
layer.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('is dispatched by the group when layer opacity changes', function() {
|
it('is dispatched by the group when layer opacity changes', function() {
|
||||||
@@ -102,8 +102,8 @@ describe('ol.layer.Group', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(group);
|
group.dispose();
|
||||||
goog.dispose(layer);
|
layer.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('is dispatched by the group when group opacity changes', function() {
|
it('is dispatched by the group when group opacity changes', function() {
|
||||||
@@ -161,8 +161,8 @@ describe('ol.layer.Group', function() {
|
|||||||
expect(layerGroup.getLayers().getLength()).to.be(1);
|
expect(layerGroup.getLayers().getLength()).to.be(1);
|
||||||
expect(layerGroup.getLayers().item(0)).to.be(layer);
|
expect(layerGroup.getLayers().item(0)).to.be(layer);
|
||||||
|
|
||||||
goog.dispose(layer);
|
layer.dispose();
|
||||||
goog.dispose(layerGroup);
|
layerGroup.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('accepts an extent option', function() {
|
it('accepts an extent option', function() {
|
||||||
@@ -202,8 +202,8 @@ describe('ol.layer.Group', function() {
|
|||||||
expect(layerGroup.getLayers().getLength()).to.be(1);
|
expect(layerGroup.getLayers().getLength()).to.be(1);
|
||||||
expect(layerGroup.getLayers().item(0)).to.be(layer);
|
expect(layerGroup.getLayers().item(0)).to.be(layer);
|
||||||
|
|
||||||
goog.dispose(layer);
|
layer.dispose();
|
||||||
goog.dispose(layerGroup);
|
layerGroup.dispose();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -216,7 +216,7 @@ describe('ol.layer.Group', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(layerGroup);
|
layerGroup.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('returns a layerState from the properties values', function() {
|
it('returns a layerState from the properties values', function() {
|
||||||
@@ -312,9 +312,9 @@ describe('ol.layer.Group', function() {
|
|||||||
layerGroup.setLayers(layers);
|
layerGroup.setLayers(layers);
|
||||||
expect(layerGroup.getLayers()).to.be(layers);
|
expect(layerGroup.getLayers()).to.be(layers);
|
||||||
|
|
||||||
goog.dispose(layerGroup);
|
layerGroup.dispose();
|
||||||
goog.dispose(layer);
|
layer.dispose();
|
||||||
goog.dispose(layers);
|
layers.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
@@ -329,7 +329,7 @@ describe('ol.layer.Group', function() {
|
|||||||
expect(layerStatesArray).to.be.a(Array);
|
expect(layerStatesArray).to.be.a(Array);
|
||||||
expect(layerStatesArray.length).to.be(0);
|
expect(layerStatesArray.length).to.be(0);
|
||||||
|
|
||||||
goog.dispose(layerGroup);
|
layerGroup.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
var layer1 = new ol.layer.Layer({
|
var layer1 = new ol.layer.Layer({
|
||||||
@@ -372,7 +372,7 @@ describe('ol.layer.Group', function() {
|
|||||||
|
|
||||||
expect(layerStatesArray[1]).to.eql(layer2.getLayerState());
|
expect(layerStatesArray[1]).to.eql(layer2.getLayerState());
|
||||||
|
|
||||||
goog.dispose(layerGroup);
|
layerGroup.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('uses the layer group extent if layer has no extent', function() {
|
it('uses the layer group extent if layer has no extent', function() {
|
||||||
@@ -383,7 +383,7 @@ describe('ol.layer.Group', function() {
|
|||||||
});
|
});
|
||||||
var layerStatesArray = layerGroup.getLayerStatesArray();
|
var layerStatesArray = layerGroup.getLayerStatesArray();
|
||||||
expect(layerStatesArray[0].extent).to.eql(groupExtent);
|
expect(layerStatesArray[0].extent).to.eql(groupExtent);
|
||||||
goog.dispose(layerGroup);
|
layerGroup.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('uses the intersection of group and child extent', function() {
|
it('uses the intersection of group and child extent', function() {
|
||||||
@@ -395,7 +395,7 @@ describe('ol.layer.Group', function() {
|
|||||||
var layerStatesArray = layerGroup.getLayerStatesArray();
|
var layerStatesArray = layerGroup.getLayerStatesArray();
|
||||||
expect(layerStatesArray[0].extent).to.eql(
|
expect(layerStatesArray[0].extent).to.eql(
|
||||||
ol.extent.getIntersection(layer3.getExtent(), groupExtent));
|
ol.extent.getIntersection(layer3.getExtent(), groupExtent));
|
||||||
goog.dispose(layerGroup);
|
layerGroup.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('transforms layerStates correctly', function() {
|
it('transforms layerStates correctly', function() {
|
||||||
@@ -433,7 +433,7 @@ describe('ol.layer.Group', function() {
|
|||||||
minResolution: 0.25
|
minResolution: 0.25
|
||||||
});
|
});
|
||||||
|
|
||||||
goog.dispose(layerGroup);
|
layerGroup.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('let order of layers without Z-index unchanged', function() {
|
it('let order of layers without Z-index unchanged', function() {
|
||||||
@@ -447,7 +447,7 @@ describe('ol.layer.Group', function() {
|
|||||||
expect(layerStatesArray[0]).to.eql(initialArray[0]);
|
expect(layerStatesArray[0]).to.eql(initialArray[0]);
|
||||||
expect(layerStatesArray[1]).to.eql(initialArray[1]);
|
expect(layerStatesArray[1]).to.eql(initialArray[1]);
|
||||||
|
|
||||||
goog.dispose(layerGroup);
|
layerGroup.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('orders layer with higher Z-index on top', function() {
|
it('orders layer with higher Z-index on top', function() {
|
||||||
@@ -477,20 +477,19 @@ describe('ol.layer.Group', function() {
|
|||||||
expect(layerStatesArray[2]).to.eql(initialArray[2]);
|
expect(layerStatesArray[2]).to.eql(initialArray[2]);
|
||||||
expect(layerStatesArray[3]).to.eql(initialArray[1]);
|
expect(layerStatesArray[3]).to.eql(initialArray[1]);
|
||||||
|
|
||||||
goog.dispose(layer10);
|
layer10.dispose();
|
||||||
goog.dispose(layerM1);
|
layerM1.dispose();
|
||||||
goog.dispose(layerGroup);
|
layerGroup.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
goog.dispose(layer1);
|
layer1.dispose();
|
||||||
goog.dispose(layer2);
|
layer2.dispose();
|
||||||
goog.dispose(layer3);
|
layer3.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
goog.require('ol.array');
|
goog.require('ol.array');
|
||||||
goog.require('goog.dispose');
|
|
||||||
goog.require('ol.Collection');
|
goog.require('ol.Collection');
|
||||||
goog.require('ol.ObjectEventType');
|
goog.require('ol.ObjectEventType');
|
||||||
goog.require('ol.events');
|
goog.require('ol.events');
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ describe('ol.layer.Tile', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(layer);
|
layer.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('creates an instance', function() {
|
it('creates an instance', function() {
|
||||||
@@ -32,6 +32,5 @@ describe('ol.layer.Tile', function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
goog.require('goog.dispose');
|
|
||||||
goog.require('ol.layer.Tile');
|
goog.require('ol.layer.Tile');
|
||||||
goog.require('ol.source.OSM');
|
goog.require('ol.source.OSM');
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ describe('ol.layer.VectorTile', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(layer);
|
layer.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('creates an instance', function() {
|
it('creates an instance', function() {
|
||||||
@@ -32,6 +32,5 @@ describe('ol.layer.VectorTile', function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
goog.require('goog.dispose');
|
|
||||||
goog.require('ol.layer.VectorTile');
|
goog.require('ol.layer.VectorTile');
|
||||||
goog.require('ol.source.VectorTile');
|
goog.require('ol.source.VectorTile');
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ describe('ol.Map', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(map);
|
map.dispose();
|
||||||
document.body.removeChild(target);
|
document.body.removeChild(target);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -143,7 +143,7 @@ describe('ol.Map', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(map);
|
map.dispose();
|
||||||
document.body.removeChild(target);
|
document.body.removeChild(target);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -226,12 +226,12 @@ describe('ol.Map', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
it('removes the viewport from its parent', function() {
|
it('removes the viewport from its parent', function() {
|
||||||
goog.dispose(map);
|
map.dispose();
|
||||||
expect(map.getViewport().parentNode).to.be(null);
|
expect(map.getViewport().parentNode).to.be(null);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('removes window listeners', function() {
|
it('removes window listeners', function() {
|
||||||
goog.dispose(map);
|
map.dispose();
|
||||||
expect(map.handleResize_).to.be(undefined);
|
expect(map.handleResize_).to.be(undefined);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -383,7 +383,7 @@ describe('ol.Map', function() {
|
|||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
map.removeOverlay(overlay);
|
map.removeOverlay(overlay);
|
||||||
goog.dispose(map);
|
map.dispose();
|
||||||
document.body.removeChild(target);
|
document.body.removeChild(target);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -425,7 +425,6 @@ describe('ol.Map', function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
goog.require('goog.dispose');
|
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.MapEvent');
|
goog.require('ol.MapEvent');
|
||||||
goog.require('ol.Overlay');
|
goog.require('ol.Overlay');
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ describe('ol.Overlay', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(map);
|
map.dispose();
|
||||||
document.body.removeChild(target);
|
document.body.removeChild(target);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -72,7 +72,6 @@ describe('ol.Overlay', function() {
|
|||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
goog.require('goog.dispose');
|
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
goog.require('ol.Overlay');
|
goog.require('ol.Overlay');
|
||||||
goog.require('ol.View');
|
goog.require('ol.View');
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ describe('ol.render.Box', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(map);
|
map.dispose();
|
||||||
document.body.removeChild(target);
|
document.body.removeChild(target);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ describe('ol.renderer.webgl.ImageLayer', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
afterEach(function() {
|
afterEach(function() {
|
||||||
goog.dispose(map);
|
map.dispose();
|
||||||
});
|
});
|
||||||
|
|
||||||
it('produces a correct matrix', function() {
|
it('produces a correct matrix', function() {
|
||||||
@@ -80,7 +80,6 @@ describe('ol.renderer.webgl.ImageLayer', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
goog.require('goog.dispose');
|
|
||||||
goog.require('goog.vec.Mat4');
|
goog.require('goog.vec.Mat4');
|
||||||
goog.require('goog.vec.Vec4');
|
goog.require('goog.vec.Vec4');
|
||||||
goog.require('ol.Map');
|
goog.require('ol.Map');
|
||||||
|
|||||||
@@ -370,7 +370,7 @@
|
|||||||
global.disposeMap = function(map) {
|
global.disposeMap = function(map) {
|
||||||
var target = map.getTarget();
|
var target = map.getTarget();
|
||||||
map.setTarget(null);
|
map.setTarget(null);
|
||||||
goog.dispose(map);
|
map.dispose();
|
||||||
document.body.removeChild(target);
|
document.body.removeChild(target);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user