Currently, I am in search of the latitude and longitude coordinates for a specific address input by the user. Upon clicking a button, the script provided below is triggered to display an alert with the latitude and longitude values:
<script type="text/javascript" src="http://maps.google.com/maps/api/js?v=3&sensor=false&key=AIzaSyDVk87DSFyZlxmYAM8NPNr8sZPN60FYLNA"></script>
<script type="text/javascript">
function calculateCoordinates() {
// Retrieving elements from the HTML document
}
</script>
<asp:TextBox id="txtLatitude" runat="server" Width="100px"></asp:TextBox>
<asp:TextBox id="txtLongitude" runat="server" Width="100px"></asp:TextBox>
The functionality works smoothly at present, but I have two main requirements: 1. Instead of using a textarea, I need to utilize a Label element as the address will be fetched from a database. 2. The latitude and longitude values should be passed to labels within the code so that I can later save them in the database.
Is there a way to achieve this within the current setup, or are there simpler alternatives available?