From 1a90c69c80d43bec51e18f2a5af02361b0a14577 Mon Sep 17 00:00:00 2001 From: Cmen <1176967590@qq.com> Date: Sat, 12 Mar 2022 11:24:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=A0=87=E8=AE=B0=E7=82=B9=E8=A6=86?= =?UTF-8?q?=E7=9B=96=E7=89=A9=E5=B1=9E=E6=80=A7=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/editor/Property/index.tsx | 52 +++++++++++++++++++++------------ src/store/reducers/map/index.ts | 6 ++-- 2 files changed, 37 insertions(+), 21 deletions(-) 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; }