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

Method setCRS

src/mapboxgl/mapping/WebMap.js:99–109  ·  view source on GitHub ↗

* @function WebMap.prototype.setCRS * @description 更新地图投影。 * @param {string|Object} crs - 地图 crs。

(crs)

Source from the content-addressed store, hash-verified

97 * @param {string|Object} crs - 地图 crs。
98 */
99 setCRS(crs) {
100 if (this.map) {
101 this.mapOptions.crs = crs;
102 if (this.mapOptions.crs) {
103 const crsVal = crs.epsgCode
104 ? this._crsManager.registerCRS({ name: crs.epsgCode, wkt: crs.WKT, ...this.mapOptions.crs }, false)
105 : this._crsManager.getCRS(crs);
106 this.map.setCRS(crsVal);
107 }
108 }
109 }
110
111 _createWebMapFactory(type) {
112 const commonFactoryOptions = {

Callers 1

callbackFunction · 0.45

Calls 2

registerCRSMethod · 0.45
getCRSMethod · 0.45

Tested by

no test coverage detected