import { KSJGeographicCRSSettingApi } from "bjksj-sdk";
import "./App.css";
function Gis() {
    return (
        <div className="detail-content">
            <div className="detail-content-title">gis</div>
            <div className="detail-content-button">
                <button
                    onClick={async () => {
                        await KSJGeographicCRSSettingApi.setGeographicCRS({
                            type: "CGCS2000",
                            projectionType: "高斯投影",
                            utmRegion: "1N",
                            scaleFactor: "1",
                            centerLon: "117",
                            falseEasting: "104",
                            falseNorthing: "0",
                            orginLon: "104",
                            orginLat: "0",
                            orginHeight: "0",
                        });
                    }}
                >
                    设置地理坐标系
                </button>
                <input
                    id="file-input1"
                    type="file"
                    accept=".prj"
                    onChange={async (e) => {
                        const files = e.target.files;
                        if (files && files.length > 0) {
                            const file = files[0];
                            await KSJGeographicCRSSettingApi.ImportGeographicCRS({ file });
                        }
                    }}
                    style={{ display: "none" }}
                />
                <button
                    onClick={() => {
                        document.getElementById("file-input1").click();
                    }}
                >
                    导入PRJ文件
                </button>
                <input
                    id="file-input2"
                    type="file"
                    accept=".kml"
                    onChange={async (e) => {
                        const files = e.target.files;
                        if (files && files.length > 0) {
                            const file = files[0];
                            await KSJGeographicCRSSettingApi.createDecoratorFromKml({ file });
                        }
                    }}
                    style={{ display: "none" }}
                />
                <button
                    onClick={() => {
                        document.getElementById("file-input2").click();
                    }}
                >
                    导入Kml数据
                </button>
            </div>
        </div>
    );
}

export default Gis;
