Published
Edited
Jan 22, 2022
1 fork
22 stars
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
globeletjs = import("globeletjs")
Insert cell
Insert cell
document.head.appendChild(
html`<link href="https://unpkg.com/globeletjs@0.1.1/dist/globelet.css" rel=stylesheet>`
)
Insert cell
Insert cell
maptilerKey = "mrAq6zQEFxOkanukNbGm" // Get your own key: maptiler.com
Insert cell
style = {
let doc = await FileAttachment("klokantech-basic-style.json").json();
Object.values(doc.sources).forEach(src => {
if (src.url) src.url = src.url.replace(/{key}/, maptilerKey);
});
doc.glyphs = doc.glyphs.replace(/{key}/, maptilerKey);
return doc;
}
Insert cell
Insert cell
globe = globeletjs.initGlobe({
container,
style,
center: [-70, 30], // Initial [longitude, latitude] of camera
altitude: 6371 * 3 // Initial camera altitude: approximately 3x Earth radius
})
Insert cell
globe.startAnimation()
Insert cell
Insert cell
html`<style>
#globeDiv {
height: 600px;
width: ${width}px;
}
.globelet .main {
background-color: grey;
}
`
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