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.
18 lines
509 B
18 lines
509 B
|
3 years ago
|
import { toPoint } from "../../../utils";
|
||
|
|
import { Props } from "./";
|
||
|
|
|
||
|
|
export function useInit(props: Props, contentRef?: HTMLElement) {
|
||
|
|
const { minWidth, maxWidth, maxHeight, autoPan, closeButton, offset, autoPanPadding, closeOnClick, content } = props;
|
||
|
|
const instance = new T.InfoWindow(contentRef || content, {
|
||
|
|
minWidth,
|
||
|
|
maxWidth,
|
||
|
|
maxHeight,
|
||
|
|
autoPan,
|
||
|
|
closeButton,
|
||
|
|
offset: toPoint(offset),
|
||
|
|
autoPanPadding: toPoint(autoPanPadding),
|
||
|
|
closeOnClick
|
||
|
|
});
|
||
|
|
return instance;
|
||
|
|
}
|