
[code]
<script src="//unpkg.com/d3-array"></script>
<script src="//unpkg.com/d3-scale"></script>
<script src="//unpkg.com/three"></script>
<script src="//unpkg.com/globe.gl"></script>
<!--<script src="../../dist/globe.gl.js"></script>-->
<rssapp-ticker id="WnIWA7UzVTCyLaaW"></rssapp-ticker><script src="https://widget.rss.app/v1/ticker.js" type="text/javascript" async></script>
<div id="globeViz"></div>
<script>
const colorScale = d3.scaleOrdinal(['orangered', 'mediumblue', 'darkgreen', 'yellow']);
const labelsTopOrientation = new Set(['Apollo 12', 'Luna 2', 'Luna 20', 'Luna 21', 'Luna 24', 'LCROSS Probe']); // avoid label collisions
const elem = document.getElementById('globeViz');
const moon = Globe()
.globeImageUrl('//unpkg.com/three-globe/example/img/earth-blue-marble.jpg')
.bumpImageUrl('//unpkg.com/three-globe/example/img/earth-topology.png')
.backgroundImageUrl('//unpkg.com/three-globe/example/img/night-sky.png')
.showGraticules(true)
.showAtmosphere(true) // moon has no atmosphere
.labelText('label')
.labelSize(1.7)
.labelDotRadius(0.4)
.labelDotOrientation(d => labelsTopOrientation.has(d.label) ? 'top' : 'bottom')
.labelColor(d => colorScale(d.agency))
.labelLabel(d =>
`
<div><b>${d.label}</b></div>
<div>${d.agency} - ${d.program} Program</div>
<div>Landing on <i>${new Date(d.date).toLocaleDateString()}</i></div>
`)
.onLabelClick(d => window.open(d.url, '_blank'))
(elem);
fetch('https://shange-fagan.github.io/globe.news/moon_landings.json') // make the request to fetch https://raw.githubusercontent.com/eesur/country-codes-lat-long/e20f140202afbb65addc13cad120302db26f119a/country-codes-lat-long-alpha3.json
// fetch('https://raw.githubusercontent.com/eesur/country-codes-lat-long/e20f140202afbb65addc13cad120302db26f119a/country-codes-lat-long-alpha3.json')
.then(r => r.json()) //then get the returned json request header if and when the request value returns true
.then(landingSites => { // then use the request result as a callback
console.log(landingSites)
// moon.labelsData(landingSites.ref_country_codes);
moon.labelsData(landingSites);
console.log(moon.labelLabel)
// custom globe material
const globeMaterial = moon.globeMaterial();
globeMaterial.bumpScale = 10;
new THREE.TextureLoader().load('//unpkg.com/three-globe/example/img/earth-water.png', texture => {
globeMaterial.specularMap = texture;
globeMaterial.specular = new THREE.Color('grey');
globeMaterial.shininess = 15;
});
setTimeout(() => { // wait for scene to be populated (asynchronously)
const directionalLight = moon.scene().children.find(obj3d => obj3d.type === 'DirectionalLight');
directionalLight && directionalLight.position.set(1, 1, 1); // change light position to see the specularMap's effect
});
});
//moon.controls().autoRotate = false;
//moon.controls().autoRotateSpeed = 0.85;
//const animate = () => {
//requestAnimationFrame(animate);
//moon.rotation.y += 0.01;
//}
//animate();
</script>
[/code]
게시글 목록
| 번호 | 제목 |
|---|---|
| 17316 | |
| 17315 |
JavaScript
시계 스크립트 그런데 페이지 뜨는건 느린게 문제네...
|
| 17313 |
PHP
php 업로드 소스
4
|
| 17312 | |
| 17305 | |
| 17304 | |
| 17298 |
node.js
간단한 채팅
|
| 17294 | |
| 17291 | |
| 17285 | |
| 17284 |
JavaScript
두가지 형태의 페이지 로딩 [ 로딩중, 로딩 프로그레스바 ]
2
|
| 17279 | |
| 17272 | |
| 17271 |
JavaScript
관계에 따른 메뉴 구성방안
1
|
| 17270 | |
| 17262 | |
| 17255 | |
| 17248 |
JavaScript
엘레먼트 요소에서 data 를 이벤트 핸들러로 사용하기
4
|
| 17241 | |
| 17238 |
MySQL
interval에 쓸 수 있는 값
3
|
| 17236 |
PHP
탈퇴합니다.
6
|
| 17220 | |
| 17217 |
JavaScript
회원가입
2
|
| 17216 | |
| 17214 | |
| 17207 | |
| 17205 | |
| 17203 | |
| 17201 | |
| 17198 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기