Published
Edited
Jul 16, 2020
Insert cell
md`# tileset.json generator for MapBox GL JS`
Insert cell
{
let lon = 5.5981999;
let lat = 51.462916;

function degrees2meters (lon,lat) {
var x = lon * 20037508.34 / 180;
var y = Math.log(Math.tan((90 + lat) * Math.PI / 360)) / (Math.PI / 180);
y = y * 20037508.34 / 180;
return [x, y]
}

return degrees2meters(lon,lat);
}
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