Skip to content

Commit 4414ad5

Browse files
committed
md: add code example
1 parent c6dc2ba commit 4414ad5

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

+24
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,30 @@
44

55
You can see an example [here](https://pyjun01.github.io/react-google-map-wrapper/docs/examples/basic/).
66

7+
```tsx
8+
import { Suspense } from 'react';
9+
import { GoogleMap, GoogleMapApiLoader, Marker } from 'react-google-map-wrapper';
10+
11+
function Map() {
12+
return (
13+
<GoogleMap className='h-[400px]' zoom={17} center={{ lat: 37.5709413, lng: 126.977787 }}>
14+
<Marker lat={37.5709413} lng={126.977787} />
15+
</GoogleMap>
16+
);
17+
}
18+
19+
function App() {
20+
return (
21+
<Suspense fallback={<Fallback />}>
22+
{/* Load the google map api */}
23+
<GoogleMapApiLoader apiKey='YOUR_API_KEY' suspense>
24+
<Map />
25+
</GoogleMapApiLoader>
26+
</Suspense>
27+
);
28+
}
29+
```
30+
731
## Installation
832

933
```bash

0 commit comments

Comments
 (0)