Fix vector tile docs and types

This commit is contained in:
ahocevar
2018-06-05 16:38:15 +02:00
parent 7e2814d110
commit 08e0a0dfea
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -59,7 +59,7 @@ const VectorTile = function(tileCoord, state, src, format, tileLoadFunction, opt
* @private * @private
* @type {module:ol/proj/Projection} * @type {module:ol/proj/Projection}
*/ */
this.projection_; this.projection_ = null;
/** /**
* @private * @private
+4 -2
View File
@@ -31,11 +31,13 @@ import {createXYZ, extentFromProjection, createForProjection} from '../tilegrid.
* tile.setLoader(function() { * tile.setLoader(function() {
* var data = // ... fetch data * var data = // ... fetch data
* var format = tile.getFormat(); * var format = tile.getFormat();
* tile.setProjection(format.readProjection(data));
* tile.setFeatures(format.readFeatures(data, { * tile.setFeatures(format.readFeatures(data, {
* // uncomment the line below for ol/format/MVT only * // featureProjection is not required for ol/format/MVT
* extent: tile.getExtent(),
* featureProjection: map.getView().getProjection() * featureProjection: map.getView().getProjection()
* })); * }));
* // the line below is only required for ol/format/MVT
* tile.setExtent(format.getLastExtent());
* }; * };
* }); * });
* @property {module:ol/Tile~UrlFunction} [tileUrlFunction] Optional function to get tile URL given a tile coordinate and the projection. * @property {module:ol/Tile~UrlFunction} [tileUrlFunction] Optional function to get tile URL given a tile coordinate and the projection.