Created the style property for the map component

This commit is contained in:
Leonardo Farias
2023-12-19 22:16:57 -03:00
parent f23d7965f2
commit 4ddfc1126a
3 changed files with 17 additions and 6 deletions

View File

@@ -0,0 +1,5 @@
---
'@portaljs/components': patch
---
Created the style property in the Map component

View File

@@ -30,6 +30,7 @@ export type MapProps = {
title?: string; title?: string;
center?: { latitude: number | undefined; longitude: number | undefined }; center?: { latitude: number | undefined; longitude: number | undefined };
zoom?: number; zoom?: number;
style?: Object;
}; };
export function Map({ export function Map({
@@ -44,6 +45,7 @@ export function Map({
center = { latitude: 45, longitude: 45 }, center = { latitude: 45, longitude: 45 },
zoom = 2, zoom = 2,
title = '', title = '',
style = {}
}: MapProps) { }: MapProps) {
const [isLoading, setIsLoading] = useState<boolean>(false); const [isLoading, setIsLoading] = useState<boolean>(false);
const [layersData, setLayersData] = useState<any>([]); const [layersData, setLayersData] = useState<any>([]);
@@ -96,6 +98,7 @@ export function Map({
zoom={zoom} zoom={zoom}
scrollWheelZoom={false} scrollWheelZoom={false}
className="h-80 w-full" className="h-80 w-full"
style={style ?? {}}
// @ts-ignore // @ts-ignore
whenReady={(map: any) => { whenReady={(map: any) => {
// Enable zoom using scroll wheel // Enable zoom using scroll wheel

View File

@@ -21,6 +21,9 @@ const meta: Meta = {
zoom: { zoom: {
description: 'Zoom level', description: 'Zoom level',
}, },
style: {
description: "Styles for the container"
}
}, },
}; };