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

Method getEpsgInfoFromWKT

src/openlayers/mapping/WebMap.js:4560–4574  ·  view source on GitHub ↗

* 通过 WKT 参数获取坐标信息。 * * @param {string} wkt 字符串。 * @returns {string} EPSG,如:"EPSG:4326"。

(wkt)

Source from the content-addressed store, hash-verified

4558 * @returns {string} EPSG,如:"EPSG:4326"
4559 */
4560 getEpsgInfoFromWKT(wkt) {
4561 if (typeof wkt !== 'string') {
4562 return false;
4563 } else if (wkt.indexOf('EPSG') === 0) {
4564 return wkt;
4565 } else {
4566 let lastAuthority = wkt.lastIndexOf('AUTHORITY') + 10,
4567 endString = wkt.indexOf(']', lastAuthority) - 1;
4568 if (lastAuthority > 0 && endString > 0) {
4569 return `EPSG:${wkt.substring(lastAuthority, endString).split(',')[1].substr(1)}`;
4570 } else {
4571 return false;
4572 }
4573 }
4574 }
4575
4576 /**
4577 * @private

Callers 2

addProjctionFromWKTMethod · 0.95
handleCRSMethod · 0.80

Calls 1

indexOfMethod · 0.80

Tested by

no test coverage detected