Skip to content

Raster Tile Source

A raster-tile source describes raster imagery tiles (XYZ or TMS). Render it with a raster layer.

PropertyTypeDefaultDescription
type"raster-tile"(required)Source type.
urlstring(required)Tile URL template (contains {z}/{x}/{y}).
tmsbooleanfalseWhether the tile scheme is flipped along the Y axis (TMS).
minZoomnumber0Minimum zoom level tiles are provided for.
maxZoomnumber20Maximum zoom level new tiles are requested for.
overscaledMaxZoomnumber24Maximum zoom overscaled (stretched-parent) tiles are used up to.
import ThreeView from "@navaramap/three";
const imagery = view.addSource({
type: "raster-tile",
url: "https://example.com/{z}/{x}/{y}.png",
maxZoom: 19,
});
view.addLayer({ type: "raster", source: imagery });
// Style the raster imagery with `raster`.
view.addLayer({ type: "raster", source: imagery, raster: { opacity: 0.8 } });