Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Windows Phone 7.5: Building Location-aware Applications

You're reading from   Windows Phone 7.5: Building Location-aware Applications Build your first Windows Phone application with Location and Maps with this book and ebook.

Arrow left icon
Product type Paperback
Published in Jul 2012
Publisher Packt
ISBN-13 9781849687249
Length 148 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (11) Chapters Close

Windows Phone 7.5: Building Location-aware Applications
Credits
About the Author
About the Reviewers
1. www.PacktPub.com
2. Preface
1. The Location-based World FREE CHAPTER 2. Using Location in Windows Phone 7.5 3. Using Maps in your Windows Phone App 4. Events App - PacktEvents 5. Location-aware News App — PacktNews

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. 1. We start by creating a new project titled HelloMaps-Pushpin.

  2. 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:

  3. 3. Open MainPage.xaml.cs and copy over the location variable and methods from the Hello Location example. Add a variable in the global scope called zoomLevel that controls your map's zoom level.

    GeoCoordinateWatcher locationManager;
    double zoomLevel...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image