TileLayer

constructor(urlTemplate: String, options: T = definedExternally)

Parameters

urlTemplate

A string of the following form:

http://{s}.somedomain.com/blabla/{z}/{x}/{y}{r}.png
  • {s} means one of the available subdomains (used sequentially to help with browser parallel requests per domain limitation; subdomain values are specified in options; a, b or c by default, can be omitted),

  • {z} — zoom level,

  • {x} and {y} — tile coordinates.

  • {r} can be used to add "@2x" to the URL to load retina tiles.

You can use custom keys in the template, which will be evaluated from TileLayer options, like this:

LeafletObjectFactory.tileLayer("http://{s}.somedomain.com/{foo}/{z}/{x}/{y}.png") {
asDynamic().foo = "bar"
}