()
| 407 | } |
| 408 | |
| 409 | selectAlternateOrChangeProjection() { |
| 410 | let mapml = this.src ? this.shadowRoot : this; |
| 411 | let selectedAlternate = |
| 412 | this.getProjection() !== this.parentElement.projection && |
| 413 | mapml.querySelector( |
| 414 | 'map-link[rel=alternate][projection=' + |
| 415 | this.parentElement.projection + |
| 416 | '][href]' |
| 417 | ); |
| 418 | |
| 419 | if (selectedAlternate) { |
| 420 | let url = new URL( |
| 421 | selectedAlternate.getAttribute('href'), |
| 422 | selectedAlternate.getBase() |
| 423 | ).href; |
| 424 | throw new Error('changeprojection', { |
| 425 | cause: { href: url } |
| 426 | }); |
| 427 | } |
| 428 | let contentProjection = this.getProjection(); |
| 429 | if ( |
| 430 | contentProjection !== this.parentElement.projection && |
| 431 | this.parentElement.layers.length === 1 |
| 432 | ) { |
| 433 | throw new Error('changeprojection', { |
| 434 | cause: { mapprojection: contentProjection } |
| 435 | }); |
| 436 | } |
| 437 | } |
| 438 | |
| 439 | copyRemoteContentToShadowRoot(mapml) { |
| 440 | let shadowRoot = this.shadowRoot; |
no test coverage detected