Vector Tiles
Spectrum Spatial supports the Mapbox vector tile (MVT) v2.1 format for tile generation and
rendering. This vector format can be used as an alternative to raster image formats
(PNG, GIF, and JPG/JPEG) in the Map Tiling Service, the Web Map Tile Service (WMTS), and
the tile generator utilities for both tiling services. The tile builder utilities for
both tiling services support the MVT format as output using the format
parameter. The format
parameter has replaced the image
parameter; however, for older installations the image
format will still
work.
Vector tiles have several advantages over raster tiles:
-
They can render faster.
- They can be smaller than an equivalent image tile.
- They allow you to apply different styles in the client application without needing to generate multiple tile sets per style on the server.
Use Spectrum Spatialâ„¢ Manager to configure a named tile to use the vector format when creating or editing a named tile, and also to select the theme expressions or tables columns you want to expose as attributes. If only MVT tiles are used, a small Pad Factor (for example, 0.02) will give better performance. When rendering vector tiles using WMTS, it is recommended that you also enable caching in Spectrum Spatialâ„¢ Manager.
To render vector tiles, specify the .mvt tile format in the tile service request:
- Map Tiling Service -
http://<server>:<port>/rest/Spatial/MapTilingService/Samples/NamedTiles/WorldTile/2/1:1/tile.mvt
- WMTS -
http://<server>:<port>/rest/Spatial/WMTS/1.0.0/default/tiles/World_WMTS_Layer_ID1/default/WorldWebMercatorQuad_0_to_19/2/1/1.mvt
A vector tile (the MVT payload) contains at least one layer. It can include feature layers and group layers (pie, bar, line linkage, line chart, graduated symbol layers, and label layers are not supported). Each layer:
- has a unique name throughout the payload
- contains a geometry.
- contains zero or more attribute values
- may have an ID (each feature in the layer can also have an ID)
For more information about the MVT format, see the Mapbox specification.
A JavaScript example for vector tiles served by WMTS is available in the JavaScript Examples application. From the Spectrum Spatial section of the Welcome Page, click the View Examples link located under the JavaScript API tab.