问题描述
其实我想找到使用GoogleMaps.LocationServices API的lat和long地址。
代码:
使用 GoogleMaps.LocationServices;
使用系统;
命名空间协调
{
public static class LocationService
{
public static 位置位置(字符串地址)
{
var locationService = new GoogleLocationService();
var location = new Location();
尝试
{
var point = locationService.GetLatLongFromAddress(address );
if (point!= null )
{
location.Latitude = point.Latitude.ToString();
location.Longitude = point.Longitude.ToString();
}
}
catch (例外情况)
{
Console.WriteLine(ex.Message) ;
}
返回位置;
}
}
}
i得到了类似未处理的类型异常的错误'System.Net.WebException'发生在GoogleMaps.LocationServices.dll
附加信息:请求未授权或超过QueryLimit代码中的以下行
var point = locationService.GetLatLongFromAddress(address);
请帮帮我
谢谢你/>
我尝试了什么:
i得到的错误如An GoogleMaps.LocationServices.dll中发生了'System.Net.WebException'类型的未处理异常
其他信息:请求未授权或超过QueryLimit代码中的以下行
var point = locationService.GetLatLongFromAddress(address);
Actually i want to find out the lat and long based Address using GoogleMaps.LocationServices API.
code:
using GoogleMaps.LocationServices; using System; namespace Coordination { public static class LocationService { public static Location Location (string address) { var locationService = new GoogleLocationService(); var location = new Location(); try { var point = locationService.GetLatLongFromAddress(address); if (point != null) { location.Latitude = point.Latitude.ToString(); location.Longitude = point.Longitude.ToString(); } } catch(Exception ex) { Console.WriteLine(ex.Message); } return location; } } }
i had got the the error like "An unhandled exception of type 'System.Net.WebException' occurred in GoogleMaps.LocationServices.dll
Additional information: Request Not Authorized or Over QueryLimit" in the following line in the code
var point = locationService.GetLatLongFromAddress(address);
Please help me
Thank u
What I have tried:
i had got the the error like "An unhandled exception of type 'System.Net.WebException' occurred in GoogleMaps.LocationServices.dll
Additional information: Request Not Authorized or Over QueryLimit" in the following line in the code
var point = locationService.GetLatLongFromAddress(address);
这篇关于请求未经授权或超过querylimit的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!