none
using bing map ? RRS feed

  • Question

  • how to use bing map service ?

    i want to send my longitude and latitude and return the corresponding address?

    sorry i have no knowledge about the service , please help me

    Thursday, March 7, 2013 9:49 AM

Answers

All replies

  • Do you have trying to search on web ??

    Do you can do this for getting adress from latitude and longitude:

    But you need reference the webService before . Look at here :http://msdn.microsoft.com/en-us/library/dd221354.aspx

    string myAdress = SearchKeywordLocation(47.6,7.03);

    private string SearchKeywordLocation(string keywordLocation)
    {
        String results = "";
        String key = "insert your Bing Maps key here";
        SearchRequest searchRequest = new SearchRequest();
    
        // Set the credentials using a valid Bing Maps key
        searchRequest.Credentials = new SearchService.Credentials();
        searchRequest.Credentials.ApplicationId = key;
    
        //Create the search query
        StructuredSearchQuery ssQuery = new StructuredSearchQuery();
        string[] parts = keywordLocation.Split(';');
        ssQuery.Keyword = parts[0];
        ssQuery.Location = parts[1];
        searchRequest.StructuredQuery = ssQuery;
    
        //Define options on the search
        searchRequest.SearchOptions = new SearchOptions();
        searchRequest.SearchOptions.Filters = 
            new FilterExpression() { PropertyId = 3, 
                CompareOperator = CompareOperator.GreaterThanOrEquals, FilterValue = 8.16 };
    
        //Make the search request 
        SearchServiceClient searchService = new SearchServiceClient();
        SearchResponse searchResponse = searchService.Search(searchRequest);
    
        //Parse and format results
        if (searchResponse.ResultSets[0].Results.Length > 0)
        {
            StringBuilder resultList = new StringBuilder("");
            for (int i = 0; i < searchResponse.ResultSets[0].Results.Length; i++)
            {
                resultList.Append(String.Format("{0}. {1}\n", i+1, 
                    searchResponse.ResultSets[0].Results[i].Name));                    
            }
    
            results = resultList.ToString();
        }
        else
            results = "No results found";
        
        return results;
    }


    King Middle

    Thursday, March 7, 2013 10:09 AM
  • Don't use the SOAP services as they are a legacy service. Also, the Search service is the wrong SOAP service to do reverse geocoding. Instead use the REST services. Here is information on how to do reverse geocoding: http://msdn.microsoft.com/en-us/library/ff701710.aspx

    Here is information on how to use this service in .NET: http://msdn.microsoft.com/en-us/library/jj819168.aspx


    http://rbrundritt.wordpress.com

    Saturday, March 9, 2013 10:55 AM