- Get an API key ( http://www.bing.com/toolbox/bingdeveloper/)
- Create a GeoWatcher instance (Android equivalent: LocationManager)
- Add event listeners for when the position or location status has changed
- Start the GeoWatcher instance in it's own thread (Android equivalent: LocationManager.requestLocationUpdates which does step #3 and #4 in one go)
- Receive location updates as GeoCoordinates containing latitude, longitude and optionally altitude, accuracy, speed and course. Latitude and longitude are in the range -180.0 to 180.0 as opposed to the Android micro degrees
- Add a Map tag to your XAML and your API key as an attribute
- Add optional things like starting zoom level and if zoom controls should be visible or not
- As child tags you can add PushPins, Layers and Shapes (to plot routes and areas)
The above can be done programatically of course. I did however decide to go for full use of XAML and databinding to bind the "I'm here" pushpin location to the location I get from the GeoWatcher. Simple and very elegant.
No comments:
Post a Comment