tileUrl

fun RasterTileSpec.tileUrl(x: Int, y: Int, zoom: Int): String?(source)

Resolves the URL of a single tile from a RasterTileSpec.

MapLibre expands these placeholders itself, so this exists for renderers that do not: the Google map's tile provider is asked for one x/y/zoom at a time and has to hand back a finished URL.

Returns null when the tile is outside the source's zoom range, or when the template still holds a placeholder we could not fill — a leftover {apiKey} would otherwise be sent to the server with its braces intact, which reads in the logs as a server fault rather than a template the user never finished.