mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
Fix fitBounds
This commit is contained in:
parent
44cb38e050
commit
e167f29e68
2 changed files with 1 additions and 29 deletions
|
@ -270,8 +270,7 @@ define(function (require) {
|
|||
* @return {undefined}
|
||||
*/
|
||||
TileMap.prototype.fitBounds = function (map, mapData) {
|
||||
|
||||
map.fitBounds(this.getBounds(mapData));
|
||||
map.fitBounds(mapData._latlngs || mapData.getBounds());
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -757,18 +756,6 @@ define(function (require) {
|
|||
this.popups.push(popup);
|
||||
};
|
||||
|
||||
/**
|
||||
* get bounds of features from geoJson
|
||||
*
|
||||
* @method getBounds
|
||||
* @param mapData {geoJson Object}
|
||||
* @return bounds {Leaflet Object}
|
||||
*/
|
||||
TileMap.prototype.getBounds = function (mapData) {
|
||||
var bounds = L.geoJson(mapData).getBounds();
|
||||
return bounds;
|
||||
};
|
||||
|
||||
/**
|
||||
* retuns data for data for heat map intensity
|
||||
* if heatNormalizeData attribute is checked/true
|
||||
|
|
|
@ -293,21 +293,6 @@ define(function (require) {
|
|||
});
|
||||
});
|
||||
|
||||
describe('getBounds method', function () {
|
||||
it('should return bounds object that contains every point in mapData', function () {
|
||||
vis.handler.charts.forEach(function (chart) {
|
||||
var containsPoint = [];
|
||||
var bounds = chart.getBounds(mapData);
|
||||
for (var i = 0; i < mapData.features.length; i++) {
|
||||
var pt = [mapData.features[i].geometry.coordinates[1], mapData.features[i].geometry.coordinates[0]];
|
||||
containsPoint.push(bounds.contains(pt));
|
||||
}
|
||||
containsPoint = _.compact(containsPoint);
|
||||
expect(containsPoint.length).to.be(mapData.features.length);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('showTooltip method', function () {
|
||||
it('should create a .leaflet-popup-kibana div for the tooltip', function () {
|
||||
vis.handler.charts.forEach(function (chart) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue