forked from marshdugan/Season-All
-
Notifications
You must be signed in to change notification settings - Fork 0
/
getAPI.html
41 lines (36 loc) · 1.3 KB
/
getAPI.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h1>TEST</h1>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script type="text/javascript">
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function (position) {
var pos = {
lat: position.coords.latitude,
lng: position.coords.longitude
};
const queryURL = "https://www.hikingproject.com/data/get-trails?lat=" + pos.lat + "&lon=" + pos.lng + "&maxDistance=10&key=200706624-a0ce2059fccca3e98797fa8cdd9232f4"
$.ajax({
url: queryURL,
method: "GET",
}).then(function (response) {
console.log(response);
});
});
}
const plantURL = "https://cors-anywhere.herokuapp.com/https://trefle.io/api/species/?token=cENnQVVGbndtK0EvT0pMK1paMmN4dz09";
$.ajax({
url: plantURL,
method: "GET",
}).then(function (response) {
console.log(response);
});
</script>
</body>
</html>