我使用此代码从 Google API 生成静态图像,但我的请求太多,因此有时我会过度使用 Google。
string latlng = location.Latitude + "," + location.Longitude;
string path = "http://maps.googleapis.com/maps/api/staticmap?center=" + latlng +
"&zoom=16&size=200x200&maptype=roadmap&markers=color:blue%7Clabel:S%7C" +
latlng + "&sensor=false";
是否可以从 C# 调用它来生成和保存图像?我找不到获取图像对象的方法。
最佳答案
using (WebClient wc = new WebClient()) {
wc.DownloadFile(url, @"c:\temp\img.png");
}
关于c# - 如何从 Google 静态 map API 获取图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11594702/