Merge pull request #269 from ahocevar/wms-extent
Fixing extent check for undefined extents. r=@elemoine
This commit is contained in:
@@ -27,6 +27,7 @@ var layers = new ol.Collection([
|
|||||||
source: new ol.source.TiledWMS({
|
source: new ol.source.TiledWMS({
|
||||||
url: 'http://vmap0.tiles.osgeo.org/wms/vmap0',
|
url: 'http://vmap0.tiles.osgeo.org/wms/vmap0',
|
||||||
crossOrigin: null,
|
crossOrigin: null,
|
||||||
|
version: '1.1.1',
|
||||||
params: {
|
params: {
|
||||||
'LAYERS': 'basic',
|
'LAYERS': 'basic',
|
||||||
'FORMAT': 'image/jpeg'
|
'FORMAT': 'image/jpeg'
|
||||||
|
|||||||
@@ -49,9 +49,11 @@ ol.source.TiledWMS = function(tiledWMSOptions) {
|
|||||||
var x = tileCoord.x;
|
var x = tileCoord.x;
|
||||||
var tileExtent = tileGrid.getTileCoordExtent(tileCoord);
|
var tileExtent = tileGrid.getTileCoordExtent(tileCoord);
|
||||||
var projectionExtent = projection.getExtent();
|
var projectionExtent = projection.getExtent();
|
||||||
|
var extent = goog.isDef(tiledWMSOptions.extent) ?
|
||||||
|
tiledWMSOptions.extent : projectionExtent;
|
||||||
// FIXME do we want a wrapDateLine param? The code below will break maps
|
// FIXME do we want a wrapDateLine param? The code below will break maps
|
||||||
// with projections that do not span the whole world width.
|
// with projections that do not span the whole world width.
|
||||||
if (extent && extent.minX === projectionExtent.minX &&
|
if (extent.minX === projectionExtent.minX &&
|
||||||
extent.maxX === projectionExtent.maxX) {
|
extent.maxX === projectionExtent.maxX) {
|
||||||
var numCols = Math.ceil(
|
var numCols = Math.ceil(
|
||||||
(extent.maxX - extent.minX) / (tileExtent.maxX - tileExtent.minX));
|
(extent.maxX - extent.minX) / (tileExtent.maxX - tileExtent.minX));
|
||||||
|
|||||||
Reference in New Issue
Block a user