none
Bing map V8 geocode service RRS feed

Answers

All replies

  • Bing Maps V8 is a JavaScript control. What you are looking for is the Bing Maps REST services, which replaced the old SOAP services you are currently using, 6 or 7 years ago. You can find documentation on these services here: https://msdn.microsoft.com/en-us/library/ff701713.aspx

    Here is documentation for geocoding: https://msdn.microsoft.com/en-us/library/ff701711.aspx

    I also recommend taking a look at our best practices document here: https://msdn.microsoft.com/en-us/library/dn894107.aspx

    Documentation on using the REST services in .NET can be found here: https://msdn.microsoft.com/en-us/library/jj819168.aspx That said, we are working on making an open source portable class library that wraps the REST services and makes it easy to use in .NET. If you email me at richbrun at microsoft.com, I'll send you the source code.

    All that said, if your application needs to geocode an address in a webpage, there is no need to use C#. This can be done directly from JavaScript. The Bing Maps V8 web control has a search module which makes it easy to geocode addresses: https://msdn.microsoft.com/en-us/library/mt750534.aspx


    [Blog] [twitter] [LinkedIn]


    Monday, October 17, 2016 7:44 PM
  • Hi Ricky,

    Thanks for your reply. We are able to get the latitude and longitude using the code given in below link.

    https://msdn.microsoft.com/en-us/library/jj819168.aspx

    The code given in this link using Async method. Can you have sample code to get the latitude and longitude using Sync method. Async method is not work in our case so please give us sample code where we get the lat/long using Sync method.

    Thanks!

    Balasaheb


    Balasaheb


    Tuesday, October 25, 2016 1:09 PM
  • Simply use the sync version of WebClient.

    private void GetResponse(Uri uri, Action<Response> callback)
    {
    	if (callback != null)
    	{
    		WebClient wc = new WebClient();
    		using(var s = wc.OpenRead(uri))
    		{
    			var ser = new DataContractJsonSerializer(typeof(Response));
    			callback(ser.ReadObject(s) as Response);
    		}
    	}
    }


    [Blog] [twitter] [LinkedIn]


    Tuesday, October 25, 2016 5:29 PM
  • Hi Ricky,

    Thanks ricky, it worked. 

    We have changed following in the code given by you.

    callback(ser.ReadObject(a.Result) as Response); to

    callback(ser.ReadObject(s) as Response);


    Thanks!

    Balasaheb


    Balasaheb

    Wednesday, October 26, 2016 7:19 AM
  • Correct, that's what I get for copy/paste/edit in the browser.

    [Blog] [twitter] [LinkedIn]

    Wednesday, October 26, 2016 5:10 PM