sbjw
2025-08-27 e74fe336f8c6c434b1cf6c0e3378c4e14f9d58d5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import React, {Component} from 'react'
import './ExampleDrawPage.css'
import {GIS} from "iclient3d-plot-diy";
 
;
import {Button} from "antd";
 
export default class ExampleBlcPage extends Component {
 
    constructor(props) {
        super(props);
        this.state = {
            htmlString: '<h3>正在加载中...</h3>',
        };
    }
 
    options = [
        {
            "bz": true,
            "bzlx": "simple",
            "jbwb": "R:00017",
            "type": "2002",
            "code": "draw_primitive_1000_",
            "useModify": false,
            "lon": 102.73181802939419,
            "lat": 30.982754659441543,
            "height": 0
        },
        {
            "bz": true,
            "bzlx": "detail",
            "jbwb": "R:00017",
            "type": "2002",
            "xbwb": "17/10/2019\n16:45:8\n9260.00-10400.00MHZ",
            "code": "draw_primitive_1001_",
            "useModify": false,
            "lon": 102.74521918551825,
            "lat": 30.982390144247127,
            "height": 0
        }
    ]
 
    componentDidMount() {
        this.showData();
 
        fetch('./example/ExampleBlcPage.md')
            .then(response => response.text())
            .then(mdText => {
                this.setState({htmlString: window.marked.parse(mdText)});
            });
        //监听拨盘事件
    }
 
    showData() {
        this.mapFunction.mapApiService.showDrawDatas(this.options);
    }
 
    setCameraHeightByScale(scale) {
        this.mapFunction.setScale(scale);
    }
 
    render() {
        return (
            <div className={"example_draw_container"}>
                <h3>切换比例尺</h3>
                <div className={"map_wrapper"}>
                    <GIS refs={
                        e => {
                            this.mapFunction = e
                        }
                    }
                         plotUrl={this.state.plotUrl}
                         mapRef={this}
                         showDefaultLayer={true}
                    />
                </div>
                <Button type="primary" onClick={() => this.setCameraHeightByScale(50)}>1:50</Button>
                <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>
                <div className={"code_wrapper"}>
                    <div dangerouslySetInnerHTML={{__html: this.state.htmlString}}></div>
                </div>
            </div>
        )
    }
}