#eqMap EqMap is a generic mapping utility for plotting, earthquakes, monitoring stations, and polygons on a Google Map. The plugin uses Google Maps API V3 (API V2 is deprecated and will stop working on 5/19/2013). The plugin expects a JSON objects for the earthquakes and stations, and KML files for all polygons. The JSON objects need to served via web service; the KML files must be hosted on a public facing web server.
- Point browser to one of the example html files*
- Once you create your own templates add your API Key
*By default the example files use PNSN event and station data, a PNSN boundary KML file and a S. California fault KML file.
The plugin is called by:
For example to create a volcano map on a div with id ="map":
The Configuration has the following hierarchy.
- In eqMapConfig.js standardDefaults($.fn.eqMap.standardDefaults) are loaded for every map. These are defaults shared by all maps. The recent eq map uses the standardDefaults exclusively.
- The individual map types in eqMapConfig.js override the standardDefaults. If your map_type is named 'blar', the plugin will expect a config object of $fn.eqMap.blarDefaults
- The arguments in the plugin call override the defaults in eqMapConfig.js. See example files.
##Data Types ###Events Events need to be in a JSON object with the following attributes. You can see an example object at http://www.pnsn.org/events/recent_events.json
Attribute type evid Should be int. Required for historic map. Optionally used in bubble text for other maps auth string version int lat float float lng float depth_km float depth_mi float magnitude, float event_time_utc string time stamp (optional for bubble and list only) event_time_local string time stamp (optional for bubble and list only) event_time_epoch float events.etype" string ('re', 'le', 'ex', 'px') regional, local, explosion, probable explosion. Defaults to local events.
###Stations Stations need to be a JSON object with the following attributes. Example object can be viewed at http://www.pnsn.org/station_type_groups.json
Attributes type sta string auth string staname string description string lat float lng float elev float code string (describes station type) used for icon assignment
###Polygons Polygons are served via a public facing KML file. You can add as many polygon files as you wish. Each must have a unique name. See eqMapConfigExample.js for examples.
##Request types This plugin expects a JSON object served via a web service or public facing flat file. If the web service is on a different host than the web server(server that is hosting eqMap) you must create a JSONP request, which allows for cross site scripting. This can be done by appending "?callback=?" to the end of the webservice url. A simple php web service is included. See the URLs in the eqMapConfigExample.js file for examples. If the JSON file is on the web server, JSONP is not required but the file must be served via http. You must use the web service for testing on local i.e. http://localhost/your/path/eqMap/php/json_service.php
A python script is included to generate a json file from the 1 week usgs all feed