//@ts-ignore import { MarkerLayer, Scene } from '@antv/l7'; import { AMapScene, Marker, Popup } from '@antv/l7-react'; import { GaodeMap } from '@antv/l7-maps'; import * as React from 'react'; import { useState } from 'react'; const Amap2demo_markerPopup = () => { const [showPopup, setShowPopup] = useState(false); return ( { console.log(marker.getElement().children[0].children[0]); marker .getElement() .children[0].children[0].addEventListener('mouseenter', (e) => { setShowPopup(true); }); marker .getElement() .children[0].children[0].addEventListener('mouseout', (e) => { setShowPopup(false); }); }} /> {showPopup && ( 这是个信息框 )} ); }; export default Amap2demo_markerPopup;