Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/matlab/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Json Panoramio-搜索一张图片API_Json_Api_Search_Panoramio - Fatal编程技术网

Json Panoramio-搜索一张图片API

Json Panoramio-搜索一张图片API,json,api,search,panoramio,Json,Api,Search,Panoramio,我有lat lng-48.980861,16.523444。 如何从latLng whit API(JSON)中搜索一张图片 网址: API: 网址=美国石油学会 谢谢公共类MapLocation { 公共双lat{get;set;} 公共双lon{get;set;} 公共int全景{get;set;} } 公开课照片 { 公共整数高度{get;set;} 公共双纬度{get;set;} 公共双经度{get;set;} public int owner_id{get;set;} 公共字符串所

我有lat lng-48.980861,16.523444。 如何从latLng whit API(JSON)中搜索一张图片

网址:

API:

网址=美国石油学会 谢谢

公共类MapLocation
{
公共双lat{get;set;}
公共双lon{get;set;}
公共int全景{get;set;}
}
公开课照片
{
公共整数高度{get;set;}
公共双纬度{get;set;}
公共双经度{get;set;}
public int owner_id{get;set;}
公共字符串所有者\u名称{get;set;}
公共字符串所有者\u url{get;set;}
公共字符串照片文件url{get;set;}
public int photo_id{get;set;}
公共字符串photo_title{get;set;}
公共字符串photo_url{get;set;}
公共字符串上载\u日期{get;set;}
公共整数宽度{get;set;}
公共字符串place_id{get;set;}
}
公共类根对象
{
公共整数计数{get;set;}
公共布尔还有{get;set;}
公共映射位置映射_位置{get;set;}
公开列表照片{get;set;}
}
var dataContractJsonSerializer=新的dataContractJsonSerializer(typeof(RootObject));
RootObject readObject=(RootObject)dataContractJsonSerializer.readObject(memoryStream);
foreach(readObject.photos中的变量项)
{
//item.photo\u文件\u url
//item.photo\u id
//item.photo\u标题
//item.photo\u url
//item.upload\u日期
//等等。
}
阅读这篇文章

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.
}