【解决办法】引入Proj4js库进行坐标转换,例如:
proj4.defs("EPSG:4546","+proj=tmerc +lat_0=0 +lon_0=111 +k=1 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs +type=crs");
proj4.defs("EPSG:4490","+proj=longlat +ellps=GRS80 +no_defs +type=crs");
var crs1 =new L.supermap.Proj.CRS("EPSG:4546",{
bounds: L.bounds([341226.58,2003156.85], [658773.42,4998263.83]),
});
var crs2 =new L.supermap.Proj.CRS("EPSG:4490",{
bounds: L.bounds([73.62,16.7], [134.77,53.56 ]),
});
L.Proj.CRS.EPSG4546 = L.Proj.CRS.crs1;
L.Proj.CRS.EPSG4490 = L.Proj.CRS.crs2;
var coords4546 = [500000.0, 3498607.91];
var coords4490 = proj4('EPSG:4546', 'EPSG:4490', coords4546);
console.log('Converted coordinates:', coords4490);