sbjw
2025-08-13 6f6a34fd1f2b72e0e1cd7b83adfd61d8f8393794
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
import React, {PureComponent} from 'react'
import './FirstPage.css'
import {GIS, updateLanguage} from "iclient3d-plot-diy";
import {Button, Input} from "antd";
 
export default class FirstPage extends PureComponent {
    constructor(props) {
        super(props);
        this.state = {};
    }
 
    componentDidMount() {
 
        let airInfos = [{
            code: '123',
            bz: true,
            jbwb: "R:00017",
            bzlx: 'detail',
            type: "2002",
            lon: 4,
            lat: 30,
            height: 0,
            useModify: false,
            // points: [{lon:4, lat:30, height:0}]
        }];
 
        setTimeout(()=>{
            this.mapFunction.mapApiService.appendBh('air',airInfos);
        },1000)
    }
 
 
    updatePlotUrl(event) {
        localStorage.setItem('plot_url', this.state.plotUrl || '');
        alert('plotUrl服务地址设置成功');
    }
 
    updateImageUrl(event) {
        localStorage.setItem('plot_image', this.state.imageUrl || '');
        alert('plotUrl服务地址设置成功');
    }
 
    updateDemUrl(event) {
        localStorage.setItem('plot_dem', this.state.demUrl || '');
        alert('plotUrl服务地址设置成功');
    }
 
    updateLanguage1() {
        updateLanguage('zh-CN')
        alert('切换语言成功');
    }
 
    updateLanguage2() {
        updateLanguage('en-US')
        alert('切换语言成功');
    }
 
    updateLanguage3() {
        updateLanguage('fr-FR')
        alert('切换语言成功');
    }
 
    render() {
        return (
            <div className={"plot-map-container"}>
                <GIS refs={e => {
                    this.mapFunction = e
                }}
                     plotUrl={this.state.plotUrl}
                     mapRef={this}
                     global={[3,29,4,31]}
                />
 
                <div className={"button_wrapper"}>
 
                    <span>公共plotUrl服务地址:</span>
                    <Input.Group compact>
                        <Input
                            placeholder={'请输入标绘服务地址'}
                            defaultValue={this.state['plotUrl']}
                            onChange={(v) => this.setState({plotUrl: v.target.value})}
                        />
                        <Button type="primary" onClick={this.updatePlotUrl.bind(this)}>设置</Button>
                    </Input.Group>
                    <br/>
                    <span>公共影像图地址:</span>
                    <Input.Group compact>
                        <Input
                            placeholder={'请输入标绘服务地址'}
                            defaultValue={this.state['imageUrl']}
                            onChange={(v) => this.setState({imageUrl: v.target.value})}
                        />
                        <Button type="primary" onClick={this.updateImageUrl.bind(this)}>设置</Button>
                    </Input.Group>
                    <br/>
                    <span>公共Dem地址:</span>
                    <Input.Group compact>
                        <Input
                            placeholder={'请输入标绘服务地址'}
                            defaultValue={this.state['demUrl']}
                            onChange={(v) => this.setState({demUrl: v.target.value})}
                        />
                        <Button type="primary" onClick={this.updateDemUrl.bind(this)}>设置</Button>
                    </Input.Group>
                    <br/>
                    <span>公共语言:</span>
                    <Button type="primary" onClick={this.updateLanguage1.bind(this)}>中文</Button>
                    <Button type="primary" onClick={this.updateLanguage2.bind(this)}>英文</Button>
                    <Button type="primary" onClick={this.updateLanguage3.bind(this)}>法语</Button>
                    <br/>
                </div>
            </div>
        )
    }
}