• forked:Moricoro Park Summer Festival 2014 Guide App
Import an externally hosted application
Check style

  • JavaScript
  • CSS
  • HTML
  • Images
  • Input Data
  • ReadMe
  • forked:Moricoro Park Summer Festival 2014 Guide App
  • jquery-1.7.1.min.js  
  • http://code.jquery.com/jquery-1.11.1.min.js  
  • http://code.jquery.com/mobile/1.4.3/jquery.mobile-1.4.3.min.js  
  • https://maps.googleapis.com/maps/api/js?v=3.exp  
  •  
  • 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
 
/*
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. 
*/
 
 
// グローバル変数
eventlist_data  = new Array();  // イベントリスト
genre_data      = new Array();  // イベントジャンルリスト
spot_data       = new Array();  // スポットリスト 
eventtime_data  = new Array();  // イベントタイムテーブル
 
stop_data       = new Array();  // バス停リスト
week_data       = new Array();  // 平日時刻表
holi_data       = new Array();  // 休日時刻表
 
var user_lat    = '';           // ユーザの緯度
var user_lng    = '';           // ユーザの経度
var sel_spot_id = null;
var map;                        
var currentWindow = null;       // 表示中のinfoWindow
 
// ページが表示されたときに関数を呼び出す
$('#list').bind('pageshow',checkChoice);
$('#detail').bind('pageshow',detailMapCanvas);
$('#map').bind('pageshow',mapCanvas);
$('#bus').bind('pageshow',busMapCanvas);
 
// 画面起動時の関数
window.onload = function() {
    initialize();
    //ユーザーの現在の位置情報を取得
    navigator.geolocation.getCurrentPosition(successCallback, errorCallback);
}
 
// 初期化の関数
function initialize(){
    //現在地の取得
    getGeoLocation();
    // LinkDataからデータの読み込み
    loadData();
    // バス停情報のロード
    loadBusStopData();
}
 
//######################################################################################################################################
//  地図関連
//######################################################################################################################################
 
//--------------------------------------
//  位置情報関連
//--------------------------------------
 
// 位置情報の取得
function getGeoLocation(){
    
    // HTML5 geolocation 機能で現在地を取得
    if(navigator.geolocation) {
        navigator.geolocation.getCurrentPosition(function(position) {
            // ユーザの現在位置を取得
            user_lat = position.coords.latitude; user_lng = position.coords.longitude;  // オリジナル
            //user_lat = 35.177541; user_lng = 137.087564;                              // 公園駅
            //user_lat = 35.173806; user_lng = 137.089160;                              // プール
            //user_lat = 35.168942; user_lng = 137.092158;                              // 展望塔
            //user_lat = 35.182279; user_lng = 137.021347;                              // 藤が丘駅
            //user_lat = 35.154545; user_lng = 136.961582;                              // 名大
            var user_pos = new google.maps.LatLng(user_lat, user_lng);
            
        }, function() {
            handleNoGeolocation(true);
        });
    } else {
        // ブラウザがGeolocationをサポートしていない
        handleNoGeolocation(false);
    }
    
}
 
// 位置情報取得のエラー処理
function handleNoGeolocation(errorFlag) {
    if (errorFlag) {
        var content = '位置情報が取得できませんでした';
    } else {
        var content = 'ブラウザが位置情報機能に対応していません';
    }
    alert(content);
}
 
 
// 測地線航海算法の公式
function geoDistance(lat1, lng1, lat2, lng2, precision) {
  // 引数 precision は小数点以下の桁数(距離の精度)
  var distance = 0;
  if ((Math.abs(lat1 - lat2) < 0.00001) && (Math.abs(lng1 - lng2) < 0.00001)) {
    distance = 0;
  } else {
    lat1 = lat1 * Math.PI / 180;
    lng1 = lng1 * Math.PI / 180;
    lat2 = lat2 * Math.PI / 180;
jquery-1.7.1.min.js
http://code.jquery.com/jquery-1.11.1.min.js
http://code.jquery.com/mobile/1.4.3/jquery.mobile-1.4.3.min.js
https://maps.googleapis.com/maps/api/js?v=3.exp
Playing...

jquery-1.7.1.min.js
http://code.jquery.com/jquery-1.11.1.min.js
http://code.jquery.com/mobile/1.4.3/jquery.mobile-1.4.3.min.js
https://maps.googleapis.com/maps/api/js?v=3.exp