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 3676774
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T03:08:25+00:00 2026-05-19T03:08:25+00:00

few month ago i write something to get the latitude or longitude from google

  • 0

few month ago i write something to get the latitude or longitude from google API. latter i get the database from drupal for latitude or longitude to most of city in worlds.

but the problem is that the same city name can be found two or more times in a area. like Firozabad in India and bangladesh both. Agra in UP and agar in Rajasthan.

means the confusion in name by user if they found two city by same name they are confused.

i hear that HTML 5 support latitude or longitude of the visiter but i need latitude or longitude where they are born or city they want to use to fill a form.

how i can get the latitude or longtiude from API like google and some other.

the process is that:

user put the location in textbox for getting their latitude or longitude.

for right thing i want to show them all location [if same thing found more then one].

they can choose the right location and after click they can get the lati and langitude.

how i can do this using any API.

  • 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-05-19T03:08:26+00:00Added an answer on May 19, 2026 at 3:08 am

    If I understood you correctly then here’s a Javascript function that returns a list of actual locations based on the address (full or partial) that user has entered:

    getLocationsByAddress = function(address, onComplete) {
        var geocoder = null;
        var locations = [];
        var location = null;
    
        geocoder = new GClientGeocoder();
        geocoder.getLocations(address, function(response) {
            if (!response || response.Status.code != 200) {
                if (typeof (onComplete) != 'undefined') {
                    onComplete([]);
                }
            } else {
                for (var i = 0; i < response.Placemark.length; i++) {
                    location = response.Placemark[i];
                    locations[locations.length] = {
                        address: location.address,
                        x: location.Point.coordinates[1],
                        y: location.Point.coordinates[0],
                        zoom: 14
                    }
                }
    
                if (typeof (onComplete) != 'undefined') {
                    onComplete(locations);
                }
            }
        });
    }
    

    The code uses API version 2 but I think it should be fairly easy to make it work with V3 (please see this API reference for details).

    UPDATE

    As @Maxym stated the V2 API is considered as deprecated and therefore shouldn’t be used any further.

    Take a look at this jQuery plugin. It claims to work with both V2 and V3 so you may want to examine the source code in order to find out how they do an it with V3.

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

Sidebar

Related Questions

From few months ago when i was using twitter, i was able to send
I am new to programming (learned how to write apps a few months ago)
Few times ago, I asked how to do to display data per month, I
A few months ago I built some online samples like this one from Jeff
A few month ago I was reading somewhere that if you re-encrypt an encrypted
A few months ago I had to write a small tool to program the
I had installed VS2008 and VS2008SP1 on my machine a few month ago and
Few months ago, I have came across a Silverlight tutorial of Eric Cartman (South
A few months ago I was introduced to the new DateTimeOffset type and was
A few months ago, I was working on a PHP project in Aptana Studio.

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.