Refactor overpass support using own implementation of overpass layer.

This commit is contained in:
David Molineus
2016-11-14 11:00:10 +01:00
parent 130848c1f3
commit c61e2d9cc9
7 changed files with 447 additions and 37 deletions

View File

@@ -30,23 +30,31 @@ L.Map.include({
}
if (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);
this.fitBounds(this._dynamicBounds, this.getBoundsOptions());
}
},
/**
* Get the bounds optons
* @returns {{}}
*/
getBoundsOptions: function () {
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;
}
}
return options;
},
/**
* Scan recursively for bounds in a layer and extend _dynamicBounds if any found.
*