This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This code belongs in a custom point/marker view class. | |
// | |
// Calculate this view's size scale based on distance from user's current location. | |
// | |
- (CGFloat) rangeScale | |
{ | |
CGFloat scale = 1.0; | |
if (self.poi) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This code should probably go in sm3darLoadPoints: | |
// Position 3DAR logo in the bottom right of the view. | |
CGFloat logoCenterX = sm3dar.view.frame.size.width - 10 - (sm3dar.iconLogo.frame.size.width / 2); | |
CGFloat logoCenterY = sm3dar.view.frame.size.height - 10 - (sm3dar.iconLogo.frame.size.height / 2); | |
sm3dar.iconLogo.center = CGPointMake(logoCenterX, logoCenterY); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CLLocation *polylineLocation = [[[CLLocation alloc] initWithLatitude:45.5 longitude:-122.6] autorelease]; | |
NSMutableArray *worldCoords = [NSMutableArray array]; | |
Coord3D coord; | |
coord.x = 0; // East | |
coord.y = 100; // North | |
coord.z = 0; // Up | |
WorldCoordinate *wc = [[[WorldCoordinate alloc] initWithCoord:coord] autorelease]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Changing 3DAR's frame will position the logo. | |
CGRect new3darFrame = CGRectMake(0, 0, 160, 240); | |
[sm3dar setFrame:new3darFrame]; | |
// You can also set the icon's position directly. | |
sm3dar.iconLogo.center = CGPointMake(10, 10); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) viewDidLoad // or awakeFromNib | |
{ | |
// Retain a reference to sm3dar. | |
self.sm3dar = [[[SM3DARController alloc] initWithDelegate:self] autorelease]; | |
sm3dar.map = yourArcGisMapOrSomeOtherMapView; // Optional. | |
UIView *containerViewFor3dar = self.view; // Common usage. | |
[containerViewFor3dar addSubview:sm3dar.view] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) add3dObjectNortheastOfUserLocation | |
{ | |
SM3DARTexturedGeometryView *modelView = [[[SM3DARTexturedGeometryView alloc] initWithOBJ:@"star.obj" textureNamed:nil] autorelease]; | |
CLLocationDegrees latitude = mapView.sm3dar.userLocation.coordinate.latitude + 0.0001; | |
CLLocationDegrees longitude = mapView.sm3dar.userLocation.coordinate.longitude + 0.0001; | |
// Add a point with a 3D view to the 3DAR scene. | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In the web view's controller set the UIWebView's baseURL to the resource bundle path. | |
NSString *path = [[NSBundle mainBundle] bundlePath]; | |
NSURL *baseURL = [NSURL fileURLWithPath:path]; | |
[webView loadHTMLString:htmlString baseURL:baseURL]; | |
// Download this powered by image and put it in your app's resource bundle. | |
// https://spotmetrix.s3.amazonaws.com/3DAR/powered_by_3dar_310x50.png | |
// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[{ | |
"title": "AboutUs", | |
"longitude": -122.664284, | |
"altitude": 314, | |
"latitude": 45.519027, | |
"subtitle": "", | |
"my_custom_rating": 4, | |
"some_other_field": ["array value 1", "array value 2"] | |
}, { | |
"title": "Floyd's Coffee Shop", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "SM3DAR.h" | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
SM3DAR_Controller *sm3dar = [SM3DAR_Controller sharedController]; | |
[self.view addSubview:sm3dar.view]; | |
sm3dar.delegate = self; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void) sm3darViewDidLoad | |
- (void) loadPointsOfInterest | |
- (void) didChangeFocusToPOI:(SM3DAR_Point*)newPOI fromPOI:(SM3DAR_Point*)oldPOI | |
- (void) didChangeSelectionToPOI:(SM3DAR_Point*)newPOI fromPOI:(SM3DAR_Point*)oldPOI | |
- (void) didChangeOrientationYaw:(CGFloat)yaw pitch:(CGFloat)pitch roll:(CGFloat)roll | |
- (void) logoWasTapped |