5ebdc4d6d2501908342e3740e65bb89090a91f81..4395e3a004ca0d6f18881e32792c3385228f6ca7
2025-08-28 sbjw
ignore
4395e3 diff | tree
2025-08-28 sbjw
修复showLayer和hideLayer功能
abbf6c diff | tree
7 files modified
58 ■■■■■ changed files
.gitignore 1 ●●●● patch | view | raw | blame | history
package.json 2 ●●● patch | view | raw | blame | history
public/example/ExampleDynamicBlcPage.md 5 ●●●●● patch | view | raw | blame | history
public/example/ExampleLayerPage.md 14 ●●●●● patch | view | raw | blame | history
src/example/ExampleDynamicBlcPage.js 5 ●●●●● patch | view | raw | blame | history
src/example/ExampleLayerPage.js 14 ●●●●● patch | view | raw | blame | history
src/example/ExamplePage.js 17 ●●●●● patch | view | raw | blame | history
.gitignore
@@ -7,3 +7,4 @@
./nginx-1.20.2/
*.iml
/pnpm-lock.yaml
package-lock.json
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.15",
        "iclient3d-plot-diy": "^1.0.16",
        "iclient3d-plot-diy-attachment": "^1.0.1",
        "jquery": "^3.7.1",
        "react-draggable": "^3.3.2",
