I have created a layer of Virginia Colleges and Universities. I have also added a filter for public or private schools. The full code is here: https://github.com/mjbrgis/geojson/blob/main/layers-AGOL-VA-colleges-sample.html
The labels for the schools are separate graphics layers. I want to be able to add or remove graphics layers based on the chosen filter. However, I can't for the life of me figure out how to pass the chosen filter value to another function. The general idea is this:
- initial load shows all schools and all labels
- filtering for public schools shows public schools, removes all labels, shows public labels, removes private labels (if necessary)
- filtering for private schools shows private schools, removes all labels, removes public labels (if necessary), shows private labels
Any advice would be much appreciated.