diff --git a/koki/koryo.js b/koki/koryo.js index 5fcea35..03b6664 100644 --- a/koki/koryo.js +++ b/koki/koryo.js @@ -24,10 +24,11 @@ let img = []; for (var x = 0; x<2;x++){ titen[x] = L.latLng(point[x]); - marker[x] = L.marker(point[x]); - group[x] = L.layerGroup(marker[x]); - group[x].addTo(mymap); + marker[x] = L.marker(titen[x]); }; + + group = L.layerGroup(marker); + group.addTo(mymap); function stopGPS() { @@ -54,7 +55,7 @@ "ここは lat="+latlng.lat+", lng="+latlng.lng+"です" ).openPopup(); for (var i = 0; i < 2; i++) { - if (latlng.distanceTo(point[i]) < 30) { + if (latlng.distanceTo(titen[i]) < 30) { if (!judge[i]){ judge[i] = true; alert("スタンプゲット!!"); @@ -85,7 +86,7 @@ ).openPopup(); } for (var i = 0; i < 2; i++) { - if (latlng.distanceTo(point[i]) < 30) { + if (latlng.distanceTo(titen[i]) < 30) { if (!judge[i]){ judge[i] = true; alert("スタンプゲット!!");