I tried to get the location ref. using the published code and using bigdatacloud_reverse_geocode.min.js
<script>
/* 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) {
document.getElementById("json-result").innerHTML = rresult.localityInfo['administrative'][4].name;
});
/* Get the administrative location information using a set of known coordinates */
reverseGeocoder.getClientLocation({
latitude: 12.9716,
longitude: 77.5946,
}, function(result) {
document.getElementById("json-result").innerHTML = result.localityInfo['administrative'][4].name;
});
/* You can also set the locality language as needed */
reverseGeocoder.localityLanguage = 'en';
/* Request the current user's coordinates (requires HTTPS and acceptance of prompt) */
reverseGeocoder.getClientCoordinates(function(result) {
document.getElementById("json-result").innerHTML = result.localityInfo['administrative'][4].name;
});
/* document.getElementById("log").innerHTML = 5 + 6;*/
</script>
Thanks.