public/example/ExampleDynamicBlcPage.md
@@ -5,6 +5,7 @@
import React, {Component} from 'react'
import './ExampleDrawPage.css'
import {GIS} from "iclient3d-plot-diy";
import {Button} from "antd";
export default class ExampleDynamicDlcPage extends Component {
@@ -56,6 +57,10 @@
                         iconScales={[[0, 100000], [100000, 500000], [500000, 1000000], [1000000, 2000000], [2000000, 20000000]]}
                    />
                </div>
                <Button type="primary" onClick={() => this.mapFunction.mapApiService.enableTilt()}>启用旋转和倾斜
                </Button>
                <Button type="primary" onClick={() => this.mapFunction.mapApiService.disableTilt()}>禁用旋转和倾斜
                </Button>
                <div className={"code_wrapper"}>
                    <div dangerouslySetInnerHTML={{__html: this.state.htmlString}}></div>
                </div>
public/example/ExampleLayerPage.md
@@ -36,6 +36,9 @@
    addDemLayer() {
        this.mapFunction.updateDemLayer(this.state.terrainUrl, true);
    }
    removeDemLayer() {
        this.mapFunction.removeDemLayer(this.state.terrainUrl, true);
    }
    addGeoJsonLayer() {
        this.mapFunction.showGeoJsonDataSource({
@@ -49,12 +52,20 @@
        }, true);
    }
    hideGeoJsonLayer() {
        this.mapFunction.hideLayer('id_for_geojson');
    }
    addSuperMapImageryLayer() {
        this.mapFunction.showSuperMapImageryProvider({
            code: 'id_for_imagery_provider',
            url: this.state.superMapImageryUrl,
            name: 'supermap_imagery_provider'
        }, true);
    }
    hideSuperMapImageryLayer() {
        this.mapFunction.hideLayer('id_for_imagery_provider');
    }
    render() {
@@ -79,18 +90,21 @@
                           value={this.state['terrainUrl']}
                           onChange={(v) => this.setState({terrainUrl: v.target.value})}/>
                    <Button type="primary" onClick={this.addDemLayer.bind(this)}>添加地形</Button>
                    <Button type="primary" onClick={this.removeDemLayer.bind(this)}>移除地形</Button>
                    <br/>
                    <span>矢量服务地址:</span>
                    <input type="text" placeholder={'请输入矢量服务地址'}
                           value={this.state['geojsonUrl']}
                           onChange={(v) => this.setState({geojsonUrl: v.target.value})}/>
                    <Button type="primary" onClick={this.addGeoJsonLayer.bind(this)}>添加矢量</Button>
                    <Button type="primary" onClick={this.hideGeoJsonLayer.bind(this)}>关闭矢量</Button>
                    <br/>
                    <span>影像服务地址:</span>
                    <input type="text" placeholder={'请输入影像服务地址'}
                           value={this.state['superMapImageryUrl']}
                           onChange={(v) => this.setState({superMapImageryUrl: v.target.value})}/>
                    <Button type="primary" onClick={this.addSuperMapImageryLayer.bind(this)}>添加影像</Button>
                    <Button type="primary" onClick={this.hideSuperMapImageryLayer.bind(this)}>关闭影像</Button>
                </div>
                <div className={"code_wrapper"}>
                    <div dangerouslySetInnerHTML={{__html: this.state.htmlString}}></div>
src/example/ExampleDynamicBlcPage.js
@@ -1,6 +1,7 @@
import React, {Component} from 'react'
import './ExampleDrawPage.css'
import {GIS} from "iclient3d-plot-diy";
import {Button} from "antd";
export default class ExampleDynamicDlcPage extends Component {
@@ -52,6 +53,10 @@
                         iconScales={[[0, 100000], [100000, 500000], [500000, 1000000], [1000000, 2000000], [2000000, 20000000]]}
                    />
                </div>
                <Button type="primary" onClick={() => this.mapFunction.mapApiService.enableTilt()}>启用旋转和倾斜
                </Button>
                <Button type="primary" onClick={() => this.mapFunction.mapApiService.disableTilt()}>禁用旋转和倾斜
                </Button>
                <div className={"code_wrapper"}>
                    <div dangerouslySetInnerHTML={{__html: this.state.htmlString}}></div>
                </div>
src/example/ExampleLayerPage.js
@@ -32,6 +32,9 @@
    addDemLayer() {
        this.mapFunction.updateDemLayer(this.state.terrainUrl, true);
    }
    removeDemLayer() {
        this.mapFunction.removeDemLayer(this.state.terrainUrl, true);
    }
    addGeoJsonLayer() {
        this.mapFunction.showGeoJsonDataSource({
@@ -45,12 +48,20 @@
        }, true);
    }
    hideGeoJsonLayer() {
        this.mapFunction.hideLayer('id_for_geojson');
    }
    addSuperMapImageryLayer() {
        this.mapFunction.showSuperMapImageryProvider({
            code: 'id_for_imagery_provider',
            url: this.state.superMapImageryUrl,
            name: 'supermap_imagery_provider'
        }, true);
    }
    hideSuperMapImageryLayer() {
        this.mapFunction.hideLayer('id_for_imagery_provider');
    }
    render() {
@@ -75,18 +86,21 @@
                           value={this.state['terrainUrl']}
                           onChange={(v) => this.setState({terrainUrl: v.target.value})}/>
                    <Button type="primary" onClick={this.addDemLayer.bind(this)}>添加地形</Button>
                    <Button type="primary" onClick={this.removeDemLayer.bind(this)}>移除地形</Button>
                    <br/>
                    <span>矢量服务地址:</span>
                    <input type="text" placeholder={'请输入矢量服务地址'}
                           value={this.state['geojsonUrl']}
                           onChange={(v) => this.setState({geojsonUrl: v.target.value})}/>
                    <Button type="primary" onClick={this.addGeoJsonLayer.bind(this)}>添加矢量</Button>
                    <Button type="primary" onClick={this.hideGeoJsonLayer.bind(this)}>关闭矢量</Button>
                    <br/>
                    <span>影像服务地址:</span>
                    <input type="text" placeholder={'请输入影像服务地址'}
                           value={this.state['superMapImageryUrl']}
                           onChange={(v) => this.setState({superMapImageryUrl: v.target.value})}/>
                    <Button type="primary" onClick={this.addSuperMapImageryLayer.bind(this)}>添加影像</Button>
                    <Button type="primary" onClick={this.hideSuperMapImageryLayer.bind(this)}>关闭影像</Button>
                </div>
                <div className={"code_wrapper"}>
                    <div dangerouslySetInnerHTML={{__html: this.state.htmlString}}></div>
src/example/ExamplePage.js
@@ -15,6 +15,7 @@
            plotLanguage: localStorage.getItem('plot_language') || '',
            imageUrl: localStorage.getItem('plot_image') || '',
            demUrl: localStorage.getItem('plot_dem') || '',
            addressSearchUrl: localStorage.getItem('addressSearchUrl') || '',
        };
    }
@@ -33,6 +34,11 @@
    updateDemUrl(event) {
        localStorage.setItem('plot_dem', this.state.demUrl || '');
        alert('plotUrl服务地址设置成功');
    }
    updateAddressSearchUrl(event) {
        localStorage.setItem('addressSearchUrl', this.state.addressSearchUrl || '');
        alert('plotUrl服务地址设置成功');
    }
@@ -101,6 +107,17 @@
                        <Button type="primary" onClick={this.updateDemUrl.bind(this)}>设置</Button>
                    </Input.Group>
                    <br/>
                    <span>公共地址查询URL:</span>
                    <Input.Group compact>
                        <Input
                            placeholder={'公共地址查询URL'}
                            defaultValue={this.state['addressSearchUrl']}
                            onChange={(v) => this.setState({addressSearchUrl: v.target.value})}
                        />
                        <Button type="primary" onClick={this.updateAddressSearchUrl.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>