import {
AMapScene,
LayerEvent,
LineLayer,
MapboxScene,
PolygonLayer,
Popup,
} from '@antv/l7-react';
import * as React from 'react';
import ReactDOM from 'react-dom';
const World = React.memo(function Map() {
const [popupInfo, setPopInfo] = React.useState();
const hoverHandle = (e) => {
console.log(e);
setPopInfo(e);
};
const hoverOutHandle = () => {
setPopInfo(undefined);
};
const data = {
type: 'FeatureCollection',
features: [
{
type: 'Feature',
properties: {},
geometry: {
type: 'Polygon',
coordinates: [
[
[111.9287109375, 28.22697003891834],
[115.6640625, 28.22697003891834],
[115.6640625, 31.015278981711266],
[111.9287109375, 31.015278981711266],
[111.9287109375, 28.22697003891834],
],
],
},
},
],
};
return (
{data && [
,
,
]}
{popupInfo && (
这是个信息框
)}
);
});
ReactDOM.render(, document.getElementById('map'));