This commit is contained in:
Marc Jansen
2012-06-20 17:45:00 +02:00
2 changed files with 6 additions and 4 deletions

View File

@@ -117,7 +117,7 @@ ol.Loc.prototype.transform = function(proj) {
if (goog.isString(proj)) {
proj = new ol.Projection(proj);
}
return this.transform_(proj);
return this._transform(proj);
};
/**
@@ -126,8 +126,8 @@ ol.Loc.prototype.transform = function(proj) {
* @param {!ol.Projection} proj The destination projection.
* @returns {!ol.Loc}
*/
ol.Loc.prototype.transform_ = function(proj) {
var point = {x: this.x_, y: this.y_};
ol.Loc.prototype._transform = function(proj) {
var point = {'x': this.x_, 'y': this.y_};
var sourceProj = this.projection_;
if (!goog.isDefAndNotNull(sourceProj)) {
throw new Error("Cannot transform a location without a source projection.");

View File

@@ -8,7 +8,7 @@ goog.require('ol.TileSet');
* Class for XYZ layers.
* @constructor
* @param {string} url URL template. E.g.
* http://a.tile.openstreetmap.org/${z}/${x}/${y}.png.
* http://a.tile.openstreetmap.org/{z}/{x}/{y}.png.
*/
ol.layer.XYZ = function(url) {
@@ -111,6 +111,7 @@ ol.layer.XYZ.prototype.getData = function(bounds, resolution) {
zoom = me.zoomForResolution(resolution);
resolution = me.resolutions_[zoom];
// define some values used for the actual tiling
var boundsMinX = bounds.getMinX(),
boundsMaxX = bounds.getMaxX(),
boundsMinY = bounds.getMinY(),
@@ -133,6 +134,7 @@ ol.layer.XYZ.prototype.getData = function(bounds, resolution) {
gridLeft = tileOriginX + tileWidthGeo * offsetX,
gridTop = tileOriginY - tileHeightGeo * offsetY;
// now tile
var tiles = [],
tile,
url,