Skip to main content

Posts

Showing posts with the label WP7Contrib Bing Maps WP7

WP7Contrib: Criterion Factory - Location by search by latitude & longitude

To kick off the series about the Criterion Factory in the Bing Maps service I thought I'd start with the easiest functionality - searching for a location using latitude & longitude. Firstly here is the code - I have to emphasize how easy this is to use. It has taken only 5 lines of code to get the location information and the only required is a set of WP7Contrib assembly references. private void locationByPointClick ( object sender , RoutedEventArgs e ) { var geoCoordinate = new GeoCoordinate ( Convert . ToDouble ( this . lat . Text ) , Convert . ToDouble ( this . @ long . Text ) ) ;   var criterion = CriterionFactory . CreateLocationSearchForPoint ( geoCoordinate ) ; this . bingMapsService . SearchForLocationUsingPoint ( criterion ) . ObserveOnDispatcher ( ) . Subscribe ( result = > { this . address . Text = result . Locations [ 0 ] . Address . Locality ; this . address . T...