@@ -3,7 +3,7 @@ import { extentLayer } from './mapml/layers/ExtentLayer';
3
3
import { createLayerControlExtentHTML } from './mapml/elementSupport/extents/createLayerControlForExtent' ;
4
4
5
5
/* global M */
6
- export class MapExtent extends HTMLElement {
6
+ export class HTMLMapExtentElement extends HTMLElement {
7
7
static get observedAttributes ( ) {
8
8
return [ 'checked' , 'label' , 'opacity' , 'hidden' ] ;
9
9
}
@@ -134,7 +134,7 @@ export class MapExtent extends HTMLElement {
134
134
return Util . getClosest ( this , 'mapml-viewer,map[is=web-map]' ) ;
135
135
}
136
136
getLayerEl ( ) {
137
- return Util . getClosest ( this , 'layer- ' ) ;
137
+ return Util . getClosest ( this , 'map-layer ' ) ;
138
138
}
139
139
attributeChangedCallback ( name , oldValue , newValue ) {
140
140
if ( this . #hasConnected /* jshint ignore:line */ ) {
@@ -234,7 +234,7 @@ export class MapExtent extends HTMLElement {
234
234
this . _changeHandler = this . _handleChange . bind ( this ) ;
235
235
}
236
236
async connectedCallback ( ) {
237
- // this.parentNode.host returns the layer- element when parentNode is
237
+ // this.parentNode.host returns the map-layer element when parentNode is
238
238
// the shadow root
239
239
this . parentLayer = this . getLayerEl ( ) ;
240
240
if (
@@ -246,8 +246,8 @@ export class MapExtent extends HTMLElement {
246
246
await this . mapEl . whenProjectionDefined ( this . units ) . catch ( ( ) => {
247
247
throw new Error ( 'Undefined projection:' + this . units ) ;
248
248
} ) ;
249
- // when projection is changed, the parent layer- ._layer is created (so whenReady is fulfilled) but then removed,
250
- // then the map-extent disconnectedCallback will be triggered by layer- ._onRemove() (clear the shadowRoot)
249
+ // when projection is changed, the parent map-layer ._layer is created (so whenReady is fulfilled) but then removed,
250
+ // then the map-extent disconnectedCallback will be triggered by map-layer ._onRemove() (clear the shadowRoot)
251
251
// even before connectedCallback is finished
252
252
// in this case, the microtasks triggered by the fulfillment of the removed MapMLLayer should be stopped as well
253
253
// !this.isConnected <=> the disconnectedCallback has run before
@@ -430,7 +430,7 @@ export class MapExtent extends HTMLElement {
430
430
_handleChange ( ) {
431
431
// add _extentLayer to map if map-extent is checked, otherwise remove it
432
432
if ( this . checked && ! this . disabled ) {
433
- // can be added to mapmllayer layerGroup no matter layer- is checked or not
433
+ // can be added to mapmllayer layerGroup no matter map-layer is checked or not
434
434
this . _extentLayer . addTo ( this . parentLayer . _layer ) ;
435
435
this . _extentLayer . setZIndex (
436
436
Array . from (
@@ -462,8 +462,8 @@ export class MapExtent extends HTMLElement {
462
462
}
463
463
}
464
464
disconnectedCallback ( ) {
465
- // in case of projection change, the disconnectedcallback will be triggered by removing layer- ._layer even before
466
- // map-extent.connectedcallback is finished (because it will wait for the layer- to be ready)
465
+ // in case of projection change, the disconnectedcallback will be triggered by removing map-layer ._layer even before
466
+ // map-extent.connectedcallback is finished (because it will wait for the map-layer to be ready)
467
467
// !this._extentLayer <=> this.connectedCallback has not yet been finished before disconnectedCallback is triggered
468
468
if (
469
469
this . hasAttribute ( 'data-moving' ) ||
0 commit comments