react-earth
v0.1.2
Published
A visualization of the Earth in React
Downloads
24
Readme
React Earth
This is a package to display an Earth via a React component.
Installation
Install with npm:
npm install react-earth
Or yarn:
yarn add react-earth
Usage
import ReactEarth from 'react-earth';
const App = () => {
return (
<ReactEarth />
);
};
List of (all optional) props is as follows:
width
- the width of the canvas.height
- the height of the canvas.speed
- indicates the speed the globe should rotate at. 0 indicates no rotation. You can specify a negative rotation to rotate it backwards.className
- a class name to pass to the containing divshowCloud
- whether to show clouds or nottextures
- an object of custom textures to pass to the globetextures.map
- the main texture of the globetextures.bumpMap
- a bump map to give the globe some texturetextures.specular
- a specular map to give the globe some reflectivitytextures.cloud
- a cloud map to overlay on the globebumpScale
- the amount of extrusion for the bump mapcloudOpacity
- the amount of opacity for the cloud layercities
- a list of objects containinglat
andlng
points to displaycitySize
- the size of the cityonCityMouseOver
- a callback function when hovering over a cityonCityMouseOut
- a callback function when stopping hovering over a city
Inspired by this great tutorial.