Language
Login
Language Setting
X
English
日本語 [Japanese]
about this App
forked:須坂市の避難場所
useful
3
Loading...
/* This is a Example program to retrieve and display the data. Press the Run button on the right of the screen (described the behavior of the Example program below). Please create a new application rewrite this program work. */ var all_data; function initialize(){ all_data = new Array(); // データをLinkDataから取得 tmp_a_data = new Array(); $.each(LinkData.getWorks(), function(workKey, workValue) { $.each(LinkData.getFiles(workValue), function(fileKey, fileValue) { $.each(LinkData.getSubjects(workValue, fileValue), function(subjKey, subjValue) { var tmp_data = {} tmp_data["id"] = subjValue; $.each(LinkData.getProperties(workValue, fileValue), function(propKey, propValue) { $.each(LinkData.getObjects(workValue, fileValue, subjValue, propValue), function(objKey, objValue) { if(propValue == "http://linkdata.org/property/rdf1s1913i#" + encodeURIComponent("施設名")){ tmp_data["name"] = objValue; }else if(propValue == "http://www.w3.org/2003/01/geo/wgs84_pos#lat"){ tmp_data["lat"] = objValue; }else if(propValue == "http://www.w3.org/2003/01/geo/wgs84_pos#long"){ tmp_data["lng"] = objValue; }else if(propValue == "http://linkdata.org/property/rdf1s1913i#" + encodeURIComponent("所在地")){ tmp_data["location"] = objValue; }else if(propValue == "http://linkdata.org/property/rdf1s1913i#" + encodeURIComponent("分類")){ tmp_data["genre"] = objValue; }else if(propValue == "http://linkdata.org/property/rdf1s1913i#" + encodeURIComponent("体育館等収容人数")){ tmp_data["capacity"] = objValue; }else if(propValue == "http://linkdata.org/property/rdf1s1913i#" + encodeURIComponent("対象地域")){ tmp_data["area"] = objValue; } }); }); tmp_a_data.push(tmp_data); }); }); }); //全データ all_data = tmp_a_data; //地地図センター緯度経度の初期値は「須坂市役所」 var myLatLng = new google.maps.LatLng(34.827009 134.690796); var myMap = new google.maps.Map(document.getElementById('result'), { zoom: 12, center: myLatLng, mapTypeId: google.maps.MapTypeId.ROADMAP, scaleControl: true, scrollwheel: true }); //ポイントの設定 var latlng; var data = new Array(); for (var i in all_data) { //避難所の種類で区分する latlng = new google.maps.LatLng(all_data[i].lat,all_data[i].lng);// 緯度経度から中心点をつくる if ((all_data[i].genre == "予備")){ var spot_Options = { center: latlng, // 中心点 }; //marker test start var gmarker = new google.maps.Marker({ position: latlng, // 緯度・経度は地図の中心 title: all_data[i].name,// ツールチップ openInfo:true, icon: "http://labs.google.com/ridefinder/images/mm_20_blue.png", map: myMap }); } else{ var spot_Options = { center: latlng // 中心点 }; //test start var gmarker = new google.maps.Marker({ position: latlng, // 緯度・経度は地図の中心 title: all_data[i].name ,// ツールチップ icon: "http://app.linkdata.org/asset/ce65058e.png", map: myMap }); }//if toji // ウィンドウに表示するデータをつくる var spot_name = all_data [i].name; data.push({position: new google.maps.LatLng(all_data[i].lat, all_data[i].lng), content: spot_name + '<br><small>【所在地】' + all_data[i].location + '<br>【分類】' + all_data[i].genre + '<br>【収容人数】' + all_data[i].capacity +'<br>【対象地域】' + all_data[i].area + '</small>'}); // 地図上にウィンドウで表示 attachMessage(gmarker, data[i].content); }; //for toji };//initialize toji // 地図のマーカーをクリックするとウィンドウを表示する処理 function attachMessage(marker, msg) { google.maps.event.addListener(marker, 'click', function(event) { new google.maps.InfoWindow({ content: msg }).open(marker.getMap(), marker); }); }; window.onload = function() { $(function(){ initialize(); }); };
<style type="text/css"> html { height: 100% } body { height: 100%; margin: 0; padding: 0 } #map_canvas { height: 100% } </style> <div id="result" style="width:100%; height:100%"></div>
Preview
Input Data
ReadMe
Snapshots
This application does not using any data or contains private/limited data.
Link http://app.linkdata.org/run/app1s793i?tab=readme
jquery-1.7.1.min.js
http://maps.googleapis.com/maps/api/js?sensor=false
Work
Add
Clear
insert work id or work name.