Skip to content

Commit

Permalink
fix(mapvieweditor.tsx): fix undefined lastGeomapPanelInstance which i…
Browse files Browse the repository at this point in the history
…s necessary to set current view
  • Loading branch information
felix-mu committed Jun 13, 2024
1 parent 172d187 commit 0d6cf89
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/GeomapPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ export class GeomapPanel extends Component<Props, State> {
}

componentDidMount() {
// lastGeomapPanelInstance = this;
lastGeomapPanelInstance = this;
// this.initMapRef(this.mapDiv!);

// https://github.com/grafana/grafana/blob/633486e4f13c91940d9681d4768807776ecdcd7f/public/app/plugins/panel/geomap/GeomapPanel.tsx#L77C5-L77C38
Expand Down
1 change: 1 addition & 0 deletions src/editor/MapViewEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export const MapViewEditor: FC<StandardEditorProps<MapViewConfig, any, GeomapPan

const onSetCurrentView = useCallback(() => {
const map = lastGeomapPanelInstance?.map;
// const map = context.instanceState?.map;
if (map) {
const view = map.getView();
const coords = view.getCenter();
Expand Down

0 comments on commit 0d6cf89

Please sign in to comment.