Skip to content

Commit

Permalink
docs(README.md): Update SimpleMap Component Example
Browse files Browse the repository at this point in the history
* Replace instance methods with functions from props
* Close #251
* Original commit: 6e26638
* Thanks @joshburgess
  • Loading branch information
joshburgess authored and tomchentw committed May 10, 2016
1 parent 5c77cb9 commit a149d50
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export default function SimpleMap (props) {
<GoogleMapLoader
containerElement={
<div
{...this.props}
{...props.containerElementProps}
style={{
height: "100%",
}}
Expand All @@ -27,13 +27,14 @@ export default function SimpleMap (props) {
<GoogleMap
ref={(map) => console.log(map)}
defaultZoom={3}
defaultCenter={{lat: -25.363882, lng: 131.044922}}
onClick={::this.handleMapClick}>
{this.state.markers.map((marker, index) => {
defaultCenter={{ lat: -25.363882, lng: 131.044922 }}
onClick={props.onMapClick}
>
{props.markers.map((marker, index) => {
return (
<Marker
{...marker}
onRightclick={this.handleMarkerRightclick.bind(this, index)} />
onRightclick={() => props.onMarkerRightclick(index)} />
);
})}
</GoogleMap>
Expand Down

0 comments on commit a149d50

Please sign in to comment.