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

Method countFeatureLayers

src/layer.js:652–664  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

650 return { totalCount, disabledCount };
651 };
652 const countFeatureLayers = () => {
653 let totalCount = 0;
654 let disabledCount = 0;
655
656 this._layer.eachLayer((layer) => {
657 if (layer instanceof MapFeatureLayer) {
658 totalCount++;
659 if (!layer.isVisible()) disabledCount++;
660 }
661 });
662
663 return { totalCount, disabledCount };
664 };
665 // setTimeout is necessary to make the validateDisabled happen later than the moveend operations etc.,
666 // to ensure that the validated result is correct
667 setTimeout(() => {

Callers

nothing calls this directly

Calls 1

isVisibleMethod · 0.80

Tested by

no test coverage detected