public final class MvtTileSource
- Object
- HttpTileSource
- MvtTileSource
ImplementsTileSource
A networked MVT (Mapbox Vector Tile) source. Point it at any
{z}/{x}/{y}.pbf/.mvt endpoint (MapLibre/OpenMapTiles, Protomaps,
MapTiler, …). Most hosted vector basemaps require an API key, supplied
through HttpTileSource.setApiKey and referenced as {key} in the URL.
For a keyless, self-hostable basemap, Protomaps .pmtiles served behind a
z/x/y proxy works well; for fully offline maps use BundledTileSource.
Constructors
public MvtTileSource(String urlTemplate, int minZoom, int maxZoom) | Creates a vector source from a {z}/{x}/{y} URL template. |
Methods
public static MvtTileSource openFreeMap() | The free, keyless OpenFreeMap vector basemap, built from OpenStreetMap data. |
Inherited methods
Constructor details
MvtTileSource
public MvtTileSource(String urlTemplate, int minZoom, int maxZoom)Creates a vector source from a
{z}/{x}/{y} URL template.Method details
openFreeMap
public static MvtTileSource openFreeMap()The free, keyless OpenFreeMap vector basemap,
built from OpenStreetMap data. No API key or sign-up is required. Its
tile URLs are versioned, so the source is given OpenFreeMap’s TileJSON
URL (no
{z} token) and resolves the current tile template from it on
first use. Works out of the box with MapStyle.light() / MapStyle.dark().