GRID DEI TERREMOTI PIÙ RECENTI (REAL TIME FEED & DATA IN FORMATO GEOJSONP). FONTE USGS
Grid dei terremoti più recenti (Real time feed & data in formato geoJSONP). Fonte USGS
html, body { font-size: 75%; } $.jgrid.no_legacy_api = true; $.jgrid.useJSON = true; /*global $ */ $(function () { "use strict"; $.extend($.jgrid.search, {multipleSearch: true, multipleGroup: true, overlay: 0}); $('#grid').jqGrid({ url: 'http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/2.5_week.geojsonp', // url: 'http://earthquake.usgs.gov/earthquakes/feed/geojsonp/2.5/week', datatype: 'jsonp', postData: '', ajaxGridOptions: { jsonp: false, jsonpCallback: 'eqfeed_callback', cache: true}, colModel: [ {name: 'mag', label: 'MAGNITUDO', align: 'center', width: 150, jsonmap: 'properties.mag', sorttype: 'number', formatter: 'number', formatoptions: {decimalPlaces: 2}}, {name: 'place', label: 'LOCALITà', width: 250, jsonmap: 'properties.place'}, //per arginare il problema della formattazione del Epoch & Unix Timestamp applico piccola routine interna a time {name: 'time', label: 'DATE', width: 250, jsonmap: 'properties.time',sorttype: 'date', datefmt: 'd-M-Y', formatter: function (cellval, opts) { var date = new Date(cellval); opts = $.extend({}, $.jgrid.formatter.date, opts); return $.fmatter.util.DateFormat("", date, 'd-M-Y', opts); }}, {name: 'url', label: 'URL', width: 350, formatter:'link', formatoptions:{target:'_blank'}, jsonmap: 'properties.url'} ], toppager: true, gridview: true, rowList: [10, 20, 50, 10000], rowNum: 20, jsonReader: { root: 'features', repeatitems: false }, loadonce: true, ignoreCase: true, height: 'auto' }).jqGrid('navGrid', '#grid_toppager', {add: false, edit: false, del: false}) .jqGrid('filterToolbar', {stringResult: true, defaultSearch: 'cn', searchOnEnter: false}); $("#grid_toppager option[value=10000]").text('All'); });
Attendere il caricamento della pagina. Il dato geolocalizzato in real time è riferito all'ultima settimana.