var all_data;
function initialize(){
all_data = new Array();
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/rdf1s2434i#" + 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/rdf1s2434i#" + encodeURIComponent("発見日")){
tmp_data["location"] = objValue;
}else if(propValue == "http://linkdata.org/property/rdf1s2079i#" + encodeURIComponent("分類")){
tmp_data["genre"] = objValue;
}else if(propValue == "http://linkdata.org/property/rdf1s2079i#" + encodeURIComponent("体育館等収容人数")){
tmp_data["capacity"] = objValue;
}else if(propValue == "http://linkdata.org/property/rdf1s2079i#" + encodeURIComponent("対象地域")){
tmp_data["area"] = objValue;
}
});
});
tmp_a_data.push(tmp_data);
});
});
});
all_data = tmp_a_data;
var myLatLng = new google.maps.LatLng(34.756917,134.841278);
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,
};
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
};
var gmarker = new google.maps.Marker({
position: latlng,
title: all_data[i].name ,
icon: "http://takano01.sub.jp/takano/linkdata/pic/public_hall_map_pic.png",
map: myMap
});
}
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>【URL】' + all_data[i].capacity +'<br>【アクセス】' + all_data[i].area + '</small>'});