Created the style property for the map component
This commit is contained in:
5
.changeset/hip-trainers-pretend.md
Normal file
5
.changeset/hip-trainers-pretend.md
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'@portaljs/components': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
Created the style property in the Map component
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -21,6 +21,9 @@ const meta: Meta = {
|
|||||||
zoom: {
|
zoom: {
|
||||||
description: 'Zoom level',
|
description: 'Zoom level',
|
||||||
},
|
},
|
||||||
|
style: {
|
||||||
|
description: "Styles for the container"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user