<!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>
<script src="https://cdn.jsdelivr.net/gh/bigdatacloudapi/js-reverse-geocode-client@latest/bigdatacloud_reverse_geocode.min.js" type="text/javascript"></script>
<script type="text/javascript">
/* Initialise Reverse Geocode API Client */
var reverseGeocoder=new BDCReverseGeocode();
/* Get the current user's location information, based on the coordinates provided by their browser */
/* Fetching coordinates requires the user to be accessing your page over HTTPS and to allow the location prompt. */
reverseGeocoder.getClientLocation(function(result) {
console.log(result);
});
/* Get the administrative location information using a set of known coordinates */
reverseGeocoder.getClientLocation({
latitude: -33.8688,
longitude: 151.2093,
},function(result) {
console.log(result);
});
/* You can also set the locality language as needed */
reverseGeocoder.localityLanguage='vi';
/* Request the current user's coordinates (requires HTTPS and acceptance of prompt) */
reverseGeocoder.getClientCoordinates(function(result) {
console.log(result);
});
</script>
</body>
</html>