Skip to main content

tile_url

Function tile_url 

Source
pub fn tile_url(
    templates: &[String],
    coord: TileCoord,
    pixel_ratio: f64,
    tms: bool,
) -> String
Expand description

The URL of a tile from a source’s templates, as MapLibre’s CanonicalTileID.url(): the template is picked by (x + y) % n (spreading tiles over subdomains), then {prefix}, {z}, {x}, {y} (flipped for scheme: "tms"), {ratio} (@2x above pixel ratio 1), {quadkey} and {bbox-epsg-3857} (for WMS) are replaced. WMTS’s {TileMatrix}, {TileCol} and {TileRow} work too (an extension: MapLibre has none).