Click here to Skip to main content
15,896,606 members
Articles / Programming Languages / Javascript

A .NET API for the Google Maps Geocoder

Rate me:
Please Sign up or sign in to vote.
4.38/5 (10 votes)
26 Jun 2008CPOL 135.5K   3.2K   48  
A simple .NET library to wrap the Google Maps geocoding functionality
using System;
using System.Collections.Generic;
using System.Text;

namespace GMapGeocoder
{
    /// <summary>
    /// A response code (similar to HTTP status codes) indicating whether the geocode request was successful or not. 
    /// </summary>
    public enum StatusCodeOptions
    {
        /// <summary>No errors occurred; the address was successfully parsed and its geocode has been returned.</summary>
        Success = 200,
        /// <summary>A directions request could not be successfully parsed.</summary>
        BadRequest = 400,
        /// <summary>A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.</summary>
        ServerError = 500,
        /// <summary>The HTTP q parameter was either missing or had no value. For geocoding requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.</summary>
        MissingQueryOrAddress = 601,
        /// <summary>No corresponding geographic location could be found for the specified address. This may be due to the fact that the address is relatively new, or it may be incorrect.</summary>
        UnknownAddress = 602,
        /// <summary>The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons.</summary>
        UnavailableAddress = 603,
        /// <summary>The GDirections object could not compute directions between the points mentioned in the query. This is usually because there is no route available between the two points, or because we do not have data for routing in that region.</summary>
        UnknownDirections = 604,
        /// <summary>The given key is either invalid or does not match the domain for which it was given.</summary>
        BadKey = 610,
        /// <summary>The given key has gone over the requests limit in the 24 hour period.</summary>
        TooManyQueries = 620
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Cerner
United States United States
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions