Any book covering location is not complete without mentioning maps. Maps provide a great visual experience for location-based services. Maps are now a default feature on most smartphones as they provide a good graphical overview of information (usually geotagged data) around the user's location.
With custom pin markers and directions, maps also help users navigate to their destination easily. Most importantly maps give the user a feeling that "This place is around the next block, north from where I am standing," so decision-making happens quickly for the user.
In this chapter we shall cover the following topics:
BingMapsTask
Windows Phone 7.5 supports two methods of map display in your mobile app:
Before we delve into the methods, actions, and tasks of the Windows Phone Bing Maps Silverlight Control or the Bing Maps task Launcher, it is a good idea to get acquainted with the background of map geometry and how it works for Bing Maps. If you have a background in Computer Science, then you would be aware of keywords such as projection, trajectory, coordinate systems, raster and scalable graphics. If you are not from a Computer Science background, then a basic understanding of the Bing Maps API can be found at http://msdn.microsoft.com/en-us/library/ff428643.aspx. This should be good to get you started with Bing Maps.
Bing Maps uses the Mercator projection model of converting the Earth's sphere into a corresponding flat surface, grid-based, parallel map. In such a projection the longitude lines are parallel, and hence the land mass further from the equator tends to be distorted. However, the Mercator projection works well for navigational purposes, and therefore, despite the drawbacks, it is still used today.
The Mercator projection offers two compelling advantages:
The following diagrams should give you a good idea about the Mercator projection:
Earth's surface as a sphere diagram courtesy Michael Pidwirny from http://www.eoearth.org/article/Maps and http://www.physicalgeography.net/fundamentals/2a.html.
Mercator projection of the Earth's surface diagram courtesy Michael Pidwirny from http://www.eoearth.org/article/Maps and http://www.physicalgeography.net/fundamentals/2a.html.
The world map is pre-rendered at many different levels of detail and cut into tiles for quick retrieval. When you zoom in or zoom out on your Bing Maps, it is nothing but loading different tiles at different levels. To read more about the Bing Maps Tile System please see the following MSDN link:
3.144.90.182