(name, oldValue, newValue)
| 143 | return Util.getClosest(this, 'map-layer,layer-'); |
| 144 | } |
| 145 | attributeChangedCallback(name, oldValue, newValue) { |
| 146 | if (this.#hasConnected /* jshint ignore:line */) { |
| 147 | switch (name) { |
| 148 | case 'units': |
| 149 | if (oldValue !== newValue) { |
| 150 | // handle side effects |
| 151 | } |
| 152 | break; |
| 153 | case 'label': |
| 154 | if (oldValue !== newValue) { |
| 155 | this._layerControlHTML.querySelector( |
| 156 | '.mapml-extent-item-name' |
| 157 | ).innerHTML = newValue || this.getMapEl().locale.dfExtent; |
| 158 | } |
| 159 | break; |
| 160 | case 'checked': |
| 161 | this.parentLayer |
| 162 | .whenReady() |
| 163 | .then(() => { |
| 164 | this._handleChange(); |
| 165 | this._calculateBounds(); |
| 166 | this._layerControlCheckbox.checked = newValue !== null; |
| 167 | }) |
| 168 | .catch((error) => { |
| 169 | console.log( |
| 170 | 'Error while waiting on parentLayer for map-extent checked callback: ' + |
| 171 | error |
| 172 | ); |
| 173 | }); |
| 174 | break; |
| 175 | case 'opacity': |
| 176 | if (oldValue !== newValue) { |
| 177 | this._opacity = newValue; |
| 178 | if (this._extentLayer) this._extentLayer.changeOpacity(newValue); |
| 179 | } |
| 180 | break; |
| 181 | case 'hidden': |
| 182 | if (oldValue !== newValue) { |
| 183 | this.parentLayer |
| 184 | .whenReady() |
| 185 | .then(() => { |
| 186 | let extentsRootFieldset = |
| 187 | this.parentLayer._propertiesGroupAnatomy; |
| 188 | let position = Array.from( |
| 189 | this.parentLayer.src |
| 190 | ? this.parentLayer.shadowRoot.querySelectorAll( |
| 191 | ':host > map-extent:not([hidden])' |
| 192 | ) |
| 193 | : this.parentLayer.querySelectorAll( |
| 194 | ':scope > map-extent:not([hidden])' |
| 195 | ) |
| 196 | ).indexOf(this); |
| 197 | if (newValue !== null) { |
| 198 | // remove from layer control (hide from user) |
| 199 | this._layerControlHTML.remove(); |
| 200 | } else { |
| 201 | // insert the extent fieldset into the layer control container in |
| 202 | // the calculated position |
nothing calls this directly
no test coverage detected