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

Function hasRegisterProj

src/leaflet/mapping/initMap.js:174–186  ·  view source on GitHub ↗

* @private * @function hasRegisterProj * @description 判断是否注册了投影。 * @param {string} epsgCodeStr - epsgCode。 * @param {boolean} isConsole - 是否在控制台打印。 * @returns {boolean}

(epsgCodeStr, isConsole = true)

Source from the content-addressed store, hash-verified

172 * @returns {boolean}
173 */
174function 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

Callers 2

crsFromMapJSONFunction · 0.85
setProjFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected