|
@@ -1,7 +1,7 @@
|
|
|
import { useRef, useEffect } from "react";
|
|
|
/* global google */
|
|
|
|
|
|
-export default mapDiv => {
|
|
|
+export default (mapDiv, lat=25, lng=-25, zoom=0) => {
|
|
|
const map = useRef(null);
|
|
|
useEffect(() => {
|
|
|
if (map.current) {
|
|
@@ -10,12 +10,12 @@ export default mapDiv => {
|
|
|
}
|
|
|
|
|
|
map.current = new google.maps.Map(mapDiv.current, {
|
|
|
- center: { lat: 25, lng: -25 },
|
|
|
- zoom: 0,
|
|
|
+ center: { lat, lng },
|
|
|
+ zoom,
|
|
|
disableDefaultUI: true,
|
|
|
fullscreenControl: true,
|
|
|
});
|
|
|
- }, [mapDiv]);
|
|
|
+ }, [mapDiv, lat, lng, zoom]);
|
|
|
|
|
|
return map;
|
|
|
}
|