• forked:島根県温泉マップ
Import an externally hosted application
Check style

  • JavaScript
  • CSS
  • HTML
  • Images
  • Input Data
  • ReadMe
  • forked:島根県温泉マップ
  • jquery-1.7.1.min.js  
  • http://maps.googleapis.com/maps/api/js?sensor=false  
  •  
  • history

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
 
/*
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/rdf1s598i#address"){
                            tmp_data["address"] = objValue;
                        }else if(propValue == "http://www.w3.org/2000/01/rdf-schema#label1"){
                            tmp_data["label1"] = 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://purl.org/dc/terms/1.1/isPartOf"){
                            tmp_data["shokan"] = objValue;
                        */}else if(propValue == "http://www.w3.org/2000/01/rdf-schema#label2"){
                            tmp_data["label2"] = objValue;
                        }else if(propValue == "http://www.w3.org/2000/01/rdf-schema#label3"){
                            tmp_data["label3"] = objValue;
                        }else if(propValue == "http://www.w3.org/2000/01/rdf-schema#label4"){
                            tmp_data["label4"] = objValue;
                        }
                    });
                });
                tmp_a_data.push(tmp_data);
            });
        });
    });
    //全データ
    all_data = tmp_a_data;
    
    //全データを地図上に表示
 
    // 地図センター緯度経度の初期値は「横浜市役所」
    var latlng = new google.maps.LatLng(35.0956,132.345613);
    var myOptions = {
        zoom: 9,
        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].label;  
        data.push({position: new google.maps.LatLng(all_data[i].lat, all_data[i].longitude), content: '<small>[温泉名]</small>' + all_data[i].label1.fontcolor("blue") +'<br>'+ all_data[i].label2.fontcolor("Skyblue") +'<br>'+ '<small>[泉質]</small>' + all_data[i].label3.fontcolor("green") +'<br>'+ '<small>[効能]</small>' + all_data[i].label4.fontcolor("green")});
    };     
    // 地図上にウィンドウで表示
    for (i = 0; i < data.length; i++) {
         var marker = new google.maps.Marker({
            position: data[i].position,
            map: map
        });
        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();        
    }); 
};
 
jquery-1.7.1.min.js
http://maps.googleapis.com/maps/api/js?sensor=false
Playing...

jquery-1.7.1.min.js
http://maps.googleapis.com/maps/api/js?sensor=false