import { AMapScene, Marker, PointLayer } from '@antv/l7-react'; import * as React from 'react'; import ReactDOM from 'react-dom'; import './index.less'; const MarkerPinImg = { green: 'https://gw.alipayobjects.com/mdn/rms_855bab/afts/img/A*JhBbT4LvHpQAAAAAAAAAAAAAARQnAQ', blue: 'https://gw.alipayobjects.com/mdn/rms_855bab/afts/img/A*n6cXTb8R7iUAAAAAAAAAAAAAARQnAQ', }; const MarkerInfo = ({ title }) => { return (
{title}
marker
); }; const World = React.memo(function Map() { const [data, setData] = React.useState(); React.useEffect(() => { const fetchData = async () => { const response = await fetch( 'https://gw.alipayobjects.com/os/basement_prod/893d1d5f-11d9-45f3-8322-ee9140d288ae.json', ); const data = await response.json(); setData(data); }; fetchData(); }, []); return ( {data && data.map((item: any) => { return ( ); })} ); }); ReactDOM.render(, document.getElementById('map'));