No extent magic
Setting the extent on a tile source now only means that tiles won't be drawn outside that extent. Now the only way to specify the origin of the tile grid is to provide a custom tileGrid. By default, the grid origin is the top left corner of the projection's extent.
This commit is contained in:
@@ -35,14 +35,12 @@ ol.source.TiledWMSOptions;
|
||||
* @param {ol.source.TiledWMSOptions} tiledWMSOptions options.
|
||||
*/
|
||||
ol.source.TiledWMS = function(tiledWMSOptions) {
|
||||
goog.asserts.assert(tiledWMSOptions.params);
|
||||
|
||||
var projection = goog.isDef(tiledWMSOptions.projection) ?
|
||||
tiledWMSOptions.projection : ol.Projection.getFromCode('EPSG:3857');
|
||||
var projectionExtent = projection.getExtent();
|
||||
|
||||
var extent = goog.isDef(tiledWMSOptions.extent) ?
|
||||
tiledWMSOptions.extent : projection.getExtent();
|
||||
tiledWMSOptions.extent : projectionExtent;
|
||||
|
||||
var version = goog.isDef(tiledWMSOptions.version) ?
|
||||
tiledWMSOptions.version : '1.3';
|
||||
@@ -60,7 +58,7 @@ ol.source.TiledWMS = function(tiledWMSOptions) {
|
||||
resolutions[z] = size / (256 << z);
|
||||
}
|
||||
tileGrid = new ol.tilegrid.TileGrid({
|
||||
origin: extent.getTopLeft(),
|
||||
origin: projectionExtent.getTopLeft(),
|
||||
resolutions: resolutions
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user