Skip to content

Commit db612f2

Browse files
committed
Fix spooky errors due to closure and other unknowns TBD
1 parent 94589a1 commit db612f2

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/map-feature.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,9 @@ export class MapFeature extends HTMLElement {
221221
};
222222

223223
let parentLayer =
224-
parentEl.nodeName.toUpperCase() === 'LAYER-'
225-
? parentEl
226-
: parentEl.parentElement || parentEl.parentNode.host;
224+
this._parentEl.nodeName.toUpperCase() === 'LAYER-'
225+
? this._parentEl
226+
: this._parentEl.parentElement || this._parentEl.parentNode.host;
227227
this._layer = parentLayer._layer;
228228
_attachedToMap();
229229
}

src/mapml/layers/MapMLLayer.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -1535,7 +1535,7 @@ export var MapMLLayer = L.Layer.extend({
15351535
layer._styles = getAlternateStyles();
15361536
layer._validateExtent();
15371537
if (this.responseXML) {
1538-
attachToLayer();
1538+
attachToLayer.call(layer);
15391539
}
15401540
// update controls if needed based on mapml-viewer controls/controlslist attribute
15411541
if (layer._layerEl.parentElement) {
@@ -1677,7 +1677,8 @@ export var MapMLLayer = L.Layer.extend({
16771677
}
16781678
}
16791679
function attachToLayer() {
1680-
let shadowRoot = layer._layerEl.shadowRoot;
1680+
let mapml = xhr.responseXML,
1681+
shadowRoot = this._layerEl.shadowRoot;
16811682
let elements = mapml.children[0].children[1].children;
16821683
if (elements) {
16831684
let baseURL = mapml.children[0].children[0]

0 commit comments

Comments
 (0)