Class DemoTileSource
java.lang.Object
com.codename1.maps.vector.DemoTileSource
- All Implemented Interfaces:
TileSource
A self-contained
TileSource that synthesizes a deterministic Mapbox
Vector Tile in memory for every address, with no network or bundled
assets. Every tile carries the same recognizable content -- a water body,
a landuse area, two roads, a building and a labeled place -- which makes it
ideal for offline demos and for reproducible map screenshot tests.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic byte[]Builds the synthetic MVT payload.voidfetchTile(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.
-
Constructor Details
-
DemoTileSource
public DemoTileSource()
-
-
Method Details
-
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
-
buildTile
Builds the synthetic MVT payload. Public and static so unit tests and the demo can reuse exactly the same bytes.- Throws:
IOException
-