From c4de1a95624e2f3d257a9777b60028196a3b08fe Mon Sep 17 00:00:00 2001
From: sbjw <sbjw.happy@163.com>
Date: Tue, 09 Dec 2025 02:59:35 +0000
Subject: [PATCH] * 1.0.33 ``` 1、修复双色线异常 2、修复重复加载svg文件的问题,同步解决大量军标点的性能问题。 3、修复2d下比例尺设置的问题 4、修复DrawEnd事件在重启修改时,无法触发的问题。 5、修复2d下触发材料问题 ```
---
src/example/ExampleBlinkPage.js | 145 ++++++++++++++++++++++++++++++++++++++++++++++++
src/example/ExampleXzxxPage.js | 9 +++
src/example/ExampleHtmlBoardPage.js | 2
src/example/ExamplePage.js | 1
package.json | 2
src/App.js | 2
src/example/ExampleAggregatorPage.js | 2
7 files changed, 160 insertions(+), 3 deletions(-)
diff --git a/package.json b/package.json
index 66ef59a..8fbdac2 100644
--- a/package.json
+++ b/package.json
@@ -19,7 +19,7 @@
"@ant-design/icons": "^4.0.0",
"antd": "^4.24.16",
"echarts": "^5.6.0",
- "iclient3d-plot-diy": "^1.0.32",
+ "iclient3d-plot-diy": "^1.0.33",
"iclient3d-plot-diy-attachment": "^1.0.2",
"jquery": "^3.7.1",
"@turf/turf": "^7.2.0",
diff --git a/src/App.js b/src/App.js
index 7b217c7..350b4e7 100644
--- a/src/App.js
+++ b/src/App.js
@@ -27,6 +27,7 @@
import ExampleXzxxPage from "./example/ExampleXzxxPage";
import ExampleHtmlBoardPage from "./example/ExampleHtmlBoardPage";
import Example2DDrawUpdatePage from "./example/Example2DDrawUpdatePage";
+import ExampleBlinkPage from "./example/ExampleBlinkPage";
function App() {
return (
@@ -56,6 +57,7 @@
<Route path="/example/xzxx" exact component={ExampleXzxxPage}/>
<Route path="/example/htmlBoard" exact component={ExampleHtmlBoardPage}/>
<Route path="/example/map2dDrawUpdate" exact component={Example2DDrawUpdatePage}/>
+ <Route path="/example/blink" exact component={ExampleBlinkPage}/>
<Route path="/doc" exact component={DocPage}/>
<Route path="/doc/:page" exact component={DocPage}/>
<Route path="/test" exact component={TestPage}/>
diff --git a/src/example/ExampleAggregatorPage.js b/src/example/ExampleAggregatorPage.js
index 99779d6..9b64b7b 100644
--- a/src/example/ExampleAggregatorPage.js
+++ b/src/example/ExampleAggregatorPage.js
@@ -19,7 +19,7 @@
this.setState({htmlString: window.marked.parse(mdText)});
});
- const randomPoints = this.generateRandomPointsInRadius(35.9042, 112.4074, 10, 200);
+ const randomPoints = this.generateRandomPointsInRadius(35.9042, 112.4074, 500, 5000);
let options = [];
for (let i = 0; i < randomPoints.length; i++) {
diff --git a/src/example/ExampleBlinkPage.js b/src/example/ExampleBlinkPage.js
new file mode 100644
index 0000000..c07cb0a
--- /dev/null
+++ b/src/example/ExampleBlinkPage.js
@@ -0,0 +1,145 @@
+import React, {Component} from 'react'
+import './ExampleDrawPage.css'
+import {GIS} from "iclient3d-plot-diy";
+
+import {Button} from "antd";
+
+export default class ExampleBlinkPage extends Component {
+
+
+ optionObjs = {
+ "目标醒目": {
+ code: '123',
+ type: "2002",
+ xz: true,
+ xzColor: '#00ff00',
+ xx: true,
+ xxColor: '#ff0000',
+ iconColor: '#dddddd',
+ returnHeight: true,
+ useModify: false,
+ lon: 102.23554539488224,
+ lat: 31.005068100060593,
+ height: 0,
+ blink: true,
+ blinkCycle: 2000,
+ points: []
+ },
+ "掩护区域": {
+ type: 'yhqy',
+ 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,
+ blink: true,
+ blinkCycle: 3000,
+ },
+ "协同关系": {
+ type: 'xtgx',
+ points: [{lon: 102.642853926199, lat: 31.012509646376447, height: 0},
+ {lon: 102.66192135373299, lat: 31.005988487769518, height: 0}],
+ useModify: false,
+ blink: true,
+ blinkCycle: 2000,
+ },
+ "干扰线": {
+ type: 'grx',
+ points: [{lon: 102.732420985008, lat: 30.97556325857848, height: 0},
+ {lon: 102.73983041603873, lat: 30.97504986175468, height: 0}],
+ useModify: false,
+ blink: true,
+ blinkCycle: 1000,
+ },
+ }
+ line_star
+ drawOps = [];
+
+ constructor(props) {
+ super(props);
+ this.state = {
+ htmlString: '<h3>正在加载中...</h3>',
+ plotText: ''
+ };
+ }
+
+ componentDidMount() {
+ fetch('./example/ExampleBlinkPage.md')
+ .then(response => response.text())
+ .then(mdText => {
+ this.setState({htmlString: window.marked.parse(mdText)});
+ });
+ this.showOptions();
+ }
+
+ showOptions = () => {
+ if (this.mapFunction) {
+ let options = [];
+ for (let key in this.optionObjs) {
+ options.push(this.optionObjs[key]);
+ }
+ this.mapFunction.mapApiService.showDrawDatas(options);
+ }
+ };
+
+
+ async draw(option) {
+ option = JSON.parse(JSON.stringify(option));
+ option.useModify = true;
+ delete option.points;
+ delete option.lon;
+ delete option.lat;
+ delete option.height;
+ let p = await this.mapFunction.mapApiService.draw(option);
+ p.drawEnd.subscribe(value => {
+ // alert(p.export());
+ })
+ this.drawOps.push(p);
+ }
+
+ export() {
+ let op = [];
+ let draws = this.mapFunction.mapApiService.getAllDraw();
+ for (let d of draws) {
+ let dd = this.mapFunction.mapApiService.exportDraw(d.code);
+ if (dd) {
+ op.push(dd);
+ }
+ }
+ console.log(op);
+ }
+
+ render() {
+ let buttons = [];
+ let obs = JSON.parse(JSON.stringify(this.optionObjs));
+ for (let key in obs) {
+ let option = obs[key];
+ buttons.push(<Button type="primary" onClick={this.draw.bind(this, option)} key={key}>{key}</Button>);
+ }
+
+ return (
+ <div className={"example_draw_container"}>
+ <h3>军标绘制/展示已有的军标数据</h3>
+ <div className={"map_wrapper"}>
+ <GIS refs={
+ e => {
+ this.mapFunction = e
+ }
+ }
+ useSvgIcon={true}
+ iconScales={[[0, 2000], [2000, 10000], [10000, 5000000]]}
+ plotUrl={this.state.plotUrl}
+ mapRef={this}
+ />
+ </div>
+ {this.state.plotText}
+ <div className={"code_wrapper"}>
+ <div dangerouslySetInnerHTML={{__html: this.state.htmlString}}></div>
+ </div>
+ </div>
+ )
+ }
+}
+
+
diff --git a/src/example/ExampleHtmlBoardPage.js b/src/example/ExampleHtmlBoardPage.js
index 006a247..e4e675e 100644
--- a/src/example/ExampleHtmlBoardPage.js
+++ b/src/example/ExampleHtmlBoardPage.js
@@ -1,6 +1,6 @@
import React, {Component} from 'react'
import './ExampleHtmlBoardPage.css'
-import {GIS} from "iclient3d-plot-diy";
+import {Bp, GIS} from "iclient3d-plot-diy";
import {Button} from "antd";
import $ from "jquery";
diff --git a/src/example/ExamplePage.js b/src/example/ExamplePage.js
index 062eb92..01850bc 100644
--- a/src/example/ExamplePage.js
+++ b/src/example/ExamplePage.js
@@ -81,6 +81,7 @@
<li><NavLink to='/example/xzxx'>选中、X图标</NavLink></li>
<li><NavLink to='/example/htmlBoard'>Html标牌</NavLink></li>
<li><NavLink to='/example/map2dDrawUpdate'>2d画图更新</NavLink></li>
+ <li><NavLink to='/example/blink'>闪烁</NavLink></li>
</ul>
<div className={"button_wrapper"}>
diff --git a/src/example/ExampleXzxxPage.js b/src/example/ExampleXzxxPage.js
index d47e048..fea9c7d 100644
--- a/src/example/ExampleXzxxPage.js
+++ b/src/example/ExampleXzxxPage.js
@@ -153,6 +153,14 @@
options.push(this.optionObjs[key]);
}
this.mapFunction.mapApiService.showDrawDatas(options);
+
+ // this.mapFunction.mapApiService.draw(options[0]);
+ // setTimeout(() => {
+ // let p = this.mapFunction.mapApiService.getDraw(options[0].code);
+ // p.drawEnd.subscribe(value => {
+ // alert(p.export());
+ // })
+ // })
}
};
@@ -206,6 +214,7 @@
plotUrl={this.state.plotUrl}
mapRef={this}
showDefaultLayer={false}
+ global={[102.5, 30.5, 103.5, 31.5]}
/>
</div>
<Button type="primary" onClick={this.showOptions.bind(this)}>显示已有标绘数据</Button>
--
Gitblit v1.9.3