Class BundledTileSource
java.lang.Object
com.codename1.maps.vector.BundledTileSource
- All Implemented Interfaces:
TileSource
A TileSource that loads tiles from application resources bundled into the
app (the classpath), with no network access. It powers offline maps and,
crucially, the deterministic map screenshot tests: a small fixture tileset
is shipped as a resource and rendered identically on every run.
The resource path is a template containing the literal tokens {z}, {x}
and {y} (for example /maptiles/{z}/{x}/{y}.mvt).
-
Constructor Summary
ConstructorsConstructorDescriptionBundledTileSource(String pathTemplate, boolean vector, int minZoom, int maxZoom) Creates a bundled source. -
Method Summary
Modifier and TypeMethodDescriptionvoidfetchTile(int z, int x, int y, TileCallback callback) Requests the tile atz/x/y, delivering the result tocallbackon the event dispatch thread.Attribution text that must be displayed over the map.intThe largest zoom level this source serves.intThe smallest zoom level this source serves.intThe tile edge in pixels (almost always 256).booleanisVector()True for MVT vector tiles, false for raster image tiles.setAttribution(String attribution) Sets the attribution string shown over the map.
-
Constructor Details
-
BundledTileSource
Creates a bundled source.
Parameters
-
pathTemplate: a resource path containing{z}/{x}/{y}tokens -
vector: true for MVT tiles, false for raster image tiles -
minZoom: the smallest available zoom -
maxZoom: the largest available zoom
-
-
-
Method Details
-
setAttribution
Sets the attribution string shown over the map. -
isVector
public boolean isVector()True for MVT vector tiles, false for raster image tiles.- Specified by:
isVectorin interfaceTileSource
-
getTileSize
public int getTileSize()The tile edge in pixels (almost always 256).- Specified by:
getTileSizein interfaceTileSource
-
getMinZoom
public int getMinZoom()The smallest zoom level this source serves.- Specified by:
getMinZoomin interfaceTileSource
-
getMaxZoom
public int getMaxZoom()The largest zoom level this source serves.- Specified by:
getMaxZoomin interfaceTileSource
-
getAttribution
Attribution text that must be displayed over the map.- Specified by:
getAttributionin interfaceTileSource
-
fetchTile
Requests the tile atz/x/y, delivering the result tocallbackon the event dispatch thread.- Specified by:
fetchTilein interfaceTileSource
-