|
@@ -1,12 +1,14 @@
|
|
|
import React from 'react';
|
|
|
import { compose, withProps } from "recompose";
|
|
|
import { withScriptjs, withGoogleMap, StreetViewPanorama, GoogleMap, Marker } from "react-google-maps";
|
|
|
-import { GOOGLE_MAPS_URL } from "../config";
|
|
|
+import { GOOGLE_API_KEY } from "../config";
|
|
|
import RoundTimer from "./round-timer.component";
|
|
|
|
|
|
+// TODO want a button for moving the pano back to start somehow
|
|
|
+
|
|
|
const PositionedStreetView = compose(
|
|
|
withProps({
|
|
|
- googleMapURL: GOOGLE_MAPS_URL,
|
|
|
+ googleMapURL: `https://maps.googleapis.com/maps/api/js?key=${GOOGLE_API_KEY}&v=3.exp&libraries=geometry,drawing,places`,
|
|
|
loadingElement: <div style={{ height: `100%` }} />,
|
|
|
containerElement: <div style={{ height: `70vh` }} />,
|
|
|
mapElement: <div style={{ height: `100%` }} />,
|
|
@@ -27,7 +29,7 @@ const PositionedStreetView = compose(
|
|
|
|
|
|
const SelectionMap = compose(
|
|
|
withProps({
|
|
|
- googleMapURL: GOOGLE_MAPS_URL,
|
|
|
+ googleMapURL: `https://maps.googleapis.com/maps/api/js?key=${GOOGLE_API_KEY}&v=3.exp&libraries=geometry,drawing,places`,
|
|
|
loadingElement: <div style={{ height: `100%` }} />,
|
|
|
containerElement: <div style={{ height: `250px` }} />,
|
|
|
mapElement: <div style={{ height: `100%` }} />,
|
|
@@ -78,7 +80,7 @@ const GamePanel = ({
|
|
|
}}>
|
|
|
<RoundTimer seconds={roundSeconds} onTimeout={onTimeout} />
|
|
|
<SelectionMap
|
|
|
- onClick={({ latLng }) => onSelectPoint(latLng)}
|
|
|
+ onClick={({ latLng }) => onSelectPoint({ lat: latLng.lat(), lng: latLng.lng() })}
|
|
|
markerPosition={selectedPoint}
|
|
|
/>
|
|
|
<button
|