Skip to content

Commit

Permalink
remove toasts
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasneirynck committed Apr 2, 2021
1 parent f91804e commit 9a6af8e
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 135 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ export class ServiceSettings implements IServiceSettings {
});
}

shouldShowZoomMessage({ origin }: { origin: string }): boolean {
return origin === ORIGIN.EMS && this._showZoomMessage;
}

enableZoomMessage(): void {
this._showZoomMessage = true;
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/maps_legacy/kibana.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"ui": true,
"server": true,
"requiredPlugins": ["mapsEms"],
"requiredBundles": ["kibanaReact", "visDefaultEditor", "mapsEms"]
"requiredBundles": ["visDefaultEditor", "mapsEms"]
}
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,12 @@ export function BaseMapsVisualizationProvider() {
isDesaturated,
isDarkMode
);
const showZoomMessage = serviceSettings.shouldShowZoomMessage(tmsLayer);
const options = { ...tmsLayer };
delete options.id;
delete options.subdomains;
this._kibanaMap.setBaseLayer({
baseLayerType: 'tms',
options: { ...options, showZoomMessage, ...meta },
options: { ...options, ...meta },
});
}

Expand Down
23 changes: 0 additions & 23 deletions src/plugins/maps_legacy/public/map/kibana_map.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,11 @@
*/

import { EventEmitter } from 'events';
import { createZoomWarningMsg } from './map_messages';
import $ from 'jquery';
import { get, isEqual, escape } from 'lodash';
import { zoomToPrecision } from './zoom_to_precision';
import { i18n } from '@kbn/i18n';
import { ORIGIN } from '../../../maps_ems/common';
import { getToasts } from '../kibana_services';
import { L } from '../leaflet';

function makeFitControl(fitContainer, kibanaMap) {
Expand Down Expand Up @@ -479,22 +477,6 @@ export class KibanaMap extends EventEmitter {
this._updateLegend();
}

_addMaxZoomMessage = (layer) => {
const zoomWarningMsg = createZoomWarningMsg(
getToasts(),
this.getZoomLevel,
this.getMaxZoomLevel
);

this._leafletMap.on('zoomend', zoomWarningMsg);
this._containerNode.setAttribute('data-test-subj', 'zoomWarningEnabled');

layer.on('remove', () => {
this._leafletMap.off('zoomend', zoomWarningMsg);
this._containerNode.removeAttribute('data-test-subj');
});
};

setLegendPosition(position) {
if (this._legendPosition === position) {
if (!this._leafletLegendControl) {
Expand Down Expand Up @@ -572,11 +554,6 @@ export class KibanaMap extends EventEmitter {
});

this._leafletBaseLayer = baseLayer;
if (settings.options.showZoomMessage) {
baseLayer.on('add', () => {
this._addMaxZoomMessage(baseLayer);
});
}
this._leafletBaseLayer.addTo(this._leafletMap);
this._leafletBaseLayer.bringToBack();
if (settings.options.minZoom > this._leafletMap.getZoom()) {
Expand Down
105 changes: 0 additions & 105 deletions src/plugins/maps_legacy/public/map/map_messages.js

This file was deleted.

0 comments on commit 9a6af8e

Please sign in to comment.