-
Notifications
You must be signed in to change notification settings - Fork 318
/
index.html
27 lines (24 loc) · 891 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<head>
<style> body { margin: 0; } </style>
<script src="//unpkg.com/globe.gl"></script>
<!-- <script src="../../dist/globe.gl.js"></script>-->
</head>
<body>
<div id="globeViz"></div>
<script>
fetch('../datasets/ne_110m_admin_0_countries.geojson').then(res => res.json()).then(countries =>
{
const world = new Globe(document.getElementById('globeViz'))
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-dark.jpg')
.hexPolygonsData(countries.features)
.hexPolygonResolution(3)
.hexPolygonMargin(0.3)
.hexPolygonUseDots(true)
.hexPolygonColor(() => `#${Math.round(Math.random() * Math.pow(2, 24)).toString(16).padStart(6, '0')}`)
.hexPolygonLabel(({ properties: d }) => `
<b>${d.ADMIN} (${d.ISO_A2})</b> <br />
Population: <i>${d.POP_EST}</i>
`);
});
</script>
</body>