mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
move default zoom and center back to tile_map
fixes issue when not using geoJson as the data source
This commit is contained in:
parent
8a543a5789
commit
133d879966
2 changed files with 7 additions and 9 deletions
|
@ -5,9 +5,6 @@ define(function (require) {
|
|||
var rowsToFeatures = require('components/agg_response/geo_json/rowsToFeatures');
|
||||
var tooltipFormatter = Private(require('components/agg_response/geo_json/_tooltip_formatter'));
|
||||
|
||||
var defaultMapZoom = 2;
|
||||
var defaultMapCenter = [15, 5];
|
||||
|
||||
return function (vis, table) {
|
||||
|
||||
function columnIndex(schema) {
|
||||
|
@ -37,8 +34,8 @@ define(function (require) {
|
|||
properties: {
|
||||
min: _.min(values),
|
||||
max: _.max(values),
|
||||
zoom: (geoAgg) ? geoAgg.params.mapZoom : defaultMapZoom,
|
||||
center: (geoAgg) ? geoAgg.params.mapCenter : defaultMapCenter,
|
||||
zoom: _.deepGet(geoAgg, 'params.mapZoom'),
|
||||
center: _.deepGet(geoAgg, 'params.mapCenter')
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -5,10 +5,11 @@ define(function (require) {
|
|||
var L = require('leaflet');
|
||||
require('leaflet-heat');
|
||||
require('leaflet-draw');
|
||||
require('css!components/vislib/styles/main');
|
||||
|
||||
var Chart = Private(require('components/vislib/visualizations/_chart'));
|
||||
|
||||
require('css!components/vislib/styles/main');
|
||||
var defaultMapZoom = 2;
|
||||
var defaultMapCenter = [15, 5];
|
||||
|
||||
// Convenience function to turn around the LngLat recieved from ES
|
||||
function cloneAndReverse(arr) {
|
||||
|
@ -40,8 +41,8 @@ define(function (require) {
|
|||
this.originalConfig = chartData || {};
|
||||
_.assign(this, this.originalConfig);
|
||||
|
||||
this._attr.mapZoom = this.geoJson.properties.zoom;
|
||||
this._attr.mapCenter = this.geoJson.properties.center;
|
||||
this._attr.mapZoom = _.deepGet(this.geoJson, 'properties.zoom') || defaultMapZoom;
|
||||
this._attr.mapCenter = _.deepGet(this.geoJson, 'properties.center') || defaultMapCenter;
|
||||
|
||||
// add allmin and allmax to geoJson
|
||||
var allMinMax = this.getMinMax(handler.data.data);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue