1.定義4490
L.CRS.CustomEPSG4490 = L.extend({}, L.CRS.Earth, {
code: 'EPSG:4490',
projection: L.Projection.LonLat,
transformation: new L.Transformation(1 / 180, 1, -1 / 180, 0.5),
scale: function (zoom) {
return 256 * Math.pow(2, zoom - 1);
}
});
2.加載是配置 crs: L.CRS.CustomEPSG4490
var layer=L.tileLayer.wms("XXXX/geoserver/XXXX/wms?service=WMS", {
// 鏈接要改對應(yīng)的
layers: "XX:XXX",
format: "image/png",
layerID: Math.random(),
crs: L.CRS.CustomEPSG4490
transparent: true,
});