Remove use of goog.bind and use ES5 .bind

This commit is contained in:
Nicholas L
2016-01-08 23:41:24 +13:00
parent ace3ac4f1d
commit db3ad70a3d
27 changed files with 64 additions and 58 deletions
+1 -1
View File
@@ -55,7 +55,7 @@ ol.source.BingMaps = function(options) {
'include': 'ImageryProviders',
'uriScheme': 'https',
'key': options.key
}, goog.bind(this.handleImageryMetadataResponse, this));
}, this.handleImageryMetadataResponse.bind(this));
};
goog.inherits(ol.source.BingMaps, ol.source.TileImage);
+2 -2
View File
@@ -130,10 +130,10 @@ ol.source.Image.prototype.getImage = function(extent, resolution, pixelRatio, pr
this.reprojectedImage_ = new ol.reproj.Image(
sourceProjection, projection, extent, resolution, pixelRatio,
goog.bind(function(extent, resolution, pixelRatio) {
function(extent, resolution, pixelRatio) {
return this.getImageInternal(extent, resolution,
pixelRatio, sourceProjection);
}, this));
}.bind(this));
this.reprojectedRevision_ = this.getRevision();
return this.reprojectedImage_;
+1 -1
View File
@@ -65,7 +65,7 @@ ol.source.ImageVector = function(options) {
goog.base(this, {
attributions: options.attributions,
canvasFunction: goog.bind(this.canvasFunctionInternal_, this),
canvasFunction: this.canvasFunctionInternal_.bind(this),
logo: options.logo,
projection: options.projection,
ratio: options.ratio,
+1 -1
View File
@@ -80,7 +80,7 @@ ol.source.Raster = function(options) {
function() {
return 1;
},
goog.bind(this.changed, this));
this.changed.bind(this));
var layerStatesArray = ol.source.Raster.getLayerStatesArray_(this.renderers_);
var layerStates = {};
+1 -1
View File
@@ -42,7 +42,7 @@ ol.source.TileArcGISRest = function(opt_options) {
reprojectionErrorThreshold: options.reprojectionErrorThreshold,
tileGrid: options.tileGrid,
tileLoadFunction: options.tileLoadFunction,
tileUrlFunction: goog.bind(this.tileUrlFunction_, this),
tileUrlFunction: this.tileUrlFunction_.bind(this),
url: options.url,
urls: options.urls,
wrapX: options.wrapX !== undefined ? options.wrapX : true
+2 -2
View File
@@ -229,9 +229,9 @@ ol.source.TileImage.prototype.getTile = function(z, x, y, pixelRatio, projection
sourceProjection, sourceTileGrid,
projection, targetTileGrid,
tileCoord, wrappedTileCoord, this.getTilePixelRatio(pixelRatio),
goog.bind(function(z, x, y, pixelRatio) {
function(z, x, y, pixelRatio) {
return this.getTileInternal(z, x, y, pixelRatio, sourceProjection);
}, this), this.reprojectionErrorThreshold_,
}.bind(this), this.reprojectionErrorThreshold_,
this.renderReprojectionEdges_);
cache.set(tileCoordKey, tile);
+2 -2
View File
@@ -45,8 +45,8 @@ ol.source.TileJSON = function(options) {
if (options.jsonp) {
var request = new goog.net.Jsonp(options.url);
request.send(undefined, goog.bind(this.handleTileJSONResponse, this),
goog.bind(this.handleTileJSONError, this));
request.send(undefined, this.handleTileJSONResponse.bind(this),
this.handleTileJSONError.bind(this));
} else {
var xhr = new goog.net.XhrIo(new goog.net.CorsXmlHttpFactory());
goog.events.listen(xhr, goog.net.EventType.COMPLETE, function(e) {
+3 -3
View File
@@ -50,7 +50,7 @@ ol.source.TileUTFGrid = function(options) {
this.template_ = undefined;
var request = new goog.net.Jsonp(options.url);
request.send(undefined, goog.bind(this.handleTileJSONResponse, this));
request.send(undefined, this.handleTileJSONResponse.bind(this));
};
goog.inherits(ol.source.TileUTFGrid, ol.source.Tile);
@@ -361,8 +361,8 @@ ol.source.TileUTFGridTile_.prototype.loadInternal_ = function() {
if (this.state == ol.TileState.IDLE) {
this.state = ol.TileState.LOADING;
var request = new goog.net.Jsonp(this.src_);
request.send(undefined, goog.bind(this.handleLoad_, this),
goog.bind(this.handleError_, this));
request.send(undefined, this.handleLoad_.bind(this),
this.handleError_.bind(this));
}
};
+1 -1
View File
@@ -46,7 +46,7 @@ ol.source.TileWMS = function(opt_options) {
reprojectionErrorThreshold: options.reprojectionErrorThreshold,
tileGrid: options.tileGrid,
tileLoadFunction: options.tileLoadFunction,
tileUrlFunction: goog.bind(this.tileUrlFunction_, this),
tileUrlFunction: this.tileUrlFunction_.bind(this),
url: options.url,
urls: options.urls,
wrapX: options.wrapX !== undefined ? options.wrapX : true