質問編集履歴
1
修正点の追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -28,13 +28,23 @@
|
|
28
28
|
|
29
29
|
|
30
30
|
|
31
|
+
// 追記
|
32
|
+
|
33
|
+
具体的には、jQueryを利用しているので[jQuery throttle / debounce](http://benalman.com/projects/jquery-throttle-debounce-plugin/)を利用しました。
|
34
|
+
|
35
|
+
以下修正したコードです。
|
36
|
+
|
37
|
+
|
38
|
+
|
31
39
|
```JavaScriot
|
32
40
|
|
33
41
|
// プログラムのソース
|
34
42
|
|
35
43
|
id = navigator.geolocation.watchPosition(
|
36
44
|
|
45
|
+
$.throttle(3000, updateLocation), // 3秒毎にAPIを叩く
|
46
|
+
|
37
|
-
|
47
|
+
failedGeolocation, {
|
38
48
|
|
39
49
|
enableHighAccuracy: true,
|
40
50
|
|