(mapInfo, _taskID)
| 211 | } |
| 212 | |
| 213 | _handleLayerInfo(mapInfo, _taskID) { |
| 214 | mapInfo = this._setLayerID(mapInfo); |
| 215 | this._mapInfo = mapInfo; |
| 216 | this.layerAdded = 0; |
| 217 | this.expectLayerLen = 0; |
| 218 | const { layers, grid } = mapInfo; |
| 219 | this._setExpectLayerLen(mapInfo); |
| 220 | if (this.expectLayerLen === 0) { |
| 221 | this._sendMapToUser(0, 0); |
| 222 | } |
| 223 | if (this._shouldLoadBaseLayer(mapInfo, this.layerFilter)) { |
| 224 | this._initBaseLayer(mapInfo, () => { |
| 225 | this._addLayerSucceeded(); |
| 226 | }); |
| 227 | } |
| 228 | if (layers && layers.length !== 0) { |
| 229 | let filterLayers = layers; |
| 230 | if (typeof this.layerFilter === 'function') { |
| 231 | filterLayers = layers.filter(this.layerFilter); |
| 232 | } |
| 233 | this._initOverlayLayers(filterLayers, _taskID); |
| 234 | } |
| 235 | if (grid && grid.graticule) { |
| 236 | this._initGraticuleLayer(grid.graticule); |
| 237 | } |
| 238 | } |
| 239 | |
| 240 | _setExpectLayerLen(mapInfo) { |
| 241 | if (this._shouldLoadBaseLayer(mapInfo, this.layerFilter)) { |
no test coverage detected