From b2e11f4ebeb0c935133af2ff63c6aee6addf31a6 Mon Sep 17 00:00:00 2001
From: sbjw <sbjw.happy@163.com>
Date: Sun, 21 Sep 2025 16:32:26 +0000
Subject: [PATCH] update
---
src/example/ExampleSimpleEventPage.js | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 56 insertions(+), 0 deletions(-)
diff --git a/src/example/ExampleSimpleEventPage.js b/src/example/ExampleSimpleEventPage.js
new file mode 100644
index 0000000..d3cfc3d
--- /dev/null
+++ b/src/example/ExampleSimpleEventPage.js
@@ -0,0 +1,56 @@
+import React, {Component} from 'react'
+import './CommonExample.css'
+import {GIS} from "iclient3d-plot-diy";
+
+export default class ExampleSimpleEventPage extends Component {
+ drawOps = [];
+
+ constructor(props) {
+ super(props);
+ this.state = {
+ htmlString: '<h3>正在加载中...</h3>',
+ };
+ }
+
+ componentDidMount() {
+ this.showData();
+
+ fetch('./example/ExampleSimpleEventPage.md')
+ .then(response => response.text())
+ .then(mdText => {
+ this.setState({htmlString: window.marked.parse(mdText)});
+ });
+ //监听拨盘事件
+ }
+
+ showData() {
+ this.mapFunction.mapApiService.mapClickEvent.addEventListener((id, primitive, isPoint) => {
+ alert(id);
+ }, this);
+ this.mapFunction.mapApiService.mapRightClickEvent.addEventListener((id, primitive, isPoint) => {
+ alert(id);
+ }, this);
+ }
+
+ render() {
+ return (
+ <div className={"example_fwy_container"}>
+ <h3>自定义事件</h3>
+ <div className={"map_wrapper"}>
+ <GIS refs={e => {
+ this.mapFunction = e
+ }}
+ plotUrl={this.state.plotUrl}
+ mapRef={this}
+ showDefaultLayer={true}
+ />
+ </div>
+ <div className={"code_wrapper"}>
+ <div dangerouslySetInnerHTML={{__html: this.state.htmlString}}></div>
+ </div>
+ </div>
+ )
+ }
+}
+
+
--
Gitblit v1.9.3