import React, {Component} from 'react' import './ExamplePage.css' import "./CommonExample.css"; import {GIS} from "iclient3d-plot-diy"; ; import ProfileTool from "./profile/ProfileTool"; import ProfilePage from "./profile/ProfilePage"; export default class ExampleCustomToolbarPage extends Component { constructor(props) { super(props); this.state = { profileVisible: false, profileResult: null, htmlString: '

正在加载中...

' }; } toolbars = [ 'global', 'fullscreen', 'measureDistance', 'measureArea', 'seethrough', { key: 'profile', icon: 'profile', title: '剖面分析', titleI18n: 'profile', handleClick: () => { this.doProfile(); } }, ]; componentDidMount() { fetch('./example/ExampleCustomToolbarPage.md') .then(response => response.text()) .then(mdText => { this.setState({htmlString: window.marked.parse(mdText)}); }); //启用旋转和倾斜 this.mapFunction.mapApiService.enableTilt(); } doProfile() { this.profileVisible = !this.profileVisible; this.setState({ profileVisible: this.profileVisible }) } callProfile(profileResult) { this.setState({ profileResult: profileResult }) } render() { return (

分组数据展示

{ this.mapFunction = e } } mapRef={this} showDefaultLayer={true} toolbars={this.toolbars} />
{this.state.profileVisible && } {this.state.profileResult && }
) } }