Skip to content

Commit ea0ade1

Browse files
committed
Fix failing tests
1 parent 12de277 commit ea0ade1

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

src/mapml.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,7 @@
430430
}
431431

432432
/* Disable pointer events where they'd interfere with the intended action. */
433+
.mapml-feature-index-box,
433434
.leaflet-tooltip,
434435
.leaflet-crosshair *,
435436
.mapml-layer-item-settings .mapml-control-layers summary label,

src/mapml/layers/FeatureIndexOverlay.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,18 @@ export var FeatureIndexOverlay = L.Layer.extend({
4040
body.allFeatures = [];
4141
keys.forEach(i => {
4242
let layers = features[i].layer._layers;
43-
let keys = Object.keys(layers);
4443
let bounds = L.bounds();
45-
keys.forEach(j => {
46-
if(!bounds) bounds = L.bounds(layers[j]._bounds.min, layers[j]._bounds.max);
47-
bounds.extend(layers[j]._bounds.min);
48-
bounds.extend(layers[j]._bounds.max);
49-
});
44+
45+
if(layers) {
46+
let keys = Object.keys(layers);
47+
keys.forEach(j => {
48+
if(!bounds) bounds = L.bounds(layers[j]._bounds.min, layers[j]._bounds.max);
49+
bounds.extend(layers[j]._bounds.min);
50+
bounds.extend(layers[j]._bounds.max);
51+
});
52+
} else if(features[i].layer._bounds){
53+
bounds = L.bounds(features[i].layer._bounds.min, features[i].layer._bounds.max);
54+
}
5055

5156
if(featureIndexBounds.overlaps(bounds)){
5257
let group = features[i].path;

0 commit comments

Comments
 (0)