More clarity about origin and direction of tile coordinates
This commit is contained in:
@@ -36,9 +36,9 @@ Note that `ol.FeatureOverlay#getFeatures()` returned an `{ol.Collection.<ol.Feat
|
||||
|
||||
#### `ol.TileCoord` changes
|
||||
|
||||
Until now, the API exposed two different types of `ol.TileCoord` tile coordinates: internal ones that increase from left to right and from bottom to top, and transformed ones that may increase from top to bottom, as defined by a transform function on the tile grid. With this change, the API now only exposes tile coordinates that increase from left to right and from bottom to top.
|
||||
Until now, the API exposed two different types of `ol.TileCoord` tile coordinates: internal ones that increase left to right and upward, and transformed ones that may increase downward, as defined by a transform function on the tile grid. With this change, the API now only exposes tile coordinates that increase left to right and upward.
|
||||
|
||||
Previously, tile grids created by OpenLayers either had their origin at the top-left or at the bottom-left corner of the tile grid. To make it easier to for application developers to transform tile coordinates to the common XYZ tiling scheme, all tile grids that OpenLayers creates internally have their origin now at the top-left corner.
|
||||
Previously, tile grids created by OpenLayers either had their origin at the top-left or at the bottom-left corner of the extent. To make it easier to for application developers to transform tile coordinates to the common XYZ tiling scheme, all tile grids that OpenLayers creates internally have their origin now at the top-left corner of the extent.
|
||||
|
||||
This change affects applications that configure a custom `tileUrlFunction` for an `ol.source.Tile`. Previously, the `tileUrlFunction` was called with rather unpredictable tile coordinates, depending on whether a tile coordinate transform took place before calling the `tileUrlFunction`. Now it is always called with OpenLayers tile coordinates. To transform these into the common XYZ tiling scheme, a custom `tileUrlFunction` has to change the `y` value (tile row) of the `ol.TileCoord`:
|
||||
```js
|
||||
|
||||
@@ -6168,8 +6168,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. If not
|
||||
* specified, `extent` or `origins` must be provided.
|
||||
* Tile coordinates increase left to right and upwards. If not specified,
|
||||
* `extent` or `origins` must be provided.
|
||||
* @type {ol.Coordinate|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
@@ -6180,8 +6180,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. If not
|
||||
* specified, `extent` or `origin` must be provided.
|
||||
* coordinates increase left to right and upwards. If not specified, `extent`
|
||||
* or `origin` must be provided.
|
||||
* @type {Array.<ol.Coordinate>|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
@@ -6241,8 +6241,8 @@ olx.tilegrid.WMTSOptions.prototype.extent;
|
||||
|
||||
/**
|
||||
* 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. If not
|
||||
* specified, `extent` or `origins` must be provided.
|
||||
* Tile coordinates increase left to right and upwards. If not specified,
|
||||
* `extent` or `origins` must be provided.
|
||||
* @type {ol.Coordinate|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
@@ -6253,8 +6253,8 @@ olx.tilegrid.WMTSOptions.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. If not
|
||||
* specified, `extent` or `origin` must be provided.
|
||||
* coordinates increase left to right and upwards. If not specified, `extent` or
|
||||
* `origin` must be provided.
|
||||
* @type {Array.<ol.Coordinate>|undefined}
|
||||
* @api stable
|
||||
*/
|
||||
@@ -6288,7 +6288,7 @@ olx.tilegrid.WMTSOptions.prototype.matrixIds;
|
||||
* further limit the extent for which tile requests are made by sources. Note
|
||||
* that when the top-left corner of the `extent` is used as `origin` or
|
||||
* `origins`, then the `y` value must be negative because OpenLayers tile
|
||||
* coordinates increase from bottom to top.
|
||||
* coordinates increase upwards.
|
||||
* @type {Array.<ol.Size>|undefined}
|
||||
* @api
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user