views:

335

answers:

5

I need to simulate how my application will look when a user is driving around for a demo. I have a MKMapView, how can I simulate the look of a user driving around which will use the map.userLocation functionality, which obviously will not be available in the demo.

Thanks!

+1  A: 

No way to simulate in iPhone simulator. You'll need to load it onto your device and move around.

Kenny Winker
I didn't mean exactly simulate it using CoreLocation, jsut some way to animate a pin moving around.
DevDevDev
A: 

I'm not an iPhone dev expert, but how does the map view receive the coordinates? If it's through a function that calls the CoreLocation API, could you possibly just write a function that randomly generates longitude and latitude values at a certain time interval and have your map view pull the coordinates from there instead? Just a thought.

blabus
The MapKit maps work like this for the pins you drop, but when you put your own location in (the blue circle), the MapKit uses the CoreLocation services internally. Unfortunately, this won't work.
marcc
It receives them through a custom Annotation, all of the internals of this annotation are hidden so it is impossible to emulate.
DevDevDev
A: 

You could also check out iSimulate which claims to be able to simulate several features only available on the iPhone in the iPhone simulator include CoreLocation. I have not tried this myself so your mileage may vary.

Jon Steinmetz
A: 

Well I got something going, I just did essentially this

- (void)moveIcon:(MKAnnotationView*)locationView toLocation:(CLLocation*)newLoc
{
    LocationAnnotation* annotation = [[[LocationAnnotation alloc] initWithCoordinate:newLoc.coordinate] autorelease];
    [locationView setAnnotation:annotation];
    [map setCenterCoordinate:newLoc.coordinate animated:YES];
}

Then I call this guy in a loop between all of my vertices with a slight delay. Works quite qell.

DevDevDev
A: 

The answer is NO. Then, how about adding an abstraction layer between your code and MKMapKit? You can do xUnit tests for your objective.

KatokichiSoft