Implement bounds padding option.

This commit is contained in:
David Molineus
2016-10-11 14:32:43 +02:00
parent 17e7bc5e1c
commit 28490a9ee6
5 changed files with 43 additions and 4 deletions

View File

@@ -30,7 +30,20 @@ L.Map.include({
}
if (this._dynamicBounds) {
this.fitBounds(this._dynamicBounds);
options = {};
if (this.options.boundsPadding) {
options.padding = this.options.boundsPadding;
} else {
if (this.options.boundsPaddingTopLeft) {
options.paddingTopLeft = this.options.boundsPaddingTopLeft;
}
if (this.options.boundsPaddingBottomRight) {
options.paddingBottomRight = this.options.boundsPaddingBottomRight;
}
}
this.fitBounds(this._dynamicBounds, options);
}
},