This simple code makes it easy for a another user to see all the exact service URLs grouped logically as laid out in The National Map viewer for another developer to copy to use to embed in their application.
By default, it just calls the default TNM Viewer JSON file:
Or for the new NHD Viewer, add ?nhd
to call the nhd.json file
which has a slightly different URL configuration
You know which JSON to call as it is the p parameter in the URI for instance, p=nhd
It parses the JSON, first looking at the basemap buttons for the background maps, then the overlays sections for the different data layer groups. It reads the Name, type of service, service URL, counts the layers, and reads the legend URL. (View the source of the code to see the JSON reader).
Florin Alexandrescu (email@example.com), ATA Contractor to TNM/USGS
David Hughes (firstname.lastname@example.org), TNM Government Manager