Skip to content

Commit

Permalink
docs(examples): new example using google.maps.visualization.HeatmapLa…
Browse files Browse the repository at this point in the history
…yer (#445)
  • Loading branch information
CedricAngeloSina-on authored Jul 10, 2024
1 parent 6410bef commit 183f5a4
Show file tree
Hide file tree
Showing 12 changed files with 71,557 additions and 0 deletions.
36 changes: 36 additions & 0 deletions examples/heatmap/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Heatmap

This uses the `useMapsLibrary` hook showing earthquake magnitude data in a
heatmap.

## Google Maps Platform API key

This example does not come with an API key. Running the examples locally requires a valid API key for the Google Maps Platform.
See [the official documentation][get-api-key] on how to create and configure your own key.

The API key has to be provided via an environment variable `GOOGLE_MAPS_API_KEY`. This can be done by creating a
file named `.env` in the example directory with the following content:

```shell title=".env"
GOOGLE_MAPS_API_KEY="<YOUR API KEY HERE>"
```

If you are on the CodeSandbox playground you can also choose to [provide the API key like this](https://codesandbox.io/docs/learn/environment/secrets)

## Development

Go into the example-directory and run

```shell
npm install
```

To start the example with the local library run

```shell
npm run start-local
```

The regular `npm start` task is only used for the standalone versions of the example (CodeSandbox for example)

[get-api-key]: https://developers.google.com/maps/documentation/javascript/get-api-key
Loading

0 comments on commit 183f5a4

Please sign in to comment.