Skip to content

Commit

Permalink
fix(bounds-updating-overlay): fix map not appearing on desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
miles-grant-ibigroup committed Oct 1, 2021
1 parent 921b5e5 commit 16fe92d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/components/map/bounds-updating-overlay.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,18 @@ class BoundsUpdatingOverlay extends MapLayer {
const oldIntermediate = oldProps.query && oldProps.query.intermediatePlaces
const newIntermediate = newProps.query && newProps.query.intermediatePlaces
const intermediateChanged = !isEqual(oldIntermediate, newIntermediate)
const oldMapConfig = oldProps.mapConfig
const newMapConfig = newProps.mapConfig

// Also refit map if itineraryView prop has changed.
const itineraryViewChanged = oldProps.itineraryView !== newProps.itineraryView

if (oldMapConfig !== newMapConfig) {
setTimeout(() => {
map.invalidateSize(true)
map.setZoom(newMapConfig.initZoom)
}, 250)
}
if (itineraryViewChanged) {
this._fitItineraryViewToMap(newProps, newItinBounds, map)
} else if (
Expand Down

0 comments on commit 16fe92d

Please sign in to comment.