Skip to content

Commit

Permalink
feat(polyline/polygon): add controlable props (#287)
Browse files Browse the repository at this point in the history
* feat:修复 LabelMarker,以便兼容高德地图JS API v1.4.xxx。

* fix:修复细节

* feat:添加Polyline-Editor Poly-Editor组件项目,修改PolyLine、Polygon、PolygonEditor组件内容

* feat:添加MouseTool组件项目,以便支持 MouseTool 插件功能。

* feat:添加 polyline、polygon 的一些可控属性
  • Loading branch information
peidongGuo authored Jan 14, 2023
1 parent 2964b33 commit 9e3c4e3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
16 changes: 15 additions & 1 deletion packages/polygon/src/usePolygon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,21 @@ export const usePolygon = (props = {} as UsePolygon) => {
}, [map]);

useVisiable(polygon!, visiable);
useSettingProperties<AMap.Polygon, UsePolygon>(polygon!, props, ['Path', 'Options', 'Map', 'ExtData', 'Draggable']);
useSettingProperties<AMap.Polygon, UsePolygon>(polygon!, props, [
'Path',
'ZIndex',
'Cursor',
'StrokeColor',
'StrokeOpacity',
'StrokeWeight',
'FillColor',
'FillOpacity',
'StrokeStyle',
'StrokeDasharray',
'Map',
'ExtData',
'Draggable',
]);
useEventProperties<AMap.Polygon, UsePolygon>(polygon!, props, [
'onClick',
'onDblClick',
Expand Down
11 changes: 10 additions & 1 deletion packages/polyline/src/usePolyline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,16 @@ export function usePolyline(props = {} as UsePolyline) {
useVisiable(polyline!, visiable);
useSettingProperties<AMap.Polyline, UsePolyline>(polyline!, props, [
'Path',
'Options',
'ZIndex',
'Cursor',
'StrokeColor',
'StrokeOpacity',
'StrokeWeight',
'IsOutline',
'BorderWeight',
'OutlineColor',
'StrokeStyle',
'StrokeDasharray',
'Map',
'ExtData',
'Draggable',
Expand Down

1 comment on commit 9e3c4e3

@vercel
Copy link

@vercel vercel bot commented on 9e3c4e3 Jan 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

react-amap – ./

react-amap-398188662.vercel.app
react-amap-one.vercel.app
react-amap-git-master-398188662.vercel.app

Please sign in to comment.