Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using GPX file in iOS simulator doesn't stop at the last coordinate, keeps looping

I've been reading through a lot of questions/answers relating to the simulation of location on the iOS simulators, but none touching on my specific issue. I have a prototype of a location aware application which I configured to use a GPX file as described in this answer: How to solve Xcode 4.1 (LION) GPS error?

It works great and it provides all the information I need, with one exception. I was expecting the location updates to stop as soon as we moved into the last position defined in the GPX file. Instead, the current location keeps updating in a loop. It returns to the starting position, and loops until you stop it.

I've tried marking positions around the area where I want it to linger at, but it ignores them. It could have something to do with the minimum change in position, but it just ignores it and continues with the loop.

Created a quick project to illustrate the issue and loaded it to GitHub: https://github.com/acolchado/LocationPrototype

To reproduce follow these steps:

  1. Load the project in xcode, I created it using xcode 4.4.1.

  2. Run the project.

  3. From the debug panel, locate the location arrow. Click on the arrow and select "SanBruno_To_Downtown_SF" from the context menu.

  4. Bring the simulator to the foreground and observe the endless loop.

I have looked everywhere for a solution for this, but I am unable to find any mention of the loop. I would greatly appreciate any help anyone could offer here.

Thanks,

Agustin

like image 642
acolchado Avatar asked Sep 05 '12 18:09

acolchado


People also ask

How do I use GPX file simulator?

1) Open finder project and paste the GPX file in route directory. 2) Add that file in your project. 4) Start the simulation through GPX data.

How do I turn off location in simulator?

Open your phone's Settings app. Under "Personal," tap Location access. At the top of the screen, turn Access to my location on or off.


2 Answers

my cheat:

just copy paste the last waypoint in your .gpx file a bunch of times (enough to keep it stuck there until it satisfies your criteria)

like image 92
Nitin Alabur Avatar answered Oct 05 '22 23:10

Nitin Alabur


You can also add a timestamp in the gpx file. Make yourself linger at the last stop by having a really long timestamp.

like image 33
user6604783 Avatar answered Oct 06 '22 01:10

user6604783