コード例 #1
0
ファイル: DoGeocoding.cs プロジェクト: rbproworks/uLocate
        //TODO: Heather - change to use umbraco plugin manager to resolve the plugins rather than hard-coding this.

        internal static Coordinate GetCoordinateForAddress(IAddress TheAddress)
        {
            Coordinate returnCoordinate = new Coordinate();

            GoogleMapsGeocodeProvider mapProvider = new GoogleMapsGeocodeProvider(ApplicationContext.Current.ApplicationCache.RuntimeCache);

            var Response = mapProvider.Geocode(TheAddress);

            if (Response.Status == GeocodeStatus.Ok)
            {
                var Result = Response.Results.FirstOrDefault();
                if (Result != null)
                {
                    returnCoordinate.Latitude  = Result.Latitude;
                    returnCoordinate.Longitude = Result.Longitude;
                }
            }

            return(returnCoordinate);
        }
コード例 #2
0
ファイル: DoGeocoding.cs プロジェクト: ismailmayat/uLocate
        //TODO: Heather - change to use umbraco plugin manager to resolve the plugins rather than hard-coding this.
        internal static Coordinate GetCoordinateForAddress(IAddress TheAddress)
        {
            Coordinate returnCoordinate = new Coordinate();

            GoogleMapsGeocodeProvider mapProvider = new GoogleMapsGeocodeProvider(ApplicationContext.Current.ApplicationCache.RuntimeCache);

            var Response = mapProvider.Geocode(TheAddress);

            if (Response.Status == GeocodeStatus.Ok)
            {
                var Result = Response.Results.FirstOrDefault();
                if (Result != null)
                {
                    returnCoordinate.Latitude = Result.Latitude;
                    returnCoordinate.Longitude = Result.Longitude;
                }
            }

            return returnCoordinate;
        }