• forked:toinav - nagano pref
Import an externally hosted application
Check style

  • JavaScript
  • CSS
  • HTML
  • Images
  • Input Data
  • ReadMe
  • forked:toinav - nagano pref
  • jquery-1.11.2.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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
 
var all_data; 
var markFLG = 0;
var currentInfoWindow = null;   //最後に開いた情報ウィンドウを記憶
var currentMarker = null;   //最後に開いたマカーを記憶
 
function initialize(){
    
    // 1.データをLinkDataから取得
    all_data = new Array();
    work_data = new Array();
    $.each(LinkData.getWorks(), function(workKey, workValue) {
//      $("#result").append("<h3>workValue: " + workValue + "</h3>");
        $.each(LinkData.getFiles(workValue), function(fileKey, fileValue) {
//          $("#result").append("<h3>fileValue: " + fileValue + "</h3>");
            $.each(LinkData.getSubjects(workValue, fileValue), function(subjKey, subjValue) {
                
//              $("#result").append("<h3>subjValue: " + subjValue + "</h3>");
                
                var tmp_data = {}
                tmp_data["id"] = subjValue;
                $.each(LinkData.getProperties(workValue, fileValue), function(propKey, propValue) {
                    
//                  $("#result").append("<h3>propValue: " + propValue + "</h3>");
                    
                    $.each(LinkData.getObjects(workValue, fileValue, subjValue, propValue), function(objKey, objValue) {
                        
//                      $("#result").append("<h3>objValue: " + objValue + "</h3>");
                        
                        if(propValue == "http://purl.org/dc/elements/1.1/description"){
                            tmp_data["description"] = 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/rdf1s2662i#%E6%B4%8B%E5%BC%8F"){
                            tmp_data["yousiki"] = objValue;
                        }else if(propValue == "http://linkdata.org/property/rdf1s2662i#%E3%83%A9%E3%83%B3%E3%82%AF"){
                            tmp_data["rank"] = objValue;
                        }else if(propValue == "http://www.w3.org/2000/01/rdf-schema#label"){
                            tmp_data["label"] = objValue;
                        }
                    });
                });
                work_data.push(tmp_data);
            });
        });
    });
    //全データ
    all_data = work_data;
    //for (var i in all_data){ 
    //$("#result").append("<h3>all_data: " + all_data[i].description + "</h3>");
    //}
    
    // 2.取得した情報を地図に表示
    
    // 中心の初期値:「長野県庁」
    var latlng = new google.maps.LatLng(36.649231, 138.182394);
    
    var myOptions = {
        zoom: 15,
        center: latlng,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    // htmlに地図描画
    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: '<h4>' + all_data[i].label +'</h4>' + '<br>' + '洋式:' + all_data[i].yousiki + '<br><small>' + '設備:' + all_data[i].description +'</small>',rank:all_data[i].rank});
    };     
 
    // 地図上にウィンドウで表示
    for (i = 0; i < data.length; i++) {
        //マーカーの配置
         var marker = new google.maps.Marker({
            position: data[i].position,
            animation: google.maps.Animation.DROP,
             //ピンにランクを表示
            //icon: "http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=" + data[i].rank + "|66FFFF|000000",
            icon: "http://chart.apis.google.com/chart?chst=d_map_xpin_icon&chld=pin|glyphish_walk|99FFFF",
             //ピンを吹き出し表示
             //icon:"https://chart.googleapis.com/chart?chst=d_bubble_icon_text_small&chld=wc-male|bb|" + data[i].rank + "|FFFFFF|000000",
            map: map
        });
        //情報ウインドウの設定
        attachMessage(marker, data[i].content);
    };
 
};
 
// マーカーをクリックするとウィンドウを表示する処理
function attachMessage(marker, msg) {
    google.maps.event.addListener(marker, 'click', function(event) {
        infowindow = new google.maps.InfoWindow({
            content: msg
        });
        
jquery-1.11.2.min.js
http://maps.googleapis.com/maps/api/js?sensor=false
Playing...

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