the Tile constructor now takes a url as the first arg
This commit is contained in:
@@ -3,8 +3,15 @@ goog.provide('ol.Tile');
|
|||||||
/**
|
/**
|
||||||
* The Tile class.
|
* The Tile class.
|
||||||
* @constructor
|
* @constructor
|
||||||
|
* @param {string} url
|
||||||
*/
|
*/
|
||||||
ol.Tile = function() {
|
ol.Tile = function(url) {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @private
|
||||||
|
* @type {string}
|
||||||
|
*/
|
||||||
|
this.url_ = url;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
* @private
|
||||||
@@ -14,25 +21,22 @@ ol.Tile = function() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the tile for a given URL.
|
* Load the tile.
|
||||||
* @param {string} src The src URL.
|
|
||||||
*/
|
*/
|
||||||
ol.Tile.prototype.load = function(src) {
|
ol.Tile.prototype.load = function() {
|
||||||
this.setImgSrc(src);
|
this.img_.src = this.url_;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the image src.
|
* Get the tile url.
|
||||||
* @param {string|undefined} src The src URL.
|
* @return {string}
|
||||||
* @return {ol.Tile}
|
|
||||||
*/
|
*/
|
||||||
ol.Tile.prototype.setImgSrc = function(src) {
|
ol.Tile.prototype.getUrl = function() {
|
||||||
this.img_.src = src;
|
return this.url_;
|
||||||
return this;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the image node.
|
* Get the tile image.
|
||||||
* @return {Element}
|
* @return {Element}
|
||||||
*/
|
*/
|
||||||
ol.Tile.prototype.getImg = function() {
|
ol.Tile.prototype.getImg = function() {
|
||||||
@@ -41,7 +45,7 @@ ol.Tile.prototype.getImg = function() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an image node. This is done by cloning
|
* Create an image node. This is done by cloning
|
||||||
* an image template.
|
* the same image element.
|
||||||
* @return {Element}
|
* @return {Element}
|
||||||
*/
|
*/
|
||||||
ol.Tile.createImage = (function() {
|
ol.Tile.createImage = (function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user