diff --git a/src/editor/Property/index.tsx b/src/editor/Property/index.tsx index 4da43b7..011559a 100644 --- a/src/editor/Property/index.tsx +++ b/src/editor/Property/index.tsx @@ -1,5 +1,5 @@ import { useSelector } from "react-redux"; -import { Form, Select } from "antd"; +import { Form, Select, Input } from "antd"; import { selectedIdsSelector, mapOptionsSelector, editorAction } from "@store"; import { OverlayCategory, IOverlay, OverlayTypes } from "@map"; @@ -21,6 +21,7 @@ const Property = () => { if (!selectedIds?.length) return <>; const [id] = selectedIds; const overlay = overlays.find((overlay) => overlay.id === id)!; + const { lngLat = [0, 0] } = overlay; const updateOverlayProps = (props: Partial) => editorAction.updateOverlay(props); @@ -36,6 +37,37 @@ const Property = () => { ); } + const categoryPane = ( + + + + ); + + const positionPane = ( + <> + + + + + + + + ); + return (
@@ -50,23 +82,7 @@ const Property = () => { } /> - - - + {overlay.type === OverlayTypes.Point ? positionPane : categoryPane} {overlay.category === OverlayCategory.Building ? ( overlay.id === id); if (existed) { + console.log(overlay); overlays[overlays.indexOf(existed)] = { ...existed, ...overlay, }; } else { overlay.name = OverlayNamePrefixs[type] + overlay.id; - const isRoad = type === OverlayTypes.Polyline; - if (isRoad) { + if (type === OverlayTypes.Polyline) { overlay.category = OverlayCategory.Road; - } else { + } else if (type !== OverlayTypes.Point) { overlay.category = OverlayCategory.Building; overlay.height = 100; }