Merge branch 'master' of github.com:openlayers/openlayers into utfgrid
This commit is contained in:
@@ -452,7 +452,9 @@ OpenLayers.Layer.ArcGISCache = OpenLayers.Class(OpenLayers.Layer.XYZ, {
|
||||
// Write the values into our formatted url
|
||||
url = OpenLayers.String.format(url, {'x': x, 'y': y, 'z': z});
|
||||
|
||||
return url;
|
||||
return OpenLayers.Util.urlAppend(
|
||||
url, OpenLayers.Util.getParameterString(this.params)
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -202,6 +202,10 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
||||
* track of the loading progress. Listeners are called with an object
|
||||
* with a tile property as first argument, making the loded tile
|
||||
* available to the listener.
|
||||
* tileerror - Triggered before the tileloaded event (i.e. when the tile is
|
||||
* still hidden) if a tile failed to load. Listeners receive an object
|
||||
* as first argument, which has a tile property that references the
|
||||
* tile that could not be loaded.
|
||||
*/
|
||||
|
||||
/**
|
||||
@@ -969,7 +973,6 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
||||
}
|
||||
this.numLoadingTiles++;
|
||||
};
|
||||
tile.events.register("loadstart", this, tile.onLoadStart);
|
||||
|
||||
tile.onLoadEnd = function() {
|
||||
this.numLoadingTiles--;
|
||||
@@ -987,8 +990,18 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
||||
}
|
||||
}
|
||||
};
|
||||
tile.events.register("loadend", this, tile.onLoadEnd);
|
||||
tile.events.register("unload", this, tile.onLoadEnd);
|
||||
|
||||
tile.onLoadError = function() {
|
||||
this.events.triggerEvent("tileerror", {tile: tile});
|
||||
};
|
||||
|
||||
tile.events.on({
|
||||
"loadstart": tile.onLoadStart,
|
||||
"loadend": tile.onLoadEnd,
|
||||
"unload": tile.onLoadEnd,
|
||||
"loaderror": tile.onLoadError,
|
||||
scope: this
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -1005,6 +1018,7 @@ OpenLayers.Layer.Grid = OpenLayers.Class(OpenLayers.Layer.HTTPRequest, {
|
||||
"loadstart": tile.onLoadStart,
|
||||
"loadend": tile.onLoadEnd,
|
||||
"unload": tile.onLoadEnd,
|
||||
"loaderror": tile.onLoadError,
|
||||
scope: this
|
||||
});
|
||||
},
|
||||
|
||||
@@ -60,7 +60,9 @@ OpenLayers.Layer.HTTPRequest = OpenLayers.Class(OpenLayers.Layer, {
|
||||
initialize: function(name, url, params, options) {
|
||||
OpenLayers.Layer.prototype.initialize.apply(this, [name, options]);
|
||||
this.url = url;
|
||||
this.params = OpenLayers.Util.extend( {}, params);
|
||||
if (!this.params) {
|
||||
this.params = OpenLayers.Util.extend({}, params);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
||||
@@ -34,7 +34,7 @@ OpenLayers.Layer.OSM = OpenLayers.Class(OpenLayers.Layer.XYZ, {
|
||||
/**
|
||||
* APIProperty: url
|
||||
* {String} The tileset URL scheme. Defaults to
|
||||
* : http://tile.openstreetmap.org/${z}/${x}/${y}.png
|
||||
* : http://[a|b|c].tile.openstreetmap.org/${z}/${x}/${y}.png
|
||||
* (the official OSM tileset) if the second argument to the constructor
|
||||
* is null or undefined. To use another tileset you can have something
|
||||
* like this:
|
||||
@@ -43,7 +43,11 @@ OpenLayers.Layer.OSM = OpenLayers.Class(OpenLayers.Layer.XYZ, {
|
||||
* "http://tah.openstreetmap.org/Tiles/tile/${z}/${x}/${y}.png");
|
||||
* (end)
|
||||
*/
|
||||
url: 'http://tile.openstreetmap.org/${z}/${x}/${y}.png',
|
||||
url: [
|
||||
'http://a.tile.openstreetmap.org/${z}/${x}/${y}.png',
|
||||
'http://b.tile.openstreetmap.org/${z}/${x}/${y}.png',
|
||||
'http://c.tile.openstreetmap.org/${z}/${x}/${y}.png'
|
||||
],
|
||||
|
||||
/**
|
||||
* Property: attribution
|
||||
|
||||
Reference in New Issue
Block a user