@@ -2,11 +2,15 @@ import _ from 'lodash';
2
2
import MapsProvider from 'ui/vis_maps/maps' ;
3
3
import VisRenderbotProvider from 'ui/vis/renderbot' ;
4
4
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 ) {
6
7
const AngularPromise = $injector . get ( 'Promise' ) ;
7
8
const Maps = Private ( MapsProvider ) ;
8
9
const Renderbot = Private ( VisRenderbotProvider ) ;
9
10
const buildChartData = Private ( MapsVisTypeBuildChartDataProvider ) ;
11
+ const notify = new Notifier ( {
12
+ location : 'Tilemap'
13
+ } ) ;
10
14
11
15
_ . class ( MapsRenderbot ) . inherits ( Renderbot ) ;
12
16
function MapsRenderbot ( vis , $el , uiState ) {
@@ -15,6 +19,11 @@ module.exports = function MapsRenderbotFactory(Private, $injector) {
15
19
}
16
20
17
21
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
+ }
18
27
if ( this . mapsVis ) this . destroy ( ) ;
19
28
this . mapsParams = this . _getMapsParams ( ) ;
20
29
this . mapsVis = new Maps ( this . $el [ 0 ] , this . vis , this . mapsParams ) ;
0 commit comments