Add ol.source.Tile support for wrapping around the x-axis
This commit is contained in:
@@ -37,15 +37,10 @@ ol.source.TileJSON = function(options) {
|
||||
crossOrigin: options.crossOrigin,
|
||||
projection: ol.proj.get('EPSG:3857'),
|
||||
state: ol.source.State.LOADING,
|
||||
tileLoadFunction: options.tileLoadFunction
|
||||
tileLoadFunction: options.tileLoadFunction,
|
||||
wrapX: goog.isDef(options.wrapX) ? options.wrapX : true
|
||||
});
|
||||
|
||||
/**
|
||||
* @type {boolean|undefined}
|
||||
* @private
|
||||
*/
|
||||
this.wrapX_ = options.wrapX;
|
||||
|
||||
var request = new goog.net.Jsonp(options.url);
|
||||
request.send(undefined, goog.bind(this.handleTileJSONResponse, this));
|
||||
|
||||
@@ -82,10 +77,7 @@ ol.source.TileJSON.prototype.handleTileJSONResponse = function(tileJSON) {
|
||||
this.tileGrid = tileGrid;
|
||||
|
||||
this.tileUrlFunction = ol.TileUrlFunction.withTileCoordTransform(
|
||||
tileGrid.createTileCoordTransform({
|
||||
extent: extent,
|
||||
wrapX: this.wrapX_
|
||||
}),
|
||||
tileGrid.createTileCoordTransform({extent: extent}),
|
||||
ol.TileUrlFunction.createFromTemplates(tileJSON.tiles));
|
||||
|
||||
if (goog.isDef(tileJSON.attribution) &&
|
||||
|
||||
Reference in New Issue
Block a user