Extends
Methods
-
Dispatches an event and calls all listeners listening for events of this type. The event parameter can either be a string or an Object with a
type
property.Name Type Description event
Object | module:ol/events/Event~Event | string Event object.
Returns:
false
if anyone called preventDefault on the event object or if any of the listeners returned false.
-
Gets the extent of the vector tile.
Returns:
The extent.
-
Get the features for this tile. Geometries will be in the projection returned by
module:ol/VectorTile~VectorTile#getProjection
.Returns:
Features.
-
Get the feature format assigned for reading this tile's features.
Returns:
Feature format.
-
Get the feature projection of features returned by
module:ol/VectorTile~VectorTile#getFeatures
.Returns:
Feature projection.
-
Get the tile coordinate for this tile.
Returns:
The tile coordinate.
-
Load the image or retry if loading previously failed. Loading is taken care of by the tile queue, and calling this method is only needed for preloading or for reloading in case of an error.
-
setExtent(extent)
VectorTile.js, line 192 -
Function for use in an
module:ol/source/VectorTile~VectorTile
'stileLoadFunction
. Sets the extent of the vector tile. This is only required for tiles in projections withtile-pixels
as units. The extent should be set to[0, 0, tilePixelSize, tilePixelSize]
, wheretilePixelSize
is calculated by multiplying the tile size with the tile pixel ratio. For sources usingmodule:ol/format/MVT~MVT
as feature format, themodule:ol/format/MVT~MVT#getLastExtent
method will return the correct extent. The default is[0, 0, 4096, 4096]
.Name Type Description extent
module:ol/extent~Extent The extent.
-
setFeatures(features)
VectorTile.js, line 202 -
Function for use in an
module:ol/source/VectorTile~VectorTile
'stileLoadFunction
. Sets the features for the tile.Name Type Description features
Array.<module:ol/Feature~Feature> Features.
-
setLoader(loader)
VectorTile.js, line 232 -
Set the feature loader for reading this tile's features.
Name Type Description loader
module:ol/featureloader~FeatureLoader Feature loader.
-
setProjection(projection)
VectorTile.js, line 214 -
Function for use in an
module:ol/source/VectorTile~VectorTile
'stileLoadFunction
. Sets the projection of the features that were added withmodule:ol/VectorTile~VectorTile#setFeatures
.Name Type Description projection
module:ol/proj/Projection~Projection Feature projection.
-
Sets the state of this tile. If you write your own
tileLoadFunction
, it is important to set the state correctly tomodule:ol/TileState~ERROR
when the tile cannot be loaded. Otherwise the tile cannot be removed from the tile queue and will block other requests.Name Type Description state
module:ol/TileState State.