Language
Login
Language Setting
X
English
日本語 [Japanese]
about this App
統計データを地図上に表示するアプリ
useful
5
Loading...
if(typeof Application==="undefined"||!Application){var Application= {};} Application.gc = function() { this._init.apply(this, arguments); } Application.gc.prototype = { _data : null, _options : null, _init : function() { this._data = this._getGoogleDataTable(); this._options = this._getGoogleOption(); }, _configArray : function() { var array = [ { "caption" : "Latitude", "property" : "lat" }, { "caption" : "Longitude", "property" : "long" }, { "caption" : "Location", "property" : "label" }, { "caption" : "平成21年従業員数", "property" : "平成21年従業員数" } ]; return array; }, _getGoogleOption : function() { var options = { region: 'JP', displayMode: 'markers', colorAxis: {colors: ['yellow', 'red']} }; return options; }, _getGoogleDataTable : function() { var configArray = this._configArray(); var main = []; var array = []; $.each(configArray, function(index, obj) { array.push(obj.caption); }); main.push(array); var mainArray = this._getObjectArray(); $.each(mainArray, function(i, objArray) { array = []; $.each(objArray, function(j, objData) { $.each(configArray, function(k, obj) { if (objData.property === obj.property) { var val = objData.value; if (! isNaN(val)) { if (Math.floor(val).toString() == val.toString()) { // yay! we have an int val = parseInt(val); } else { // it's a float or something else. val = parseFloat(val); } } array[k] = val; } }); }); main.push(array); }); return main; }, _getObjectArray : function() { var main = []; $.each(LinkData.getWorks(), function(workKey, workValue) { $.each(LinkData.getFiles(workValue), function(fileKey, fileValue) { $.each(LinkData.getSubjects(workValue, fileValue), function(subjKey, subjValue) { var array = []; $.each(LinkData.getProperties(workValue, fileValue), function(propKey, propValue) { var obj = {}; var propLabel = propValue; var arr = propValue.split("#"); if (arr.length > 1) { propLabel = decodeURIComponent(arr[1]); } var objValue = LinkData.getObjects(workValue, fileValue, subjValue, propValue)[0]; obj.property = propLabel; obj.value = objValue; array.push(obj); }); main.push(array); }); }); }); return main; }, getData : function() { return this._data; }, getOptions : function() { return this._options; } } var drawMarkersMap = function() { var gc = new Application.gc(); var data = google.visualization.arrayToDataTable(gc.getData()); var options = gc.getOptions(); var chart = new google.visualization.GeoChart(document.getElementById('chart_div')); chart.draw(data, options); } google.load('visualization', '1', {'packages': ['geochart']}); google.setOnLoadCallback(drawMarkersMap);
<h2>都道府県別従業員数</h2> <div id="chart_div" style="width: 900px; height: 500px;"></div>
Preview
Input Data
ReadMe
Snapshots
LinkData Work
Table Data
都道府県別従業者数(従業者10人以上の事業所)緯度経度付き
Contributor:nobuotto
Update:Dec 5, 2011
1801 Downloads, 4 Applications
経済産業省 工業統計調査 平成21年確報 産業編 第16表 都道府県別従業者数(従業者10人以上の事業所)のLOD
都道府県別従業者数(従業者数10名以上)緯度経度付き
Add LinkData work(LinkData)
Link http://app.linkdata.org/run/app1s2i?tab=readme
Initial content
jquery-1.7.1.min.js
https://www.google.com/jsapi
Work
Add
Clear
insert work id or work name.