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

Method setStyle

src/common/mapping/WebMapBase.js:263–275  ·  view source on GitHub ↗

* @function WebMapBase.prototype.setStyle * @description 更新地图样式。 * @param {Object} style - 地图 style 样式 * @param {boolean} preserveMap - 保留地图实例,覆盖图层样式。

(style, preserveMap = false)

Source from the content-addressed store, hash-verified

261 * @param {boolean} preserveMap - 保留地图实例,覆盖图层样式。
262 */
263 setStyle(style, preserveMap = false) {
264 if (this.map) {
265 this.mapOptions.style = style;
266 if (preserveMap) {
267 this.cleanLayers();
268 }
269 if (this._isWebMapV3(style)) {
270 this.setMapId(style, preserveMap)
271 return;
272 }
273 this._initWebMap(!preserveMap);
274 }
275 }
276
277 /**
278 * @function WebMapBase.prototype.setRasterTileSize

Callers 1

Calls 4

cleanLayersMethod · 0.95
_isWebMapV3Method · 0.95
setMapIdMethod · 0.95
_initWebMapMethod · 0.95

Tested by

no test coverage detected