Classes
Type Definitions
-
Properties:
Name Type Argument Default Description attributionsmodule:ol/source/Source~AttributionLike <optional>
Attributions.
cacheSizenumber <optional>
128 Cache size.
extentmodule:ol/extent~Extent <optional>
formatmodule:ol/format/Feature~FeatureFormat <optional>
Feature format for tiles. Used and required by the default.
overlapsboolean <optional>
true This source may have overlapping geometries. Setting this to
false(e.g. for sources with polygons that represent administrative boundaries or TopoJSON sources) allows the renderer to optimise fill and stroke operations.projectionmodule:ol/proj~ProjectionLike Projection.
statemodule:ol/source/State <optional>
Source state.
tileClassClass.<module:ol/VectorTile~VectorTile> <optional>
Class used to instantiate image tiles. Default is
module:ol/VectorTile.maxZoomnumber <optional>
22 Optional max zoom level.
minZoomnumber <optional>
Optional min zoom level.
tileSizenumber | module:ol/size~Size <optional>
512 Optional tile size.
tileGridmodule:ol/tilegrid/TileGrid~TileGrid <optional>
Tile grid.
tileLoadFunctionmodule:ol/Tile~LoadFunction <optional>
Optional function to load a tile given a URL. Could look like this:
function(tile, url) { tile.setLoader(function() { var data = // ... fetch data var format = tile.getFormat(); tile.setProjection(format.readProjection(data)); tile.setFeatures(format.readFeatures(data, { // featureProjection is not required for ol/format/MVT featureProjection: map.getView().getProjection() })); // the line below is only required for ol/format/MVT tile.setExtent(format.getLastExtent()); } });tileUrlFunctionmodule:ol/Tile~UrlFunction <optional>
Optional function to get tile URL given a tile coordinate and the projection.
urlstring <optional>
URL template. Must include
{x},{y}or{-y}, and{z}placeholders. A{?-?}template pattern, for examplesubdomain{a-f}.domain.com, may be used instead of defining each one separately in theurlsoption.transitionnumber <optional>
A duration for tile opacity transitions in milliseconds. A duration of 0 disables the opacity transition.
urlsArray.<string> <optional>
An array of URL templates.
wrapXboolean <optional>
true Whether to wrap the world horizontally. When set to
false, only one world will be rendered. When set totrue, tiles will be wrapped horizontally to render multiple worlds.