TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Srikanth
NA
27
38k
Can you help me in getting the current location....i provided the code iam using ..(windows mobile..)
Sep 6 2011 4:39 AM
hi i am using this to get the Current location.
currently i am getting the value from longitude and lattitude (default value)
i need to get the current location randomly when the person changes the location..
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
using System.Device.Location;
using SimpleGPS.Terra;
using Microsoft.Phone.Controls.Maps;
namespace SimpleGPS
{
public partial class MainPage : PhoneApplicationPage
{
Terra.TerraServiceSoapClient client = new Terra.TerraServiceSoapClient();
double latitude, longitude;
// Constructor
public MainPage()
{
InitializeComponent();
client.ConvertLonLatPtToNearestPlaceCompleted += new EventHandler<ConvertLonLatPtToNearestPlaceCompletedEventArgs>(client_ConvertLonLatPtToNearestPlaceCompleted);
mapBing.ZoomBarVisibility = System.Windows.Visibility.Visible;
}
void client_ConvertLonLatPtToNearestPlaceCompleted(object sender, ConvertLonLatPtToNearestPlaceCompletedEventArgs e)
{
txtResult.Text = e.Result;
mapBing.Center = new GeoCoordinate(latitude, longitude);
mapBing.ZoomLevel = 10;
}
private void btnGet_Click(object sender, RoutedEventArgs e)
{
txtResult.Text = "Loading....";
GeoCoordinateWatcher myWatcher = new GeoCoordinateWatcher();
var myPosition = myWatcher.Position;
// Here iam getting the location of the user...
but here it is maually wrote the longittude and lattitude.
i need to get the location default.
latitude = 61.066;
longitude = 28.183;
if (!myPosition.Location.IsUnknown)
{
latitude = myPosition.Location.Latitude;
longitude = myPosition.Location.Longitude;
}
client.ConvertLonLatPtToNearestPlaceAsync(new Terra.LonLatPt { Lat = latitude, Lon = longitude });
}
}
}
Reply
Answers (
2
)
Line graph in WPF
In WPF applicaiton how to get View Source for a page loaded in Webbrowser control