by doPanic GmbH - for sales and support contact info@dopanic.com
Just add
pod 'PanicAR', :podspec => 'https://raw2.github.com/doPanic/PanicAR/beta/PanicAR.podspec'
to your podfile and do a
pod install
simple as that. Really.
Check API Reference http://docs.dopanic.com/panicar
Check the wiki for tipps and guides on how to implement: https://github.com/doPanic/PanicAR/wiki/
For common build errors and other issues check: https://github.com/doPanic/PanicAR/wiki/Troubleshooting
By default, PanicAR only runs, when the device is GPS enabled (i.e. all iPhones and the 3G/4G iPads), to give the best possible performance. However, you can enable PanicAR for all devices, by calling
[PSKDeviceProperties setSimulateGPSForAllDevices:YES];
in your appdelegate.
POIs, which are further away than the radar range, are shown at the edge. You can set this range by calling
[self.arRadarView setRadarRange:1500];
with a higher value in your PARViewController extension. The value sets the radius of the radar view in meters.
You can change the image of the POI on the radar view by setting the POIs radarView property:
PARPoi* poi = [[poiLabelClass alloc] initWithTitle:@"circle"
theDescription:@"circle"
atLocation:[[CLLocation alloc] initWithLatitude:51.500141 longitude:-0.126257]
];
poi.radarView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"myDot"]];
You can achieve this by setting the backgroundImageView property of the RadarView (you need to rotate it depending on the heading).
OR
by adding 4 POIs, each with an image containing the Letter (N, E, S, W) placed North/East/South/West of the user.
To change the position of an existing POI, use the setLocation method, followed by updateLocation:
// Move all POIs along the Latitudes.
for(PARPoi* poi in [[PARController sharedARController] arObjects]) {
CLLocation * loc = [poi location];
CLLocationCoordinate2D coord = [loc coordinate];
[poi setLocation: [[CLLocation alloc] initWithLatitude:coord.latitude += 0.0001f longitude:coord.longitude]];
[poi updateLocation];
};
Make sure to override the switchFaceDown method:
-(void)switchFaceDown:(BOOL)inFaceDown {
// make sure this is an empty call; otherwise the PARViewController will display a HUD text once the device goes
// into UIDeviceOrientationFaceDown (which it will when the user looks up)
}
Extend PARPoiAdvancedLabel (not just PARPOILabel) and overwrite -(BOOL)stacksInView so that it returns YES
POILabels are just views, so anything that is possible with them is also possible with POI labels.
You need to set the API key via the setApiKey method of [PARController sharedARController]. You e.g. can do this in the loadView method of your controller:
- (void)loadView
{
// IMPORTANT: set Api Key before calling super:loadView!
[[PARController sharedARController] setApiKey:@""];
[[PARController sharedARController] setDelegate:self];
[super loadView];
[self.arRadarView setRadarRange:1500];
}
This can happen if the -load_all linker flag is used, reportedly. Try removing it.
PanicAR is not supported, because the iPod Touch does not have a compass.
The main energy consumer in PanicAR is the camera. The native camera app also drains the battery quite fast.
PanicAR works fine with iOS 8. You only have to make a minor change in the apps' s .plist
file due to new location permissions in iOS 8. Add NSLocationWhenInUseUsageDescription
as key and a string as value describing the purpose of GPS use e.g. "Your location is used to display the Augmented Reality view."
(for further details see here).