Skip to content

Commit b2e15ce

Browse files
committed
Move padding to constants.js
1 parent 967acde commit b2e15ce

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

src/plots/map/constants.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,5 @@ module.exports = {
8585

8686

8787
mapOnErrorMsg: 'Map error.',
88-
89-
88+
fitBoundsPadding: 20,
9089
};

src/plots/map/map.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ proto.createMap = function(calcData, fullLayout, resolve, reject) {
9696
pitch: opts.pitch,
9797
bounds: _fitBounds,
9898
fitBoundsOptions: {
99-
padding: 20,
99+
padding: constants.fitBoundsPadding,
100100
},
101101
maxBounds: maxBounds,
102102

@@ -344,7 +344,7 @@ proto.updateLayout = function(fullLayout) {
344344
map.setZoom(opts.zoom);
345345
if (opts._fitBounds) {
346346
var { west, south, east, north } = opts._fitBounds
347-
map.fitBounds([[west, south], [east, north]], { padding: 20 })
347+
map.fitBounds([[west, south], [east, north]], { padding: constants.fitBoundsPadding })
348348
}
349349
map.setBearing(opts.bearing);
350350
map.setPitch(opts.pitch);

0 commit comments

Comments
 (0)