From 1f124a8a516795a0c46e94250623a92df47bc967 Mon Sep 17 00:00:00 2001 From: Billy R <119595254+billyulbi@users.noreply.github.com> Date: Thu, 9 Feb 2023 18:48:31 +0700 Subject: [PATCH 1/8] Create index.html --- endpoint/rpl/714222072/index.html | 1 + 1 file changed, 1 insertion(+) create mode 100644 endpoint/rpl/714222072/index.html diff --git a/endpoint/rpl/714222072/index.html b/endpoint/rpl/714222072/index.html new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/endpoint/rpl/714222072/index.html @@ -0,0 +1 @@ + From d23e79717935560b306731ddfc5b20ea5491273c Mon Sep 17 00:00:00 2001 From: Billy R <119595254+billyulbi@users.noreply.github.com> Date: Thu, 9 Feb 2023 21:20:48 +0700 Subject: [PATCH 2/8] Create script.js --- endpoint/rpl/714222072/script.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 endpoint/rpl/714222072/script.js diff --git a/endpoint/rpl/714222072/script.js b/endpoint/rpl/714222072/script.js new file mode 100644 index 0000000..1275b21 --- /dev/null +++ b/endpoint/rpl/714222072/script.js @@ -0,0 +1,20 @@ +var myHeaders = new Headers(); +myHeaders.append("Content-Type", "application/json"); + +var raw = JSON.stringify({ + "api-key": "Sa9Jtl0xGx9HnXnRV7ispcHOz9JdNEYD2rKVGNGICDRmvZqwX8HArSKO6EkAPlEm", + "long": 107.575902278736, + "lat": -6.8732786951873255 +}); + +var requestOptions = { + method: 'POST', + headers: myHeaders, + body: raw, + redirect: 'follow' +}; + +fetch("https://ap-southeast-1.aws.data.mongodb-api.com/app/application-0-mfpjl/endpoint/geojson", requestOptions) + .then(response => $('#result').html(response.text())) + .then(result => console.log(result)) + .catch(error => console.log('error', error)); From 8232f041acd8cac7a20cc1c047de91d954adbde5 Mon Sep 17 00:00:00 2001 From: Billy R <119595254+billyulbi@users.noreply.github.com> Date: Thu, 9 Feb 2023 21:22:52 +0700 Subject: [PATCH 3/8] Update script.js --- endpoint/rpl/714222072/script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/endpoint/rpl/714222072/script.js b/endpoint/rpl/714222072/script.js index 1275b21..ea99264 100644 --- a/endpoint/rpl/714222072/script.js +++ b/endpoint/rpl/714222072/script.js @@ -15,6 +15,6 @@ var requestOptions = { }; fetch("https://ap-southeast-1.aws.data.mongodb-api.com/app/application-0-mfpjl/endpoint/geojson", requestOptions) - .then(response => $('#result').html(response.text())) - .then(result => console.log(result)) + .then(response => response.text()) + .then(result => document.getElementById("result").innerHTML = result) .catch(error => console.log('error', error)); From 869d26ca36678ba7de26621867f8db50a5e8b9d8 Mon Sep 17 00:00:00 2001 From: Billy R <119595254+billyulbi@users.noreply.github.com> Date: Thu, 9 Feb 2023 21:23:42 +0700 Subject: [PATCH 4/8] Update script.js --- endpoint/rpl/714222072/script.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/endpoint/rpl/714222072/script.js b/endpoint/rpl/714222072/script.js index ea99264..25d66e7 100644 --- a/endpoint/rpl/714222072/script.js +++ b/endpoint/rpl/714222072/script.js @@ -1,10 +1,11 @@ +function cari(long, lat) { var myHeaders = new Headers(); myHeaders.append("Content-Type", "application/json"); var raw = JSON.stringify({ "api-key": "Sa9Jtl0xGx9HnXnRV7ispcHOz9JdNEYD2rKVGNGICDRmvZqwX8HArSKO6EkAPlEm", - "long": 107.575902278736, - "lat": -6.8732786951873255 + "long": long, + "lat": lat }); var requestOptions = { @@ -18,3 +19,5 @@ fetch("https://ap-southeast-1.aws.data.mongodb-api.com/app/application-0-mfpjl/e .then(response => response.text()) .then(result => document.getElementById("result").innerHTML = result) .catch(error => console.log('error', error)); + +} From 0b34d1587ed1ec3c4a17cbe06603637f6b36b6cf Mon Sep 17 00:00:00 2001 From: Billy R <119595254+billyulbi@users.noreply.github.com> Date: Thu, 9 Feb 2023 21:30:08 +0700 Subject: [PATCH 5/8] Update index.html --- endpoint/rpl/714222072/index.html | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/endpoint/rpl/714222072/index.html b/endpoint/rpl/714222072/index.html index 8b13789..2301d79 100644 --- a/endpoint/rpl/714222072/index.html +++ b/endpoint/rpl/714222072/index.html @@ -1 +1,15 @@ - + + + 714222072-Bernadus Billy Riantono-UAS-GIS-ULBI + + +
+ + + +
+
+
+ + + From 02ad250ce1745a353e607748ebb6d8c0e4e1dd50 Mon Sep 17 00:00:00 2001 From: Billy R <119595254+billyulbi@users.noreply.github.com> Date: Thu, 9 Feb 2023 21:32:03 +0700 Subject: [PATCH 6/8] Update script.js --- endpoint/rpl/714222072/script.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/endpoint/rpl/714222072/script.js b/endpoint/rpl/714222072/script.js index 25d66e7..7749899 100644 --- a/endpoint/rpl/714222072/script.js +++ b/endpoint/rpl/714222072/script.js @@ -1,11 +1,11 @@ -function cari(long, lat) { +function cari() { var myHeaders = new Headers(); myHeaders.append("Content-Type", "application/json"); var raw = JSON.stringify({ "api-key": "Sa9Jtl0xGx9HnXnRV7ispcHOz9JdNEYD2rKVGNGICDRmvZqwX8HArSKO6EkAPlEm", - "long": long, - "lat": lat + "long": document.getElementsByName("long").value, + "lat": document.getElementsByName("lat").value }); var requestOptions = { From 000d8085703bf8ab5126696762f604cac0cda498 Mon Sep 17 00:00:00 2001 From: Billy R <119595254+billyulbi@users.noreply.github.com> Date: Thu, 9 Feb 2023 21:35:05 +0700 Subject: [PATCH 7/8] Update script.js --- endpoint/rpl/714222072/script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/endpoint/rpl/714222072/script.js b/endpoint/rpl/714222072/script.js index 7749899..8ffbc8d 100644 --- a/endpoint/rpl/714222072/script.js +++ b/endpoint/rpl/714222072/script.js @@ -4,8 +4,8 @@ myHeaders.append("Content-Type", "application/json"); var raw = JSON.stringify({ "api-key": "Sa9Jtl0xGx9HnXnRV7ispcHOz9JdNEYD2rKVGNGICDRmvZqwX8HArSKO6EkAPlEm", - "long": document.getElementsByName("long").value, - "lat": document.getElementsByName("lat").value + "long": document.getElementsByName("long")[0].value, + "lat": document.getElementsByName("lat")[0].value }); var requestOptions = { From 236f551a0ba5e2750a978dbb31b1ff394ea9a0b3 Mon Sep 17 00:00:00 2001 From: Billy R <119595254+billyulbi@users.noreply.github.com> Date: Thu, 9 Feb 2023 21:36:18 +0700 Subject: [PATCH 8/8] Update script.js --- endpoint/rpl/714222072/script.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/endpoint/rpl/714222072/script.js b/endpoint/rpl/714222072/script.js index 8ffbc8d..6ffe23d 100644 --- a/endpoint/rpl/714222072/script.js +++ b/endpoint/rpl/714222072/script.js @@ -4,8 +4,8 @@ myHeaders.append("Content-Type", "application/json"); var raw = JSON.stringify({ "api-key": "Sa9Jtl0xGx9HnXnRV7ispcHOz9JdNEYD2rKVGNGICDRmvZqwX8HArSKO6EkAPlEm", - "long": document.getElementsByName("long")[0].value, - "lat": document.getElementsByName("lat")[0].value + "long": parseFloat(document.getElementsByName("long")[0].value), + "lat": parseFloat(document.getElementsByName("lat")[0].value) }); var requestOptions = {