UrlTemplate

class UrlTemplate(val template: String)

Slippy-map URL template with the WorldWind dialect of substitution tokens:

  • {x} / {y} / {z} — tile coordinates.

  • {lang} — current locale language code.

  • {rand=a,b,c} — random choice from the supplied comma-separated values.

  • {i} — x % 4 + y % 4 * 4, the 16-server tile-hash pattern some XYZ providers use.

Parses the template once at construction; buildUrl is cheap to call per tile.

Constructors

Link copied to clipboard
constructor(template: String)

Properties

Link copied to clipboard

Functions

Link copied to clipboard
fun buildUrl(z: Int, x: Int, y: Int): String

Substitute (z, x, y) plus dialect tokens into the template.