Skip to content

Commit

Permalink
Being able to toggle automatically adjusting the map viewport.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zandor300 committed Dec 29, 2021
1 parent db7093b commit 72b595a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/lib/AppleMaps.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,20 @@ class AppleMaps extends Component {
spanLong,
zoomLevel,
width,
height
height,
autoAdjust
} = this.props

if(
if((
prevProps.latitude !== latitude ||
prevProps.longitude !== longitude ||
prevProps.spanLat !== spanLat ||
prevProps.spanLong !== spanLong ||
prevProps.zoomLevel !== zoomLevel ||
prevProps.width !== width ||
prevProps.height !== height
) {
prevProps.height !== height ||
prevProps.autoAdjust !== autoAdjust
) && autoAdjust) {
this.setMainCoords()
}

Expand Down Expand Up @@ -298,7 +300,8 @@ AppleMaps.defaultProps = {
height: '100vh',
zoomLevel: 6,
longitude: 53.8008,
latitude: -1.5491
latitude: -1.5491,
autoAdjust: false
}

export default AppleMaps

0 comments on commit 72b595a

Please sign in to comment.