Public
Edited
Oct 26, 2023
Fork of Vector tiles
15 forks
Importers
18 stars
Insert cell
Insert cell
Insert cell
map = svg`<svg viewBox="0 0 ${width} ${height}">
${tiles.map(([x, y, z], i, {translate: [tx, ty], scale: k}) => svg`
<image xlink:href="${url(x, y, z)}" x="${Math.round((x + tx) * k)}" y="${Math.round((y + ty) * k)}" width="${k}" height="${k}">
`)}
</svg>`
Insert cell
tiles = tile()
Insert cell
tile = d3.tile()
.size([width, height])
.scale(projection.scale() * 2 * Math.PI)
.translate(projection([0, 0]))
Insert cell
projection = d3.geoMercator()
.center([-122.4183, 37.7750])
.scale(Math.pow(2, 21) / (2 * Math.PI))
.translate([width / 2, height / 2])
Insert cell
path = d3.geoPath(projection)
Insert cell
height = 600
Insert cell
d3 = require("d3-geo@3", "d3-tile@1")
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more