[v9.4.x] Geomap: Ensure options work while in table view (#62635)
Geomap: Ensure options work while in table view (#62632)
(cherry picked from commit cf6952a963)
Co-authored-by: Drew Slobodnjak <60050885+drew08t@users.noreply.github.com>
This commit is contained in:
co-authored by
Drew Slobodnjak
parent
c156621981
commit
2bb672a7de
@@ -82,6 +82,8 @@ export class GeomapPanel extends Component<Props, State> {
|
|||||||
for (const lyr of this.layers) {
|
for (const lyr of this.layers) {
|
||||||
lyr.handler.dispose?.();
|
lyr.handler.dispose?.();
|
||||||
}
|
}
|
||||||
|
// Ensure map is disposed
|
||||||
|
this.map?.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldComponentUpdate(nextProps: Props) {
|
shouldComponentUpdate(nextProps: Props) {
|
||||||
@@ -183,15 +185,15 @@ export class GeomapPanel extends Component<Props, State> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
initMapRef = async (div: HTMLDivElement) => {
|
initMapRef = async (div: HTMLDivElement) => {
|
||||||
|
if (!div) {
|
||||||
|
// Do not initialize new map or dispose old map
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.mapDiv = div;
|
this.mapDiv = div;
|
||||||
if (this.map) {
|
if (this.map) {
|
||||||
this.map.dispose();
|
this.map.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!div) {
|
|
||||||
this.map = undefined;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const { options } = this.props;
|
const { options } = this.props;
|
||||||
|
|
||||||
const map = getNewOpenLayersMap(this, options, div);
|
const map = getNewOpenLayersMap(this, options, div);
|
||||||
|
|||||||
Reference in New Issue
Block a user