* @private * @function hasRegisterProj * @description 判断是否注册了投影。 * @param {string} epsgCodeStr - epsgCode。 * @param {boolean} isConsole - 是否在控制台打印。 * @returns {boolean}
(epsgCodeStr, isConsole = true)
| 172 | * @returns {boolean} |
| 173 | */ |
| 174 | function hasRegisterProj(epsgCodeStr, isConsole = true) { |
| 175 | try { |
| 176 | proj4(epsgCodeStr); |
| 177 | } catch (e) { |
| 178 | if (isConsole) { |
| 179 | console.error( |
| 180 | `The projection of ${epsgCodeStr} is missing, please register the projection of ${epsgCodeStr} first, refer to the documentation: https://iclient.supermap.io/web/introduction/leafletDevelop.html#multiProjection` |
| 181 | ); |
| 182 | } |
| 183 | return false; |
| 184 | } |
| 185 | return true; |
| 186 | } |
| 187 | |
| 188 | /** |
| 189 | * @private |
no outgoing calls
no test coverage detected