[view/map][xs] Small fix in the getBounds method (does not work for multi-geometries)
This commit is contained in:
@@ -448,9 +448,11 @@ my.Map = Backbone.View.extend({
|
|||||||
if (layer instanceof L.Marker){
|
if (layer instanceof L.Marker){
|
||||||
bounds.extend(layer.getLatLng());
|
bounds.extend(layer.getLatLng());
|
||||||
} else {
|
} else {
|
||||||
|
if (layer.getBounds){
|
||||||
bounds.extend(layer.getBounds().getNorthEast());
|
bounds.extend(layer.getBounds().getNorthEast());
|
||||||
bounds.extend(layer.getBounds().getSouthWest());
|
bounds.extend(layer.getBounds().getSouthWest());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}, this);
|
}, this);
|
||||||
return (typeof bounds.getNorthEast() !== 'undefined') ? bounds : null;
|
return (typeof bounds.getNorthEast() !== 'undefined') ? bounds : null;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user