Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions endpoint/rpl/714222072/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<html>
<head>
<title>714222072-Bernadus Billy Riantono-UAS-GIS-ULBI</title>
</head>
<body>
<div id="form">
<input type="text" name="long" placeholder="Longitude"/>
<input type="text" name="lat" placeholder="Latitude"/>
<button type="button" onClick="cari();">Cari</button>
</div>
<div id="result">
</div>
<script src="script.js" type="text/javascript"></script>
</body>
</html>
23 changes: 23 additions & 0 deletions endpoint/rpl/714222072/script.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
function cari() {
var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
"api-key": "Sa9Jtl0xGx9HnXnRV7ispcHOz9JdNEYD2rKVGNGICDRmvZqwX8HArSKO6EkAPlEm",
"long": parseFloat(document.getElementsByName("long")[0].value),
"lat": parseFloat(document.getElementsByName("lat")[0].value)
});

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 => response.text())
.then(result => document.getElementById("result").innerHTML = result)
.catch(error => console.log('error', error));

}