From e2da56afa1ff1b3c8d8497f942e2a264e03b7efa Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Tue, 16 Jun 2015 15:20:58 +0200 Subject: [PATCH 1/3] Tile grid documentation improvements Using the term 'bottom-left' for origin and origins is misleading, because many developers use -y-1 for the tile url's y in their tile url functions, and the origin really only determines where tile coordinates start to increase from left to right and from bottom to top. --- externs/olx.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/externs/olx.js b/externs/olx.js index 8e9cf44973..39910f962a 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -6148,7 +6148,9 @@ olx.tilegrid.TileGridOptions.prototype.minZoom; /** - * Origin, i.e. the bottom-left corner of the grid. Default is null. + * The tile grid origin, i.e. where the `x` and `y` axes meet (`[z, 0, 0]`). + * Tile coordinates increase from left to right and from bottom to top. Default + * is null. * @type {ol.Coordinate|undefined} * @api stable */ @@ -6156,9 +6158,10 @@ olx.tilegrid.TileGridOptions.prototype.origin; /** - * Origins, i.e. the bottom-left corners of the grid for each zoom level. If - * given, the array length should match the length of the `resolutions` array, - * i.e. each resolution can have a different origin. + * Tile grid origins, i.e. where the `x` and `y` axes meet (`[z, 0, 0]`), for + * each zoom level. If given, the array length should match the length of the + * `resolutions` array, i.e. each resolution can have a different origin. Tile + * coordinates increase from left to right and from bottom to top. * @type {Array.|undefined} * @api stable */ From d628f6b09857aa1aa096eac493b4ff943a673677 Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Tue, 16 Jun 2015 15:21:36 +0200 Subject: [PATCH 2/3] Use the tileSize variable --- examples/xyz-esri-4326-512.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/xyz-esri-4326-512.js b/examples/xyz-esri-4326-512.js index 2704012ce4..ac6d8f850b 100644 --- a/examples/xyz-esri-4326-512.js +++ b/examples/xyz-esri-4326-512.js @@ -25,7 +25,7 @@ var map = new ol.Map({ attributions: [attribution], maxZoom: 16, projection: projection, - tileSize: 512, + tileSize: tileSize, tileUrlFunction: function(tileCoord) { return urlTemplate.replace('{z}', (tileCoord[0] - 1).toString()) .replace('{x}', tileCoord[1].toString()) From d6bb13b54b161b756d11500fbe4459b619e7f2fd Mon Sep 17 00:00:00 2001 From: Andreas Hocevar Date: Tue, 16 Jun 2015 18:47:50 +0200 Subject: [PATCH 3/3] Add note about extent --- externs/olx.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/externs/olx.js b/externs/olx.js index 39910f962a..3d8444a6ca 100644 --- a/externs/olx.js +++ b/externs/olx.js @@ -6149,8 +6149,8 @@ olx.tilegrid.TileGridOptions.prototype.minZoom; /** * The tile grid origin, i.e. where the `x` and `y` axes meet (`[z, 0, 0]`). - * Tile coordinates increase from left to right and from bottom to top. Default - * is null. + * Tile coordinates increase from left to right and from bottom to top. If not + * specified, `extent` or `origins` must be provided. * @type {ol.Coordinate|undefined} * @api stable */ @@ -6161,7 +6161,8 @@ olx.tilegrid.TileGridOptions.prototype.origin; * Tile grid origins, i.e. where the `x` and `y` axes meet (`[z, 0, 0]`), for * each zoom level. If given, the array length should match the length of the * `resolutions` array, i.e. each resolution can have a different origin. Tile - * coordinates increase from left to right and from bottom to top. + * coordinates increase from left to right and from bottom to top. If not + * specified, `extent` or `origin` must be provided. * @type {Array.|undefined} * @api stable */