* @function WebMapBase.prototype.setStyle * @description 更新地图样式。 * @param {Object} style - 地图 style 样式 * @param {boolean} preserveMap - 保留地图实例,覆盖图层样式。
(style, preserveMap = false)
| 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 |
no test coverage detected