Fix deleting map not removing map from map view
This commit is contained in:
parent
c543f15c81
commit
9ff6053498
@ -32,8 +32,7 @@ function MapInteraction({
|
||||
useEffect(() => {
|
||||
if (map === null) {
|
||||
setMapLoaded(false);
|
||||
}
|
||||
if (mapImageSourceStatus === "loaded") {
|
||||
} else if (mapImageSourceStatus === "loaded") {
|
||||
setMapLoaded(true);
|
||||
}
|
||||
}, [mapImageSourceStatus, map]);
|
||||
|
@ -3,6 +3,8 @@ import useImage from "use-image";
|
||||
|
||||
import useDataSource from "./useDataSource";
|
||||
|
||||
import { isEmpty } from "./shared";
|
||||
|
||||
import { mapSources as defaultMapSources } from "../maps";
|
||||
|
||||
function useMapImage(map) {
|
||||
@ -38,6 +40,8 @@ function useMapImage(map) {
|
||||
if (map.file && map.quality !== mapSourceMap.quality) {
|
||||
updateMapSource();
|
||||
}
|
||||
} else if (!map && !isEmpty(mapSourceMap)) {
|
||||
setMapSourceMap({});
|
||||
}
|
||||
}, [map, mapSourceMap]);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user