MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / crsFromMapJSON

Function crsFromMapJSON

src/leaflet/mapping/initMap.js:134–150  ·  view source on GitHub ↗
(mapJSONObj, mapOptions)

Source from the content-addressed store, hash-verified

132 * @returns {CRS} 返回CRS。
133 */
134export function crsFromMapJSON(mapJSONObj, mapOptions) {
135 const { maxZoom = 22 } = mapOptions || {};
136
137 const { bounds, prjCoordSys, dpi, visibleScales, coordUnit, origin } = mapJSONObj;
138 let resolutions = mapJSONObj.resolutions;
139 if (!resolutions) {
140 resolutions = scalesToResolutions(visibleScales, bounds, dpi, coordUnit, maxZoom);
141 }
142 if (isPlaneProjection(prjCoordSys.type)) {
143 return getNonEarthCRS(bounds, origin, resolutions);
144 }
145 const epsgCodeStr = getEpsgCode(prjCoordSys);
146 if (!hasRegisterProj(epsgCodeStr)) {
147 return;
148 }
149 return getCRS(epsgCodeStr, { bounds, dpi, resolutions, origin });
150}
151
152/**
153 * @private

Callers 2

initMapSpec.jsFile · 0.90
initMapFunction · 0.85

Calls 6

scalesToResolutionsFunction · 0.90
isPlaneProjectionFunction · 0.90
getEpsgCodeFunction · 0.90
getNonEarthCRSFunction · 0.85
hasRegisterProjFunction · 0.85
getCRSFunction · 0.85

Tested by

no test coverage detected