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

Method setCenter

src/common/mapping/WebMapBase.js:207–215  ·  view source on GitHub ↗

* @function WebMapBase.prototype.setCenter * @description 更新地图中心点。 * @param {Array} center - 地图中心点。

(center)

Source from the content-addressed store, hash-verified

205 * @param {Array} center - 地图中心点。
206 */
207 setCenter(center) {
208 if (this.map && this._centerValid(center)) {
209 this.mapOptions.center = center;
210 const { lng, lat } = this.map.getCenter();
211 if (center[0] !== +lng.toFixed(4) || center[1] !== +lat.toFixed(4)) {
212 this.map.setCenter(center, { from: 'setCenter' });
213 }
214 }
215 }
216
217 /**
218 * @function WebMapBase.prototype.setRenderWorldCopies

Callers 15

setMapOptionsMethod · 0.95
WebMapSpec.jsFile · 0.45
callbackFunction · 0.45
addLayerFunction · 0.45
WebMapSpec.jsFile · 0.45
callbackFunction · 0.45
RFunction · 0.45
home.jsFile · 0.45
createViewMethod · 0.45
axFunction · 0.45
echarts-en.min.jsFile · 0.45
dxFunction · 0.45

Calls 1

_centerValidMethod · 0.95

Tested by

no test coverage detected