* @function WebMap.prototype.setCRS * @description 更新地图投影。 * @param {string|Object} crs - 地图 crs。
(crs)
| 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 = { |
no test coverage detected