示例#1
0
        /// <summary>
        /// Translate an address to a Location object, containing the latitude and
        /// the longitude of the address.
        /// </summary>
        /// <param name="address">The address to be translated</param>
        /// <returns>A Location instance</returns>
        public static Location addressToLocation(string address)
        {
            string[] coords;
            double   latitude;
            double   longitude;
            Location location;

            coords    = GMapsAPI.addressToLatLng(address);
            latitude  = double.Parse(coords[0]);
            longitude = double.Parse(coords[1]);
            location  = new Location(address, latitude, longitude);

            return(location);
        }