# Part 25: Working with the Geolocator and Geoposition Classes

Play Part 25: Working with the Geolocator and Geoposition Classes

## The Discussion

• @BobTabor: You are awesome. I alway vote 5 stars for you.

• @QuocTruong: Thanks.

• I finished this tutorial and my app builds, but when I run it on my phone (my computer won't support the emulator so I have to run everything on my device) it crashes when it tries to find my location.

• @Russell: how does it crash?  Does an exception get thrown?  Do you have the Location and map capabilities checked from https://channel9.msdn.com/Series/Windows-Phone-8-Development-for-Absolute-Beginners/Part-24-Getting-Started-with-the-AroundMe-Project

• @Russell: I think you may be experiencing the issue with sending too many digits after the decimal to Flickr.  I believe I talk about this problem in the next video or two.  Sorry!  They can only accept 5 digits after the decimal.  Didn't realize this until it was too late.

• How can assign my current place Latitude,Longitude.

this code is giving chicago as place but what if i want my city?

• @gauravi: you can set the emulator to where every you want.  if you want easy way to get lat,long, use Wikipedia, look for coordinates on the right side.  http://en.wikipedia.org/wiki/Arc_de_Triomphe or http://en.wikipedia.org/wiki/Seattle

• @Russell: Try to change TimeSpan.FromSeconds(30) to TimeSpan.FromSeconds(300). It works on my device.

• Quick question.  Why create a new GeoCoordinate instance as opposed to using the position.Coordinate instance?  Does it make a difference or were you just trying to be more explicit?

```var position = await geoLocator.GetGeopositionAsync(TimeSpan.FromMinutes(1), TimeSpan.FromSeconds(30));

var gpsCoorCenter = new GeoCoordinate(position.Coordinate.Latitude, position.Coordinate.Longitude);```

• Hai bab. . I need to download that sdk for my machine for later use incase if removed accidently. . i tried but i shows we can install online only . . instead of this i need to install in offline mode. . kindly help me via this mail id . .

mailto.rajiv18@yahoo.com // mailto.rajiv18@hotmail.co.in

Thank you so much in advance . . :-)

• @devlife3: they are actually different classes ... note the upper and lower case C in coordinate.

X

• How i can Select location in map
i need select location phone any where
and detect the earliest point i want

• @laith 2: we didn't cover that in our tutorial, head over to https://dev.windowsphone.com, I found https://code.msdn.microsoft.com/wpapps/Windows-Phone-8-JumpStart-b3ef6476 which has push pins

• Hello Bob, I am developing a windows phone app in 8.1 and the visual studio i am using is vs express for windows phone 2012... so will it be compatible for developing app??? and i am not getting that how to add bing map api in my project??? help me out...

• Hello I'm from Brazil

Translation:

Hello! I'm finding it difficult to develop an app that uses the GPS on a map so that it shows the path of a person for example, if she tighten "button to start the race" the app starts to show the way that person is going through and that stop it when she squeeze in another button "stop" ... if the app would save the path from the starting point to the end ... and show details like speed, distance traveled ...
thanks for listening....

message Original

Olá! Galera estou encontrando dificuldades em desenvolver um app que use o GPS em um mapa de forma que ele mostre o trajeto de uma pessoa por exemplo, se ela apertar em "botao iniciar corrida" o app começa a mostrar o caminho que essa pessoa está percorrendo e que ele pare quando ela apertar em um outro botao "parar"... o app no caso salvaria o trajeto do ponto inicial e o final... e mostraria detalhes como velocidade, distancia percorrida...

• @ratna03: Hi, you're getting your terms mixed.  Windows Phone 8.0 ... Windows 8.1 ... they're different.  Windows Phone 8.1 doesn't exist (yet).  re: Bing Map ... see the yellow box on this page:

https://msdn.microsoft.com/en-us/library/windowsphone/develop/jj207045(v=vs.105).aspx

@Luandierison: Sorry, that's not part of this series.  I can't help you with that.

• Hi,Bob , I want to thank you for this great tutorials but I have a little question.

when we call GetGeopositionAsync() method ,why in parameter you put

TimeSpan.FromMinutes(1), TimeSpan.FromSeconds(30)

what is the benefit of it?? I removed it and called the method without parameter and it was the same result !!

Thanks :)

• Hi bob, i am working on an app where i am using windows phone 8 maps API. I have attached a slider control with the map control for zooming in an out, although i have set the maximum and minimum vale 20 and 1, but the problem is that when the user slides and stop at a type double value, the debugger throws an exception. Can you guide me how to handle this situation

• Hello, your tutorials are a great help!! i wanted to know how how can i get the same perfect results as you got for John Hancock, Chicago, for some area in my city, say for example i want Dolmen Mall, Karachi (Pakistan). firstly it doesn't provide me with any location on the map if i just enter the name of area in words. even if i give the respective co-ordinates for Dolmen Mall Karachi, it doesn't show a detailed location marked dolmen mall as that it gave for John Hancock, Chicago. naturally i want the user to have a nice detailed look so that he can have an idea of his location.
i even tried giving the following properties of mode true, but nothing as such changed...
PedestrianFeaturesEnabled="True"
LandmarksEnabled="True"

• Hello,

Thank you for this great tutorial.
I do have one question: Can i improve the latency on getting the current geolocation? If I change the location quickly in the emulator en then debug for the coördinates, the systeem still retrieves the previous geolocation.

It seems to be lagging when switching locations quickly.

Math