我有lat lng - 48.980861,16.523444。 如何从latLng whit API(JSON)中搜索一张图片?
URL: http://www.panoramio.com/map/#lt=48.980842&ln=16.523444&z=-3&k=2&a=1&tab=1&pl=all
URL!= API 感谢
答案 0 :(得分:0)
public class MapLocation
{
public double lat { get; set; }
public double lon { get; set; }
public int panoramio_zoom { get; set; }
}
public class Photo
{
public int height { get; set; }
public double latitude { get; set; }
public double longitude { get; set; }
public int owner_id { get; set; }
public string owner_name { get; set; }
public string owner_url { get; set; }
public string photo_file_url { get; set; }
public int photo_id { get; set; }
public string photo_title { get; set; }
public string photo_url { get; set; }
public string upload_date { get; set; }
public int width { get; set; }
public string place_id { get; set; }
}
public class RootObject
{
public int count { get; set; }
public bool has_more { get; set; }
public MapLocation map_location { get; set; }
public List<Photo> photos { get; set; }
}
var dataContractJsonSerializer = new DataContractJsonSerializer(typeof(RootObject));
RootObject readObject = (RootObject)dataContractJsonSerializer.ReadObject(memoryStream);
foreach (var item in readObject.photos)
{
//item.photo_file_url
//item.photo_id
//item.photo_title
//item.photo_url
//item.upload_date
// and etc.
}
阅读此帖Parsing JSON