From f0351f77f11779d72b502f5244a00927c33f012b Mon Sep 17 00:00:00 2001
From: sbjw <sbjw.happy@163.com>
Date: Wed, 11 Mar 2026 03:31:03 +0000
Subject: [PATCH] 细节整理

---
 public/example/ExampleSimpleEventPage.md |   53 ++++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 50 insertions(+), 3 deletions(-)

diff --git a/public/example/ExampleSimpleEventPage.md b/public/example/ExampleSimpleEventPage.md
index 4156a3d..f946b48 100644
--- a/public/example/ExampleSimpleEventPage.md
+++ b/public/example/ExampleSimpleEventPage.md
@@ -5,6 +5,7 @@
 import React, {Component} from 'react'
 import './CommonExample.css'
 import {GIS} from "iclient3d-plot-diy";
+import {Button} from "antd";
 
 export default class ExampleSimpleEventPage extends Component {
     drawOps = [];
@@ -25,15 +26,60 @@
                 this.setState({htmlString: window.marked.parse(mdText)});
             });
         //监听拨盘事件
+        this.mapFunction.mapApiService.showDrawDatas([{
+            code: 'asdladjakl',
+            bz: true,
+            bzColor: '#e000ff',
+            bzLineColor: '#ff0000',
+            bzlx: 'simple',
+            jbwb: 'R:00017',
+            type: "2002",
+            returnHeight: true,
+            useModify: false,
+            lon: 102.33054539488224,
+            lat: 31.005468100060593,
+            height: 0,
+            points: [],
+            iconSize: [[20, 20], [30, 30], [40, 40]]
+        }, {
+            type: 'yhqy',
+            code: 'xxcxvawda',
+            points: [{lon: 102.642853926199, lat: 31.012509646376447, height: 0},
+                {lon: 102.65927322610115, lat: 31.01540811637356, height: 0},
+                {lon: 102.66192135373299, lat: 31.005988487769518, height: 0},
+                {lon: 102.64755620178961, lat: 31.00246196283815, height: 0},
+                {lon: 102.642853926199, lat: 31.012509646376447, height: 0}],
+            useModify: false,
+
+        }])
     }
 
     showData() {
-        this.mapFunction.mapApiService.mapClickEvent.addEventListener((id, primitive, isPoint) => {
-            alert(id);
+        // 左击 如果需要dom时的监听
+        this.mapFunction.addEventListener((id, overlay, primitive, data) => {
+            alert('gis组件的左击事件:' + id);
         }, this);
+
+        // 左击如果需要底层对象的监听
+        this.mapFunction.mapClickEvent.addEventListener((id, primitive, isPoint) => {
+            console.log(id, primitive, isPoint);
+            alert('左击事件:' + id);
+        }, this);
+
+        // 右键监听
         this.mapFunction.mapApiService.mapRightClickEvent.addEventListener((id, primitive, isPoint) => {
-            alert(id);
+            console.log(id, primitive, isPoint);
+            alert('右击事件' + id);
         }, this);
+    }
+
+    drawPolygon() {
+        //监听拨盘事件
+        this.mapFunction.mapApiService.draw({
+            code: 'xxcx_new_',
+            type: 'yhqy',
+            useModify: true,
+        });
     }
 
     render() {
@@ -49,6 +95,7 @@
                          showDefaultLayer={true}
                     />
                 </div>
+                <Button type="primary" onClick={this.drawPolygon.bind(this)}>新画一个面</Button>
                 <div className={"code_wrapper"}>
                     <div dangerouslySetInnerHTML={{__html: this.state.htmlString}}></div>
                 </div>

--
Gitblit v1.9.3