Class MvtTileSource
java.lang.Object
com.codename1.maps.vector.HttpTileSource
com.codename1.maps.vector.MvtTileSource
- All Implemented Interfaces:
TileSource
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(String) 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.
-
Constructor Summary
ConstructorsConstructorDescriptionMvtTileSource(String urlTemplate, int minZoom, int maxZoom) Creates a vector source from a{z}/{x}/{y}URL template. -
Method Summary
Modifier and TypeMethodDescriptionstatic MvtTileSourceThe free, keyless OpenFreeMap vector basemap, built from OpenStreetMap data.Methods inherited from class HttpTileSource
fetchTile, getAttribution, getMaxZoom, getMinZoom, getTileSize, isVector, setApiKey, setAttribution
-
Constructor Details
-
MvtTileSource
Creates a vector source from a{z}/{x}/{y}URL template.
-
-
Method Details
-
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 withMapStyle.light()/MapStyle.dark().
-