首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >谷歌地理编码(反向地理编码) WaitingForActivation

谷歌地理编码(反向地理编码) WaitingForActivation
EN

Stack Overflow用户
提问于 2022-06-30 17:20:12
回答 1查看 101关注 0票数 0

我正试图用.net6对一些坐标进行反编译。我正在使用googleGeo编码器与谷歌的api。

出于安全原因,我隐藏了API密钥。

代码语言:javascript
复制
            IGeocoder geocoder = new GoogleGeocoder() { ApiKey = "" };



            static async Task<IEnumerable<Address>> getPlaceAsync(IGeocoder geocoder)
            {
                IEnumerable<Address> addresses = await geocoder.ReverseGeocodeAsync(51.683, -1.68847);



                return addresses;
            }

            var ff = getPlaceAsync(geocoder);

响应是当我在函数调用之后放置断点时。

EN

回答 1

Stack Overflow用户

发布于 2022-07-01 08:50:17

您的getPlaceAsync方法是异步的。你得等电话

代码语言:javascript
复制
var results = await GetPlaceAsync(geocoder);

至于包裹本身。Geocoding.Google不是谷歌的官方客户端库。它自2017年以来就没有开发过,这意味着它可能不支持.net 6。这也许就是为什么即使在修复了等待问题之后运行代码也会导致

Geocoding.Google.GoogleGeocodingException:处理地理编码请求时出错了。有关更多信息,请参见状态或InnerException。(应Geocoding.Google.GoogleGeocoder.ProcessWebResponse(HttpResponseMessage响应)(应Geocoding.Google.GoogleGeocoder.ProcessRequest(HttpRequestMessage请求)在Geocoding.Google.GoogleGeocoder.ReverseGeocodeAsync(Double纬度,双经度)在Geocoding.Google.GoogleGeocoder.Geocoding.IGeocoder.ReverseGeocodeAsync(Double纬度,双经度)在C:\YouTube\dev\Blazor\GoogleGeocoderTest\GoogleGeocoderTest\Program.cs:line 15中的Program.<$>g__GetPlaceAsync|0_0(IGeocoder地理编码器)

据我所知,没有官方的谷歌.net客户端库的地理编码api。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72819734

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档