argis toggle layers on and off kml
Eric you would have to combine that sample and this one:
You can also accomplish this task with the newer 4.x version of the ArcGIS API for JavaScript. You'll use the same approach of combining the KML sample with the LayerList sample:
KML sample:
KMLLayer | ArcGIS API for JavaScript 4.8
LayerList sample:
LayerList widget | ArcGIS API for JavaScript 4.8
Combined Sample:
Hi Kelly, I tried your hybrid. Only I get only the one layer to work not only in your example but mine as well?
yours https://bcczo.colorado.edu/GISapi/layers-kmltoggle-source.html
mine https://bcczo.colorado.edu/GISapi/layers-kmltoggleczo.html
Thanks so much!!
Eric in my example they both work - one layer is in California and the other in Pennsylvania. And in your example if I look in the dev console it seems like there is an issue with adding the boundaries kml.
There are some limitations when using KML that are outlined here:
Yes now I see Pennsylvania, sorry it is way off the loading extent. Only now where is my second kml? Doesn't show up in the UR menu either. I double checked them they are valid kml's. I have only changed the base map to "satellite" and the kml URL.
Thank you
Neither excel the 10mb limit or exceed the extent seen. It was built own the same manner as the one that does show.
I'm not a kml expert so not sure what is wrong but if I run both of your kml files through this kml validator the one that displays comes back as valid and the one that does not display comes back as invalid.
Hi Kelly,
Thanks for everything so far.
Part 2: Now I need better control for the user over those kml layers. This will allow the user choose which ones they want to see and all but one or two would be turned "off" when the page loads until the user clicks on it. I was originally looking to do this with check boxes but am open to what will work best.
I've looked around but have not seen a good ways to do this. Found a few that don't work.
Do you have any helpful suggestions here?
Again THANKS