|
@@ -10,7 +10,6 @@ const useClickMarker = (map, onMove) => {
|
|
|
marker.current.setMap(null);
|
|
|
}
|
|
|
marker.current = new google.maps.Marker({ map: map.current, position: latLng });
|
|
|
- console.log({ lat: latLng.lat(), lng: latLng.lng() });
|
|
|
onMove({ lat: latLng.lat(), lng: latLng.lng() });
|
|
|
});
|
|
|
|
|
@@ -19,7 +18,8 @@ const useClickMarker = (map, onMove) => {
|
|
|
}
|
|
|
|
|
|
export default ({ onMarkerMoved }) => {
|
|
|
- const [mapDivRef, mapRef] = useMap();
|
|
|
+ const mapDivRef = useRef(null);
|
|
|
+ const mapRef = useMap(mapDivRef);
|
|
|
useClickMarker(mapRef, onMarkerMoved);
|
|
|
return <div className="map-div" ref={mapDivRef} />
|
|
|
}
|