mirror of
https://github.com/netzmacht/contao-leaflet-maps.git
synced 2026-01-17 21:05:17 +01:00
Implement bounds padding option.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user