PHP 7.4.33
Preview: GoogleMap.md Size: 939 B
/var/www/sitesecurity.bitkit.dk/httpdocs/node_modules/@react-google-maps/api/src/GoogleMap.md
# Google Map example

```jsx
const { LoadScript } = require("./LoadScript");
const ScriptLoaded = require("./docs/ScriptLoaded").default;

<ScriptLoaded>
  <GoogleMap
    id="circle-example"
    mapContainerStyle={{
      height: "400px",
      width: "800px"
    }}
    zoom={7}
    center={{
      lat: -3.745,
      lng: -38.523
    }}
  />
</ScriptLoaded>;
```

## Map instance

To access map instance (eg. to pan the map imperatively), you can utilize the `onLoad` prop of GoogleMap component.

The GoogleMap component uses React Context internally to pass the map instance around. For the convenience the value is exposed with hook `useGoogleMap` (**_requires React 16.8+_**).

```js static
import React from 'react'
import { useGoogleMap } from '@react-google-maps/api'

function PanningComponent() {
  const map = useGoogleMap()

  React.useEffect(() => {
    if (map) {
      map.panTo(...)
    }
  }, [map])

  return null
}
```

Directory Contents

Dirs: 4 × Files: 15
Name Size Perms Modified Actions
- drwxr-xr-x 2026-04-28 09:11:40
Edit Download
docs DIR
- drwxr-xr-x 2026-04-28 09:11:40
Edit Download
utils DIR
- drwxr-xr-x 2026-04-28 09:11:40
Edit Download
__tests__ DIR
- drwxr-xr-x 2026-04-28 09:11:40
Edit Download
939 B lrw-r--r-- 2026-04-28 09:11:40
Edit Download
829 B lrw-r--r-- 2026-04-28 09:11:40
Edit Download
16.12 KB lrw-r--r-- 2026-04-28 09:11:40
Edit Download
3.56 KB lrw-r--r-- 2026-04-28 09:11:40
Edit Download
6.24 KB lrw-r--r-- 2026-04-28 09:11:40
Edit Download
198 B lrw-r--r-- 2026-04-28 09:11:40
Edit Download
1.29 KB lrw-r--r-- 2026-04-28 09:11:40
Edit Download
479 B lrw-r--r-- 2026-04-28 09:11:40
Edit Download
8.56 KB lrw-r--r-- 2026-04-28 09:11:40
Edit Download
270 B lrw-r--r-- 2026-04-28 09:11:40
Edit Download
275 B lrw-r--r-- 2026-04-28 09:11:40
Edit Download
1.37 KB lrw-r--r-- 2026-04-28 09:11:40
Edit Download
2.71 KB lrw-r--r-- 2026-04-28 09:11:40
Edit Download
1.39 KB lrw-r--r-- 2026-04-28 09:11:40
Edit Download
3.50 KB lrw-r--r-- 2026-04-28 09:11:40
Edit Download
If ZipArchive is unavailable, a .tar will be created (no compression).