-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.html
31 lines (25 loc) · 1004 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
28
29
30
31
<head>
<style> body { margin: 0; } </style>
<script src="//unpkg.com/aframe"></script>
<script src="//unpkg.com/@ar-js-org/ar.js"></script>
<script src="//unpkg.com/globe-ar"></script>
<!-- <script src="../../dist/globe-ar.js"></script>-->
</head>
<body>
<div id="globeViz"></div>
<script type="module">
import * as THREE from 'https://esm.sh/three';
import * as topojson from 'https://esm.sh/topojson-client';
const world = new GlobeAR(document.getElementById('globeViz'))
.showGlobe(false)
.showAtmosphere(false);
fetch('//unpkg.com/world-atlas/land-110m.json').then(res => res.json())
.then(landTopo => {
world
.polygonsData(topojson.feature(landTopo, landTopo.objects.land).features)
.polygonCapMaterial(new THREE.MeshLambertMaterial({ color: 'darkslategrey', side: THREE.DoubleSide }))
.polygonSideColor(() => 'rgba(0,0,0,0)')
.polygonStrokeColor(() => 'transparent');
});
</script>
</body>