(clean = true)
| 518 | } |
| 519 | |
| 520 | _initWebMap(clean = true) { |
| 521 | clean && this.clean(); |
| 522 | if (this.webMapInfo) { |
| 523 | // 传入是webmap对象 |
| 524 | const mapInfo = this.webMapInfo; |
| 525 | mapInfo.mapParams = { |
| 526 | title: this.webMapInfo.title, |
| 527 | description: this.webMapInfo.description |
| 528 | }; |
| 529 | this.mapParams = mapInfo.mapParams; |
| 530 | Promise.resolve() |
| 531 | .then(() => { |
| 532 | this._getMapInfo(mapInfo); |
| 533 | }) |
| 534 | .catch((error) => { |
| 535 | this._fire('mapcreatefailed', { error }); |
| 536 | }); |
| 537 | return; |
| 538 | } else if (!this.mapId || !this.options.serverUrl) { |
| 539 | Promise.resolve() |
| 540 | .then(() => { |
| 541 | this._createMap('MapStyle'); |
| 542 | }) |
| 543 | .catch((error) => { |
| 544 | this._fire('mapcreatefailed', { error }); |
| 545 | }); |
| 546 | return; |
| 547 | } |
| 548 | this._taskID = new Date(); |
| 549 | this.getMapInfo(this._taskID); |
| 550 | } |
| 551 | |
| 552 | setZoom(zoom) { |
| 553 | if (this.map) { |
no test coverage detected