Language
Login
Language Setting
X
English
日本語 [Japanese]
about this App
須高地域AED設置場所(経路案内追加ver.)
useful
4
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) { //$("#result").append("<h3>Work: " + workValue + "</h3>"); $.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/rdf1s2261i#" + encodeURIComponent("設置場所")){ tmp_data["name"] = objValue; }else if(propValue == "http://linkdata.org/property/rdf1s2261i#" + encodeURIComponent("住所")){ tmp_data["location"] = 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["longitude"] = objValue; }else if(propValue == "http://linkdata.org/property/rdf1s2261i#" + encodeURIComponent("電話番号")){ tmp_data["tel"] = objValue; } }); }); tmp_a_data.push(tmp_data); }); }); }); //全データ all_data = tmp_a_data; //全データを地図上に表示 // 地図センター緯度経度の初期値は「須坂市役所」 var latlng = new google.maps.LatLng(36.651080,138.307227); var myOptions = { zoom: 12, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("result"), myOptions); // ウィンドウに表示するデータをつくる var data = new Array(); for (var i in all_data){ var value = all_data[i].name; data.push({position: new google.maps.LatLng(all_data[i].lat, all_data[i].longitude), content: '<h3>' + all_data[i].name + '</h3><br>【所在地】' + all_data[i].location + '<br>【電話番号】' + '<a href=tel:' + all_data[i].tel + '>' + all_data[i].tel + '</a>' + '<br>' + '<a href="http://www.city.suzaka.nagano.jp/i/aed1.htm"' + 'target="_blank">' +'応急手当の手順(須坂市のサイトが開きます)' + "</a>" + '<br> 平成25年3月31日時点<h3><a href="http://maps.google.com/maps?q=' + all_data[i].lat + ',' + all_data[i].longitude + '" target="_blank">マップアプリで経路案内</a></h3>' }); }; // 地図上にウィンドウで表示 for (i = 0; i < data.length; i++) { var marker = new google.maps.Marker({ position: data[i].position, map: map, icon: 'http://app.linkdata.org/asset/92cc5fd5.png' }); attachMessage(marker, data[i].content); }; }; // 地図のマーカーをクリックするとウィンドウを表示する処理 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(); }); };
h3 { font-weight: bold; line-height: 1; color: #ff0000; margin-top: 1em; margin-bottom: 0.5em; }
<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/app1s953i?tab=readme
jquery-1.7.1.min.js
http://maps.google.com/maps/api/js?sensor=false&language=ja
Work
Add
Clear
insert work id or work name.