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

View File

@@ -53,7 +53,7 @@ var proj54009 = ol.proj.get('ESRI:54009');
proj54009.setExtent([-18e6, -9e6, 18e6, 9e6]);
var layers = [];
var layers = {};
layers['bng'] = new ol.layer.Tile({
source: new ol.source.XYZ({

View File

@@ -273,8 +273,8 @@ ol.interaction.Select.handleEvent = function(mapBrowserEvent) {
var set = !add && !remove && !toggle;
var map = mapBrowserEvent.map;
var features = this.featureOverlay_.getSource().getFeaturesCollection();
var /** @type {!Array.<ol.Feature>} */ deselected = [];
var /** @type {!Array.<ol.Feature>} */ selected = [];
var deselected = [];
var selected = [];
var change = false;
if (set) {
// Replace the currently selected feature(s) with the feature(s) at the

View File

@@ -197,7 +197,7 @@ ol.render.webgl.ImageReplay = function(tolerance, maxExtent) {
/**
* Start index per feature (the feature).
* @type {Array.<ol.Feature>}
* @type {Array.<ol.Feature|ol.render.Feature>}
* @private
*/
this.startIndicesFeature_ = [];
@@ -494,7 +494,7 @@ ol.render.webgl.ImageReplay.prototype.createTextures_ = function(textures, image
* @param {number} opacity Global opacity.
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
* 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 {ol.Extent=} opt_hitExtent Hit extent: Only features intersecting
* this extent are checked.
@@ -729,7 +729,7 @@ ol.render.webgl.ImageReplay.prototype.drawElements_ = function(
* @param {ol.webgl.Context} context Context.
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
* 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 {ol.Extent=} opt_hitExtent Hit extent: Only features intersecting
* this extent are checked.
@@ -756,7 +756,7 @@ ol.render.webgl.ImageReplay.prototype.drawHitDetectionReplay_ = function(gl, con
* @param {ol.webgl.Context} context Context.
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
* 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.
* @template T
*/
@@ -780,7 +780,7 @@ ol.render.webgl.ImageReplay.prototype.drawHitDetectionReplayAll_ = function(gl,
* @param {ol.webgl.Context} context Context.
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
* 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
* this extent are checked.
* @return {T|undefined} Callback result.
@@ -1038,7 +1038,7 @@ ol.render.webgl.ReplayGroup.prototype.replay = function(context,
* @param {number} opacity Global opacity.
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
* 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 {ol.Extent=} opt_hitExtent Hit extent: Only features intersecting
* this extent are checked.
@@ -1075,7 +1075,7 @@ ol.render.webgl.ReplayGroup.prototype.replayHitDetection_ = function(context,
* @param {number} opacity Global opacity.
* @param {Object.<string, boolean>} skippedFeaturesHash Ids of features
* 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.
* @template T
*/
@@ -1104,7 +1104,7 @@ ol.render.webgl.ReplayGroup.prototype.forEachFeatureAtCoordinate = function(
coordinate, resolution, rotation, ol.render.webgl.HIT_DETECTION_SIZE_,
pixelRatio, opacity, skippedFeaturesHash,
/**
* @param {ol.Feature} feature Feature.
* @param {ol.Feature|ol.render.Feature} feature Feature.
* @return {?} Callback result.
*/
function(feature) {
@@ -1145,7 +1145,7 @@ ol.render.webgl.ReplayGroup.prototype.hasFeatureAtCoordinate = function(
coordinate, resolution, rotation, ol.render.webgl.HIT_DETECTION_SIZE_,
pixelRatio, opacity, skippedFeaturesHash,
/**
* @param {ol.Feature} feature Feature.
* @param {ol.Feature|ol.render.Feature} feature Feature.
* @return {boolean} Is there a feature?
*/
function(feature) {

View File

@@ -182,7 +182,7 @@ ol.renderer.Layer.prototype.renderIfReadyAndVisible = function() {
ol.renderer.Layer.prototype.scheduleExpireCache = function(frameState, tileSource) {
if (tileSource.canExpireCache()) {
frameState.postRenderFunctions.push(
goog.partial(
/** @type {ol.PostRenderFunction} */ (goog.partial(
/**
* @param {ol.source.Tile} tileSource Tile source.
* @param {ol.Map} map Map.
@@ -192,7 +192,7 @@ ol.renderer.Layer.prototype.scheduleExpireCache = function(frameState, tileSourc
var tileSourceKey = goog.getUid(tileSource).toString();
tileSource.expireCache(frameState.viewState.projection,
frameState.usedTiles[tileSourceKey]);
}, tileSource));
}, tileSource)));
}
};

View File

@@ -351,7 +351,9 @@ ol.renderer.Map.prototype.removeUnusedLayerRenderers_ = function(map, frameState
* @protected
*/
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_) {
if (!(layerKey in frameState.layerStates)) {
frameState.postRenderFunctions.push(
this.removeUnusedLayerRenderers_.bind(this));
/** @type {ol.PostRenderFunction} */ (this.removeUnusedLayerRenderers_.bind(this))
);
return;
}
}

View File

@@ -139,7 +139,7 @@ ol.renderer.webgl.ImageLayer.prototype.prepareFrame = function(frameState, layer
texture = this.createTexture_(image_);
if (this.texture) {
frameState.postRenderFunctions.push(
goog.partial(
/** @type {ol.PostRenderFunction} */ (goog.partial(
/**
* @param {WebGLRenderingContext} gl GL.
* @param {WebGLTexture} texture Texture.
@@ -148,7 +148,7 @@ ol.renderer.webgl.ImageLayer.prototype.prepareFrame = function(frameState, layer
if (!gl.isContextLost()) {
gl.deleteTexture(texture);
}
}, gl, this.texture));
}, gl, this.texture)));
}
}
}

View File

@@ -95,7 +95,7 @@ ol.renderer.webgl.Layer.prototype.bindFramebuffer = function(frameState, framebu
this.framebufferDimension != framebufferDimension) {
frameState.postRenderFunctions.push(
goog.partial(
/** @type {ol.PostRenderFunction} */ (goog.partial(
/**
* @param {WebGLRenderingContext} gl GL.
* @param {WebGLFramebuffer} framebuffer Framebuffer.
@@ -106,7 +106,7 @@ ol.renderer.webgl.Layer.prototype.bindFramebuffer = function(frameState, framebu
gl.deleteFramebuffer(framebuffer);
gl.deleteTexture(texture);
}
}, gl, this.framebuffer, this.texture));
}, gl, this.framebuffer, this.texture)));
var texture = ol.webgl.Context.createEmptyTexture(
gl, framebufferDimension, framebufferDimension);

View File

@@ -4,8 +4,6 @@ goog.provide('ol.renderer.webgl.Map');
goog.require('goog.asserts');
goog.require('goog.dom');
goog.require('goog.log');
goog.require('goog.log.Logger');
goog.require('goog.style');
goog.require('goog.webgl');
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
*/
@@ -512,7 +502,9 @@ ol.renderer.webgl.Map.prototype.renderFrame = function(frameState) {
if (this.textureCache_.getCount() - this.textureCacheFrameMarkerCount_ >
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()) {

View File

@@ -117,7 +117,7 @@ ol.renderer.webgl.VectorLayer.prototype.forEachFeatureAtCoordinate = function(co
frameState.size, frameState.pixelRatio, layerState.opacity,
{},
/**
* @param {ol.Feature} feature Feature.
* @param {ol.Feature|ol.render.Feature} feature Feature.
* @return {?} Callback result.
*/
function(feature) {