Skip to content

Commit

Permalink
Set default height for Map
Browse files Browse the repository at this point in the history
  • Loading branch information
qgerome committed May 24, 2022
1 parent 6244d2d commit 9e9b26e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/components/map/Map.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ import { MapContainer, MapContainerProps, TileLayer } from "react-leaflet";

export type MapProps = {
loading?: boolean;
height?: number;
style?: object;
} & MapContainerProps;
const Map = (props: MapProps) => {
const {
children,
center = [12.2395, -1.5584094],
zoom = 7,
height = 600,
loading,
className,
style = { height: 600 },
...delegated
} = props;
const { t } = useTranslation();

return (
<div className={clsx(className, "relative w-full", `h-[${height}px]`)}>
<div className={clsx(className, "relative h-full w-full")} style={style}>
<MapContainer
center={center}
zoom={zoom}
Expand Down
2 changes: 1 addition & 1 deletion src/features/dataset/VectorDatasetMap/ClientVectorMap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const ClientVectorMap = (props: Props) => {
const { geoJSON, height, loading = false, ...delegated } = props;

return (
<Map height={height} loading={loading} {...delegated}>
<Map style={{ height }} loading={loading} {...delegated}>
{geoJSON && <BigGeoJsonLayer data={geoJSON} />}
</Map>
);
Expand Down

0 comments on commit 9e9b26e

Please sign in to comment.