Use ol.inherits instead of goog.inherits

This commit is contained in:
Frederic Junod
2016-04-07 16:26:11 +02:00
parent 072728b083
commit e289bfbb7d
166 changed files with 448 additions and 452 deletions

View File

@@ -23,7 +23,7 @@ goog.require('ol.tilecoord');
*/
ol.source.BingMaps = function(options) {
goog.base(this, {
ol.source.TileImage.call(this, {
cacheSize: options.cacheSize,
crossOrigin: 'anonymous',
opaque: true,
@@ -54,7 +54,7 @@ ol.source.BingMaps = function(options) {
'jsonp');
};
goog.inherits(ol.source.BingMaps, ol.source.TileImage);
ol.inherits(ol.source.BingMaps, ol.source.TileImage);
/**

View File

@@ -40,7 +40,7 @@ ol.source.CartoDB = function(options) {
*/
this.templateCache_ = {};
goog.base(this, {
ol.source.XYZ.call(this, {
attributions: options.attributions,
cacheSize: options.cacheSize,
crossOrigin: options.crossOrigin,
@@ -53,7 +53,7 @@ ol.source.CartoDB = function(options) {
});
this.initializeMap_();
};
goog.inherits(ol.source.CartoDB, ol.source.XYZ);
ol.inherits(ol.source.CartoDB, ol.source.XYZ);
/**

View File

@@ -24,7 +24,7 @@ goog.require('ol.source.Vector');
* @api
*/
ol.source.Cluster = function(options) {
goog.base(this, {
ol.source.Vector.call(this, {
attributions: options.attributions,
extent: options.extent,
logo: options.logo,
@@ -70,7 +70,7 @@ ol.source.Cluster = function(options) {
this.source_.on(ol.events.EventType.CHANGE,
ol.source.Cluster.prototype.onSourceChange_, this);
};
goog.inherits(ol.source.Cluster, ol.source.Vector);
ol.inherits(ol.source.Cluster, ol.source.Vector);
/**

View File

@@ -31,7 +31,7 @@ ol.source.ImageArcGISRest = function(opt_options) {
var options = opt_options || {};
goog.base(this, {
ol.source.Image.call(this, {
attributions: options.attributions,
logo: options.logo,
projection: options.projection,
@@ -91,7 +91,7 @@ ol.source.ImageArcGISRest = function(opt_options) {
this.ratio_ = options.ratio !== undefined ? options.ratio : 1.5;
};
goog.inherits(ol.source.ImageArcGISRest, ol.source.Image);
ol.inherits(ol.source.ImageArcGISRest, ol.source.Image);
/**

View File

@@ -16,7 +16,7 @@ goog.require('ol.source.Image');
*/
ol.source.ImageCanvas = function(options) {
goog.base(this, {
ol.source.Image.call(this, {
attributions: options.attributions,
logo: options.logo,
projection: options.projection,
@@ -50,7 +50,7 @@ ol.source.ImageCanvas = function(options) {
options.ratio : 1.5;
};
goog.inherits(ol.source.ImageCanvas, ol.source.Image);
ol.inherits(ol.source.ImageCanvas, ol.source.Image);
/**

View File

@@ -21,7 +21,7 @@ goog.require('ol.source.Image');
*/
ol.source.ImageMapGuide = function(options) {
goog.base(this, {
ol.source.Image.call(this, {
projection: options.projection,
resolutions: options.resolutions
});
@@ -98,7 +98,7 @@ ol.source.ImageMapGuide = function(options) {
this.renderedRevision_ = 0;
};
goog.inherits(ol.source.ImageMapGuide, ol.source.Image);
ol.inherits(ol.source.ImageMapGuide, ol.source.Image);
/**

View File

@@ -24,7 +24,7 @@ goog.require('ol.source.Source');
*/
ol.source.Image = function(options) {
goog.base(this, {
ol.source.Source.call(this, {
attributions: options.attributions,
extent: options.extent,
logo: options.logo,
@@ -59,7 +59,7 @@ ol.source.Image = function(options) {
this.reprojectedRevision_ = 0;
};
goog.inherits(ol.source.Image, ol.source.Source);
ol.inherits(ol.source.Image, ol.source.Source);
/**
@@ -192,7 +192,7 @@ ol.source.Image.defaultImageLoadFunction = function(image, src) {
*/
ol.source.ImageEvent = function(type, image) {
goog.base(this, type);
ol.events.Event.call(this, type);
/**
* The image related to the event.
@@ -202,7 +202,7 @@ ol.source.ImageEvent = function(type, image) {
this.image = image;
};
goog.inherits(ol.source.ImageEvent, ol.events.Event);
ol.inherits(ol.source.ImageEvent, ol.events.Event);
/**

View File

@@ -29,7 +29,7 @@ ol.source.ImageStatic = function(options) {
options.imageLoadFunction !== undefined ?
options.imageLoadFunction : ol.source.Image.defaultImageLoadFunction;
goog.base(this, {
ol.source.Image.call(this, {
attributions: options.attributions,
logo: options.logo,
projection: ol.proj.get(options.projection)
@@ -52,7 +52,7 @@ ol.source.ImageStatic = function(options) {
this.handleImageChange, this);
};
goog.inherits(ol.source.ImageStatic, ol.source.Image);
ol.inherits(ol.source.ImageStatic, ol.source.Image);
/**
@@ -93,5 +93,5 @@ ol.source.ImageStatic.prototype.handleImageChange = function(evt) {
this.image_.setImage(canvas);
}
}
goog.base(this, 'handleImageChange', evt);
ol.source.Image.prototype.handleImageChange.call(this, evt);
};

View File

@@ -63,7 +63,7 @@ ol.source.ImageVector = function(options) {
*/
this.replayGroup_ = null;
goog.base(this, {
ol.source.ImageCanvas.call(this, {
attributions: options.attributions,
canvasFunction: this.canvasFunctionInternal_.bind(this),
logo: options.logo,
@@ -93,7 +93,7 @@ ol.source.ImageVector = function(options) {
this.handleSourceChange_, this);
};
goog.inherits(ol.source.ImageVector, ol.source.ImageCanvas);
ol.inherits(ol.source.ImageVector, ol.source.ImageCanvas);
/**

View File

@@ -31,7 +31,7 @@ ol.source.ImageWMS = function(opt_options) {
var options = opt_options || {};
goog.base(this, {
ol.source.Image.call(this, {
attributions: options.attributions,
logo: options.logo,
projection: options.projection,
@@ -109,7 +109,7 @@ ol.source.ImageWMS = function(opt_options) {
this.ratio_ = options.ratio !== undefined ? options.ratio : 1.5;
};
goog.inherits(ol.source.ImageWMS, ol.source.Image);
ol.inherits(ol.source.ImageWMS, ol.source.Image);
/**

View File

@@ -34,7 +34,7 @@ ol.source.MapQuest = function(opt_options) {
'https://otile{1-4}-s.mqcdn.com/tiles/1.0.0/' +
this.layer_ + '/{z}/{x}/{y}.jpg';
goog.base(this, {
ol.source.XYZ.call(this, {
attributions: layerConfig.attributions,
cacheSize: options.cacheSize,
crossOrigin: 'anonymous',
@@ -47,7 +47,7 @@ ol.source.MapQuest = function(opt_options) {
});
};
goog.inherits(ol.source.MapQuest, ol.source.XYZ);
ol.inherits(ol.source.MapQuest, ol.source.XYZ);
/**

View File

@@ -30,7 +30,7 @@ ol.source.OSM = function(opt_options) {
var url = options.url !== undefined ?
options.url : 'https://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png';
goog.base(this, {
ol.source.XYZ.call(this, {
attributions: attributions,
cacheSize: options.cacheSize,
crossOrigin: crossOrigin,
@@ -43,7 +43,7 @@ ol.source.OSM = function(opt_options) {
});
};
goog.inherits(ol.source.OSM, ol.source.XYZ);
ol.inherits(ol.source.OSM, ol.source.XYZ);
/**

View File

@@ -132,14 +132,14 @@ ol.source.Raster = function(options) {
wantedTiles: {}
};
goog.base(this, {});
ol.source.Image.call(this, {});
if (options.operation !== undefined) {
this.setOperation(options.operation, options.lib);
}
};
goog.inherits(ol.source.Raster, ol.source.Image);
ol.inherits(ol.source.Raster, ol.source.Image);
/**
@@ -458,7 +458,7 @@ ol.source.Raster.createTileRenderer_ = function(source) {
* @param {Object} data An object made available to operations.
*/
ol.source.RasterEvent = function(type, frameState, data) {
goog.base(this, type);
ol.events.Event.call(this, type);
/**
* The raster extent.
@@ -483,7 +483,7 @@ ol.source.RasterEvent = function(type, frameState, data) {
this.data = data;
};
goog.inherits(ol.source.RasterEvent, ol.events.Event);
ol.inherits(ol.source.RasterEvent, ol.events.Event);
/**

View File

@@ -34,7 +34,7 @@ ol.source.State = {
*/
ol.source.Source = function(options) {
goog.base(this);
ol.Object.call(this);
/**
* @private
@@ -68,7 +68,7 @@ ol.source.Source = function(options) {
this.wrapX_ = options.wrapX !== undefined ? options.wrapX : false;
};
goog.inherits(ol.source.Source, ol.Object);
ol.inherits(ol.source.Source, ol.Object);
/**
* Turns various ways of defining an attribution to an array of `ol.Attributions`.

View File

@@ -101,7 +101,7 @@ ol.source.Stamen = function(options) {
'https://stamen-tiles-{a-d}.a.ssl.fastly.net/' + options.layer +
'/{z}/{x}/{y}.' + layerConfig.extension;
goog.base(this, {
ol.source.XYZ.call(this, {
attributions: ol.source.Stamen.ATTRIBUTIONS,
cacheSize: options.cacheSize,
crossOrigin: 'anonymous',
@@ -114,7 +114,7 @@ ol.source.Stamen = function(options) {
});
};
goog.inherits(ol.source.Stamen, ol.source.XYZ);
ol.inherits(ol.source.Stamen, ol.source.XYZ);
/**

View File

@@ -30,7 +30,7 @@ ol.source.TileArcGISRest = function(opt_options) {
var options = opt_options || {};
goog.base(this, {
ol.source.TileImage.call(this, {
attributions: options.attributions,
cacheSize: options.cacheSize,
crossOrigin: options.crossOrigin,
@@ -57,7 +57,7 @@ ol.source.TileArcGISRest = function(opt_options) {
this.tmpExtent_ = ol.extent.createEmpty();
};
goog.inherits(ol.source.TileArcGISRest, ol.source.TileImage);
ol.inherits(ol.source.TileArcGISRest, ol.source.TileImage);
/**

View File

@@ -17,7 +17,7 @@ goog.require('ol.source.Tile');
*/
ol.DebugTile_ = function(tileCoord, tileSize, text) {
goog.base(this, tileCoord, ol.TileState.LOADED);
ol.Tile.call(this, tileCoord, ol.TileState.LOADED);
/**
* @private
@@ -38,7 +38,7 @@ ol.DebugTile_ = function(tileCoord, tileSize, text) {
this.canvasByContext_ = {};
};
goog.inherits(ol.DebugTile_, ol.Tile);
ol.inherits(ol.DebugTile_, ol.Tile);
/**
@@ -87,7 +87,7 @@ ol.DebugTile_.prototype.getImage = function(opt_context) {
*/
ol.source.TileDebug = function(options) {
goog.base(this, {
ol.source.Tile.call(this, {
opaque: false,
projection: options.projection,
tileGrid: options.tileGrid,
@@ -95,7 +95,7 @@ ol.source.TileDebug = function(options) {
});
};
goog.inherits(ol.source.TileDebug, ol.source.Tile);
ol.inherits(ol.source.TileDebug, ol.source.Tile);
/**

View File

@@ -23,7 +23,7 @@ goog.require('ol.source.UrlTile');
*/
ol.source.TileImage = function(options) {
goog.base(this, {
ol.source.UrlTile.call(this, {
attributions: options.attributions,
cacheSize: options.cacheSize,
extent: options.extent,
@@ -80,7 +80,7 @@ ol.source.TileImage = function(options) {
*/
this.renderReprojectionEdges_ = false;
};
goog.inherits(ol.source.TileImage, ol.source.UrlTile);
ol.inherits(ol.source.TileImage, ol.source.UrlTile);
/**
@@ -88,7 +88,7 @@ goog.inherits(ol.source.TileImage, ol.source.UrlTile);
*/
ol.source.TileImage.prototype.canExpireCache = function() {
if (!ol.ENABLE_RASTER_REPROJECTION) {
return goog.base(this, 'canExpireCache');
return ol.source.UrlTile.prototype.canExpireCache.call(this);
}
if (this.tileCache.canExpireCache()) {
return true;
@@ -108,7 +108,7 @@ ol.source.TileImage.prototype.canExpireCache = function() {
*/
ol.source.TileImage.prototype.expireCache = function(projection, usedTiles) {
if (!ol.ENABLE_RASTER_REPROJECTION) {
goog.base(this, 'expireCache', projection, usedTiles);
ol.source.UrlTile.prototype.expireCache.call(this, projection, usedTiles);
return;
}
var usedTileCache = this.getTileCacheForProjection(projection);
@@ -153,7 +153,7 @@ ol.source.TileImage.prototype.getOpaque = function(projection) {
!ol.proj.equivalent(this.getProjection(), projection)) {
return false;
} else {
return goog.base(this, 'getOpaque', projection);
return ol.source.UrlTile.prototype.getOpaque.call(this, projection);
}
};
@@ -163,7 +163,7 @@ ol.source.TileImage.prototype.getOpaque = function(projection) {
*/
ol.source.TileImage.prototype.getTileGridForProjection = function(projection) {
if (!ol.ENABLE_RASTER_REPROJECTION) {
return goog.base(this, 'getTileGridForProjection', projection);
return ol.source.UrlTile.prototype.getTileGridForProjection.call(this, projection);
}
var thisProj = this.getProjection();
if (this.tileGrid &&
@@ -185,7 +185,7 @@ ol.source.TileImage.prototype.getTileGridForProjection = function(projection) {
*/
ol.source.TileImage.prototype.getTileCacheForProjection = function(projection) {
if (!ol.ENABLE_RASTER_REPROJECTION) {
return goog.base(this, 'getTileCacheForProjection', projection);
return ol.source.UrlTile.prototype.getTileCacheForProjection.call(this, projection);
}
var thisProj = this.getProjection();
if (!thisProj || ol.proj.equivalent(thisProj, projection)) {

View File

@@ -35,7 +35,7 @@ ol.source.TileJSON = function(options) {
*/
this.tileJSON_ = null;
goog.base(this, {
ol.source.TileImage.call(this, {
attributions: options.attributions,
cacheSize: options.cacheSize,
crossOrigin: options.crossOrigin,
@@ -58,7 +58,7 @@ ol.source.TileJSON = function(options) {
}
};
goog.inherits(ol.source.TileJSON, ol.source.TileImage);
ol.inherits(ol.source.TileJSON, ol.source.TileImage);
/**

View File

@@ -27,7 +27,7 @@ goog.require('ol.tilegrid.TileGrid');
*/
ol.source.Tile = function(options) {
goog.base(this, {
ol.source.Source.call(this, {
attributions: options.attributions,
extent: options.extent,
logo: options.logo,
@@ -74,7 +74,7 @@ ol.source.Tile = function(options) {
this.key_ = '';
};
goog.inherits(ol.source.Tile, ol.source.Source);
ol.inherits(ol.source.Tile, ol.source.Source);
/**
@@ -322,7 +322,7 @@ ol.source.Tile.prototype.useTile = ol.nullFunction;
*/
ol.source.TileEvent = function(type, tile) {
goog.base(this, type);
ol.events.Event.call(this, type);
/**
* The tile related to the event.
@@ -332,7 +332,7 @@ ol.source.TileEvent = function(type, tile) {
this.tile = tile;
};
goog.inherits(ol.source.TileEvent, ol.events.Event);
ol.inherits(ol.source.TileEvent, ol.events.Event);
/**

View File

@@ -25,7 +25,7 @@ goog.require('ol.source.Tile');
* @api
*/
ol.source.TileUTFGrid = function(options) {
goog.base(this, {
ol.source.Tile.call(this, {
projection: ol.proj.get('EPSG:3857'),
state: ol.source.State.LOADING
});
@@ -72,7 +72,7 @@ ol.source.TileUTFGrid = function(options) {
goog.asserts.fail('Either url or tileJSON options must be provided');
}
};
goog.inherits(ol.source.TileUTFGrid, ol.source.Tile);
ol.inherits(ol.source.TileUTFGrid, ol.source.Tile);
/**
@@ -270,7 +270,7 @@ ol.source.TileUTFGrid.prototype.useTile = function(z, x, y) {
*/
ol.source.TileUTFGridTile_ = function(tileCoord, state, src, extent, preemptive, jsonp) {
goog.base(this, tileCoord, state);
ol.Tile.call(this, tileCoord, state);
/**
* @private
@@ -316,7 +316,7 @@ ol.source.TileUTFGridTile_ = function(tileCoord, state, src, extent, preemptive,
this.jsonp_ = jsonp;
};
goog.inherits(ol.source.TileUTFGridTile_, ol.Tile);
ol.inherits(ol.source.TileUTFGridTile_, ol.Tile);
/**

View File

@@ -36,7 +36,7 @@ ol.source.TileWMS = function(opt_options) {
var transparent = 'TRANSPARENT' in params ? params['TRANSPARENT'] : true;
goog.base(this, {
ol.source.TileImage.call(this, {
attributions: options.attributions,
cacheSize: options.cacheSize,
crossOrigin: options.crossOrigin,
@@ -99,7 +99,7 @@ ol.source.TileWMS = function(opt_options) {
this.setKey(this.getKeyForParams_());
};
goog.inherits(ol.source.TileWMS, ol.source.TileImage);
ol.inherits(ol.source.TileWMS, ol.source.TileImage);
/**
@@ -180,7 +180,7 @@ ol.source.TileWMS.prototype.getGutterInternal = function() {
* @inheritDoc
*/
ol.source.TileWMS.prototype.getKeyZXY = function(z, x, y) {
return this.coordKeyPrefix_ + goog.base(this, 'getKeyZXY', z, x, y);
return this.coordKeyPrefix_ + ol.source.TileImage.prototype.getKeyZXY.call(this, z, x, y);
};

View File

@@ -18,7 +18,7 @@ goog.require('ol.source.TileEvent');
*/
ol.source.UrlTile = function(options) {
goog.base(this, {
ol.source.Tile.call(this, {
attributions: options.attributions,
cacheSize: options.cacheSize,
extent: options.extent,
@@ -61,7 +61,7 @@ ol.source.UrlTile = function(options) {
}
};
goog.inherits(ol.source.UrlTile, ol.source.Tile);
ol.inherits(ol.source.UrlTile, ol.source.Tile);
/**

View File

@@ -76,7 +76,7 @@ ol.source.Vector = function(opt_options) {
var options = opt_options || {};
goog.base(this, {
ol.source.Source.call(this, {
attributions: options.attributions,
logo: options.logo,
projection: undefined,
@@ -183,7 +183,7 @@ ol.source.Vector = function(opt_options) {
}
};
goog.inherits(ol.source.Vector, ol.source.Source);
ol.inherits(ol.source.Vector, ol.source.Source);
/**
@@ -888,7 +888,7 @@ ol.source.Vector.prototype.removeFromIdIndex_ = function(feature) {
*/
ol.source.VectorEvent = function(type, opt_feature) {
goog.base(this, type);
ol.events.Event.call(this, type);
/**
* The feature being added or removed.
@@ -898,4 +898,4 @@ ol.source.VectorEvent = function(type, opt_feature) {
this.feature = opt_feature;
};
goog.inherits(ol.source.VectorEvent, ol.events.Event);
ol.inherits(ol.source.VectorEvent, ol.events.Event);

View File

@@ -27,7 +27,7 @@ goog.require('ol.source.UrlTile');
*/
ol.source.VectorTile = function(options) {
goog.base(this, {
ol.source.UrlTile.call(this, {
attributions: options.attributions,
cacheSize: options.cacheSize !== undefined ? options.cacheSize : 128,
extent: options.extent,
@@ -59,7 +59,7 @@ ol.source.VectorTile = function(options) {
this.tileClass = options.tileClass ? options.tileClass : ol.VectorTile;
};
goog.inherits(ol.source.VectorTile, ol.source.UrlTile);
ol.inherits(ol.source.VectorTile, ol.source.UrlTile);
/**

View File

@@ -163,7 +163,7 @@ ol.source.WMTS = function(options) {
urls.map(createFromWMTSTemplate)) :
ol.TileUrlFunction.nullTileUrlFunction;
goog.base(this, {
ol.source.TileImage.call(this, {
attributions: options.attributions,
cacheSize: options.cacheSize,
crossOrigin: options.crossOrigin,
@@ -182,7 +182,7 @@ ol.source.WMTS = function(options) {
this.setKey(this.getKeyForDimensions_());
};
goog.inherits(ol.source.WMTS, ol.source.TileImage);
ol.inherits(ol.source.WMTS, ol.source.TileImage);
/**

View File

@@ -38,7 +38,7 @@ ol.source.XYZ = function(opt_options) {
tileSize: options.tileSize
});
goog.base(this, {
ol.source.TileImage.call(this, {
attributions: options.attributions,
cacheSize: options.cacheSize,
crossOrigin: options.crossOrigin,
@@ -56,4 +56,4 @@ ol.source.XYZ = function(opt_options) {
});
};
goog.inherits(ol.source.XYZ, ol.source.TileImage);
ol.inherits(ol.source.XYZ, ol.source.TileImage);

View File

@@ -118,7 +118,7 @@ ol.source.Zoomify = function(opt_options) {
}
}
goog.base(this, {
ol.source.TileImage.call(this, {
attributions: options.attributions,
cacheSize: options.cacheSize,
crossOrigin: options.crossOrigin,
@@ -130,7 +130,7 @@ ol.source.Zoomify = function(opt_options) {
});
};
goog.inherits(ol.source.Zoomify, ol.source.TileImage);
ol.inherits(ol.source.Zoomify, ol.source.TileImage);
/**
@@ -146,7 +146,7 @@ goog.inherits(ol.source.Zoomify, ol.source.TileImage);
ol.source.ZoomifyTile_ = function(
tileCoord, state, src, crossOrigin, tileLoadFunction) {
goog.base(this, tileCoord, state, src, crossOrigin, tileLoadFunction);
ol.ImageTile.call(this, tileCoord, state, src, crossOrigin, tileLoadFunction);
/**
* @private
@@ -156,7 +156,7 @@ ol.source.ZoomifyTile_ = function(
this.zoomifyImageByContext_ = {};
};
goog.inherits(ol.source.ZoomifyTile_, ol.ImageTile);
ol.inherits(ol.source.ZoomifyTile_, ol.ImageTile);
/**
@@ -169,7 +169,7 @@ ol.source.ZoomifyTile_.prototype.getImage = function(opt_context) {
if (key in this.zoomifyImageByContext_) {
return this.zoomifyImageByContext_[key];
} else {
var image = goog.base(this, 'getImage', opt_context);
var image = ol.ImageTile.prototype.getImage.call(this, opt_context);
if (this.state == ol.TileState.LOADED) {
if (image.width == tileSize && image.height == tileSize) {
this.zoomifyImageByContext_[key] = image;