将数据源从融合表更改为Excel文件(链接)
由于安全考虑,我必须将所有数据从一个融合表中移植到一个excel文件中,并且仍然保留用作谷歌地图来源的融合表function。 现在我面临的问题是我遇到了alasql。 我想用这个来执行我的任务。 但我无法find任何logging的例子,为Excel和谷歌地图使用JavaScript只alasql。
有人能指出我的一个恰当的例子,我可以参考或与excel和gmaps的alasql上的任何文档。 下面的代码是我必须从一个链接给出的从融合表到Excel文件的端口。
google.load('visualization', '1', {'packages':['table']}); function initialize() { var map = new google.maps.Map(document.getElementById('map_canvas'), { center: new google.maps.LatLng(55.7200,12.5700), zoom: 2, minZoom: 1, maxZoom: 4, mapTypeControl: false, streetViewControl: false, mapTypeId: google.maps.MapTypeId.ROADMAP }); var layer = new google.maps.FusionTablesLayer({ query: { select: 'Address', from: '1234324235435435' // fusion table id here }, suppressInfoWindows: true }); layer.setMap(map); google.maps.event.addListener(layer, 'click', function(e) { var data = new google.visualization.DataTable(); data.addColumn('string', 'header1:'); data.addColumn('string', e.value1); data.addRows([ ['header2', e.value2], ['header3', e.value3], ['header4', e.value4], ['header5', e.value5], ['header6', e.value6], ['header7', e.value7], ['header8', e.value8], ['header9', e.value9], ['header10', e.value10], ]); var chart = new google.visualization.Table(document.getElementById('chart')); var options = { 'title': e.row['header'].value + ' ', }; chart.draw(data, options); }); } function changeData(Sitecode) { var whereClause = ""; if(Sitecode) { whereClause = " WHERE 'Sitecode' = '" + Sitecode + "'"+"order by StartTime DESC limit 3"; } var queryText = encodeURIComponent("SELECT 'Sitecode', 'IncidentID', 'IncidentReport', 'Resolved', 'StartTime' FROM 12345678" + whereClause); var query = new google.visualization.Query('http://www.google.com/fusiontables/gvizdata?tq=' + queryText); query.send(getData); } function getData(response) { var table = new google.visualization.Table(document.getElementById('visualization')); table.draw(response.getDataTable()); } function UpgradeData(Sitecode) { var whereClause = ""; if(Sitecode) { whereClause = " WHERE 'Sitecode' = '" + Sitecode + "'"; } var queryText = encodeURIComponent("SELECT 'Sitecode', 'curver' as Current_Version, 'upon' as Upgraded_On, 'upnext' as Next_Upgrade, 'upnotes' as Upgrade_Notes FROM 123456789" + whereClause); var query = new google.visualization.Query('http://www.google.com/fusiontables/gvizdata?tq=' + queryText); query.send(getdata); } function getdata(response) { var table = new google.visualization.Table(document.getElementById('visualization1')); table.draw(response.getDataTable()); }