|
@@ -1,23 +1,14 @@
|
|
|
-import React, { useState, useRef, useEffect } from "react";
|
|
|
-import Loading from "./loading.component";
|
|
|
+import React, { useRef, useEffect } from "react";
|
|
|
/* global google */
|
|
|
|
|
|
-
|
|
|
-const MapScreen = ({
|
|
|
-
|
|
|
-}) => {
|
|
|
+const MapComponent = () => {
|
|
|
const mapDivRef = useRef(null);
|
|
|
- const [map, setMap] = useState(null);
|
|
|
useEffect(() => {
|
|
|
- if (map) {
|
|
|
- return;
|
|
|
- }
|
|
|
- const newMap = new google.maps.Map(mapDivRef.current, {
|
|
|
+ const googleMap = new google.maps.Map(mapDivRef.current, {
|
|
|
center: { lat: 25, lng: -25 },
|
|
|
zoom: 0,
|
|
|
});
|
|
|
console.log("Created Map");
|
|
|
- setMap(map);
|
|
|
});
|
|
|
|
|
|
return (
|
|
@@ -28,10 +19,8 @@ const MapScreen = ({
|
|
|
justifyContent: "center",
|
|
|
}}
|
|
|
ref={mapDivRef}
|
|
|
- >
|
|
|
- {map ? null : <Loading/>}
|
|
|
- </div>
|
|
|
- )
|
|
|
+ />
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
-export default MapScreen;
|
|
|
+export default MapComponent;
|