

Location based services are based on longitude, latitude and altitude in conjunction with any map based web services or API’s available from bing. Using some simple steps I would like to demonstrate a real time map application using the emulator.
Assuming the prerequisites are installed as per earlier blogs, let’s get started by :
1) Installing the Silverlight maps control from here .
2) Add two references named Maps.MapControll.dll and Maps.MapControll.Common.dll from the location where step#1 was installed. We could use Blend to add the ‘Map’ control as this is available from Blend only and I have not seen it in Toolbox of VS2010 Express for WP7
3) Obtain the key from
4) Add another reference to your project calledSystem.Windows.Browser.dll which is available from your Silverlight install location
5) From Blend, add an attribute to the map control by name CredentialsProvider and this expects the key obtained in step #3
6) Save the project and compile in VS2010 Express for WP7 after changing the ‘Center’ property of the map control to (17, 78, 1) OR (40, -74, 1) which are the latitude, longitude and altitude respectively. The below locations are displayed once zoomed either by using the zoom control or just clicking on HYDERABAD or NEWYORK. You could zoom by using the touch screen on a real phone and the controls are used to demo only
A real good usage will be to leverage the ‘GeoCoordinateWatcher’ class and creating a handler for the ‘positionchanged’ event which delivers an object called ‘GeoCordinate’ that contains important properties for location based applications. Currently, the emulator does not return any values for these properties that are really necessary to pass in things like longitude, latitude, altitude etc...
On a real phone these are obtained from Wi-Fi, GPS or A-GPS and one can choose what is applicable to their business needs
No comments:
Post a Comment