|
|
@ -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,6 +37,37 @@ const Property = () => { |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const categoryPane = ( |
|
|
|
|
|
|
|
<Form.Item label="类型"> |
|
|
|
|
|
|
|
<Select |
|
|
|
|
|
|
|
value={overlay.category} |
|
|
|
|
|
|
|
onChange={(category) => |
|
|
|
|
|
|
|
updateOverlayProps({ |
|
|
|
|
|
|
|
id: overlay.id, |
|
|
|
|
|
|
|
category, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
{categorys.map((item) => ( |
|
|
|
|
|
|
|
<Option key={item.title} value={item.value}> |
|
|
|
|
|
|
|
{item.title} |
|
|
|
|
|
|
|
</Option> |
|
|
|
|
|
|
|
))} |
|
|
|
|
|
|
|
</Select> |
|
|
|
|
|
|
|
</Form.Item> |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const positionPane = ( |
|
|
|
|
|
|
|
<> |
|
|
|
|
|
|
|
<Form.Item label="经度"> |
|
|
|
|
|
|
|
<Input value={lngLat[0]} /> |
|
|
|
|
|
|
|
</Form.Item> |
|
|
|
|
|
|
|
<Form.Item label="纬度"> |
|
|
|
|
|
|
|
<Input value={lngLat[1]} /> |
|
|
|
|
|
|
|
</Form.Item> |
|
|
|
|
|
|
|
</> |
|
|
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div className="property-area"> |
|
|
|
<div className="property-area"> |
|
|
|
<Form size="small"> |
|
|
|
<Form size="small"> |
|
|
@ -50,23 +82,7 @@ const Property = () => { |
|
|
|
} |
|
|
|
} |
|
|
|
/> |
|
|
|
/> |
|
|
|
</Form.Item> |
|
|
|
</Form.Item> |
|
|
|
<Form.Item label="类型"> |
|
|
|
{overlay.type === OverlayTypes.Point ? positionPane : categoryPane} |
|
|
|
<Select |
|
|
|
|
|
|
|
value={overlay.category} |
|
|
|
|
|
|
|
onChange={(category) => |
|
|
|
|
|
|
|
updateOverlayProps({ |
|
|
|
|
|
|
|
id: overlay.id, |
|
|
|
|
|
|
|
category, |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
> |
|
|
|
|
|
|
|
{categorys.map((item) => ( |
|
|
|
|
|
|
|
<Option key={item.title} value={item.value}> |
|
|
|
|
|
|
|
{item.title} |
|
|
|
|
|
|
|
</Option> |
|
|
|
|
|
|
|
))} |
|
|
|
|
|
|
|
</Select> |
|
|
|
|
|
|
|
</Form.Item> |
|
|
|
|
|
|
|
{overlay.category === OverlayCategory.Building ? ( |
|
|
|
{overlay.category === OverlayCategory.Building ? ( |
|
|
|
<Form.Item label="高度"> |
|
|
|
<Form.Item label="高度"> |
|
|
|
<FineInput |
|
|
|
<FineInput |
|
|
|