Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.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
Xaml 用Bing地图去医院_Xaml_C# 4.0_Bing Maps - Fatal编程技术网

Xaml 用Bing地图去医院

Xaml 用Bing地图去医院,xaml,c#-4.0,bing-maps,Xaml,C# 4.0,Bing Maps,我正在尝试使用BING Map API for Windows 8 Metro应用程序获取印度特定城市的所有医院。不过,我无法获取详细信息。以下是尝试过的两种方法 使用NearbyVenueCollection类 NearbyVenueOptions options = new NearbyVenueOptions(loc, 10000); NearbyVenueCollection nearbyVenues = null; try { near

我正在尝试使用BING Map API for Windows 8 Metro应用程序获取印度特定城市的所有医院。不过,我无法获取详细信息。以下是尝试过的两种方法

  • 使用NearbyVenueCollection类

        NearbyVenueOptions options = new NearbyVenueOptions(loc, 10000);
    
        NearbyVenueCollection nearbyVenues = null;
        try
        {
            nearbyVenues = await MyMap.VenueManager.GetNearbyVenuesAsync(options); ;
        }
        catch (Exception)
        {
        }
        if (nearbyVenues != null && nearbyVenues.Count > 0)
        {
            foreach (var nearbyVenue in nearbyVenues)
            {
                if (nearbyVenue.Metadata.VenueType == VenueType.Hospital.ToString())
                {
                    string name = nearbyVenue.Metadata.Name;
                }
            }
        }
    
  • 这并没有提供所需的详细信息

  • 使用Bing空间数据服务
  • 下面是代码片段

    ////Create the Bing Spatial Data Services request to get nearby POI
    string findNearbyPOIRequest = "http://spatial.virtualearth.net/REST/v1/data/            f22876ec257b474b82fe2ffcb8393150/ NavteqNA/NavteqPOIs? spatialfilter=nearby("
    + loc.Latitude + "," + loc.Longitude + "," + 1000 + ")"
    + "&$filter=EntityTypeID%20EQ%20'" + "8060" + "'&               $select=EntityID,DisplayName,__Distance,Latitude,Longitude,AddressLine,         Locality,AdminDistrict,PostalCode,Phone&$top=20"
    + "&key=" + BingCredentials;
    
    
    Uri uri = new Uri(findNearbyPOIRequest);
    WebRequest request = WebRequest.Create(uri);
    
    // GetResponseAsync() returns immediately after the header is ready 
    WebResponse response = await request.GetResponseAsync();
    Stream inputStream = response.GetResponseStream();
    
    XDocument doc = XDocument.Load(inputStream);
    XNamespace m ="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata";
    XNamespace d = "http://schemas.microsoft.com/ado/2007/08/dataservices";
    MapLayer pushpinLayer = new MapLayer();
    pushpinLayer.Name = "Push Pin Layer";
    
    var elements = from nodes in doc.Descendants(m + "properties")
                   select new
                   {
                       Name = nodes.Element(d + "DisplayName").Value,
                       Latitude = nodes.Element(d + "Latitude").Value,
                       Longitude = nodes.Element(d + "Longitude").Value,
                       Address = nodes.Element(d + "AddressLine").Value,
                   };
    

    然而,我没有得到印度城市所需的详细信息。有人能帮我弄清楚需要做些什么才能获取正确的细节吗?

    场馆地图是Bing地图上唯一有室内平面图的位置。我不知道印度有哪家医院可以提供场馆地图。Bing空间数据服务中的兴趣点数据仅在北美和欧洲可用。在印度寻找位置的最佳选择是使用Bing地图SOAP搜索服务


    提供的链接是AJAX控件。这可以在Windows 8 metro应用程序中使用吗?BING地图SOAP服务可以在Windows 8应用商店应用程序中使用吗?可以。将其添加为服务参考。谢谢@rbrundritt。我一定会让你知道的,这不管用。我不确定是不是因为我在印度的位置。我尝试了链接中指定的位置,它对这些位置有效。