CHG - Tools - Snippets
TOOLS
EWX GeoServer Snippets
Add EWX-based data maps to your own webpage!

Snippets are a free and publicly accessible way to display maps from our EWX online application on your own webpage. To generate the code and markup needed to display your desired data, please visit our EWX Map Snippet Configurator tool.

The Configurator produces a small chuck of code for your website that displays a map, tailored to your specific needs, of datasets available in our EWX viewer. Snippet maps are active windows with zoom, pan and temporal navigation capabilities. With the EWX Map Snippet Configurator, you can quickly and easily customize your EWX map by selecting the data parameters available from EWX. The Configurator provides not just the code, but also all the necessary html markup. Snippets allow you to create your map, copy, paste, and be web-ready in moments. For more information on the parameter options, please visit our Snippets wiki page.

Please direct any questions, comments, or suggestions regarding EWX Snippets or the EWX Map Snippet Configurator to greg.ederer@geog.ucsb.edu.

Note: Use +/- (or the scroll wheel on your mouse) to zoom in/out. Click and drag to pan.

Example Snippet

Snippet Code Sample

<script src="http://ewx.chg.ucsb.edu/ewx-snippets/ewxmap/ewxmap.js"></script>

<div id="ewx-map-flgafy0z21" class="map"></div>
<script>
 new EwxMap ({
 	ewxUrl: 'http://chg-ewx.geog.ucsb.edu:8080/EWX',
	id: 'ewx-map-flgafy0z21',
	dataset: 'chirps',
	region: 'africa',
	periodicity: '1-dekad',
	period: { year: 2016, month: 2, dekad: 3 },
  	showDekadControl: true,
  	showYearControl: true,
	units: 'mm',
	statistic: 'data',
	width: 427,
	height: 455,
	zoom: 3,
	center: [1.5, 17],
	
 });
</script>