Fixed an issue where Geometry Viewer renders geometry incorrectly after trying to view 3D or non-4326 SRID geometry. #6017

This commit is contained in:
Aditya Toshniwal
2023-11-17 16:29:01 +05:30
parent 5bdccb6e63
commit 0bc044fa67
4 changed files with 12 additions and 13 deletions
@@ -376,7 +376,6 @@ export function GeometryViewer({rows, columns, column}) {
const contentRef = React.useRef();
const data = parseData(rows, columns, column);
const queryToolCtx = React.useContext(QueryToolContext);
const crs = data.selectedSRID === 4326 ? CRS.EPSG3857 : CRS.Simple;
useEffect(()=>{
let timeoutId;
@@ -391,10 +390,11 @@ export function GeometryViewer({rows, columns, column}) {
contentResizeObserver.observe(contentRef.current);
}, []);
// Dyanmic CRS is not supported. Use srid as key and recreate the map on change
return (
<Box ref={contentRef} width="100%" height="100%">
<Box ref={contentRef} width="100%" height="100%" key={data.selectedSRID}>
<MapContainer
crs={crs}
crs={data.selectedSRID === 4326 ? CRS.EPSG3857 : CRS.Simple}
zoom={2} center={[20, 100]}
preferCanvas={true}
className={classes.mapContainer}