|
|
@ -1,5 +1,5 @@ |
|
|
|
import { useSelector } from "react-redux"; |
|
|
|
import { useSelector } from "react-redux"; |
|
|
|
import { Form, Select } from "antd"; |
|
|
|
import { Form, Select, Input } from "antd"; |
|
|
|
import { selectedIdsSelector, mapOptionsSelector, editorAction } from "@store"; |
|
|
|
import { selectedIdsSelector, mapOptionsSelector, editorAction } from "@store"; |
|
|
|
import { OverlayCategory, IOverlay, OverlayTypes } from "@map"; |
|
|
|
import { OverlayCategory, IOverlay, OverlayTypes } from "@map"; |
|
|
|
|
|
|
|
|
|
|
@ -21,6 +21,7 @@ const Property = () => { |
|
|
|
if (!selectedIds?.length) return <></>; |
|
|
|
if (!selectedIds?.length) return <></>; |
|
|
|
const [id] = selectedIds; |
|
|
|
const [id] = selectedIds; |
|
|
|
const overlay = overlays.find((overlay) => overlay.id === id)!; |
|
|
|
const overlay = overlays.find((overlay) => overlay.id === id)!; |
|
|
|
|
|
|
|
const { lngLat = [0, 0] } = overlay; |
|
|
|
|
|
|
|
|
|
|
|
const updateOverlayProps = (props: Partial<IOverlay>) => |
|
|
|
const updateOverlayProps = (props: Partial<IOverlay>) => |
|
|
|
editorAction.updateOverlay(props); |
|
|
|
editorAction.updateOverlay(props); |
|
|
@ -36,20 +37,7 @@ const Property = () => { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
const categoryPane = ( |
|
|
|
<div className="property-area"> |
|
|
|
|
|
|
|
<Form size="small"> |
|
|
|
|
|
|
|
<Form.Item label="名称"> |
|
|
|
|
|
|
|
<FineInput |
|
|
|
|
|
|
|
value={overlay.name} |
|
|
|
|
|
|
|
onChange={(value) => |
|
|
|
|
|
|
|
updateOverlayProps({ |
|
|
|
|
|
|
|
id: overlay.id, |
|
|
|
|
|
|
|
name: value, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</Form.Item> |
|
|
|
|
|
|
|
<Form.Item label="类型"> |
|
|
|
<Form.Item label="类型"> |
|
|
|
<Select |
|
|
|
<Select |
|
|
|
value={overlay.category} |
|
|
|
value={overlay.category} |
|
|
@ -67,6 +55,34 @@ const Property = () => { |
|
|
|
))} |
|
|
|
))} |
|
|
|
</Select> |
|
|
|
</Select> |
|
|
|
</Form.Item> |
|
|
|
</Form.Item> |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const positionPane = ( |
|
|
|
|
|
|
|
<> |
|
|
|
|
|
|
|
<Form.Item label="经度"> |
|
|
|
|
|
|
|
<Input value={lngLat[0]} /> |
|
|
|
|
|
|
|
</Form.Item> |
|
|
|
|
|
|
|
<Form.Item label="纬度"> |
|
|
|
|
|
|
|
<Input value={lngLat[1]} /> |
|
|
|
|
|
|
|
</Form.Item> |
|
|
|
|
|
|
|
</> |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
|
|
|
<div className="property-area"> |
|
|
|
|
|
|
|
<Form size="small"> |
|
|
|
|
|
|
|
<Form.Item label="名称"> |
|
|
|
|
|
|
|
<FineInput |
|
|
|
|
|
|
|
value={overlay.name} |
|
|
|
|
|
|
|
onChange={(value) => |
|
|
|
|
|
|
|
updateOverlayProps({ |
|
|
|
|
|
|
|
id: overlay.id, |
|
|
|
|
|
|
|
name: value, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
/> |
|
|
|
|
|
|
|
</Form.Item> |
|
|
|
|
|
|
|
{overlay.type === OverlayTypes.Point ? positionPane : categoryPane} |
|
|
|
{overlay.category === OverlayCategory.Building ? ( |
|
|
|
{overlay.category === OverlayCategory.Building ? ( |
|
|
|
<Form.Item label="高度"> |
|
|
|
<Form.Item label="高度"> |
|
|
|
<FineInput |
|
|
|
<FineInput |
|
|
|