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

  • Home
  • SEARCH
  • 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 4530668
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T13:49:32+00:00 2026-05-21T13:49:32+00:00

I would like my user to be able to select a place on a

  • 0

I would like my user to be able to select a place on a map and return me the lat and lon which can be uploaded to a database. Any help would be appreciated

  • 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-21T13:49:33+00:00Added an answer on May 21, 2026 at 1:49 pm

    Because you are dealing with Google Maps API (based on your question’s tag), I guess taking taking advantage of the in-built API capabilities in JavaScript might help. You can go over to this place to get started learning JavaScript, you will,then read the API here, and finally will be able to post a form using JavaScript whose values have been auto-set by the JavaScript with the latitude and longitude of the point the user clicked on the map.

    Here is a bit of what you might have to do, but you might need to learn some JavaScript to extend it or use it effectively:

    var map = new GMap2(document.getElementById("map_canvas"));
    
    map.setCenter(new GLatLng(37.4419, -122.1419), 13);
    
    GEvent.addListener(map,"click", function(overlay, latlng) {     
      if (latlng) { 
        alert("Latitude : " + latlng.lat() + " , Longitude: " + latlng.lng() );
      }
    });
    

    So, assuming you create a simple html page with a form to hold the latitude and longitude like this:

    <form action="some_server_side_script_or_path" method="POST" id="map_form">
     <!-- display the map -->
     <div id="map_canvas"></div>
     <label for="mlatitude">Male</label>
      <input type="text" name="mlatitude" id="mlatitude" readonly="readonly"/>
      <br />
    <label for="mlongitude">Male</label>
      <input type="text" name="mlongitude" id="mlongitude" readonly="readonly"/>
      <br />
    <input type="submit" value="Submit Location" />
    </form>
    

    Then, by modfying our clik-handler like this, we can auto-set the latitude and longitude on the form, and then have the user simply click submit to post the values to the server.

    GEvent.addListener(map,"click", function(overlay, latlng) {     
      if (latlng) { 
        var lat = document.getElementById("mlatitude");
        var lng = document.getElementById("mlongitude");
        lat.value = latlng.lat();
        lng.value = latlng.lng();
        //at this point, you can even use Javascript to auto-submit the form using
        //document.forms["map_form"].submit();
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to intercept any URL which the user enters in their browser
I need a user to be able to enter a URL, and would like
I'm embedding a Flash video into an HTML and would like the user to
Has anyone used delegates with exchnage web services? I would like one user to
We would like to have user defined formulas in our c++ program. e.g. The
I would like to save data in cookies (user name, email address, etc...) but
I would like to add graphing to my User Controls in ASP.NET MVC. I
I would like to allow the logged user to edit MediaWiki/Common.css without adding them
I would like to implement the method User.calculate_hashed_password . I'm trying to use the
I would like to write this as a user defined function: private double Score(Story

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.