()
| 232 | } |
| 233 | } |
| 234 | async _createOrGetTileLayer() { |
| 235 | await this._parentEl.whenReady(); |
| 236 | const parentElement = this._parentEl; |
| 237 | if (this.isFirst()) { |
| 238 | // Create a new MapTileLayer |
| 239 | this._tileLayer = mapTileLayer({ |
| 240 | projection: this.getMapEl().projection, |
| 241 | opacity: 1, |
| 242 | // used by map-link and map-layer, both have containers |
| 243 | pane: |
| 244 | parentElement._templatedLayer?.getContainer() || |
| 245 | parentElement._layer.getContainer(), |
| 246 | zIndex: this.position |
| 247 | }); |
| 248 | this._tileLayer.addMapTile(this); |
| 249 | |
| 250 | // Register in parent's layer registry |
| 251 | parentElement._layerRegistry.set(this.position, { |
| 252 | layer: this._tileLayer, |
| 253 | count: 1 |
| 254 | }); |
| 255 | |
| 256 | // add MapTileLayer to TemplatedFeaturesOrTilesLayer of the MapLink |
| 257 | if (parentElement._templatedLayer?.addLayer) { |
| 258 | parentElement._templatedLayer.addLayer(this._tileLayer); |
| 259 | } else { |
| 260 | // OR to the MapLayer's layer |
| 261 | parentElement._layer.addLayer(this._tileLayer); |
| 262 | } |
| 263 | } else { |
| 264 | // Look up the existing layer from the registry |
| 265 | const entry = parentElement._layerRegistry.get(this.position); |
| 266 | this._tileLayer = entry?.layer; |
| 267 | if (entry) { |
| 268 | entry.count++; |
| 269 | } |
| 270 | if (this._tileLayer) { |
| 271 | this._tileLayer.addMapTile(this); |
| 272 | } |
| 273 | } |
| 274 | } |
| 275 | _calculateExtent() { |
| 276 | const mapEl = this.getMapEl(); |
| 277 |
no test coverage detected