Better code indentation

This commit is contained in:
Frederic Junod
2018-02-14 16:57:30 +01:00
parent 219413f324
commit 577816ca4a
2 changed files with 15 additions and 22 deletions

View File

@@ -98,10 +98,9 @@ LayerGroup.prototype.handleLayersChanged_ = function(event) {
const layers = this.getLayers();
this.layersListenerKeys_.push(
listen(layers, CollectionEventType.ADD,
this.handleLayersAdd_, this),
listen(layers, CollectionEventType.REMOVE,
this.handleLayersRemove_, this));
listen(layers, CollectionEventType.ADD, this.handleLayersAdd_, this),
listen(layers, CollectionEventType.REMOVE, this.handleLayersRemove_, this)
);
for (const id in this.listenerKeys_) {
this.listenerKeys_[id].forEach(unlistenByKey);
@@ -112,10 +111,8 @@ LayerGroup.prototype.handleLayersChanged_ = function(event) {
for (let i = 0, ii = layersArray.length; i < ii; i++) {
const layer = layersArray[i];
this.listenerKeys_[getUid(layer).toString()] = [
listen(layer, ObjectEventType.PROPERTYCHANGE,
this.handleLayerChange_, this),
listen(layer, EventType.CHANGE,
this.handleLayerChange_, this)
listen(layer, ObjectEventType.PROPERTYCHANGE, this.handleLayerChange_, this),
listen(layer, EventType.CHANGE, this.handleLayerChange_, this)
];
}
@@ -131,10 +128,8 @@ LayerGroup.prototype.handleLayersAdd_ = function(collectionEvent) {
const layer = /** @type {ol.layer.Base} */ (collectionEvent.element);
const key = getUid(layer).toString();
this.listenerKeys_[key] = [
listen(layer, ObjectEventType.PROPERTYCHANGE,
this.handleLayerChange_, this),
listen(layer, EventType.CHANGE,
this.handleLayerChange_, this)
listen(layer, ObjectEventType.PROPERTYCHANGE, this.handleLayerChange_, this),
listen(layer, EventType.CHANGE, this.handleLayerChange_, this)
];
this.changed();
};

View File

@@ -178,16 +178,14 @@ Layer.prototype.setMap = function(map) {
this.mapRenderKey_ = null;
}
if (map) {
this.mapPrecomposeKey_ = listen(
map, RenderEventType.PRECOMPOSE, function(evt) {
const layerState = this.getLayerState();
layerState.managed = false;
layerState.zIndex = Infinity;
evt.frameState.layerStatesArray.push(layerState);
evt.frameState.layerStates[getUid(this)] = layerState;
}, this);
this.mapRenderKey_ = listen(
this, EventType.CHANGE, map.render, map);
this.mapPrecomposeKey_ = listen(map, RenderEventType.PRECOMPOSE, function(evt) {
const layerState = this.getLayerState();
layerState.managed = false;
layerState.zIndex = Infinity;
evt.frameState.layerStatesArray.push(layerState);
evt.frameState.layerStates[getUid(this)] = layerState;
}, this);
this.mapRenderKey_ = listen(this, EventType.CHANGE, map.render, map);
this.changed();
}
};