Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
Updated example map and removed unnecessary key prop
Browse files Browse the repository at this point in the history
  • Loading branch information
MiniCodeMonkey committed Mar 8, 2019
1 parent a70700e commit e9637e0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions examples/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ class App extends Component {

this.state = {
width: window.innerWidth,
marker: null
marker: null,
center: [38.86530697026126, -77.20057854052735]
}
}

Expand All @@ -32,7 +33,7 @@ class App extends Component {
width={this.state.width}
height={600}
zoom={4}
center={[38.86530697026126, -77.20057854052735]}
center={this.state.center}
source={(x, y, z) => `https://maps.geocod.io/tiles/base/${z}/${x}/${y}.png`}
onMarkerClicked={this.handleMarkerClicked}
>
Expand All @@ -53,7 +54,10 @@ class App extends Component {
}

handleMarkerClicked = marker => {
this.setState({ marker })
this.setState({
marker,
center: marker.coords
})
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/Map.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Map extends Component {
this.renderChildren()

return (
<canvas key={this.props.width + '/' + this.props.height} ref={this.canvasRef} {...this.getCanvasProps()} />
<canvas ref={this.canvasRef} {...this.getCanvasProps()} />
)
}

Expand Down

0 comments on commit e9637e0

Please sign in to comment.