mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
parent
62a5dc63bb
commit
0c3bb057e2
2 changed files with 15 additions and 1 deletions
|
@ -483,6 +483,20 @@ describe('kibana_map tests', function () {
|
|||
});
|
||||
|
||||
|
||||
it('should not throw when fitting on empty-data layer', function () {
|
||||
|
||||
const geohashLayer = new GeohashLayer({
|
||||
type: 'FeatureCollection',
|
||||
features: []
|
||||
}, { 'mapType': 'Scaled Circle Markers' }, kibanaMap.getZoomLevel(), kibanaMap);
|
||||
kibanaMap.addLayer(geohashLayer);
|
||||
|
||||
expect(() => {
|
||||
kibanaMap.fitToData();
|
||||
}).to.not.throwException();
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -473,7 +473,7 @@ export class KibanaMap extends EventEmitter {
|
|||
}
|
||||
});
|
||||
|
||||
if (bounds) {
|
||||
if (bounds && bounds.isValid()) {
|
||||
this._leafletMap.fitBounds(bounds);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue