Skip to content

Example: Basic

import { GoogleMap, GoogleMapApiLoader, Marker } from 'react-google-map-wrapper';
import { Suspense } from 'react';
import { Fallback } from '../Fallback';
function Map() {
return (
<GoogleMap className='h-[400px]' zoom={17} center={{ lat: 37.5709413, lng: 126.977787 }}>
<Marker lat={37.5709413} lng={126.977787} />
</GoogleMap>
);
}
function App() {
return (
<Suspense fallback={<Fallback />}>
<GoogleMapApiLoader apiKey='YOUR_API_KEY' suspense>
<Map />
</GoogleMapApiLoader>
</Suspense>
);
}