Alternative approach to toggling layers, compared to : Toggling layers, reload file
Has the advantage of loading data only once, so it should be a smoother transition between toggles.
Click anywhere on the map to toggle layers.
https://d3js.org/d3.v4.min.js
https://d3js.org/d3-geo-projection.v1.min.js
https://d3js.org/topojson.v1.min.js