A geographic popup with controlled visibility.
import { useState } from 'react';
import { MapPopup } from '@vrum/ui';
import { MapView } from '@vrum/ui';
export default function Demo() {
const [open, setOpen] = useState(true);
return (
<MapView center={[2.3522, 48.8566]} zoom={4} styleUrl="https://demotiles.maplibre.org/style.json" showControls={false}>
<MapPopup
longitude={2.3522}
latitude={48.8566}
open={open}
hideCloseButton={false}
closeOnClick={false}
onOpenChange={setOpen}
>
{"Paris · Project workspace"}
</MapPopup>
</MapView>
);
}Copy code| Prop | Type | Default | Description |
|---|---|---|---|
longitude* | number | none | longitude configuration. |
latitude* | number | none | latitude configuration. |
open | boolean | true | Controlled visibility. |
onOpenChange | ((open: boolean) => void) | none | Called when visibility changes. |
hideCloseButton | boolean | false | hide close button configuration. |
closeOnClick | boolean | true | close on click configuration. |
className | string | none | Additional CSS classes. |
children | React.ReactNode | none | Content displayed inside the component. |