首页 / 浏览问题 / WebGIS / 问题详情
超图FAQ:【iClient】iClient for MapboxGL如何加载没有EPSG的地方坐标系地图服务呢?
55,378EXP 2024年05月14日

【iClient】iClient for MapboxGL如何加载没有EPSG的地方坐标系地图服务呢?

1个回答

【解决办法】在地图服务的prjCoordSys资源获取wkt坐标系信息,获取位置如图:贴图 获取完成后通过wkt在MapboxGL加载,需要引入mapbox-gl-enhance: 示例代码如下: var WKT = 'PROJCS["CGCS2000_3_Degree_GK_CM_116E",GEOGCS["GCS_China_2000",DATUM["D_China_2000",SPHEROID["CGCS2000",6378137.0,298.257222101,AUTHORITY["EPSG","7044"]]],PRIMEM["Greenwich",0.0,AUTHORITY["EPSG","8901"]],UNIT["DEGREE",0.017453292519943295],AUTHORITY["EPSG","4490"]],PROJECTION["Transverse_Mercator",AUTHORITY["EPSG","9807"]],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",0.0],PARAMETER["Central_Meridian",116.0],PARAMETER["Latitude_Of_Origin",0.0],PARAMETER["Scale_Factor",1.0],UNIT["METER",1.0],AUTHORITY["EPSG","4490"]]' var map = new mapboxgl.Map({ container: 'map', style: 'http://localhost:8090/iserver/services/map-mvt-City1/rest/maps/City1/tileFeature/vectorstyles.json?type=MapBox_GL&styleonly=true&tileURLTemplate=ZXY', // mapboxgl.CRS(name,wkt,extent); // name:坐标系名称,必填 // wkt:坐标系的WKT或者Proj4表述,必填。 // extent: 当前坐标系范围,[左,下,右,上] crs: new mapboxgl.CRS('2000地方', WKT, [-3258341.95 , 700013.44, 1909139.08 , 5962850.53]), center: [104.29411212318577,29.941653923532186], zoom: 3, renderWorldCopies: false, }); map.addControl(new mapboxgl.NavigationControl());
55,378EXP 2024年05月14日
...