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

Method constructor

test/tool/mock_maplibregl_map.js:428–448  ·  view source on GitHub ↗
(epsgCode, WKT, extent)

Source from the content-addressed store, hash-verified

426
427class CRS {
428 constructor(epsgCode, WKT, extent) {
429 this.epsgCode = epsgCode;
430 this.extent = extent;
431 if (Array.isArray(WKT)) {
432 this.extent = WKT;
433 WKT = null;
434 }
435 if(this.extent[0] === -180 && this.extent[2] === 180 && this.extent[3] === 90) {
436 this.extent[1] = Math.max(this.extent[1], -90);
437 }
438 this.WKT = WKT || CRS.defaultWKTs[epsgCode];
439 if (this.WKT) {
440 proj4.defs(epsgCode, this.WKT);
441 }
442 const defs = proj4.defs(epsgCode);
443 if (!defs) {
444 throw new Error(`${epsgCode} was not defined,make sure the WKT param was not null`);
445 }
446 this.unit = defs.units || 'degree';
447 CRS.set(this);
448 }
449
450 getExtent() {
451 if (!this._rectifyExtent) {

Callers

nothing calls this directly

Calls 2

maxMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected