MCPcopy Create free account
hub / github.com/Maps4HTML/MapML.js / attributeChangedCallback

Method attributeChangedCallback

src/map-tile.js:191–215  ·  view source on GitHub ↗
(name, oldValue, newValue)

Source from the content-addressed store, hash-verified

189 return Util.getClosest(this, 'map-layer,layer-');
190 }
191 attributeChangedCallback(name, oldValue, newValue) {
192 if (this.#hasConnected /* jshint ignore:line */) {
193 switch (name) {
194 case 'row':
195 case 'col':
196 case 'zoom':
197 break;
198 case 'src':
199 if (oldValue !== newValue) {
200 // If we've already calculated an extent, recalculate it
201 if (this._extent) {
202 this._calculateExtent();
203 }
204
205 // If this tile is connected to a tile layer, update it
206 if (this._tileLayer) {
207 // For src changes, normal removal works since coordinates haven't changed
208 this._tileLayer.removeMapTile(this);
209 this._tileLayer.addMapTile(this);
210 }
211 }
212 break;
213 }
214 }
215 }
216 // ~copied/reimplemented from map-feature.js
217 getMeta(metaName) {
218 let name = metaName.toLowerCase();

Callers

nothing calls this directly

Calls 1

_calculateExtentMethod · 0.95

Tested by

no test coverage detected