Skip to content

Commit c8a7f56

Browse files
barakplasmaitsmichaeldiego
authored andcommitted
Documentation: added PropTypes for heatmap prop (google-map-react#716)
* Documentation: added PropTypes for heatmap prop This PR improves the documentation of the heatmap prop by adding types. I don't mind adding PropTypes validation to this prop as well if you are interested in that. * Update API.md I added some spacing between the interface and the example snippet. I also added a link to the example I wrote for the other repository. I think we should delay this PR until that example is live. That way, the new Demo link will go to live functioning code rather than no where.
1 parent 7b02e7e commit c8a7f56

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

API.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,25 @@ For more details see the [google documentation](https://developers.google.com/ma
347347

348348
### Heatmap Layer
349349

350-
For enabling heatmap layer, just add `heatmapLibrary={true}` and provide data for heatmap in `heatmap` as props.
350+
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.
351+
352+
The typescript interface for the heatmap prop is as follows:
353+
```typescript
354+
interface heatmapProp {
355+
positions: {
356+
lat: Number;
357+
lng: Number;
358+
weight?: Number;
359+
}[];
360+
options: {
361+
radius?: number;
362+
opacity?: number;
363+
/* other options directly from Google Heatmaps API */
364+
};
365+
}
366+
```
351367

352-
#### Example
368+
#### Example [Demo](https://google-map-react.github.io/google-map-react-examples/heatmap)
353369

354370
```javascript
355371
<GoogleMapReact

0 commit comments

Comments
 (0)