Skip to content

Both copy text to your clipboard — Build with AI copies a setup prompt to paste into Claude Code, Cursor, Codex or Copilot; Copy page as Markdown copies this page to paste into a chat. How it works

Vector Tiles

You can specify where to load MVTs (which sometimes have .pbf extension) by creating a TileSet object with template parameters (for example {z} which will be replaced with the zoom level).

Point the TileSet at your own MapMetrics Atlas vector tile endpoint. In the example below we load MVTs with the OpenMapTiles schema and create a line layer for the road network — the transportation source layer comes from that schema, so any tile set following it will work.

kotlin
val tileset = TileSet(
    "openmaptiles",
    "https://YOUR_TILE_HOST/tiles-omt/{z}/{x}/{y}.pbf"
)
val openmaptiles = VectorSource("openmaptiles", tileset)
style.addSource(openmaptiles)
val roadLayer = LineLayer("road", "openmaptiles").apply {
    setSourceLayer("transportation")
    setProperties(
        lineColor("red"),
        lineWidth(2.0f)
    )
}