Skip to content

Commit 010e773

Browse files
committed
feat(overlay): Added an option to hide the overlay from the switch selector. Thanks to @Getz85 in this PR:
tombatossals#610 Merge branch 'Getz85-master'
2 parents 0cb0165 + d49cd4b commit 010e773

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/services/leafletControlHelpers.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,9 @@ angular.module("leaflet-directive").factory('leafletControlHelpers', function ($
6565
}
6666
}
6767
for (i in overlays) {
68-
if (isDefined(leafletLayers.overlays[i])) {
68+
var hideOverlayOnSelector = isDefined(overlays[i].layerOptions) &&
69+
overlays[i].layerOptions.showOnSelector === false;
70+
if (!hideOverlayOnSelector && isDefined(leafletLayers.overlays[i])) {
6971
_layersControl.addOverlay(leafletLayers.overlays[i], overlays[i].name);
7072
}
7173
}

0 commit comments

Comments
 (0)