[view/map][xs] Small fix in the getBounds method (does not work for multi-geometries)

This commit is contained in:
amercader 2012-04-24 18:53:19 +01:00
parent 3597974469
commit 653eda6f43

View File

@ -448,8 +448,10 @@ my.Map = Backbone.View.extend({
if (layer instanceof L.Marker){
bounds.extend(layer.getLatLng());
} else {
bounds.extend(layer.getBounds().getNorthEast());
bounds.extend(layer.getBounds().getSouthWest());
if (layer.getBounds){
bounds.extend(layer.getBounds().getNorthEast());
bounds.extend(layer.getBounds().getSouthWest());
}
}
}, this);
return (typeof bounds.getNorthEast() !== 'undefined') ? bounds : null;