Skip to Content

EML and Google Maps

Printer-friendly versionPrinter-friendly version
Fall 2012

Margaret O'Brien (SBC)

The Santa Barbara Coastal LTER's data catalog now includes a Google map generated from EML dataset-level <geographicCoverage> elements. The map required only one additional XSL template that mixes XSL with JavaScript; bypassing the need for KML files. XSL statements cycle through the <geographicCoverage> elements and define JavaScript variables, and all <geographicCoverage> nodes under <coverage> are plotted on the same map. All the JavaScipt is based on examples available with the Google Maps API (v3). This code has been implemented at SBC and MCR, and could be easily incorporated into another HTML display of EML metadata. The below map shows 25 sampling sites and a bounding box derived from metadata from one SBC dataset (knb-lter-sbc.1016).

Currently, the code uses the EML-required elements under <boundingCoordinates>, and logic determines whether a location should be displayed as a single point (marker) or a box (polygon). An optional <gPolygon> can also be plotted (not shown here). Some additional features are straightforward to add, such as dynamically setting the map's center and zoom. Accommodating other <geographicCoverage> elements at other locations in the EML document will require further development.
Example of a Google map generated from EML for dataset knb-lter-sbc.1016