首页 / 浏览问题 / WebGIS / 问题详情
超图FAQ:【iClient】iClient for Leaflet加载WMTS服务会有偏移?
64,468EXP 2024年05月14日
【iClient】iClient for Leaflet加载WMTS服务会有偏移?

1个回答

【问题原因】没有正确设置CRS。 var map = L.map('map', { center: [0, 0], maxZoom: 18, zoom: 0, crs: L.CRS.EPSG4326 }); 【解决办法】设置CRS示例代码如下: var resolutions = [1.4062500000020313, 0.7041106029170705, 0.35205530145853525, 0.17602765074115156, 0.08801382537057578, 0.04400691267340393, 0.02200345634858593, 0.011001728174292964, 0.005500864087146482, 0.0027504320316892785]; var map = L.map('map', { preferCanvas: true, crs: new L.supermap.Proj.CRS("EPSG:4326", { origin: [-180, 90], resolutions: resolutions, bounds: L.bounds([-180.0 - 90.0], [180.0, 90.0]) }), center: [20, 100], maxZoom: 18, zoom: 3 });
64,468EXP 2024年05月14日
热门文章
关注我们
...