sbjw
2025-12-05 c6bec252e4cf12a0c1e9a7da55d5953717715294
public/example/ExampleGetPointsPage.md
@@ -36,6 +36,54 @@
            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 (
@@ -53,6 +101,10 @@
                    />
                </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>