C# sample for Google Geocoding API (JSON output)
1 |
<span style="color: #0000cc;"><code style="color: black;"><span style="color: blue; font-family: Georgia, Times New Roman, serif;"><br /></span></code></span> |
1 |
<span style="font-family: Georgia, Times New Roman, serif;"><b>C# Google geocoding API (JSON output) sample</b></span> |
1 |
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span> |
1 |
<span style="font-family: Georgia, Times New Roman, serif;"><br /></span> |
1 |
<span style="font-family: Times, Times New Roman, serif;"><strong style="color: #222222; line-height: 21px; white-space: normal;">Geocoding</strong><span style="color: #222222; line-height: 21px; white-space: normal;"> is the process of converting addresses (like "300 n state st chicago IL") into geographic coordinates (like latitude 37.423021 and longitude -122.083739), which you can use to place markers or position the map.</span></span> |
1 |
<span style="font-family: Times, Times New Roman, serif;"><span style="color: #222222; line-height: 21px; white-space: normal;"><br /></span></span> |
1 |
<span style="color: #222222; font-family: Times, Times New Roman, serif; line-height: 21px; white-space: normal;"><br /></span> |
1 |
<span style="color: #222222; font-family: Times, Times New Roman, serif; line-height: 21px; white-space: normal;"><br /></span> |
1 |
<span style="color: #222222; font-family: Times, Times New Roman, serif; line-height: 21px; white-space: normal;">The Google Geocoding API provides a direct way to access a these services via an HTTP request.</span> |
1 |
<span style="color: #222222; font-family: Times, Times New Roman, serif; line-height: 21px; white-space: normal;"><br /></span> |
1 |
<span style="color: #222222; font-family: Times, Times New Roman, serif; line-height: 21px; white-space: normal;"><br /></span> |
1 |
<span style="color: #222222; font-family: Times, Times New Roman, serif; line-height: 21px; white-space: normal;">This service is generally designed for geocoding static (known in advance) addresses for placement of application content on a map;</span> |
1 |
<span style="color: #222222; font-family: Times, Times New Roman, serif; line-height: 21px; white-space: normal;"><br /></span> |
1 |
<span style="color: #222222; font-family: Times, Times New Roman, serif; line-height: 21px; white-space: normal;"><br /></span> |
1 |
<span style="color: #222222; font-family: Times, Times New Roman, serif; line-height: 21px; white-space: normal;"><br /></span> |
1 |
<div style="border: 0px; color: #222222; line-height: 21px; margin-bottom: 1.5em; padding: 0px; vertical-align: baseline; white-space: normal;"><br /><span style="font-family: Times, Times New Roman, serif;">A Geocoding API request must be of the following form:</span></div><br /><pre style="background-color: #fafafa; border: 1px solid rgb(187, 187, 187); color: #007000; line-height: 1.5; margin-bottom: 1.5em; margin-top: 1.5em; overflow: auto; padding: 6px 10px; vertical-align: baseline;"><span style="font-family: inherit;">http://maps.googleapis.com/maps/api/geocode/<i>output</i>?<i>parameters</i><br /></span> |
where output may be either of the following values: json (recommended) indicates output in JavaScript Object Notation (JSON) xml indicates output as XML Required parameters address — The address that you want to geocode. or latlng — The textual latitude/longitude value for which you wish to obtain the closest, human-readable address. sensor — Indicates whether or not the geocoding request comes… Read More »