Fix bug with weird clipping behaviour (cause of #125)
This commit is contained in:
parent
6353ef9e20
commit
9c671f4735
1 changed files with 30 additions and 22 deletions
|
@ -52,12 +52,20 @@ export class FilteredLayer {
|
|||
|
||||
this._wayHandling = layerDef.wayHandling;
|
||||
this._showOnPopup = showOnPopup;
|
||||
this._style = layerDef.style;
|
||||
if (this._style === undefined) {
|
||||
this._style = function () {
|
||||
this._style = (tags) => {
|
||||
if(layerDef.style === undefined){
|
||||
return {icon: {iconUrl: "./assets/bug.svg"}, color: "#000"};
|
||||
}
|
||||
|
||||
const obj = layerDef.style(tags);
|
||||
if(obj.weight && typeof (obj.weight) === "string"){
|
||||
obj.weight = Number(obj.weight);// Weight MUST be a number, otherwise leaflet does weird things. see https://github.com/Leaflet/Leaflet/issues/6075
|
||||
if(isNaN(obj.weight)){
|
||||
obj.weight = undefined;
|
||||
}
|
||||
}
|
||||
return obj;
|
||||
};
|
||||
this.name = name;
|
||||
this.filters = layerDef.overpassFilter;
|
||||
this._maxAllowedOverlap = layerDef.maxAllowedOverlapPercentage;
|
||||
|
|
Loading…
Reference in a new issue