我正在用WP8.1在c#和xaml上编写应用程序,它应该返回位于手机所有者某个特定半径的商店。而当我浏览网页时,我发现了一些类似兴趣点的内容,但它只适用于北美,我也发现了一些过时的方式,但现在没有任何效果。 我尝试这样做:bing地图,寻找附近的地方
string uriToLaunch = @"bingmaps:?&lvl=13&q={nameOfShop}&where={city}"
var uri = new Uri(uriToLaunch);
Windows.System.Launcher.LaunchUriAsync(uri);
但它迫使我打开新的应用程序,我宁愿把针上的地图控件 但如果没有别的办法,是有可能得到这个发现地点的清单引用bing地图? 我还试图连接到Google Maps API的,因为它有这个完美的选择,我从浏览器检查,它工作得很好,但应用它failes:
using (var client = new HttpClient())
{
client.BaseAddress = new Uri("https://maps.googleapis.com/");
client.DefaultRequestHeaders.Accept.Clear();
client.DefaultRequestHeaders.Accept.Add(new
MediaTypeWithQualityHeaderValue("application/json"));
// HTTP GET
String uri = "maps/api/place/search/json?key={MyKey}&location="
+ position.Coordinate.Latitude
+ ","
+ position.Coordinate.Longitude +
"&radius=500&keyword={nameOfSho}&sensor=true";
HttpResponseMessage response = await client.GetAsync(uri);
if (response.IsSuccessStatusCode)
{
String content = await response.Content.ReadAsStringAsync();
}
}
我用于Web请求的关键,这是对的吗? Windows Phone没有特定的键。 在此先感谢您的任何建议!