Skip to content

Commit

Permalink
doc(MouseTool): Update document. #269
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Dec 7, 2022
1 parent 9196c32 commit 4fa116f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
10 changes: 7 additions & 3 deletions packages/mouse-tool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ import { MouseTool } from '@uiw/react-amap-mouse-tool';

### 绘制

利用 `AMap.MouseTool` 绘制折线、弧线、多边形、矩形、圆形等 [官方示例](https://lbs.amap.com/demo/jsapi-v2/example/overlayers/overlay-draw)

> ⚠️ 注意:需要加载 `AMap.MouseTool`<!--rehype:style=background: #ffe3da;color: #ff5722;--> 插件,如果点击进入当前页面,需要 `刷新`<!--rehype:style=background: #e91e63;color: #fff;--> 页面
<!--rehype:-->
```jsx mdx:preview
import ReactDOM from 'react-dom';
Expand All @@ -46,10 +50,10 @@ const Example = () => {
绘制 Polygon
</button>
<button onClick={() => handleDraw(MouseToolDrawType.CIRCLE)}>
绘制 Circle
绘制圆形 Circle
</button>
<button onClick={() => handleDraw(MouseToolDrawType.RECTANGLE)}>
绘制 Rectangle
绘制矩形 Rectangle
</button>
<button onClick={() => handleDraw(MouseToolDrawType.MEASUREAREA)}>
绘制 MeasureArea
Expand All @@ -64,7 +68,7 @@ const Example = () => {
绘制 RectZoomOut
</button>
<div style={{ width: '100%', height: '500px' }}>
<Map zoom={14} center={[116.400274, 39.905812]}>
<Map zoom={14} center={[116.400274, 39.905812]} dragEnable={false}>
<MouseTool
active={active}
type={type}
Expand Down
3 changes: 1 addition & 2 deletions packages/mouse-tool/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"extends": "../../tsconfig",
"include": ["src", "src/**/*"],
"files": ["./src/type.d.ts"],
"include": ["src"],
"compilerOptions": {
"baseUrl": ".",
"outDir": "cjs",
Expand Down
2 changes: 1 addition & 1 deletion packages/poly-editor/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PolyEditor 编辑器
===

Polygon 或 Polyline 编辑器,支持AMap JS API v1.4.xxx 和 v2.0.xxx。
折线、多边形[编辑插件](https://lbs.amap.com/api/javascript-api/reference/plugin#AMap.PolyEditor),用于编辑 Polygon 或 Polyline 对象,支持AMap JS API v1.4.xxx 和 v2.0.xxx。[官方示例](https://lbs.amap.com/demo/javascript-api/example/overlayers/polyline-draw-and-edit)

```jsx
import { PolyEditor } from '@uiw/react-amap';
Expand Down

1 comment on commit 4fa116f

@vercel
Copy link

@vercel vercel bot commented on 4fa116f Dec 7, 2022

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-git-master-398188662.vercel.app
react-amap-398188662.vercel.app
react-amap-one.vercel.app

Please sign in to comment.