diff --git a/src/ol/base/map.js b/src/ol/base/map.js index 38d7bd52b9..6dec7913bd 100644 --- a/src/ol/base/map.js +++ b/src/ol/base/map.js @@ -590,6 +590,14 @@ ol.Map.prototype.handleBrowserEvent = function(browserEvent, opt_type) { }; +/** + * @protected + */ +ol.Map.prototype.handleCenterChanged = function() { + this.matriciesDirty_ = true; +}; + + /** * @param {goog.fx.DragEvent} dragEvent Drag event. */ @@ -599,14 +607,6 @@ ol.Map.prototype.handleDraggerEvent = function(dragEvent) { }; -/** - * @protected - */ -ol.Map.prototype.handleCenterChanged = function() { - this.matriciesDirty_ = true; -}; - - /** * @param {ol.CollectionEvent} collectionEvent Collection event. * @protected @@ -617,16 +617,6 @@ ol.Map.prototype.handleLayersAdd = function(collectionEvent) { }; -/** - * @param {ol.CollectionEvent} collectionEvent Collection event. - * @protected - */ -ol.Map.prototype.handleLayersRemove = function(collectionEvent) { - var layer = /** @type {ol.Layer} */ collectionEvent.elem; - this.removeLayer(layer); -}; - - /** * @protected */ @@ -653,6 +643,16 @@ ol.Map.prototype.handleLayersChanged = function() { }; +/** + * @param {ol.CollectionEvent} collectionEvent Collection event. + * @protected + */ +ol.Map.prototype.handleLayersRemove = function(collectionEvent) { + var layer = /** @type {ol.Layer} */ collectionEvent.elem; + this.removeLayer(layer); +}; + + /** * @protected */ @@ -731,6 +731,32 @@ ol.Map.prototype.recalculateTransforms_ = function() { }; +/** + * @param {ol.Layer} layer Layer. + * @protected + */ +ol.Map.prototype.removeLayer = function(layer) { + goog.dispose(this.removeLayerRenderer(layer)); +}; + + +/** + * @param {ol.Layer} layer Layer. + * @return {ol.LayerRenderer} Layer renderer. + * @protected + */ +ol.Map.prototype.removeLayerRenderer = function(layer) { + var key = goog.getUid(layer); + if (key in this.layerRenderers) { + var layerRenderer = this.layerRenderers[key]; + delete this.layerRenderers[key]; + return layerRenderer; + } else { + return null; + } +}; + + /** */ ol.Map.prototype.render = function() { @@ -762,32 +788,6 @@ ol.Map.prototype.renderInternal = function() { }; -/** - * @param {ol.Layer} layer Layer. - * @protected - */ -ol.Map.prototype.removeLayer = function(layer) { - goog.dispose(this.removeLayerRenderer(layer)); -}; - - -/** - * @param {ol.Layer} layer Layer. - * @return {ol.LayerRenderer} Layer renderer. - * @protected - */ -ol.Map.prototype.removeLayerRenderer = function(layer) { - var key = goog.getUid(layer); - if (key in this.layerRenderers) { - var layerRenderer = this.layerRenderers[key]; - delete this.layerRenderers[key]; - return layerRenderer; - } else { - return null; - } -}; - - /** * @param {ol.Color} backgroundColor Background color. */ @@ -849,6 +849,19 @@ goog.exportProperty( ol.Map.prototype.setLayers); +/** + * @export + * @param {ol.Projection} projection Projection. + */ +ol.Map.prototype.setProjection = function(projection) { + this.set(ol.MapProperty.PROJECTION, projection); +}; +goog.exportProperty( + ol.Map.prototype, + 'setProjection', + ol.Map.prototype.setProjection); + + /** * @export * @param {number|undefined} resolution Resolution. @@ -890,19 +903,6 @@ goog.exportProperty( ol.Map.prototype.setSize); -/** - * @export - * @param {ol.Projection} projection Projection. - */ -ol.Map.prototype.setProjection = function(projection) { - this.set(ol.MapProperty.PROJECTION, projection); -}; -goog.exportProperty( - ol.Map.prototype, - 'setProjection', - ol.Map.prototype.setProjection); - - /** * @export * @param {ol.Coordinate} userCenter Center in user projection. @@ -929,6 +929,20 @@ goog.exportProperty( ol.Map.prototype.setUserProjection); +/** + */ +ol.Map.prototype.unfreezeRendering = function() { + goog.asserts.assert(this.freezeRenderingCount_ > 0); + if (--this.freezeRenderingCount_ === 0) { + if (!this.animating_ && this.dirty_) { + if (this.renderInternal()) { + this.animate_(); + } + } + } +}; + + /** * @private */ @@ -990,20 +1004,6 @@ ol.Map.prototype.updateMatrices_ = function() { }; -/** - */ -ol.Map.prototype.unfreezeRendering = function() { - goog.asserts.assert(this.freezeRenderingCount_ > 0); - if (--this.freezeRenderingCount_ === 0) { - if (!this.animating_ && this.dirty_) { - if (this.renderInternal()) { - this.animate_(); - } - } - } -}; - - /** * @param {function(this: T)} f Function. * @param {T=} opt_obj Object.