Permalink
Browse files

Add logic for rendering contents in CesiumGlobe

  • Loading branch information...
markerikson committed Feb 24, 2017
1 parent 944084f commit f02144e3766bcde28e70616d50ed26df9a67f182
Showing with 22 additions and 1 deletion.
  1. +22 −1 src/cesium/CesiumGlobe.jsx
View
@@ -41,13 +41,30 @@ export default class CesiumGlobe extends Component {
terrainProvider,
});
+ // Force immediate re-render now that the Cesium viewer is created
+ this.setState({viewerLoaded : true}); // eslint-disable-line react/no-did-mount-set-state
}
componentWillUnmount() {
if(this.viewer) {
this.viewer.destroy();
}
}
+
+ renderContents() {
+ const {viewerLoaded} = this.state;
+ let contents = null;
+
+ if(viewerLoaded) {
+ contents = (
+ <span>
+ </span>
+ );
+ }
+
+ return contents;
+ }
+
render() {
const containerStyle = {
width: '100%',
@@ -65,13 +82,17 @@ export default class CesiumGlobe extends Component {
flexGrow : 2
}
+ const contents = this.renderContents()
+
return (
<div className="cesiumGlobeWrapper" style={containerStyle}>
<div
className="cesiumWidget"
ref={ element => this.cesiumContainer = element }
style={widgetStyle}
- />
+ >
+ {contents}
+ </div>
</div>
);
}

0 comments on commit f02144e

Please sign in to comment.