PageSourceSearch

https://www.kumon.ne.jp/enter/search/lib/get_classroom_by_gps.js

js kumon.ne.jp collected 2026-10-02 03:03:38 UTC 2,194 bytes, 64 lines download raw bytes

1    function call_gps(classroomType) {
2        // GPS機能の利用可否チェック
3        if (!navigator.geolocation) {
4            alert('GPS機能をご利用になることができません。');
5            return false;
6        }
7
8        // 教室検索のタイプを設定
9        if (typeof classroomType === 'undefined') {
10            classroomType = 'classroom_normal';
11        }
12        switch (classroomType) {
13            case 'classroom_normal':
14            case 'classroom_baby_kumon':
15                break;
16            default:
17                classroomType = 'classroom_normal';
18                break;
19        }
20
21        // GPS機能の使用
22        navigator.geolocation.getCurrentPosition(function (position) {
23            var lat = position.coords.latitude; // 緯度
24            var lng = position.coords.longitude; // 経度
25
26            // 緯度変換
27            var latConverted = (lat + lat * 0.00010696 - lng * 0.000017467 - 0.0046020 ) * 3600;
28            // 経度変換
29            var lngConverted = (lng + lat * 0.000046047 + lng * 0.000083049 - 0.010041) * 3600;
30
31            // 地図URL
32            var redirect_url  = '/enter/search/classroom_map.php'
33                    + '?classroom_type=' + classroomType
34                    + '&x=' + lngConverted
35                    + '&y=' + latConverted
36                    + '&gps=1';
37            // リダイレクト
38            location.href = redirect_url;
39
40            return false;
41        }, function (err) {
42            switch (err.code) {
43                case 1:
44                    msg = '位置情報の利用が許可されていません';
45                    break;
46                case 2:
47                    msg = 'デバイスの位置が判定できません';
48                    break;
49                case 3:
50                    msg = 'タイムアウトしました';
51                    break;
52                default:
53                    msg = '';
54                    break;
55            }
56            if (msg != '') {
57                alert(msg);
58            }
59            return false;
60        }, {
61            enableHighAccuracy: true
62            , maximumAge: 0
63        });
64    }

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.