void BingMap_MapZoom(object sender, Microsoft.Phone.Controls.Maps.MapZoomEventArgs e) { e.Handled = true; System.Device.Location.GeoCoordinate location = this.BingMap.ViewportPointToLocation(e.ViewportPoint); MobileSrc.Services.GeocodeServices.GeocodeServiceClient rclient = new MobileSrc.Services.GeocodeServices.GeocodeServiceClient("BasicHttpBinding_IGeocodeService"); MobileSrc.Services.GeocodeServices.ReverseGeocodeRequest req = new MobileSrc.Services.GeocodeServices.ReverseGeocodeRequest(); req.Credentials = new MobileSrc.Services.GeocodeServices.Credentials(); req.Credentials.ApplicationId = BingMapsApiKey; req.Location = new MobileSrc.Services.GeocodeServices.Location(); req.Location.Latitude = location.Latitude; req.Location.Longitude = location.Longitude; req.ExecutionOptions = new MobileSrc.Services.GeocodeServices.ExecutionOptions(); rclient.ReverseGeocodeCompleted += new EventHandler <MobileSrc.Services.GeocodeServices.ReverseGeocodeCompletedEventArgs>(client_ReverseGeocodeCompleted); rclient.ReverseGeocodeAsync(req); }
void listener_Hold(object sender, GestureEventArgs e) { ((MenuItem)menu.Items[0]).Header = "Identifying Location..."; menu.IsOpen = true; System.Device.Location.GeoCoordinate location = this.BingMap.ViewportPointToLocation(e.GetPosition(this.BingMap)); MobileSrc.Services.GeocodeServices.GeocodeServiceClient rclient = new MobileSrc.Services.GeocodeServices.GeocodeServiceClient("BasicHttpBinding_IGeocodeService"); MobileSrc.Services.GeocodeServices.ReverseGeocodeRequest req = new MobileSrc.Services.GeocodeServices.ReverseGeocodeRequest(); req.Credentials = new MobileSrc.Services.GeocodeServices.Credentials(); req.Credentials.ApplicationId = BingMapsApiKey; req.Location = new MobileSrc.Services.GeocodeServices.Location(); req.Location.Latitude = location.Latitude; req.Location.Longitude = location.Longitude; req.ExecutionOptions = new MobileSrc.Services.GeocodeServices.ExecutionOptions(); rclient.ReverseGeocodeCompleted += new EventHandler <MobileSrc.Services.GeocodeServices.ReverseGeocodeCompletedEventArgs>(client_ReverseGeocodeCompleted); rclient.ReverseGeocodeAsync(req); }
void listener_Hold(object sender, GestureEventArgs e) { ((MenuItem)menu.Items[0]).Header = "Identifying Location..."; menu.IsOpen = true; System.Device.Location.GeoCoordinate location = this.BingMap.ViewportPointToLocation(e.GetPosition(this.BingMap)); MobileSrc.Services.GeocodeServices.GeocodeServiceClient rclient = new MobileSrc.Services.GeocodeServices.GeocodeServiceClient("BasicHttpBinding_IGeocodeService"); MobileSrc.Services.GeocodeServices.ReverseGeocodeRequest req = new MobileSrc.Services.GeocodeServices.ReverseGeocodeRequest(); req.Credentials = new MobileSrc.Services.GeocodeServices.Credentials(); req.Credentials.ApplicationId = BingMapsApiKey; req.Location = new MobileSrc.Services.GeocodeServices.Location(); req.Location.Latitude = location.Latitude; req.Location.Longitude = location.Longitude; req.ExecutionOptions = new MobileSrc.Services.GeocodeServices.ExecutionOptions(); rclient.ReverseGeocodeCompleted += new EventHandler<MobileSrc.Services.GeocodeServices.ReverseGeocodeCompletedEventArgs>(client_ReverseGeocodeCompleted); rclient.ReverseGeocodeAsync(req); }
void BingMap_MapZoom(object sender, Microsoft.Phone.Controls.Maps.MapZoomEventArgs e) { e.Handled = true; System.Device.Location.GeoCoordinate location = this.BingMap.ViewportPointToLocation(e.ViewportPoint); MobileSrc.Services.GeocodeServices.GeocodeServiceClient rclient = new MobileSrc.Services.GeocodeServices.GeocodeServiceClient("BasicHttpBinding_IGeocodeService"); MobileSrc.Services.GeocodeServices.ReverseGeocodeRequest req = new MobileSrc.Services.GeocodeServices.ReverseGeocodeRequest(); req.Credentials = new MobileSrc.Services.GeocodeServices.Credentials(); req.Credentials.ApplicationId = BingMapsApiKey; req.Location = new MobileSrc.Services.GeocodeServices.Location(); req.Location.Latitude = location.Latitude; req.Location.Longitude = location.Longitude; req.ExecutionOptions = new MobileSrc.Services.GeocodeServices.ExecutionOptions(); rclient.ReverseGeocodeCompleted += new EventHandler<MobileSrc.Services.GeocodeServices.ReverseGeocodeCompletedEventArgs>(client_ReverseGeocodeCompleted); rclient.ReverseGeocodeAsync(req); }