Skip to content

Commit 9e3c4e3

Browse files
authored
feat(polyline/polygon): add controlable props (#287)
* feat:修复 LabelMarker,以便兼容高德地图JS API v1.4.xxx。 * fix:修复细节 * feat:添加Polyline-Editor Poly-Editor组件项目,修改PolyLine、Polygon、PolygonEditor组件内容 * feat:添加MouseTool组件项目,以便支持 MouseTool 插件功能。 * feat:添加 polyline、polygon 的一些可控属性
1 parent 2964b33 commit 9e3c4e3

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

packages/polygon/src/usePolygon.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,21 @@ export const usePolygon = (props = {} as UsePolygon) => {
2929
}, [map]);
3030

3131
useVisiable(polygon!, visiable);
32-
useSettingProperties<AMap.Polygon, UsePolygon>(polygon!, props, ['Path', 'Options', 'Map', 'ExtData', 'Draggable']);
32+
useSettingProperties<AMap.Polygon, UsePolygon>(polygon!, props, [
33+
'Path',
34+
'ZIndex',
35+
'Cursor',
36+
'StrokeColor',
37+
'StrokeOpacity',
38+
'StrokeWeight',
39+
'FillColor',
40+
'FillOpacity',
41+
'StrokeStyle',
42+
'StrokeDasharray',
43+
'Map',
44+
'ExtData',
45+
'Draggable',
46+
]);
3347
useEventProperties<AMap.Polygon, UsePolygon>(polygon!, props, [
3448
'onClick',
3549
'onDblClick',

packages/polyline/src/usePolyline.tsx

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,16 @@ export function usePolyline(props = {} as UsePolyline) {
3131
useVisiable(polyline!, visiable);
3232
useSettingProperties<AMap.Polyline, UsePolyline>(polyline!, props, [
3333
'Path',
34-
'Options',
34+
'ZIndex',
35+
'Cursor',
36+
'StrokeColor',
37+
'StrokeOpacity',
38+
'StrokeWeight',
39+
'IsOutline',
40+
'BorderWeight',
41+
'OutlineColor',
42+
'StrokeStyle',
43+
'StrokeDasharray',
3544
'Map',
3645
'ExtData',
3746
'Draggable',

0 commit comments

Comments
 (0)