* @function WebMapBase.prototype.resize * @description 调整地图大小。 * @param {boolean} [keepBounds=false] - 是否保持当前地图范围。
(keepBounds = false)
| 187 | * @param {boolean} [keepBounds=false] - 是否保持当前地图范围。 |
| 188 | */ |
| 189 | resize(keepBounds = false) { |
| 190 | this.map && this.map.resize(); |
| 191 | this._handler && this._handler.echartsLayerResize(); |
| 192 | const mapContainerStyle = window.getComputedStyle(document.getElementById(this.options.target)); |
| 193 | const { bounds } = this.mapOptions; |
| 194 | if (keepBounds && this.map && bounds && mapContainerStyle) { |
| 195 | const zoom = this._getResizedZoom(bounds, mapContainerStyle); |
| 196 | if (zoom !== this.map.getZoom()) { |
| 197 | this.map && this.map.setZoom(zoom); |
| 198 | } |
| 199 | } |
| 200 | } |
| 201 | |
| 202 | /** |
| 203 | * @function WebMapBase.prototype.setCenter |
no test coverage detected