Closed emxsys closed 6 years ago
Added the latitude, longitude and altitude props:
static propTypes = {
// ...
/**
* Latitude +/-90 degrees
*/
latitude: PropTypes.number,
/**
* Longitude +/-180 degrees
*/
longitude: PropTypes.number,
/**
* Altitude in meters above sea level (MSL)
*/
altitude: PropTypes.number,
// ...
}
Example
export default class App extends Component {
constructor(props) {
super(props)
this.state = {
lat: 34.2,
lon: -119.2,
alt: 50e3
}
}
render() {
return (
<div onClick={() => this.setState({lat: 45, lon: -75})} >
<Globe
latitude={this.state.lat}
longitude={this.state.lon}
altitude={this.state.alt}
/>
</div>
)
}
}
Add optional React props to establish the globe's latitude, longitude, range and tilt. Also, a prop to indicate whether to animate a change in view.
E.g.: