Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Only Known Long/Lat reverse code working #1

Open
incidentally opened this issue Jun 13, 2021 · 0 comments
Open

Only Known Long/Lat reverse code working #1

incidentally opened this issue Jun 13, 2021 · 0 comments

Comments

@incidentally
Copy link

incidentally commented Jun 13, 2021

Hi There,

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>

This returns 'Bengaluru' which is correct.

But, during my testing (and located in New Delhi), it does not work even after 'accepting' the location permissions.

Could you check, to view please visit Incidental app and you could see the location below the yellow divider.
Screenshot 2021-06-13 at 10 35 18 AM

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant