Skip to content

Commit

Permalink
docs(README.md): add section "Map Event Triggers"
Browse files Browse the repository at this point in the history
* Original commits: 1a144fd, 5e0fcf8, 3610a69, da21acb
* Original author: @hsin421
* Closes #131
  • Loading branch information
tomchentw committed Oct 14, 2015
1 parent a7c9992 commit 305c52a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@ Every props mentioned in __Rule 2__ could be either [controlled](https://faceboo

Anything that are inside components' `options` property could __ONLY__ be accessible via `props.options`. It's your responsibility to manage `props.options` object during the React lifetime for your component. My suggestion is, always use __Rule 3__ if possible. Only use `options` when it's necessary.

### Map Event Triggers

One common event trigger is to resize map after the size of the container div changes:

```js
componentDidUpdate() {
var map = React.findDOMNode(this.refs.map);
window.google.maps.event.trigger(map, 'resize');
}

<GoogleMap {...props} ref="map" > ... </GoogleMap>
```

### Check the examples

Static hosted [demo site][demo] on GitHub. The code is located under [examples/gh-pages][examples_gh_pages] folder.
Expand Down

0 comments on commit 305c52a

Please sign in to comment.