I copy-pasted the example, but removed the API_KEY as google allows a couple of hits without API.
IGeocoder geocoder = new GoogleGeocoder(); IEnumerable<Address> addresses = await geocoder.GeocodeAsync("1600 pennsylvania ave washington dc"); Console.WriteLine("Formatted: " + addresses.First().FormattedAddress); //Formatted: 1600 Pennsylvania Ave SE, Washington, DC 20003, USA Console.WriteLine("Coordinates: " + addresses.First().Coordinates.Latitude + ", " + addresses.First().Coordinates.Longitude); //Coordinates: 38.8791981, -76.9818437
I'm getting an Exception thrown :
XmlException: 'sans-serif' is an unexpected token. The expected token is '"' or '''. Line 1, position 253.
This exception was originally thrown at this call stack: System.Xml.XmlTextReaderImpl.Throw(System.Exception) System.Xml.XmlTextReaderImpl.Throw(string, string[]) System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(string, string) System.Xml.XmlTextReaderImpl.ParseAttributes() System.Xml.XmlTextReaderImpl.ParseElement() System.Xml.XmlTextReaderImpl.ParseElementContent() System.Xml.XmlTextReaderImpl.Read() System.Xml.XPath.XPathDocument.LoadFromReader(System.Xml.XmlReader, System.Xml.XmlSpace) System.Xml.XPath.XPathDocument.XPathDocument(System.IO.Stream) Geocoding.Google.GoogleGeocoder.LoadXmlResponse(System.Net.Http.HttpResponseMessage) ... [Call Stack Truncated]
Hello,
I copy-pasted the example, but removed the API_KEY as google allows a couple of hits without API.
IGeocoder geocoder = new GoogleGeocoder(); IEnumerable<Address> addresses = await geocoder.GeocodeAsync("1600 pennsylvania ave washington dc"); Console.WriteLine("Formatted: " + addresses.First().FormattedAddress); //Formatted: 1600 Pennsylvania Ave SE, Washington, DC 20003, USA Console.WriteLine("Coordinates: " + addresses.First().Coordinates.Latitude + ", " + addresses.First().Coordinates.Longitude); //Coordinates: 38.8791981, -76.9818437
I'm getting an Exception thrown :
XmlException: 'sans-serif' is an unexpected token. The expected token is '"' or '''. Line 1, position 253.
This exception was originally thrown at this call stack: System.Xml.XmlTextReaderImpl.Throw(System.Exception) System.Xml.XmlTextReaderImpl.Throw(string, string[]) System.Xml.XmlTextReaderImpl.ThrowUnexpectedToken(string, string) System.Xml.XmlTextReaderImpl.ParseAttributes() System.Xml.XmlTextReaderImpl.ParseElement() System.Xml.XmlTextReaderImpl.ParseElementContent() System.Xml.XmlTextReaderImpl.Read() System.Xml.XPath.XPathDocument.LoadFromReader(System.Xml.XmlReader, System.Xml.XmlSpace) System.Xml.XPath.XPathDocument.XPathDocument(System.IO.Stream) Geocoding.Google.GoogleGeocoder.LoadXmlResponse(System.Net.Http.HttpResponseMessage) ... [Call Stack Truncated]