mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
Merge branch 'master' of github.com:elastic/kibana into fix/tilemap-manifest-url-manipulation
This commit is contained in:
commit
22669aaa63
3 changed files with 14 additions and 11 deletions
|
@ -168,7 +168,7 @@ uiModules.get('kibana')
|
|||
}
|
||||
|
||||
/**
|
||||
* Make this instance property to allow for overrides by test code
|
||||
* Make this a method to allow for overrides by test code
|
||||
*/
|
||||
_getTileServiceManifest(manifestUrl, additionalQueryParams) {
|
||||
return $http({
|
||||
|
|
|
@ -2,11 +2,15 @@ import _ from 'lodash';
|
|||
import MapsProvider from 'ui/vis_maps/maps';
|
||||
import VisRenderbotProvider from 'ui/vis/renderbot';
|
||||
import MapsVisTypeBuildChartDataProvider from 'ui/vislib_vis_type/build_chart_data';
|
||||
module.exports = function MapsRenderbotFactory(Private, $injector) {
|
||||
|
||||
module.exports = function MapsRenderbotFactory(Private, $injector, tilemapSettings, Notifier) {
|
||||
const AngularPromise = $injector.get('Promise');
|
||||
const Maps = Private(MapsProvider);
|
||||
const Renderbot = Private(VisRenderbotProvider);
|
||||
const buildChartData = Private(MapsVisTypeBuildChartDataProvider);
|
||||
const notify = new Notifier({
|
||||
location: 'Tilemap'
|
||||
});
|
||||
|
||||
_.class(MapsRenderbot).inherits(Renderbot);
|
||||
function MapsRenderbot(vis, $el, uiState) {
|
||||
|
@ -15,6 +19,11 @@ module.exports = function MapsRenderbotFactory(Private, $injector) {
|
|||
}
|
||||
|
||||
MapsRenderbot.prototype._createVis = function () {
|
||||
if (tilemapSettings.getError()) {
|
||||
//Still allow the visualization to be build, but show a toast that there was a problem retrieving map settings
|
||||
//Even though the basemap will not display, the user will at least still see the overlay data
|
||||
notify.warning(tilemapSettings.getError().message);
|
||||
}
|
||||
if (this.mapsVis) this.destroy();
|
||||
this.mapsParams = this._getMapsParams();
|
||||
this.mapsVis = new Maps(this.$el[0], this.vis, this.mapsParams);
|
||||
|
|
|
@ -7,15 +7,11 @@ import VislibVisualizationsMarkerTypesGeohashGridProvider from './marker_types/g
|
|||
import VislibVisualizationsMarkerTypesHeatmapProvider from './marker_types/heatmap';
|
||||
import '../lib/tilemap_settings';
|
||||
|
||||
export default function MapFactory(Private, tilemapSettings, Notifier) {
|
||||
export default function MapFactory(Private, tilemapSettings) {
|
||||
const defaultMapZoom = 2;
|
||||
const defaultMapCenter = [15, 5];
|
||||
const defaultMarkerType = 'Scaled Circle Markers';
|
||||
|
||||
const notify = new Notifier({
|
||||
location: 'Vis'
|
||||
});
|
||||
|
||||
const markerTypes = {
|
||||
'Scaled Circle Markers': Private(VislibVisualizationsMarkerTypesScaledCirclesProvider),
|
||||
'Shaded Circle Markers': Private(VislibVisualizationsMarkerTypesShadedCirclesProvider),
|
||||
|
@ -60,10 +56,8 @@ export default function MapFactory(Private, tilemapSettings, Notifier) {
|
|||
fadeAnimation: false,
|
||||
};
|
||||
|
||||
if (tilemapSettings.hasError()) {
|
||||
notify.fatal(tilemapSettings.getError());
|
||||
}
|
||||
this._createMap(options, tilemapSettings.getUrl());
|
||||
const url = tilemapSettings.hasError() ? '' : tilemapSettings.getUrl();
|
||||
this._createMap(options, url);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue