• forked:スタンプラリー@京都が出てくる本のデータ
Import an externally hosted application
Check style

  • JavaScript
  • CSS
  • HTML
  • Images
  • Input Data
  • ReadMe
  • forked:スタンプラリー@京都が出てくる本のデータ
  • https://maps.googleapis.com/maps/api/js?v=3.exp  
  • http://code.jquery.com/jquery-1.10.2.min.js  
  •  
  • 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
 
// Created by Tetsuro Toyoda Ver. 2015.01.22.2
var stampUrl = "http://app.linkdata.org/asset/4b2b5bcf.png";//スタンプの画像です。好きなものに変えてください
var circle = 200;// 目的地点との距離がこのメートル以下になればスタンプを押せます
var ageofstamp = 365; //この日数が経過するとスタンプはリセットされます
var nameToShow = "title" // ツイッターでシェアする際に、このプロパティの値を地点の名前としてツイッターに挿入します。省略(ヌル文字列)すればサブジェクト名が選択されます
var currlat = null; //現在地点の緯度
var currlong = null; //現在地点の経度
var destlat = null; //目的地の緯度
var destlong = null; //目的地の経度
var points = new Array(); // スタンプのある地点のリスト
var timerid; // 現在地点を定期的に観測するためのタイマー
var lastTimeOfSuccess =""; // 前回現在位置を取得するのに成功した時刻
var timerInterval = 10;//位置情報を取得する間隔(秒単位)
var displayMode = "allLoc"; // 表示モード
var map = null; // 現在地の情報を表示するマップ
var mapCircle = null;//目的地のサークル群
var mapCircleIsStamped = null;//サークルがスタンプされていればtrue
var currPosMarker = null;// 現在位置を表すマーカー
var directionsService = null;
var directionsDisplay = null;
var travelMode = ['NOTHING','WALKING','DRIVING'];
var travelModeJ = ['解除','徒歩','自動車'];
var travelIndex = 0;
var destinationURI = "";
var destButtonCaption = ['目的地に設定する','目的地設定を解除する'];
var debug = false; // デバッグ時にtrueでタイマーをオフにできる
 
function setDestination( i )
{
    var eid = 'destroutemap'+i.toString(10);
    document.getElementById('destroutebutton'+i.toString(10)).value = destButtonCaption[1];
    destinationURI = points[i][5];
    travelIndex = 1;
    curLoc();
}
 
window.onload = onload();
function onload() { 
    init();
    destinationURI = getParameterFromURL( "subject" );
    if ( destinationURI == "" )
        allLoc();
    else
    for ( i = 0; i < points.length; i++ )
    {
        if ( points[i][5] == destinationURI )
        {
            $("#result").append("<br><br>↓このボタンを押して目的地を指定してください");
            showAPoint(i,points[i]);
            $("#result").append("<br><hr><input type='button' value='ルール説明を見る' onclick='allLoc()'/>");
            $("#currInfo").hide();
            $("#map-canvas").hide();
        }
    }
}
 
function checkStamp()
{
        sortPoints();
        if ( points[0][6] < circle )
        {
            if ( mapCircleIsStamped[[points[0][5]]] == false ) // 近くのサークルのスタンプが押されていない!
            {
                $("#result").append("<font color='red'><b>"+points[0][4]+"のスタンプを入手しました!</b></font>");
                stampData();
                updateCircles();
            }
        }   
}
 
function showAPoint(i,p)
{
            $("#result").append("<hr>");
            if ( p[1] != null && p[2] != null ) // 緯度経度がある地点には目的地設定ボタンをつける
            {
                $("#result").append("<input id='destroutebutton"+i+"' type='button' value='"+destButtonCaption[0]+"' onclick='setDestination("+i+")'/>");
//              $("#result").append("<div id='destroutemap"+i+"'></div>");
            }
            $("#result").append(p[0]);
}
 
function displayData()
{
    if ( displayMode == "curLoc" )
    {
        $("#currInfo").show();
        $("#map-canvas").show();
        if ( map != null )
            google.maps.event.trigger(map, 'resize');
        sortPoints();
        $("#result").empty();
        $("#result").append("現在地を表示します<br>");
        checkStamp();
    }
    else
    {
        $("#currInfo").hide();
        $("#map-canvas").hide();
    }
    if ( displayMode == "allLoc" )
https://maps.googleapis.com/maps/api/js?v=3.exp
http://code.jquery.com/jquery-1.10.2.min.js
Playing...

https://maps.googleapis.com/maps/api/js?v=3.exp
http://code.jquery.com/jquery-1.10.2.min.js