mirror of
https://github.com/grafana/grafana.git
synced 2024-11-23 09:26:43 -06:00
Geomap: Address tooltip performance issue (#71607)
This commit is contained in:
parent
1a857552a1
commit
16e5d442ba
@ -4881,7 +4881,7 @@ exports[`better eslint`] = {
|
||||
"public/app/plugins/panel/geomap/utils/selection.ts:5381": [
|
||||
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
|
||||
],
|
||||
"public/app/plugins/panel/geomap/utils/tootltip.ts:5381": [
|
||||
"public/app/plugins/panel/geomap/utils/tooltip.ts:5381": [
|
||||
[0, 0, 0, "Do not use any type assertions.", "0"]
|
||||
],
|
||||
"public/app/plugins/panel/graph/GraphContextMenuCtrl.ts:5381": [
|
||||
|
@ -29,7 +29,7 @@ import { ControlsOptions, Options, MapLayerState, MapViewConfig, TooltipMode } f
|
||||
import { getActions } from './utils/actions';
|
||||
import { getLayersExtent } from './utils/getLayersExtent';
|
||||
import { applyLayerFilter, initLayer } from './utils/layers';
|
||||
import { pointerClickListener, pointerMoveListener, setTooltipListeners } from './utils/tootltip';
|
||||
import { pointerClickListener, pointerMoveListener, setTooltipListeners } from './utils/tooltip';
|
||||
import { updateMap, getNewOpenLayersMap, notifyPanelEditor } from './utils/utils';
|
||||
import { centerPointRegistry, MapCenterID } from './view';
|
||||
|
||||
|
@ -1,3 +1,4 @@
|
||||
import { debounce } from 'lodash';
|
||||
import { MapBrowserEvent } from 'ol';
|
||||
import { toLonLat } from 'ol/proj';
|
||||
|
||||
@ -12,7 +13,7 @@ import { getMapLayerState } from './layers';
|
||||
export const setTooltipListeners = (panel: GeomapPanel) => {
|
||||
// Tooltip listener
|
||||
panel.map?.on('singleclick', panel.pointerClickListener);
|
||||
panel.map?.on('pointermove', panel.pointerMoveListener);
|
||||
panel.map?.on('pointermove', debounce(panel.pointerMoveListener, 200));
|
||||
panel.map?.getViewport().addEventListener('mouseout', (evt: MouseEvent) => {
|
||||
panel.props.eventBus.publish(new DataHoverClearEvent());
|
||||
});
|
Loading…
Reference in New Issue
Block a user