adspace


Can I get weather for my location?

Answer Posted / Dileep Yadav

Yes, you can retrieve the current weather for your location using the Bing Maps SDK. The SDK provides a LocationService class that helps to determine the user's location and get related data like weather. Here's a simple example:

```csharp
var map = new MapControl();
var locationService = new LocationService(map);
locationService.GetLocationAsync().ContinueWith((task) =>
{
if (task.IsFaulted || task.IsCanceled)
{
// handle errors
}
else
{
var geoCoordinate = task.Result;
// use the geoCoordinate to make a request for weather data
}
});n

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain how to play video in isolatedstorage using mediaelement?

939


Explain how to save screen from an xna app?

1040


Explain how to edit location for weather?

968