Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 90 lines (56 sloc) 3.375 kb
91b0ec5 Ortwin Gentz, FutureTap Added Readme
authored
1
2 FTLocationSimulator
3 ===================
4
5 FTLocationSimulator allows simulating Core Location in the iPhone simulator on the desktop. It sends fake Core Location updates taken from a KML file that describes a predefined route.
6
7 Besides the simulated Core Location updates, it also updates the blue userLocation view on MapKit views.
8
9 The sample project shows how to integrate FTLocationSimulator into an existing app, in this case Apple's "Breadcrumb" sample application.
10
11
12 Integration Steps
13 -----------------
14 In a nutshell, these are the necessary steps:
15
16 1. Add the FTLocationSimulator directory to your project
17
f050e56 Ortwin Gentz, FutureTap FTLocationSimulator now works as a drop-in replacement for CLLocationMan...
authored
18 2. Add `-licucore` to "Other Linker flags" in the project/target settings (this is needed for RegExKitLite)
03bbd47 Ortwin Gentz, FutureTap Added note about -licucore to README (thx, @davidswelt for reporting thi...
authored
19
f050e56 Ortwin Gentz, FutureTap FTLocationSimulator now works as a drop-in replacement for CLLocationMan...
authored
20 3. `#ifdef` all occurences of "`CLLocationManager`" like the following:
91b0ec5 Ortwin Gentz, FutureTap Added Readme
authored
21
22 #ifdef FAKE_CORE_LOCATION
f050e56 Ortwin Gentz, FutureTap FTLocationSimulator now works as a drop-in replacement for CLLocationMan...
authored
23 self.locationManager = [[[FTLocationSimulator alloc] init] autorelease];
91b0ec5 Ortwin Gentz, FutureTap Added Readme
authored
24 #else
25 self.locationManager = [[[CLLocationManager alloc] init] autorelease];
26 #endif
27
f050e56 Ortwin Gentz, FutureTap FTLocationSimulator now works as a drop-in replacement for CLLocationMan...
authored
28 Only the alloc/init call has to be ifdef'ed. All further occurences of your locationManager object don't need to be changed since `FTLocationSimulator` uses the same interface as `CLLocationManager`.
91b0ec5 Ortwin Gentz, FutureTap Added Readme
authored
29
03bbd47 Ortwin Gentz, FutureTap Added note about -licucore to README (thx, @davidswelt for reporting thi...
authored
30 4. `#include "FTLocationSimulator.h"` where necessary.
91b0ec5 Ortwin Gentz, FutureTap Added Readme
authored
31
f050e56 Ortwin Gentz, FutureTap FTLocationSimulator now works as a drop-in replacement for CLLocationMan...
authored
32 5. If you're using MapKit, set the `mapView` property with your `MKMapView` and set it to nil if you're done with the map. Then, put the following into your `MKMapViewDelegate`:
91b0ec5 Ortwin Gentz, FutureTap Added Readme
authored
33
34 - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation {
35 if ([annotation isMemberOfClass:[MKUserLocation class]]) {
36 #ifdef FAKE_CORE_LOCATION
f050e56 Ortwin Gentz, FutureTap FTLocationSimulator now works as a drop-in replacement for CLLocationMan...
authored
37 return self.locationManager.fakeUserLocationView;
91b0ec5 Ortwin Gentz, FutureTap Added Readme
authored
38 #else
39 return nil;
40 #endif
41 }
42 // Your code for regular annotation views
43 }
44
f050e56 Ortwin Gentz, FutureTap FTLocationSimulator now works as a drop-in replacement for CLLocationMan...
authored
45 6. Adjust `FAKE_CORE_LOCATION_UPDATE_INTERVAL` in `FTLocationSimulator.h` if the location updates are too fast.
46
47 7. Change the `fakeLocations.kml` if needed (currently, it includes a route from Cupertino to San Francisco). To create a new fakeLocations.kml, use Google Earth and create a route. Send the route via email and take the "Route.kmz" file out of the draft mail. The kmz format is zipped kml. So unzip that file using "unzip Route.kml" on the command line.
48
49 The parser is not a generic KML parser but is only able to parse these specific Google Earth KML files.
91b0ec5 Ortwin Gentz, FutureTap Added Readme
authored
50
51
52 Implemented methods and properties
53 ----------------------------------
54
f050e56 Ortwin Gentz, FutureTap FTLocationSimulator now works as a drop-in replacement for CLLocationMan...
authored
55 From `CLLocationManager`:
56
57 - `delegate`
58 - `location` (for polling updates)
59 - `distanceFilter`
60 - `-startUpdatingLocations`
61 - `-stopUpdatingLocations`
62
91b0ec5 Ortwin Gentz, FutureTap Added Readme
authored
63
f050e56 Ortwin Gentz, FutureTap FTLocationSimulator now works as a drop-in replacement for CLLocationMan...
authored
64 `CLLocationManagerDelegate`:
91b0ec5 Ortwin Gentz, FutureTap Added Readme
authored
65
f050e56 Ortwin Gentz, FutureTap FTLocationSimulator now works as a drop-in replacement for CLLocationMan...
authored
66 - `-locationManager:didUpdateToLocation:fromLocation:` (is sent by FTLocationSimulator)
91b0ec5 Ortwin Gentz, FutureTap Added Readme
authored
67
68
f050e56 Ortwin Gentz, FutureTap FTLocationSimulator now works as a drop-in replacement for CLLocationMan...
authored
69 `CLLocation` objects:
91b0ec5 Ortwin Gentz, FutureTap Added Readme
authored
70
f050e56 Ortwin Gentz, FutureTap FTLocationSimulator now works as a drop-in replacement for CLLocationMan...
authored
71 - `coordinate`
72 - `location`
73 - `timestamp`
91b0ec5 Ortwin Gentz, FutureTap Added Readme
authored
74
75
76 Known Issues
77 ------------
78 - In Google's KML files the distance between waypoints varies. For straight roads it's larger than for curvy roads. FTLocationSimulator does not consider this difference, so the speed on the KML route varies.
79 - The faked userLocation view does not incorporate the GPS halo animation.
f050e56 Ortwin Gentz, FutureTap FTLocationSimulator now works as a drop-in replacement for CLLocationMan...
authored
80 - heading, course, altitude, speed and accuracy are not implemented (some of them might be technically possible)
91b0ec5 Ortwin Gentz, FutureTap Added Readme
authored
81
82 Collaboration
83 -------------
84 We're happy if someone wants to contribute to the project or work on some of the issues. Just fork the project and send us a pull request.
85
86
87 Have fun!
88
89 -Ortwin
Something went wrong with that request. Please try again.