toddpotter
asked on
Visual Studio .net asp Google Maps API
I need help with the Google Maps API and extracting Geocodes.
In Visual Studio. net (asp.net) when a user presses a button I want to be able to:
Pull addresses from a SQL table that have null Longitude or Latitude ('Lat' and 'Lng' fields), pass the address information (Address, City, State, Zip) to the Google API, retrieve the Longitude and Latitude, then update the orginal SQL table fields 'Lat' and 'Lng'.
Thank you in advance for your help.
In Visual Studio. net (asp.net) when a user presses a button I want to be able to:
Pull addresses from a SQL table that have null Longitude or Latitude ('Lat' and 'Lng' fields), pass the address information (Address, City, State, Zip) to the Google API, retrieve the Longitude and Latitude, then update the orginal SQL table fields 'Lat' and 'Lng'.
Thank you in advance for your help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I see the examples, but I am not well experienced on the asp.net side of Visual Studio (I am a beginner); I need more help. Could you provide me with more in depth info and what code goes in which section.
For example - I currently have the following:
A form "admin/GeoCode.aspx" which has a button "Geocode Data"
On the "admin/GeoCode.aspx.vb" page I assume I would fill the datatable with addresses and cycle through the table.
I have a class called "GeoCoding.vb" where I would assume that I need to pass the address data from the "admin/GeoCode.aspx.vb" page to the API and return the longitude and latitude back to the datatable (I need help on the code here to pull out the geocode information and return it to the admin/GeoCode.aspx.vb page to update the datatable).
Also, which references do I need? How do I import for jquery, java, json etc?
Thanks
For example - I currently have the following:
A form "admin/GeoCode.aspx" which has a button "Geocode Data"
On the "admin/GeoCode.aspx.vb" page I assume I would fill the datatable with addresses and cycle through the table.
I have a class called "GeoCoding.vb" where I would assume that I need to pass the address data from the "admin/GeoCode.aspx.vb" page to the API and return the longitude and latitude back to the datatable (I need help on the code here to pull out the geocode information and return it to the admin/GeoCode.aspx.vb page to update the datatable).
Also, which references do I need? How do I import for jquery, java, json etc?
Thanks
in that, use GoogleMaps Geocoding API to get LatLng details for a given address
have a look on the below link for the service URL and the examples
https://developers.google.com/maps/documentation/geocoding/
call the service URL with the updated address and then parse the response to get the LatLng values.