Skip to content

Commit

Permalink
Upgrade mapbox to latest + remove patch for previous bug
Browse files Browse the repository at this point in the history
  • Loading branch information
karlguillotte committed Aug 18, 2018
1 parent 6bc0f39 commit f3a0190
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 18 deletions.
17 changes: 0 additions & 17 deletions client/services/mapbox/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,5 @@ import supported from '@mapbox/mapbox-gl-supported'
if (supported()) {
import('mapbox-gl/mapbox-gl').then(mapbox => {
mapbox.accessToken = accessToken

// TODO: removed when https://github.com/mapbox/mapbox-gl-js/issues/1776 gets fixed
const { fitBounds } = mapbox.Map.prototype
mapbox.Map.prototype.fitBounds = function(bounds, options, eventData) {
if (typeof options === 'object') {
const canvas = this.getCanvas()
const width = canvas.clientWidth
const [x = 0] = options.offset || []
const { padding = 0 } = options

if (width < 2 * padding + 2 * Math.abs(x)) {
options = undefined
}
}

return fitBounds.call(this, bounds, options, eventData)
}
})
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"immutable": "^3.8.1",
"jest-cli": "^22.0.4",
"jshint-stylish": "~0.1.5",
"mapbox-gl": "0.46.0",
"mapbox-gl": "0.48.0",
"mocha": "^3.0.2",
"nodemon": "^1.11.0",
"normalizr": "^3.1.0",
Expand Down

0 comments on commit f3a0190

Please sign in to comment.