Remove ol.ImageUrlFunction

This was only used in ol.source.ImageMapGuide, and added unnecessary
overhead there.
This commit is contained in:
Andreas Hocevar
2015-11-13 11:27:26 +01:00
parent f5a148e6b3
commit 152dc6e5d0
3 changed files with 5 additions and 160 deletions

View File

@@ -6,7 +6,6 @@ goog.require('goog.object');
goog.require('goog.uri.utils');
goog.require('ol.Image');
goog.require('ol.ImageLoadFunctionType');
goog.require('ol.ImageUrlFunction');
goog.require('ol.extent');
goog.require('ol.source.Image');
@@ -49,19 +48,11 @@ ol.source.ImageMapGuide = function(options) {
*/
this.params_ = options.params !== undefined ? options.params : {};
var imageUrlFunction;
if (options.url !== undefined) {
imageUrlFunction = ol.ImageUrlFunction.createFromParamsFunction(
options.url, this.params_, goog.bind(this.getUrl, this));
} else {
imageUrlFunction = ol.ImageUrlFunction.nullImageUrlFunction;
}
/**
* @private
* @type {ol.ImageUrlFunctionType}
* @type {string|undefined}
*/
this.imageUrlFunction_ = imageUrlFunction;
this.url_ = options.url;
/**
* @private
@@ -148,8 +139,9 @@ ol.source.ImageMapGuide.prototype.getImageInternal =
var height = ol.extent.getHeight(extent) / resolution;
var size = [width * pixelRatio, height * pixelRatio];
var imageUrl = this.imageUrlFunction_(extent, size, projection);
if (imageUrl !== undefined) {
if (this.url_ !== undefined) {
var imageUrl = this.getUrl(this.url_, this.params_, extent, size,
projection);
image = new ol.Image(extent, resolution, pixelRatio,
this.getAttributions(), imageUrl, this.crossOrigin_,
this.imageLoadFunction_);