Language
Login
Language Setting
X
English
日本語 [Japanese]
about this App
福井市公共施設一覧
useful
0
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. */ const DataID = 'rdf1s1191i'; const LinkDataPropUrl = 'http://linkdata.org/property/' + DataID + '#'; 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 == LinkDataPropUrl + encodeURIComponent('施設名称')){ tmp_data["name"] = objValue; }else if(propValue == LinkDataPropUrl + encodeURIComponent("施設所在地")){ tmp_data["address"] = objValue; }else if(propValue == LinkDataPropUrl + encodeURIComponent("電話番号")){ tmp_data["telnum"] = objValue; }else if(propValue == LinkDataPropUrl + encodeURIComponent("緯度")){ tmp_data["lat"] = objValue; }else if(propValue == LinkDataPropUrl + encodeURIComponent("経度")){ tmp_data["lng"] = objValue; }else if(propValue == LinkDataPropUrl + encodeURIComponent("開館時間")){ tmp_data["openHour"] = objValue; }else if(propValue == LinkDataPropUrl + encodeURIComponent("休館日")){ tmp_data["closeDay"] = objValue; } // console.log(tmp_data); }); }); tmp_a_data.push(tmp_data); }); }); }); //全データ all_data = tmp_a_data; //地図センター緯度経度の初期値は「福井市役所」 var myLatLng = new google.maps.LatLng(36.0640618,136.2195398); var myMap = new google.maps.Map(document.getElementById('result'), { zoom: 14, center: myLatLng, mapTypeId: google.maps.MapTypeId.ROADMAP, scaleControl: true, scrollwheel: true, draggable: true }); //ポイントの設定 var latlng; var data = new Array(); for (var i in all_data) { //避難所の種類で区分する var gmarker = new google.maps.Marker({ position: new google.maps.LatLng(all_data[i].lat,all_data[i].lng), title: all_data[i].name,// ツールチップ openInfo:true, //icon: 'https://mt.google.com/vt/icon/name=icons/onion/SHARED-mymaps-container_4x.png,icons/onion/1738-blank-sequence_4x.png&&highlight=0288D1,ff000000&scale=1.0&color=ffffffff&psize=15&text=' + i + '&font=fonts/Roboto-Medium.ttf', // icon: 'http://app.linkdata.org/asset/8cd9a87e.png', map: myMap, icon: { url: 'http://app.linkdata.org/asset/8cd9a87e.png', scaledSize : new google.maps.Size(40,40) } }); // ウィンドウに表示するデータをつくる var spot_info = '<B>[' + i + ']' + all_data[i].name + '</B><small>' + (all_data[i].address != undefined ? ('<br>【住所】' + all_data[i].address) : '<br>【住所】') + (all_data[i].telnum != undefined ? ('<br>【電話番号】' + all_data[i].telnum) : '<br>【電話番号】') + (all_data[i].openHour != undefined ? ('<br>【開館時間】' + all_data[i].openHour) : '<br>【開館時間】') + (all_data[i].closeDay != undefined ? ('<br>【休館日】' + all_data[i].closeDay) : '<br>【休館日】') + '<br><a href="https://www.city.fukui.lg.jp/index.html" target="_blank")><b>福井市ホームページ</b></a>' + '</small>'; data.push({ position: new google.maps.LatLng(all_data[i].lat, all_data[i].lng), content: spot_info }); // 地図上にウィンドウで表示 attachMessage(gmarker, data[i].content); console.log(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();}); };
<head> <meta name="viewport" content="user-scalable=yes"> </head> <style type="text/css"> html { height: 100% } body { height: 99%; width: 99%; margin: 1px; padding: 1px } #map_canvas { height: 100% } </style> <div id="result" style="width:100%; height:100%"></div>
Preview
Input Data
ReadMe
Snapshots
LinkData Work
Table Data
公共施設一覧
Contributor:福井市役所
Update:Apr 5, 2022
1413 Downloads, 1 Applications
福井市の公共施設一覧
fukuishishisetsu
Add LinkData work(LinkData)
Link http://app.linkdata.org/run/app1s1890i?tab=readme
https://maps.googleapis.com/maps/api/js?key=AIzaSyA6ZXodAAfMdbiDq9GqKowT7hMsKaNRPg8
jquery-1.11.2.min.js
Work
Add
Clear
insert work id or work name.