wp7 でジオコード サービスを使用して、緯度と経度から CountryName を取得しています。次のことを書きました。
GeoCoordinate location1 = null;
private GeoCoordinateWatcher watcher;
public void FindCountryUsingGps()
{
progressbar.Visibility = Visibility.Visible;
watcher = new GeoCoordinateWatcher(GeoPositionAccuracy.Default);
watcher.PositionChanged += new EventHandler<GeoPositionChangedEventArgs<GeoCoordinate>>(watcher_PositionChanged);
watcher.Start();
}
void watcher_PositionChanged(object sender, GeoPositionChangedEventArgs<GeoCoordinate> e)
{
if (watcher != null)
{
watcher.Stop();
watcher.Dispose();
watcher = null;
location1 = e.Position.Location;
ObtainCountry();//by this function you obtain country region
}
}
次に、次の参照を追加しました:-
その後、私は書きました
public void ObtainCountry()
{
if (location == null)
return;
ReverseGeocodeRequest reverseGeocodeRequest = new ReverseGeocodeRequest();
しかし、私はこれを書くことができません ReverseGeocodeRequest reverseGeocodeRequest = new ReverseGeocodeRequest(); 行、それは赤として来ます
wp7 で、これは何ですか?