Merge pull request #5011 from ahocevar/vectortile-setprojection
Add missing setProjection function to ol.VectorTile API
This commit is contained in:
+8
-4
@@ -4386,12 +4386,16 @@ olx.source.VectorTileOptions.prototype.tileGrid;
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Optional function to load a tile given a URL. The default is
|
* Optional function to load a tile given a URL. Could look like this:
|
||||||
* ```js
|
* ```js
|
||||||
* function(tile, url) {
|
* function(tile, url) {
|
||||||
* tile.setLoader(
|
* tile.setLoader(function() {
|
||||||
* ol.featureloader.tile(url, tile.getFormat()));
|
* var data = // ... fetch data
|
||||||
* };
|
* var format = tile.getFormat();
|
||||||
|
* tile.setFeatures(format.readFeatures(data));
|
||||||
|
* tile.setProjection(format.readProjection(data));
|
||||||
|
* };
|
||||||
|
* });
|
||||||
* ```
|
* ```
|
||||||
* @type {ol.TileLoadFunctionType|undefined}
|
* @type {ol.TileLoadFunctionType|undefined}
|
||||||
* @api
|
* @api
|
||||||
|
|||||||
@@ -170,7 +170,9 @@ ol.VectorTile.prototype.setFeatures = function(features) {
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Set the projection of the features that were added with {@link #setFeatures}.
|
||||||
* @param {ol.proj.Projection} projection Feature projection.
|
* @param {ol.proj.Projection} projection Feature projection.
|
||||||
|
* @api
|
||||||
*/
|
*/
|
||||||
ol.VectorTile.prototype.setProjection = function(projection) {
|
ol.VectorTile.prototype.setProjection = function(projection) {
|
||||||
this.projection_ = projection;
|
this.projection_ = projection;
|
||||||
|
|||||||
Reference in New Issue
Block a user