Serverside geocoding using Google's geocoding service.

Namespace: Reimers.Google.Map.Geocoding
Assembly: Reimers.Google.Map (in Reimers.Google.Map.dll) Version: 5.3.95.699 (5.3.95.699)

Syntax

C#
[SerializableAttribute]
public class GoogleGeocoder : IGeocoder

Remarks

Google only provides geocoding for a limited amount of countries.

Examples

The following code show how to get directions from a geocoder and display the returned routes on the map as polylines.

The code assumes that a map has been created with "map" as the ID.

CopyC#
var geocoder = new GoogleGeocoder();
var result = geocoder.GetDirections("Bratislava, Slovakia", "Trnava, Slovakia");
if (result.Status == GeocodeStatus.OK && result.Directions != null)
{
    foreach (var routeLine in result.Directions.Routes.Select(route => new Polyline(route)))
    {
        map.Overlays.Add(routeLine);
    }
}

Inheritance Hierarchy

System..::..Object
  Reimers.Google.Map.Geocoding..::..GoogleGeocoder

See Also