Skip to content

Commit

Permalink
[client] fix google map ref lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
mzogheib committed Jun 16, 2019
1 parent 4c02b1b commit 8a1bf08
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/client/src/components/Map/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,17 @@ export default class Map extends Component {
polylineItems: [],
}

componentDidMount() {
const { markerData, polylineData } = this.props

onMapMounted = mapRef => {
const melbourne = new google.maps.LatLng(-37.8079033, 144.9759344)
this.map = new google.maps.Map(this.refs.map, {
this.map = new google.maps.Map(mapRef, {
center: melbourne,
zoom: 14,
mapTypeId: 'roadmap',
})
}

componentDidMount() {
const { markerData, polylineData } = this.props

this.map.addListener('click', event => {
if (event.placeId) this.resetAllMapElements()
Expand Down Expand Up @@ -200,6 +202,6 @@ export default class Map extends Component {
)

render() {
return <Wrapper ref="map" />
return <Wrapper ref={this.onMapMounted} />
}
}

0 comments on commit 8a1bf08

Please sign in to comment.