Documentation: added PropTypes for heatmap prop (#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.
This commit is contained in:
Michael Salaverry 2019-03-05 07:41:46 +02:00 committed by Michael Diego
parent 7b02e7ef2e
commit c8a7f56261

20
API.md
View File

@ -347,9 +347,25 @@ For more details see the [google documentation](https://developers.google.com/ma
### Heatmap Layer
For enabling heatmap layer, just add `heatmapLibrary={true}` and provide data for heatmap in `heatmap` as props.
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.
#### Example
The typescript interface for the heatmap prop is as follows:
```typescript
interface heatmapProp {
positions: {
lat: Number;
lng: Number;
weight?: Number;
}[];
options: {
radius?: number;
opacity?: number;
/* other options directly from Google Heatmaps API */
};
}
```
#### Example [Demo](https://google-map-react.github.io/google-map-react-examples/heatmap)
```javascript
<GoogleMapReact