Innovative Tech

Dynamic Page of TNM Services List

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.


This page uses the DOJO Javascript framework to call the JSON configuration file in use by the viewer or any instance of the viewer. The JSON Configuration file, much like the XML OGC Context Profile, is the heart of the TNM Viewer configuration. It contains what services will show in the viewer, how they are setup, etc. for that viewer context.


For example:

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 or


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).


This JSON reader code also could be copied to be used as a JSON file reader for any Viewer to use to bring in these list of services into their Google Maps, Bing Maps, OpenLayers Viewer. Copy the file if want to use the javascript or enhance it.


Florin Alexandrescu (, ATA Contractor to TNM/USGS

David Hughes (, TNM Government Manager



- [ Show all ]


1 vote
Idea No. 14