O'Reilly logo

Windows Phone 7.5: Building Location-aware Applications by Zeeshan Chawdhary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using pushpins with maps

We have seen how to change map modes, however just a simple map without any focus does not make much sense, does it? So we move further and modify the HelloMaps example by using the Windows Phone Location Service to add a pushpin to the map — signifying the user's detected location.

The Pushpin class is part of the Microsoft.Phone.Controls.Maps namespace, with location as one of the properties. So let's use this property in our code and render a simple pushpin:

  1. We start by creating a new project titled HelloMaps-Pushpin.
  2. From our HelloMaps example, reintegrate the same UI, maps, and text labels, and from our Hello Location example, import the TextBlock named statusText. Your UI should now look like the following screenshot: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required