From 6e6ace63ad29b31fe4392ee92132649f7ac1a59d Mon Sep 17 00:00:00 2001
From: sbjw <sbjw.happy@163.com>
Date: Mon, 10 Nov 2025 11:18:20 +0000
Subject: [PATCH] 增加相关样例

---
 src/example/ExampleGetPointsPage.js |   52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 52 insertions(+), 0 deletions(-)

diff --git a/src/example/ExampleGetPointsPage.js b/src/example/ExampleGetPointsPage.js
index 87b8e62..4d2332e 100644
--- a/src/example/ExampleGetPointsPage.js
+++ b/src/example/ExampleGetPointsPage.js
@@ -32,6 +32,54 @@
             this.mapFunction.mapApiService.removeDraw(p.code);
         })
     }
+    async getBox() {
+
+        let p = await this.mapFunction.mapApiService.draw({
+            type: "box",
+        });
+        p.drawEnd.subscribe(value => {
+            let c = p.export();
+            alert(JSON.stringify(c.points));
+            this.mapFunction.mapApiService.removeDraw(p.code);
+            this.mapFunction.mapApiService.showDrawDatas([c])
+        })
+    }
+    async getLine() {
+
+        let p = await this.mapFunction.mapApiService.draw({
+            type: "line",
+        });
+        p.drawEnd.subscribe(value => {
+            let c = p.export();
+            alert(JSON.stringify(c.points));
+            this.mapFunction.mapApiService.removeDraw(p.code);
+            this.mapFunction.mapApiService.showDrawDatas([c])
+        })
+    }
+    async getPolygon() {
+
+        let p = await this.mapFunction.mapApiService.draw({
+            type: "polygon",
+        });
+        p.drawEnd.subscribe(value => {
+            let c = p.export();
+            alert(JSON.stringify(c.points));
+            this.mapFunction.mapApiService.removeDraw(p.code);
+            this.mapFunction.mapApiService.showDrawDatas([c])
+        })
+    }
+    async getCircle() {
+
+        let p = await this.mapFunction.mapApiService.draw({
+            type: "circle",
+        });
+        p.drawEnd.subscribe(value => {
+            let c = p.export();
+            alert(JSON.stringify(c.points));
+            this.mapFunction.mapApiService.removeDraw(p.code);
+            this.mapFunction.mapApiService.showDrawDatas([c])
+        })
+    }
 
     render() {
         return (
@@ -49,6 +97,10 @@
                     />
                 </div>
                 <Button type="primary" onClick={this.getPoints.bind(this)}>获取坐标点</Button>
+                <Button type="primary" onClick={this.getBox.bind(this)}>获取box</Button>
+                <Button type="primary" onClick={this.getLine.bind(this)}>获取线</Button>
+                <Button type="primary" onClick={this.getPolygon.bind(this)}>获取面</Button>
+                <Button type="primary" onClick={this.getCircle.bind(this)}>获取圆</Button>
                 <div className={"code_wrapper"}>
                     <div dangerouslySetInnerHTML={{__html: this.state.htmlString}}></div>
                 </div>

--
Gitblit v1.9.3