3

I am new to Windows Phone App development. I am developing app for windows phone 8. I want to add map function in my app.

But I searched the stack overflow, I can see that I have to use REST service. So please can anyone help me how to use REST service and get the location based data using Bing Map.

Imran Mozumder
  • 268
  • 3
  • 14

1 Answers1

2

You need to use the Bing Maps API detailed here

Ultimately though you are going to want to look at how to find a location by query on MSDN. These apis are easy to use but from experience I would use google maps API.

This is an example call

http://dev.virtualearth.net/REST/v1/Locations/locationQuery?includeNeighborhood=includeNeighborhood&maxResults=maxResults&include=queryParse&key=BingMapsKey

You would need to replace the variables with your data. For example the bingkey needs to be given to you by microsoft here

DotNetRussell
  • 9,716
  • 10
  • 56
  • 111
  • But whether Google map is supported in windows Phone App? – Imran Mozumder Jul 29 '13 at 03:58
  • @ImranMozumder well it depends what you are trying to do. There is the map api that returns JSON info that you parse and then there is the actual maps. The one that returns JSON info works on all devices. Its identical to the bing call above. – DotNetRussell Jul 29 '13 at 10:06
  • Its fine. The above API which you gave, whether I should add this through Service Reference? – Imran Mozumder Jul 29 '13 at 10:52
  • I don't know how to do it through service reference. I just dynamically created a WebClient when I needed it, used that as the URL and filled in the variables when I had them. This works just fine. The only problem you will have is that WebClients cache the return so if you do the same call again it doesn't actually call. The hack I came up with to get around that is append one extra param on the end and make it a random int. The web API ignors it but the WebClient thinks its a new address. – DotNetRussell Jul 29 '13 at 11:23
  • But if I am checking this Web Service in JsonFormatter, I am not getting any Data. I am getting response as Json data URL inaccessable. – Imran Mozumder Jul 29 '13 at 11:33
  • @ImranMozumder That is not the question you asked above. You need to close this one out and start a new one if you are attempting to ask about JsonFormatter – DotNetRussell Jul 29 '13 at 11:36