fixing map bounds (#25040)

This commit is contained in:
Peter Pisljar 2018-11-16 07:24:54 +01:00 committed by GitHub
parent 359c852c76
commit 6f527618f5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -21,7 +21,6 @@ import _ from 'lodash';
import { i18n } from '@kbn/i18n';
import { GeohashLayer } from './geohash_layer';
import { BaseMapsVisualizationProvider } from './base_maps_visualization';
import { AggConfig } from 'ui/vis/agg_config';
import { TileMapTooltipFormatterProvider } from './editors/_tooltip_formatter';
import { toastNotifications } from 'ui/notify';
@ -202,15 +201,15 @@ export function CoordinateMapsVisualizationProvider(Notifier, Private) {
if (agg) {
const searchSource = this.vis.searchSource.createChild();
searchSource.setField('size', 0);
searchSource.setField('aggs', function () {
const geoBoundsAgg = new AggConfig(agg.vis, {
searchSource.setField('aggs', () => {
const geoBoundsAgg = this.vis.getAggConfig().createAggConfig({
type: 'geo_bounds',
enabled: true,
params: {
field: agg.getField()
},
schema: 'metric'
});
schema: 'metric',
}, { addToAggConfigs: false });
return {
'1': geoBoundsAgg.toDsl()
};