EPSG:32650(投影坐标系)转EPSG:4326(地理坐标系)
根据坐标编码互转
// npm安装
npm install proj4 --save
//http://proj4js.org/
npm install ol
//https://github.com/openlayers/openlayers
import { getTransform,transform,fromLonLat,toLonLat } from "ol/proj";
import proj4 from 'proj4';
import {register} from 'ol/proj/proj4';
//https://epsg.io/32650 根据坐标编码查询注册信息
proj4.defs([
[
"EPSG:32650",
"+proj=utm +zone=50 +datum=WGS84 +units=m +no_defs +type=crs",
],
["EPSG:4326", "+proj=longlat +datum=WGS84 +no_defs +type=crs"],
]);
register(proj4);
console.log(transform([616240.0,2765970.0], "EPSG:32650", "EPSG:4326"));