Mobile map fix when listingId provided in URL

This commit is contained in:
Edin Dazdarevic
2017-04-15 01:30:38 +02:00
parent cfa14ed590
commit 04a4283371
3 changed files with 8 additions and 20 deletions

View File

@@ -133,6 +133,7 @@ class Main extends React.Component {
maxZoom: parseInt(this.state.zoom),
minZoom: parseInt(this.state.zoom)
})
map.fitBounds(initialBounds)
map.setOptions({maxZoom: originalMaxZoom, minZoom: originalMinZoom})
}
@@ -167,19 +168,6 @@ class Main extends React.Component {
control.index = 1
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(control)
this.map = map
// TODO: if state contains listingId reload
if (this.state.listingId) {
loadListing(this.state.listingId).then(l => l.text()).then(l => {
this.dispatch({
type: 'VIEW_LISTING_DETAILS',
action: {
id: this.state.listingId,
listing: JSON.parse(l)
}
})
})
}
}
removeAllMarkers () {