| | |
| | | this.mapFunction.mapApiService.removeDraw(p.code); |
| | | }) |
| | | } |
| | | async getBox() { |
| | | |
| | | let p = await this.mapFunction.mapApiService.draw({ |
| | | type: "box", |
| | | }); |
| | | p.drawEnd.subscribe(value => { |
| | | let c = p.export(); |
| | | alert(JSON.stringify(c.points)); |
| | | this.mapFunction.mapApiService.removeDraw(p.code); |
| | | this.mapFunction.mapApiService.showDrawDatas([c]) |
| | | }) |
| | | } |
| | | async getLine() { |
| | | |
| | | let p = await this.mapFunction.mapApiService.draw({ |
| | | type: "line", |
| | | }); |
| | | p.drawEnd.subscribe(value => { |
| | | let c = p.export(); |
| | | alert(JSON.stringify(c.points)); |
| | | this.mapFunction.mapApiService.removeDraw(p.code); |
| | | this.mapFunction.mapApiService.showDrawDatas([c]) |
| | | }) |
| | | } |
| | | async getPolygon() { |
| | | |
| | | let p = await this.mapFunction.mapApiService.draw({ |
| | | type: "polygon", |
| | | }); |
| | | p.drawEnd.subscribe(value => { |
| | | let c = p.export(); |
| | | alert(JSON.stringify(c.points)); |
| | | this.mapFunction.mapApiService.removeDraw(p.code); |
| | | this.mapFunction.mapApiService.showDrawDatas([c]) |
| | | }) |
| | | } |
| | | async getCircle() { |
| | | |
| | | let p = await this.mapFunction.mapApiService.draw({ |
| | | type: "circle", |
| | | }); |
| | | p.drawEnd.subscribe(value => { |
| | | let c = p.export(); |
| | | alert(JSON.stringify(c.points)); |
| | | this.mapFunction.mapApiService.removeDraw(p.code); |
| | | this.mapFunction.mapApiService.showDrawDatas([c]) |
| | | }) |
| | | } |
| | | |
| | | render() { |
| | | return ( |
| | |
| | | /> |
| | | </div> |
| | | <Button type="primary" onClick={this.getPoints.bind(this)}>获取坐标点</Button> |
| | | <Button type="primary" onClick={this.getBox.bind(this)}>获取box</Button> |
| | | <Button type="primary" onClick={this.getLine.bind(this)}>获取线</Button> |
| | | <Button type="primary" onClick={this.getPolygon.bind(this)}>获取面</Button> |
| | | <Button type="primary" onClick={this.getCircle.bind(this)}>获取圆</Button> |
| | | <div className={"code_wrapper"}> |
| | | <div dangerouslySetInnerHTML={{__html: this.state.htmlString}}></div> |
| | | </div> |