我有最新的lng - 48.980861,16.523444。如何从JSON( latLng )中搜索一张图片?
网址:http://www.panoramio.com/map/#lt=48.980842&ln=16.523444&z=-3&k=2&a=1&tab=1&pl=all
接口名:http://www.panoramio.com/map/get_panoramas.php?set=full&from=0&to=20&maxx=48.980861&maxy=16.523444&size=medium&mapfilter=true
URL!=API谢谢
发布于 2014-01-10 19:16:57
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
https://stackoverflow.com/questions/21040691
复制相似问题