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

Function transformMapCenter

src/mapboxgl/mapping/InitMap.js:116–125  ·  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

114 * @returns {Array}
115 */
116function transformMapCenter(mapInfoCenter, sourceProjection) {
117 let center = mapInfoCenter;
118 if (sourceProjection === 'EPSG:3857') {
119 return proj4(sourceProjection, 'EPSG:4326', mapInfoCenter);
120 }
121 if (sourceProjection !== 'EPSG:4326') {
122 return mapboxgl.proj4(sourceProjection, 'EPSG:4326', mapInfoCenter);
123 }
124 return center;
125}
126
127/**
128 * @private

Callers 1

createMapOptionsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected