UNPKG

@uiw/react-baidu-map-control

Version:

Baidu Map control Components for React.

19 lines 600 B
export default function getCustomOverlay() { return class extends BMap.Control { constructor(elm, defaultAnchor, defaultOffset) { super(); this.container = void 0; this.map = void 0; this.initialize = map => { this.map = map; // 添加DOM元素到地图中 map.getContainer().appendChild(this.container); return this.container; }; this.draw = () => {}; this.container = elm; this.defaultAnchor = defaultAnchor || BMAP_ANCHOR_TOP_LEFT; this.defaultOffset = defaultOffset || new BMap.Size(10, 10); } }; }