|
@@ -139,6 +139,7 @@ class Game extends React.Component {
|
|
constructor(props) {
|
|
constructor(props) {
|
|
super(props);
|
|
super(props);
|
|
this.state = {
|
|
this.state = {
|
|
|
|
+ targetPoint: {lat: 42.57343, lng: 1.58651},
|
|
selectedPoint: null,
|
|
selectedPoint: null,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -146,14 +147,16 @@ class Game extends React.Component {
|
|
handleSubmitGuess() {
|
|
handleSubmitGuess() {
|
|
const { selectedPoint } = this.state;
|
|
const { selectedPoint } = this.state;
|
|
console.log(JSON.stringify(selectedPoint));
|
|
console.log(JSON.stringify(selectedPoint));
|
|
|
|
+ // TODO actually submit
|
|
}
|
|
}
|
|
|
|
|
|
render() {
|
|
render() {
|
|
|
|
+ const { selectedPoint, targetPoint } = this.state;
|
|
return <GamePanel
|
|
return <GamePanel
|
|
onSelectPoint={latLng => this.setState({selectedPoint: latLng})}
|
|
onSelectPoint={latLng => this.setState({selectedPoint: latLng})}
|
|
onSubmitGuess={() => this.handleSubmitGuess()}
|
|
onSubmitGuess={() => this.handleSubmitGuess()}
|
|
- streetViewPoint={{lat: 42.57343, lng: 1.58651}}
|
|
|
|
- selectedPoint={this.state.selectedPoint}
|
|
|
|
|
|
+ streetViewPoint={targetPoint}
|
|
|
|
+ selectedPoint={selectedPoint}
|
|
/>
|
|
/>
|
|
}
|
|
}
|
|
|
|
|