You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
649 B
15 lines
649 B
2 years ago
|
import { useAttribution } from './attribution.js';
|
||
|
import { useLeafletContext } from './context.js';
|
||
|
import { useEventHandlers } from './events.js';
|
||
|
import { withPane } from './pane.js';
|
||
|
export function createDivOverlayHook(useElement, useLifecycle) {
|
||
|
return function useDivOverlay(props, setOpen) {
|
||
|
const context = useLeafletContext();
|
||
|
const elementRef = useElement(withPane(props, context), context);
|
||
|
useAttribution(context.map, props.attribution);
|
||
|
useEventHandlers(elementRef.current, props.eventHandlers);
|
||
|
useLifecycle(elementRef.current, context, props, setOpen);
|
||
|
return elementRef;
|
||
|
};
|
||
|
}
|