Skip to content

Commit 22669aa

Browse files
committed
Merge branch 'master' of github.com:elastic/kibana into fix/tilemap-manifest-url-manipulation
2 parents bf4083f + efc954e commit 22669aa

File tree

3 files changed

+14
-11
lines changed

3 files changed

+14
-11
lines changed

src/ui/public/vis_maps/lib/tilemap_settings.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ uiModules.get('kibana')
168168
}
169169

170170
/**
171-
* Make this instance property to allow for overrides by test code
171+
* Make this a method to allow for overrides by test code
172172
*/
173173
_getTileServiceManifest(manifestUrl, additionalQueryParams) {
174174
return $http({

src/ui/public/vis_maps/maps_renderbot.js

+10-1
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,15 @@ import _ from 'lodash';
22
import MapsProvider from 'ui/vis_maps/maps';
33
import VisRenderbotProvider from 'ui/vis/renderbot';
44
import MapsVisTypeBuildChartDataProvider from 'ui/vislib_vis_type/build_chart_data';
5-
module.exports = function MapsRenderbotFactory(Private, $injector) {
5+
6+
module.exports = function MapsRenderbotFactory(Private, $injector, tilemapSettings, Notifier) {
67
const AngularPromise = $injector.get('Promise');
78
const Maps = Private(MapsProvider);
89
const Renderbot = Private(VisRenderbotProvider);
910
const buildChartData = Private(MapsVisTypeBuildChartDataProvider);
11+
const notify = new Notifier({
12+
location: 'Tilemap'
13+
});
1014

1115
_.class(MapsRenderbot).inherits(Renderbot);
1216
function MapsRenderbot(vis, $el, uiState) {
@@ -15,6 +19,11 @@ module.exports = function MapsRenderbotFactory(Private, $injector) {
1519
}
1620

1721
MapsRenderbot.prototype._createVis = function () {
22+
if (tilemapSettings.getError()) {
23+
//Still allow the visualization to be build, but show a toast that there was a problem retrieving map settings
24+
//Even though the basemap will not display, the user will at least still see the overlay data
25+
notify.warning(tilemapSettings.getError().message);
26+
}
1827
if (this.mapsVis) this.destroy();
1928
this.mapsParams = this._getMapsParams();
2029
this.mapsVis = new Maps(this.$el[0], this.vis, this.mapsParams);

src/ui/public/vis_maps/visualizations/_map.js

+3-9
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,11 @@ import VislibVisualizationsMarkerTypesGeohashGridProvider from './marker_types/g
77
import VislibVisualizationsMarkerTypesHeatmapProvider from './marker_types/heatmap';
88
import '../lib/tilemap_settings';
99

10-
export default function MapFactory(Private, tilemapSettings, Notifier) {
10+
export default function MapFactory(Private, tilemapSettings) {
1111
const defaultMapZoom = 2;
1212
const defaultMapCenter = [15, 5];
1313
const defaultMarkerType = 'Scaled Circle Markers';
1414

15-
const notify = new Notifier({
16-
location: 'Vis'
17-
});
18-
1915
const markerTypes = {
2016
'Scaled Circle Markers': Private(VislibVisualizationsMarkerTypesScaledCirclesProvider),
2117
'Shaded Circle Markers': Private(VislibVisualizationsMarkerTypesShadedCirclesProvider),
@@ -60,10 +56,8 @@ export default function MapFactory(Private, tilemapSettings, Notifier) {
6056
fadeAnimation: false,
6157
};
6258

63-
if (tilemapSettings.hasError()) {
64-
notify.fatal(tilemapSettings.getError());
65-
}
66-
this._createMap(options, tilemapSettings.getUrl());
59+
const url = tilemapSettings.hasError() ? '' : tilemapSettings.getUrl();
60+
this._createMap(options, url);
6761

6862
}
6963

0 commit comments

Comments
 (0)