Mobile map fix when listingId provided in URL
This commit is contained in:
@@ -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 () {
|
||||
|
||||
Reference in New Issue
Block a user