//注册4490坐标系
//定义坐标系地址,后面的2384换成对应想查询的即可https://epsg.io/2384
proj4.defs([
[
"EPSG:2384",
"+proj=tmerc +lat_0=0 +lon_0=117 +k=1 +x_0=500000 +y_0=0 +a=6378140 +b=6356755.288157528 +units=m +no_defs"
],
["EPSG:4490", "+proj=longlat +ellps=GRS80 +no_defs"]
]);
var swissProjection = new ol.proj.Projection({
code: "EPSG:4490",
extent: [-180, -90, 180, 90],
units: "m"
});
ol.proj.addProjection(swissProjection);
//初始化map
map = new ol.Map({
target: "map",
controls: ol.control
.defaults({ attributionOptions: { collapsed: false } })
.extend([new ol.supermap.control.Logo()]),
view: new ol.View({
center: [117.167149, 36.979461],
zoom: 17,
projection: "EPSG:4490",//这里直接写坐标系名称即可
multiWorld: true
})
})