React Google Map

maximu·2021년 3월 11일
0

React Google Map

import React,{useState} from "react";
import { Map, GoogleApiWrapper } from "google-maps-react";


// 함수형
const App = (props) => {

    const [initialCenter, setInitialCenter] = useState({
        lat: 37.5,
        lng: 127,
      });
    
    return(
        <Map
          // onReady={fetchPlaces}
          google={props.google}
          zoom={8}
          // style={cssStyle.map}
          initialCenter={initialCenter}
        >
        </Map>
    )
    
};

export default GoogleApiWrapper(()=> ({
  apiKey: "구글API KEY",
  language: "ko",
  region: "KR",
}))(App);

0개의 댓글