From 9e3c4e34a94201ec3dde066b22affa66508ca7ec Mon Sep 17 00:00:00 2001 From: peidongGuo <44695948+peidongGuo@users.noreply.github.com> Date: Sat, 14 Jan 2023 12:24:42 +0800 Subject: [PATCH] feat(polyline/polygon): add controlable props (#287) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat:修复 LabelMarker,以便兼容高德地图JS API v1.4.xxx。 * fix:修复细节 * feat:添加Polyline-Editor Poly-Editor组件项目,修改PolyLine、Polygon、PolygonEditor组件内容 * feat:添加MouseTool组件项目,以便支持 MouseTool 插件功能。 * feat:添加 polyline、polygon 的一些可控属性 --- packages/polygon/src/usePolygon.tsx | 16 +++++++++++++++- packages/polyline/src/usePolyline.tsx | 11 ++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/packages/polygon/src/usePolygon.tsx b/packages/polygon/src/usePolygon.tsx index c84d1bdb7..708249c64 100644 --- a/packages/polygon/src/usePolygon.tsx +++ b/packages/polygon/src/usePolygon.tsx @@ -29,7 +29,21 @@ export const usePolygon = (props = {} as UsePolygon) => { }, [map]); useVisiable(polygon!, visiable); - useSettingProperties(polygon!, props, ['Path', 'Options', 'Map', 'ExtData', 'Draggable']); + useSettingProperties(polygon!, props, [ + 'Path', + 'ZIndex', + 'Cursor', + 'StrokeColor', + 'StrokeOpacity', + 'StrokeWeight', + 'FillColor', + 'FillOpacity', + 'StrokeStyle', + 'StrokeDasharray', + 'Map', + 'ExtData', + 'Draggable', + ]); useEventProperties(polygon!, props, [ 'onClick', 'onDblClick', diff --git a/packages/polyline/src/usePolyline.tsx b/packages/polyline/src/usePolyline.tsx index e6c80b9ab..89f4663a5 100644 --- a/packages/polyline/src/usePolyline.tsx +++ b/packages/polyline/src/usePolyline.tsx @@ -31,7 +31,16 @@ export function usePolyline(props = {} as UsePolyline) { useVisiable(polyline!, visiable); useSettingProperties(polyline!, props, [ 'Path', - 'Options', + 'ZIndex', + 'Cursor', + 'StrokeColor', + 'StrokeOpacity', + 'StrokeWeight', + 'IsOutline', + 'BorderWeight', + 'OutlineColor', + 'StrokeStyle', + 'StrokeDasharray', 'Map', 'ExtData', 'Draggable',