Moving maxZoom default to XYZ source.
No reason this convenience should be restricted to the OSM layer.
This commit is contained in:
@@ -613,7 +613,8 @@
|
|||||||
* @property {ol.Extent|undefined} extent Extent.
|
* @property {ol.Extent|undefined} extent Extent.
|
||||||
* @property {string|undefined} logo Logo.
|
* @property {string|undefined} logo Logo.
|
||||||
* @property {ol.ProjectionLike} projection Projection.
|
* @property {ol.ProjectionLike} projection Projection.
|
||||||
* @property {number} maxZoom Max zoom.
|
* @property {number|undefined} maxZoom Optional max zoom level. The default is
|
||||||
|
* 18.
|
||||||
* @property {number|undefined} minZoom Unsupported (TODO: remove this).
|
* @property {number|undefined} minZoom Unsupported (TODO: remove this).
|
||||||
* @property {ol.TileUrlFunctionType|undefined} tileUrlFunction Optional
|
* @property {ol.TileUrlFunctionType|undefined} tileUrlFunction Optional
|
||||||
* function to get tile URL given a tile coordinate and the projection.
|
* function to get tile URL given a tile coordinate and the projection.
|
||||||
|
|||||||
@@ -23,8 +23,6 @@ ol.source.OSM = function(opt_options) {
|
|||||||
attributions = ol.source.OSM.ATTRIBUTIONS;
|
attributions = ol.source.OSM.ATTRIBUTIONS;
|
||||||
}
|
}
|
||||||
|
|
||||||
var maxZoom = goog.isDef(options.maxZoom) ? options.maxZoom : 18;
|
|
||||||
|
|
||||||
var url = goog.isDef(options.url) ?
|
var url = goog.isDef(options.url) ?
|
||||||
options.url : 'http://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png';
|
options.url : 'http://{a-c}.tile.openstreetmap.org/{z}/{x}/{y}.png';
|
||||||
|
|
||||||
@@ -32,7 +30,7 @@ ol.source.OSM = function(opt_options) {
|
|||||||
attributions: attributions,
|
attributions: attributions,
|
||||||
crossOrigin: 'anonymous',
|
crossOrigin: 'anonymous',
|
||||||
opaque: true,
|
opaque: true,
|
||||||
maxZoom: maxZoom,
|
maxZoom: options.maxZoom,
|
||||||
url: url
|
url: url
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -33,8 +33,10 @@ ol.source.XYZ = function(options) {
|
|||||||
ol.TileUrlFunction.expandUrl(options.url));
|
ol.TileUrlFunction.expandUrl(options.url));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var maxZoom = goog.isDef(options.maxZoom) ? options.maxZoom : 18;
|
||||||
|
|
||||||
var tileGrid = new ol.tilegrid.XYZ({
|
var tileGrid = new ol.tilegrid.XYZ({
|
||||||
maxZoom: options.maxZoom
|
maxZoom: maxZoom
|
||||||
});
|
});
|
||||||
|
|
||||||
var tileCoordTransform = tileGrid.createTileCoordTransform({
|
var tileCoordTransform = tileGrid.createTileCoordTransform({
|
||||||
|
|||||||
Reference in New Issue
Block a user