You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Added all google maps api libraries to api loader
Supports places, visualization, places, and geomerty libs.
keeps support for previous heatMapLibrary prop to avoid breaking older usage.
* add libraries to props of GoogleMap
* Update google_map.js
* add warning about heatMapLibrary
* heatmap depreaction, clean libraries, docs
* clean up google map prop
Copy file name to clipboardExpand all lines: API.md
+23-4Lines changed: 23 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ Example:
16
16
key:API_KEY,
17
17
language:'ru',
18
18
region:'ru',
19
+
libraries:['places'],
19
20
...otherUrlParams,
20
21
}}
21
22
>
@@ -350,7 +351,7 @@ For more details see the [google documentation](https://developers.google.com/ma
350
351
351
352
### Heatmap Layer
352
353
353
-
To use the heatmap layer, add `heatmapLibrary={true}` to add the visualizations library, and provide the data&configuration for the heatmap in `heatmap` as props.
354
+
To use the heatmap layer, add `visualization` to the libraries property array on `bootstrapURLKeys`and provide the data & configuration for the heatmap in `heatmap` as props.
354
355
355
356
The typescript interface for the heatmap prop is as follows:
356
357
```typescript
@@ -372,10 +373,12 @@ interface heatmapProp {
372
373
373
374
```javascript
374
375
<GoogleMapReact
375
-
bootstrapURLKeys={{ key: [YOUR_KEY] }}
376
+
bootstrapURLKeys={{
377
+
key: [YOUR_KEY],
378
+
libraries:['visualization']
379
+
}}
376
380
zoom={zoom}
377
381
center={center}
378
-
heatmapLibrary={true}
379
382
heatmap={{data}}
380
383
>
381
384
{markers}
@@ -384,8 +387,24 @@ interface heatmapProp {
384
387
385
388
#### Important Note
386
389
387
-
If you have multiple `GoogleMapReact` components in project and you want to use heatmap layer so provide `heatmapLibrary={true}` for all `GoogleMapReact` components so component will load heatmap library at the beginning with google map api.
390
+
If you have multiple `GoogleMapReact` components in project and you want to use heatmap layer provide `libraries:['visualization']` to `bootstrapURLKeys`so that the visualization library will be loaded with the google map api.
388
391
389
392
### Localizing the Map
390
393
391
394
This is done by setting bootstrapURLKeys.[language](https://developers.google.com/maps/documentation/javascript/localization#Language) and bootstrapURLKeys.[region](https://developers.google.com/maps/documentation/javascript/localization#Region). Also notice that setting region to 'cn' is required when using the map from within China, see [google documentation](https://developers.google.com/maps/documentation/javascript/localization#GoogleMapsChina) for more info. Setting 'cn' will result in use of the specific API URL for China.
395
+
396
+
397
+
### Libraries
398
+
399
+
If you want to include additional libraries to load with the maps api, indicate them in the libraries property of the `bootstrapURLKeys` object.
0 commit comments