Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8553699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T14:42:46+00:00 2026-06-11T14:42:46+00:00

I have written a JavaScript to get user geolocation. It gives me latitude and

  • 0

I have written a JavaScript to get user geolocation. It gives me latitude and longitude and according to that I have plot user location in map, but when I check that location latitude and longitude in Google map it’s different so that it plot me wrong place.

function map()
{
    if (navigator.geolocation) {
        browserSupportFlag = true;
        navigator.geolocation.getCurrentPosition(function (position) {
            initialize(position.coords.latitude,position.coords.longitude);
        }, function () {
            handleNoGeolocation(browserSupportFlag);
        });
    } else {
        browserSupportFlag = false;
        handleNoGeolocation(browserSupportFlag);
}

Please let me know how I can get accurate latitude and longitude by using navigator.geolocation.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T14:42:47+00:00Added an answer on June 11, 2026 at 2:42 pm

    The Geolocation feature works by using geographical location information available through various sources used depending on the device. This includes satellite data, radio tracking devices, Internet hardware as well as wireless communication equipment.
    More precisely the system makes use of GPS, RFID, IP address, Wi-Fi and Bluetooth Mac IDs or mobile phone towers and handset IDs. So, if you are trying on browser then that would depend on the browser and its settings. It might use GPS, WLAN AP-based location, IP location, or any other conceivable method of locating itself.

    The browser runs on your local machine, so even if you’re behind a proxy, it should be able to find your actual IP address (unless security features prevent it from being sent for lookup to a geolocation server).
    else
    if you are trying on mobile device with gps turned on then it should provide results with good accuracy as from my past experience with geolocation api

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Popup button written in JavaScript. When user clicks that button, it
I have written a javascript function that uses setInterval to manipulate a string every
In testing document.location.href, I have observed that when the user initiates an action that
I have written some JavaScript code that will read from the Google Maps API
I have a control that i've written that has a javascript component and a
I have written a simple Javascript function (curteousy of codecall.net ) that creates a
Scenario: I have written an MVC wizard that automatically uses ajax if javascript is
I have written the following Javascript code : var outerFrame = document.getElementById(myframe); var outerDoc
I have written this code in JavaScript and works perfectly fine when I include
I have written this code in javascript however I have to make it work

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.