MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / getCRS

Function getCRS

src/leaflet/mapping/initMap.js:247–261  ·  view source on GitHub ↗
(epsgCodeStr, { bounds, origin, dpi, resolutions })

Source from the content-addressed store, hash-verified

245}
246
247function getCRS(epsgCodeStr, { bounds, origin, dpi, resolutions }) {
248 const wrapLngLeft = proj4(epsgCodeStr, 'EPSG:4326').forward([bounds.left, 0], true);
249 const wrapLngRight = proj4(epsgCodeStr, 'EPSG:4326').forward([bounds.right, 0], true);
250 const wrapLng = [parseInt(wrapLngLeft[0]), parseInt(wrapLngRight[0])];
251 let options = {
252 wrapLng,
253 bounds: L.bounds([bounds.left, bounds.bottom], [bounds.right, bounds.top]),
254 origin: origin || [bounds.left, bounds.top],
255 dpi: dpi
256 };
257 if (resolutions && resolutions.length > 0) {
258 options.resolutions = resolutions;
259 }
260 return new CRS(epsgCodeStr, options);
261}

Callers 1

crsFromMapJSONFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected