基于高德地图JS api开发的geojson编辑器.
http://geojson.finevis.cc/
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.
57 lines
1.3 KiB
57 lines
1.3 KiB
import { Collapse } from "antd"; |
|
import { useSelector } from "react-redux"; |
|
|
|
import { mapStateSelector } from "@store"; |
|
import { IOverlay } from "@store"; |
|
|
|
import "./style.less"; |
|
|
|
const { Panel } = Collapse; |
|
|
|
export type OverlayListProps = { |
|
overlays: IOverlay[]; |
|
}; |
|
|
|
const OverlayList = (props: OverlayListProps) => { |
|
const { overlays } = props; |
|
|
|
return ( |
|
<> |
|
{overlays.map((overlay, index) => { |
|
return ( |
|
<div key={index} className="overlay-item"> |
|
{overlay.name} |
|
</div> |
|
); |
|
})} |
|
</> |
|
); |
|
}; |
|
|
|
const Catalog = () => { |
|
// const callback = (key: string | string[]) => console.log(key); |
|
const { rectangles, polygons, polylines, circles } = |
|
useSelector(mapStateSelector); |
|
return ( |
|
<Collapse |
|
defaultActiveKey={["1"]} |
|
// onChange={callback} |
|
expandIconPosition="right" |
|
> |
|
<Panel header="矩形" key={1}> |
|
<OverlayList overlays={rectangles} /> |
|
</Panel> |
|
<Panel header="多边形" key={2}> |
|
<OverlayList overlays={polygons} /> |
|
</Panel> |
|
<Panel header="多段线" key={3}> |
|
<OverlayList overlays={polylines} /> |
|
</Panel> |
|
<Panel header="圆形" key={4}> |
|
<OverlayList overlays={circles} /> |
|
</Panel> |
|
</Collapse> |
|
); |
|
}; |
|
|
|
export default Catalog;
|
|
|