Remove goog.isNull in renderer classes

This commit is contained in:
Marc Jansen
2015-09-29 15:19:47 +02:00
parent 31a68e21a5
commit 138adf0509
15 changed files with 61 additions and 62 deletions
+4 -4
View File
@@ -71,8 +71,8 @@ goog.inherits(ol.renderer.Map, goog.Disposable);
ol.renderer.Map.prototype.calculateMatrices2D = function(frameState) {
var viewState = frameState.viewState;
var coordinateToPixelMatrix = frameState.coordinateToPixelMatrix;
goog.asserts.assert(!goog.isNull(coordinateToPixelMatrix),
'frameState has non-null coordinateToPixelMatrix');
goog.asserts.assert(coordinateToPixelMatrix,
'frameState has a coordinateToPixelMatrix');
ol.vec.Mat4.makeTransform2D(coordinateToPixelMatrix,
frameState.size[0] / 2, frameState.size[1] / 2,
1 / viewState.resolution, -1 / viewState.resolution,
@@ -171,7 +171,7 @@ ol.renderer.Map.prototype.forEachFeatureAtCoordinate =
(ol.layer.Layer.visibleAtResolution(layerState, viewResolution) &&
layerFilter.call(thisArg2, layer))) {
var layerRenderer = this.getLayerRenderer(layer);
if (!goog.isNull(layer.getSource())) {
if (layer.getSource()) {
result = layerRenderer.forEachFeatureAtCoordinate(
layer.getSource().getWrapX() ? translatedCoordinate : coordinate,
frameState, callback, thisArg);
@@ -347,7 +347,7 @@ ol.renderer.Map.prototype.removeUnusedLayerRenderers_ =
function(map, frameState) {
var layerKey;
for (layerKey in this.layerRenderers_) {
if (goog.isNull(frameState) || !(layerKey in frameState.layerStates)) {
if (!frameState || !(layerKey in frameState.layerStates)) {
goog.dispose(this.removeLayerRendererByKey_(layerKey));
}
}