Merge pull request #4780 from fredj/update_compiler

Adapt the code for the new closure-compiler version
This commit is contained in:
Frédéric Junod
2016-02-22 15:31:11 +01:00
9 changed files with 27 additions and 32 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ var proj54009 = ol.proj.get('ESRI:54009');
proj54009.setExtent([-18e6, -9e6, 18e6, 9e6]); proj54009.setExtent([-18e6, -9e6, 18e6, 9e6]);
var layers = []; var layers = {};
layers['bng'] = new ol.layer.Tile({ layers['bng'] = new ol.layer.Tile({
source: new ol.source.XYZ({ source: new ol.source.XYZ({
+2 -2
View File
@@ -273,8 +273,8 @@ ol.interaction.Select.handleEvent = function(mapBrowserEvent) {
var set = !add && !remove && !toggle; var set = !add && !remove && !toggle;
var map = mapBrowserEvent.map; var map = mapBrowserEvent.map;
var features = this.featureOverlay_.getSource().getFeaturesCollection(); var features = this.featureOverlay_.getSource().getFeaturesCollection();
var /** @type {!Array.<ol.Feature>} */ deselected = []; var deselected = [];
var /** @type {!Array.<ol.Feature>} */ selected = []; var selected = [];
var change = false; var change = false;
if (set) { if (set) {
// Replace the currently selected feature(s) with the feature(s) at the // Replace the currently selected feature(s) with the feature(s) at the
+9 -9
View File
@@ -197,7 +197,7 @@ ol.render.webgl.ImageReplay = function(tolerance, maxExtent) {
/** /**
* Start index per feature (the feature). * Start index per feature (the feature).
* @type {Array.<ol.Feature>} * @type {Array.<ol.Feature|ol.render.Feature>}
* @private * @private
*/ */
this.startIndicesFeature_ = []; this.startIndicesFeature_ = [];
@@ -494,7 +494,7 @@ ol.render.webgl.ImageReplay.prototype.createTextures_ = function(textures, image
* @param {number} opacity Global opacity. * @param {number} opacity Global opacity.
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features * @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
* to skip. * to skip.
* @param {function(ol.Feature): T|undefined} featureCallback Feature callback. * @param {function((ol.Feature|ol.render.Feature)): T|undefined} featureCallback Feature callback.
* @param {boolean} oneByOne Draw features one-by-one for the hit-detecion. * @param {boolean} oneByOne Draw features one-by-one for the hit-detecion.
* @param {ol.Extent=} opt_hitExtent Hit extent: Only features intersecting * @param {ol.Extent=} opt_hitExtent Hit extent: Only features intersecting
* this extent are checked. * this extent are checked.
@@ -729,7 +729,7 @@ ol.render.webgl.ImageReplay.prototype.drawElements_ = function(
* @param {ol.webgl.Context} context Context. * @param {ol.webgl.Context} context Context.
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features * @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
* to skip. * to skip.
* @param {function(ol.Feature): T|undefined} featureCallback Feature callback. * @param {function((ol.Feature|ol.render.Feature)): T|undefined} featureCallback Feature callback.
* @param {boolean} oneByOne Draw features one-by-one for the hit-detecion. * @param {boolean} oneByOne Draw features one-by-one for the hit-detecion.
* @param {ol.Extent=} opt_hitExtent Hit extent: Only features intersecting * @param {ol.Extent=} opt_hitExtent Hit extent: Only features intersecting
* this extent are checked. * this extent are checked.
@@ -756,7 +756,7 @@ ol.render.webgl.ImageReplay.prototype.drawHitDetectionReplay_ = function(gl, con
* @param {ol.webgl.Context} context Context. * @param {ol.webgl.Context} context Context.
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features * @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
* to skip. * to skip.
* @param {function(ol.Feature): T|undefined} featureCallback Feature callback. * @param {function((ol.Feature|ol.render.Feature)): T|undefined} featureCallback Feature callback.
* @return {T|undefined} Callback result. * @return {T|undefined} Callback result.
* @template T * @template T
*/ */
@@ -780,7 +780,7 @@ ol.render.webgl.ImageReplay.prototype.drawHitDetectionReplayAll_ = function(gl,
* @param {ol.webgl.Context} context Context. * @param {ol.webgl.Context} context Context.
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features * @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
* to skip. * to skip.
* @param {function(ol.Feature): T|undefined} featureCallback Feature callback. * @param {function((ol.Feature|ol.render.Feature)): T|undefined} featureCallback Feature callback.
* @param {ol.Extent=} opt_hitExtent Hit extent: Only features intersecting * @param {ol.Extent=} opt_hitExtent Hit extent: Only features intersecting
* this extent are checked. * this extent are checked.
* @return {T|undefined} Callback result. * @return {T|undefined} Callback result.
@@ -1038,7 +1038,7 @@ ol.render.webgl.ReplayGroup.prototype.replay = function(context,
* @param {number} opacity Global opacity. * @param {number} opacity Global opacity.
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features * @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
* to skip. * to skip.
* @param {function(ol.Feature): T|undefined} featureCallback Feature callback. * @param {function((ol.Feature|ol.render.Feature)): T|undefined} featureCallback Feature callback.
* @param {boolean} oneByOne Draw features one-by-one for the hit-detecion. * @param {boolean} oneByOne Draw features one-by-one for the hit-detecion.
* @param {ol.Extent=} opt_hitExtent Hit extent: Only features intersecting * @param {ol.Extent=} opt_hitExtent Hit extent: Only features intersecting
* this extent are checked. * this extent are checked.
@@ -1075,7 +1075,7 @@ ol.render.webgl.ReplayGroup.prototype.replayHitDetection_ = function(context,
* @param {number} opacity Global opacity. * @param {number} opacity Global opacity.
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features * @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
* to skip. * to skip.
* @param {function(ol.Feature): T|undefined} callback Feature callback. * @param {function((ol.Feature|ol.render.Feature)): T|undefined} callback Feature callback.
* @return {T|undefined} Callback result. * @return {T|undefined} Callback result.
* @template T * @template T
*/ */
@@ -1104,7 +1104,7 @@ ol.render.webgl.ReplayGroup.prototype.forEachFeatureAtCoordinate = function(
coordinate, resolution, rotation, ol.render.webgl.HIT_DETECTION_SIZE_, coordinate, resolution, rotation, ol.render.webgl.HIT_DETECTION_SIZE_,
pixelRatio, opacity, skippedFeaturesHash, pixelRatio, opacity, skippedFeaturesHash,
/** /**
* @param {ol.Feature} feature Feature. * @param {ol.Feature|ol.render.Feature} feature Feature.
* @return {?} Callback result. * @return {?} Callback result.
*/ */
function(feature) { function(feature) {
@@ -1145,7 +1145,7 @@ ol.render.webgl.ReplayGroup.prototype.hasFeatureAtCoordinate = function(
coordinate, resolution, rotation, ol.render.webgl.HIT_DETECTION_SIZE_, coordinate, resolution, rotation, ol.render.webgl.HIT_DETECTION_SIZE_,
pixelRatio, opacity, skippedFeaturesHash, pixelRatio, opacity, skippedFeaturesHash,
/** /**
* @param {ol.Feature} feature Feature. * @param {ol.Feature|ol.render.Feature} feature Feature.
* @return {boolean} Is there a feature? * @return {boolean} Is there a feature?
*/ */
function(feature) { function(feature) {
+2 -2
View File
@@ -182,7 +182,7 @@ ol.renderer.Layer.prototype.renderIfReadyAndVisible = function() {
ol.renderer.Layer.prototype.scheduleExpireCache = function(frameState, tileSource) { ol.renderer.Layer.prototype.scheduleExpireCache = function(frameState, tileSource) {
if (tileSource.canExpireCache()) { if (tileSource.canExpireCache()) {
frameState.postRenderFunctions.push( frameState.postRenderFunctions.push(
goog.partial( /** @type {ol.PostRenderFunction} */ (goog.partial(
/** /**
* @param {ol.source.Tile} tileSource Tile source. * @param {ol.source.Tile} tileSource Tile source.
* @param {ol.Map} map Map. * @param {ol.Map} map Map.
@@ -192,7 +192,7 @@ ol.renderer.Layer.prototype.scheduleExpireCache = function(frameState, tileSourc
var tileSourceKey = goog.getUid(tileSource).toString(); var tileSourceKey = goog.getUid(tileSource).toString();
tileSource.expireCache(frameState.viewState.projection, tileSource.expireCache(frameState.viewState.projection,
frameState.usedTiles[tileSourceKey]); frameState.usedTiles[tileSourceKey]);
}, tileSource)); }, tileSource)));
} }
}; };
+5 -2
View File
@@ -351,7 +351,9 @@ ol.renderer.Map.prototype.removeUnusedLayerRenderers_ = function(map, frameState
* @protected * @protected
*/ */
ol.renderer.Map.prototype.scheduleExpireIconCache = function(frameState) { ol.renderer.Map.prototype.scheduleExpireIconCache = function(frameState) {
frameState.postRenderFunctions.push(ol.renderer.Map.expireIconCache_); frameState.postRenderFunctions.push(
/** @type {ol.PostRenderFunction} */ (ol.renderer.Map.expireIconCache_)
);
}; };
@@ -364,7 +366,8 @@ ol.renderer.Map.prototype.scheduleRemoveUnusedLayerRenderers = function(frameSta
for (layerKey in this.layerRenderers_) { for (layerKey in this.layerRenderers_) {
if (!(layerKey in frameState.layerStates)) { if (!(layerKey in frameState.layerStates)) {
frameState.postRenderFunctions.push( frameState.postRenderFunctions.push(
this.removeUnusedLayerRenderers_.bind(this)); /** @type {ol.PostRenderFunction} */ (this.removeUnusedLayerRenderers_.bind(this))
);
return; return;
} }
} }
@@ -139,7 +139,7 @@ ol.renderer.webgl.ImageLayer.prototype.prepareFrame = function(frameState, layer
texture = this.createTexture_(image_); texture = this.createTexture_(image_);
if (this.texture) { if (this.texture) {
frameState.postRenderFunctions.push( frameState.postRenderFunctions.push(
goog.partial( /** @type {ol.PostRenderFunction} */ (goog.partial(
/** /**
* @param {WebGLRenderingContext} gl GL. * @param {WebGLRenderingContext} gl GL.
* @param {WebGLTexture} texture Texture. * @param {WebGLTexture} texture Texture.
@@ -148,7 +148,7 @@ ol.renderer.webgl.ImageLayer.prototype.prepareFrame = function(frameState, layer
if (!gl.isContextLost()) { if (!gl.isContextLost()) {
gl.deleteTexture(texture); gl.deleteTexture(texture);
} }
}, gl, this.texture)); }, gl, this.texture)));
} }
} }
} }
+2 -2
View File
@@ -95,7 +95,7 @@ ol.renderer.webgl.Layer.prototype.bindFramebuffer = function(frameState, framebu
this.framebufferDimension != framebufferDimension) { this.framebufferDimension != framebufferDimension) {
frameState.postRenderFunctions.push( frameState.postRenderFunctions.push(
goog.partial( /** @type {ol.PostRenderFunction} */ (goog.partial(
/** /**
* @param {WebGLRenderingContext} gl GL. * @param {WebGLRenderingContext} gl GL.
* @param {WebGLFramebuffer} framebuffer Framebuffer. * @param {WebGLFramebuffer} framebuffer Framebuffer.
@@ -106,7 +106,7 @@ ol.renderer.webgl.Layer.prototype.bindFramebuffer = function(frameState, framebu
gl.deleteFramebuffer(framebuffer); gl.deleteFramebuffer(framebuffer);
gl.deleteTexture(texture); gl.deleteTexture(texture);
} }
}, gl, this.framebuffer, this.texture)); }, gl, this.framebuffer, this.texture)));
var texture = ol.webgl.Context.createEmptyTexture( var texture = ol.webgl.Context.createEmptyTexture(
gl, framebufferDimension, framebufferDimension); gl, framebufferDimension, framebufferDimension);
+3 -11
View File
@@ -4,8 +4,6 @@ goog.provide('ol.renderer.webgl.Map');
goog.require('goog.asserts'); goog.require('goog.asserts');
goog.require('goog.dom'); goog.require('goog.dom');
goog.require('goog.log');
goog.require('goog.log.Logger');
goog.require('goog.style'); goog.require('goog.style');
goog.require('goog.webgl'); goog.require('goog.webgl');
goog.require('ol'); goog.require('ol');
@@ -426,14 +424,6 @@ ol.renderer.webgl.Map.prototype.isTileTextureLoaded = function(tile) {
}; };
/**
* @private
* @type {goog.log.Logger}
*/
ol.renderer.webgl.Map.prototype.logger_ =
goog.log.getLogger('ol.renderer.webgl.Map');
/** /**
* @inheritDoc * @inheritDoc
*/ */
@@ -512,7 +502,9 @@ ol.renderer.webgl.Map.prototype.renderFrame = function(frameState) {
if (this.textureCache_.getCount() - this.textureCacheFrameMarkerCount_ > if (this.textureCache_.getCount() - this.textureCacheFrameMarkerCount_ >
ol.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK) { ol.WEBGL_TEXTURE_CACHE_HIGH_WATER_MARK) {
frameState.postRenderFunctions.push(this.expireCache_.bind(this)); frameState.postRenderFunctions.push(
/** @type {ol.PostRenderFunction} */ (this.expireCache_.bind(this))
);
} }
if (!this.tileTextureQueue_.isEmpty()) { if (!this.tileTextureQueue_.isEmpty()) {
@@ -117,7 +117,7 @@ ol.renderer.webgl.VectorLayer.prototype.forEachFeatureAtCoordinate = function(co
frameState.size, frameState.pixelRatio, layerState.opacity, frameState.size, frameState.pixelRatio, layerState.opacity,
{}, {},
/** /**
* @param {ol.Feature} feature Feature. * @param {ol.Feature|ol.render.Feature} feature Feature.
* @return {?} Callback result. * @return {?} Callback result.
*/ */
function(feature) { function(feature) {