From 8bda1f7325f3a990e0e96304cc14959047098fc0 Mon Sep 17 00:00:00 2001
From: sbjw <sbjw.happy@163.com>
Date: Mon, 10 Nov 2025 09:20:30 +0000
Subject: [PATCH] 增加相关样例
---
src/example/ExampleBlcPage.js | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
diff --git a/src/example/ExampleBlcPage.js b/src/example/ExampleBlcPage.js
index 14b57f4..4db4874 100644
--- a/src/example/ExampleBlcPage.js
+++ b/src/example/ExampleBlcPage.js
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import './ExampleDrawPage.css'
-import {GIS} from "../iclient3d-plot-diy";
+import {GIS} from "iclient3d-plot-diy";
;
import {Button} from "antd";
@@ -11,6 +11,7 @@
super(props);
this.state = {
htmlString: '<h3>正在加载中...</h3>',
+ scale: 0
};
}
@@ -49,6 +50,9 @@
this.setState({htmlString: window.marked.parse(mdText)});
});
//监听拨盘事件
+ this.mapFunction.addScaleListener((scale) => {
+ this.setState({scale: scale});
+ })
}
showData() {
@@ -78,6 +82,7 @@
<Button type="primary" onClick={() => this.setCameraHeightByScale(2500)}>1:2500</Button>
<Button type="primary" onClick={() => this.setCameraHeightByScale(10000)}>1:10000</Button>
<Button type="primary" onClick={() => this.setCameraHeightByScale(50000)}>1:50000</Button>
+ <span>当前比例尺: {this.state.scale}</span>
<div className={"code_wrapper"}>
<div dangerouslySetInnerHTML={{__html: this.state.htmlString}}></div>
</div>
--
Gitblit v1.9.3