Building Apps for Windows Phone 8.1: (12) Maps, Geolocation, and Geofencing

Download this episode

Download Video

Download captions




Available formats for this video:

Actual format may change based on video formats available and browser capability.

    The Discussion

    • User profile image

      Great information!  It would be better if the convergence was closer but still a nice step forward.


      Where is the sample code, please?



    • User profile image

      All sample code for these projects is located here.

      Look for the file labeled "Session 12 Demos"

    • User profile image

      Still going through the excellent videos you guys have done and having the code makes it so much easier to follow along.


      Thanks for a great work!

    • User profile image
      Rich C

      You didn't mention (and can't find any mention of it anywhere) on how to enter in a street address and get a Geolocation back that can be used to calculate distance from another Geolocation or current location. Is this possible? If so, can you point me in the right direction?

    • User profile image

      Why not add the code samples to the MSDN Code Sample Gallery?

      Rich C - You can get the coordinates for a location using the maps services: From there you can then either use the map services to calculate the driving directions to get the driving distance between the locations. Alternatively you can use the Haversine formula to calculate the straight line distance (as the bird flies) between the locations. If you don't want to use the Map Services you can also use the Bing Maps REST services to do all this. The benefit of this approach is that you can use the Bing Maps REST services in universal apps.

    • User profile image

      So here's something interesting.

      I'm using exactly the same control as you, I have built a sample that puts icons on the map.

      In your sample, the icon overrides the labels on the map.  In mine, the labels override the icons, causing them to disappear seemingly randomly, but they are really getting overwritten by labels on the map.

      I've tried different Zindex's as high at 11 with no success.  (your Windows Phone map icon is set to 5).

      My sample uses a hub control and looks up the map control at runtime via its "Loaded" event handler, but other than that, I don't see a difference.

      I'll also report this in the forums, but haven't seen anyone else with this problem, so I thought I'd just remark here since you have a sample that works and is for WP 8.1


    • User profile image

      When will we be able to track location continuously in the background again? I want trigger events based on the users location, but since fencing in background only triggers every 2 minutes I cant use it... I really need to trigger more often then that!

    • User profile image

      I've got the same problem as Wp7dev007.
      So i suppose this is a bug ?

      i've got like 1300 mapicons to show and they are getting overwritten by labels on the map.

      Is there a way to fix that ?

      Thank you for your advice

    • User profile image
      Faisal Jamil

      How can i find my geo point Latitude and longitude ?
      I try but i always show 47.6785619 as my latitude and -122.1311156 as my longitude.But in actual my latitude and longitude is 33.7167° N, 73.0667° E .

    • User profile image

      @Faisal Jamil: The details of your lat/long make it sound like you are running it inside the emulator instead of on the device. If you open up the emulator options, you should be able to change the emulated lat/long using the map control that is a part of the emulator tools. 

    • User profile image
      Peter Kulcsar

      I created several pushpin as xaml controls on the map.
      The problem is they easily overlay eachother if it zoomed out - and I prefer to handle if they overlay or just too close to eachother in the Viewport.

      At MapIcons this issue is handled automatically, but not at xaml controls.
      I am pretty sure there must be an event or an easy way that could handle this problem.

      Many thanks if somebody could help!

    • User profile image

      @Rich C - 25:25 talks about how to get a postal address for a location and vice versa.

    • User profile image

      @Rich C: at 0:25:25, he talks about how to get a postal address for a location and vice versa.

    • User profile image

      I need to be able to quickly draw 2000-3000 icons (no interaction needed) on the map. Looking at MapIcon, it looks the most suitable and efficient solution.
      However it looks like the interface is performant for a set less than 500 elements added to MapElements.
      Any plan to prepare a collection of MapIcon and set it in one shot to the MapElements collection (also enhancing the speed of display).


    • User profile image

      Well, I found a nice way to go through thousands of MapIcon. It is as simple as managing it programatically. I created a MapControl in the code, then added all my MapIcon (5000).
      When the user selects to see the map, I simply add the pre-created map object as a UIElement to the grid's children. And it renders in one shot.

    • User profile image

      I use 2013 and cant get here drive or any other driving application to run! how do you have here drive running on your emulator?

    • User profile image

      Great work guys really helpful!

    Comments closed

    Comments have been closed since this content was published more than 30 days ago, but if you'd like to send us feedback you can Contact Us.