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

Function transformMapCenter

src/maplibregl/mapping/InitMap.js:109–118  ·  view source on GitHub ↗

* @private * @function transformMapCenter * @description 转换center。 * @param {Object} mapInfoCenter - 中心点。 * @param {string} baseProjection - 坐标投影。 * @returns {Array}

(mapInfoCenter, sourceProjection)

Source from the content-addressed store, hash-verified

107 * @returns {Array}
108 */
109function transformMapCenter(mapInfoCenter, sourceProjection) {
110 let center = mapInfoCenter;
111 if (sourceProjection === 'EPSG:3857') {
112 return proj4(sourceProjection, 'EPSG:4326', mapInfoCenter);
113 }
114 if (sourceProjection !== 'EPSG:4326') {
115 return maplibregl.proj4(sourceProjection, 'EPSG:4326', mapInfoCenter);
116 }
117 return center;
118}
119
120/**
121 * @private

Callers 1

createMapOptionsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected