├── .gitignore ├── Podfile.lock ├── README.md ├── pictures └── screenshot01.PNG ├── podfile ├── reaverInMap-swift ├── AppDelegate.swift ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── BridgeHeader.h ├── Info.plist ├── ObjConvert.c ├── ObjConvert.h └── ViewController.swift ├── reaverInMap.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── xcshareddata │ └── xcschemes │ ├── reaverInMap-swift.xcscheme │ ├── reaverInMap.xcscheme │ └── reaverInMapUITests.xcscheme ├── reaverInMap.xcworkspace └── contents.xcworkspacedata ├── reaverInMap ├── AMap3DObjectOverlay.h ├── AMap3DObjectOverlay.m ├── AMap3DObjectOverlayRenderer.h ├── AMap3DObjectOverlayRenderer.mm ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── Cottage_Texture.imageset │ │ ├── Contents.json │ │ └── Cottage_Texture.jpg │ ├── FA-22_Raptor_P01.imageset │ │ ├── Contents.json │ │ └── FA-22_Raptor_P01.png │ ├── Farmhouse_Texture.imageset │ │ ├── Contents.json │ │ └── Farmhouse_Texture.jpg │ ├── FelReaverMount.imageset │ │ ├── Contents.json │ │ └── FelReaverMount.png │ └── V_body.imageset │ │ ├── Contents.json │ │ └── V_body.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── ObjConvert.c ├── ObjConvert.h ├── ViewController.h ├── ViewController.m ├── main.m └── reaver │ ├── Combat_Vehicle.h │ ├── Cottage_Texture.jpg │ ├── FA-22_Raptor_P01.png │ ├── Farmhouse OBJ.h │ ├── Farmhouse_Texture.jpg │ ├── FelReaverMount.h │ ├── FelReaverMount.png │ ├── ReaverOverlay.h │ ├── ReaverOverlay.m │ ├── ReaverOverlayRenderer.h │ ├── ReaverOverlayRenderer.mm │ ├── Snow covered CottageOBJ.h │ ├── V_body.png │ └── raptor.h └── reaverInMapUITests ├── Info.plist └── reaverInMapUITests.m /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | .DS_Store 5 | ## Build generated 6 | build/ 7 | DerivedData 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata 19 | 20 | ## Other 21 | *.xccheckout 22 | *.moved-aside 23 | *.xcuserstate 24 | *.xcscmblueprint 25 | 26 | ## Obj-C/Swift specific 27 | *.hmap 28 | *.ipa 29 | 30 | # CocoaPods 31 | # 32 | # We recommend against adding the Pods directory to your .gitignore. However 33 | # you should judge for yourself, the pros and cons are mentioned at: 34 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 35 | # 36 | Pods/ 37 | Result/ 38 | output/ 39 | 40 | # Carthage 41 | # 42 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 43 | # Carthage/Checkouts 44 | 45 | Carthage/Build 46 | 47 | # fastlane 48 | # 49 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 50 | # screenshots whenever they are needed. 51 | # For more information about the recommended setup visit: 52 | # https://github.com/fastlane/fastlane/blob/master/docs/Gitignore.md 53 | 54 | fastlane/report.xml 55 | fastlane/screenshots -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - AMap3DMap (6.8.1): 3 | - AMapFoundation (~> 1.5) 4 | - AMapFoundation (1.5.6) 5 | 6 | DEPENDENCIES: 7 | - AMap3DMap 8 | 9 | SPEC REPOS: 10 | https://github.com/cocoapods/specs.git: 11 | - AMap3DMap 12 | - AMapFoundation 13 | 14 | SPEC CHECKSUMS: 15 | AMap3DMap: 9fa4ec6ab230bfbd3f0c0834f757fbd7038efe53 16 | AMapFoundation: 20fce2a12cd152e1092afdd04379cdac21932185 17 | 18 | PODFILE CHECKSUM: 049053abd6a74a9373324a39772f840f108b2b45 19 | 20 | COCOAPODS: 1.6.1 21 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 本工程主要介绍了 高德地图iOS SDK 3D版本 在基于地图的游戏方面的应用。 2 | ## 前述 ## 3 | 4 | - [高德官网申请Key](http://lbs.amap.com/dev/#/). 5 | - 阅读[开发指南](http://lbs.amap.com/api/ios-sdk/summary/). 6 | - 工程基于iOS 3D地图SDK实现 7 | 8 | ## 功能描述 ## 9 | 基于3D地图SDK,添加自定义3D模型。并对模型进行位移的操作 10 | 11 | ## 核心类/接口 ## 12 | | 类 | 接口 | 说明 | 版本 | 13 | | -----|:-----:|:-----:|:-----:| 14 | | AMap3DObjectOverlay | + (instancetype)objectOverlayWithCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate size:(CLLocationDistance)size vertexPointer:(float *)vertexPointer normalPointer:(float *)normalPointer texCoordPointer:(float *)texCoordPointer vertsNum:(unsigned int)vertsNum; | 继承自NSObject,实现了设置coordinate | v4.0.0+ | 15 | | AMap3DObjectOverlayRenderer | - (void)glRender; | 自定义Overlay绘制模型的核心代码 | v4.0.0+ | 16 | 17 | ## 核心难点 ## 18 | objective c 19 | 20 | ``` objc 21 | ///自定义Overlay回调 22 | - (MAOverlayRenderer *)mapView:(MAMapView *)mapView rendererForOverlay:(id )overlay 23 | { 24 | if ([overlay isKindOfClass:[AMap3DObjectOverlay class]]) 25 | { 26 | AMap3DObjectOverlay *objOverlay = (AMap3DObjectOverlay *)overlay; 27 | AMap3DObjectOverlayRenderer * reaverRenderer = [[AMap3DObjectOverlayRenderer alloc] initWithObjectOverlay:overlay]; 28 | [reaverRenderer loadStrokeTextureImage:[UIImage imageNamed:objOverlay.textureName]]; 29 | return reaverRenderer; 30 | } 31 | 32 | return nil; 33 | } 34 | ``` 35 | 36 | swift 37 | 38 | ``` swift 39 | ///自定义Overlay回调 40 | func mapView(_ mapView: MAMapView!, rendererFor overlay: MAOverlay!) -> MAOverlayRenderer! { 41 | if overlay.isKind(of: AMap3DObjectOverlay.self) { 42 | let objOverlay:AMap3DObjectOverlay = overlay as! AMap3DObjectOverlay 43 | 44 | let reaverRender: AMap3DObjectOverlayRenderer = AMap3DObjectOverlayRenderer(objectOverlay: overlay as! AMap3DObjectOverlay) 45 | 46 | let image:UIImage = UIImage.init(named: objOverlay.textureName)! 47 | 48 | reaverRender.loadStrokeTextureImage(image) 49 | 50 | return reaverRender 51 | } 52 | 53 | return nil 54 | } 55 | 56 | ``` 57 | 58 | objective c 59 | ``` objc 60 | ///初始化3D模型 61 | - (void)airPlaneInit 62 | { 63 | self.airPlaneOverlay = [AMap3DObjectOverlay objectOverlayWithCenterCoordinate:CLLocationCoordinate2DMake(39.984479, 116.494635) size:100 vertexPointer:raptorVerts normalPointer:raptorNormals texCoordPointer:raptorTexCoords vertsNum:raptorNumVerts]; 64 | 65 | self.airPlaneOverlay.angle = 128; 66 | self.airPlaneOverlay.altitude = 10; 67 | self.airPlaneOverlay.textureName = @"FA-22_Raptor_P01"; 68 | 69 | [self.mapView addOverlay:self.airPlaneOverlay]; 70 | } 71 | 72 | ``` 73 | 74 | swift 75 | ``` swift 76 | func airPlaneInit() { 77 | self.airPlaneOverlay = AMap3DObjectOverlay(center: CLLocationCoordinate2DMake(39.984479, 116.494635), 78 | size: 100, 79 | vertexPointer: pRaptorVerts, 80 | normalPointer: pRaptorNormals, 81 | texCoordPointer: pRaptorTexCoords, 82 | vertsNum: raptorNumVerts) 83 | self.airPlaneOverlay.angle = 128 84 | self.airPlaneOverlay.altitude = 10 85 | self.airPlaneOverlay.textureName = "FA-22_Raptor_P01" 86 | self.mapView.add(self.airPlaneOverlay) 87 | } 88 | ``` 89 | 90 | 91 | model为OC写,所以只有OC版本 92 | ``` objc 93 | ///核心模型绘制代码 94 | - (void)glRender 95 | { 96 | AMap3DObjectOverlay *objOverlay = self.objOverlay; 97 | 98 | if (_isNeedDoMoveCoordinate) { 99 | [self didMoveCoordinate]; 100 | } 101 | 102 | if (objOverlay.vertsNum == 0) 103 | { 104 | return; 105 | } 106 | 107 | glEnable(GL_DEPTH_TEST); 108 | glDepthFunc(GL_LESS); 109 | 110 | glEnable(GL_BLEND); 111 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 112 | 113 | glEnable(GL_TEXTURE_2D); 114 | glEnableClientState(GL_VERTEX_ARRAY); 115 | glEnableClientState(GL_TEXTURE_COORD_ARRAY); 116 | 117 | glBindTexture(GL_TEXTURE_2D, self.strokeTextureID); 118 | glColor4f(1, 1, 1, 1); 119 | 120 | glPushMatrix(); 121 | 122 | if ([self.objOverlay.textureName isEqualToString:@"FA-22_Raptor_P01"] && objOverlay.altitude < 500) { 123 | _centerGL.z = [self calculateSizeInGLReference] / objOverlay.size * objOverlay.altitude; 124 | objOverlay.altitude += 2; 125 | } 126 | 127 | glTranslatef(_centerGL.x, _centerGL.y, _centerGL.z); 128 | glRotatef(90, 1, 0, 0); 129 | 130 | glRotatef(objOverlay.angle, 0, 1, 0); 131 | if ([self.objOverlay.textureName isEqualToString:@"FelReaverMount"]) { 132 | objOverlay.angle += 1; 133 | } 134 | 135 | glScalef(_sizeGL, _sizeGL, _sizeGL); 136 | 137 | glVertexPointer(3, GL_FLOAT, 0, objOverlay.vertexPointer); 138 | glNormalPointer(GL_FLOAT, 0, objOverlay.normalPointer); 139 | glTexCoordPointer(2, GL_FLOAT, 0, objOverlay.texCoordPointer); 140 | 141 | glDrawArrays(GL_TRIANGLES, 0, objOverlay.vertsNum); 142 | 143 | glPopMatrix(); 144 | 145 | glDisable(GL_TEXTURE_2D); 146 | glDisableClientState(GL_VERTEX_ARRAY); 147 | glDisableClientState(GL_TEXTURE_COORD_ARRAY); 148 | 149 | glDisable(GL_BLEND); 150 | glDisable(GL_DEPTH_TEST); 151 | 152 | } 153 | 154 | ``` 155 | 156 | ## 效果图如下 ## 157 | 158 | * ![Screenshot](pictures/screenshot01.PNG "Case01") 159 | 160 | 161 | 162 | -------------------------------------------------------------------------------- /pictures/screenshot01.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/iOS-map-game/24e410ad39f7711fe5c05929cbc7c64a78e96cde/pictures/screenshot01.PNG -------------------------------------------------------------------------------- /podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '8.0' 2 | target 'reaverInMap' do 3 | pod 'AMap3DMap' 4 | end 5 | 6 | target 'reaverInMap-swift' do 7 | pod 'AMap3DMap' 8 | end -------------------------------------------------------------------------------- /reaverInMap-swift/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // reaverInMap-swift 4 | // 5 | // Created by 翁乐 on 16/12/2016. 6 | // Copyright © 2016 Autonavi. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 24 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /reaverInMap-swift/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /reaverInMap-swift/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /reaverInMap-swift/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /reaverInMap-swift/BridgeHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // BridgeHeader.h 3 | // reaverInMap 4 | // 5 | // Created by 翁乐 on 16/12/2016. 6 | // Copyright © 2016 Autonavi. All rights reserved. 7 | // 8 | 9 | #ifndef BridgeHeader_h 10 | #define BridgeHeader_h 11 | 12 | #import 13 | #import 14 | 15 | #import "ObjConvert.h" 16 | 17 | #import "AMap3DObjectOverlay.h" 18 | 19 | #import "AMap3DObjectOverlayRenderer.h" 20 | 21 | 22 | #endif /* BridgeHeader_h */ 23 | -------------------------------------------------------------------------------- /reaverInMap-swift/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /reaverInMap-swift/ObjConvert.c: -------------------------------------------------------------------------------- 1 | // 2 | // ObjConvert.c 3 | // reaverInMap 4 | // 5 | // Created by 翁乐 on 16/12/2016. 6 | // Copyright © 2016 Autonavi. All rights reserved. 7 | // 8 | 9 | #include "ObjConvert.h" 10 | 11 | float *pCombat_VehicleVerts = Combat_VehicleVerts; 12 | float *pCombat_VehicleNormals = Combat_VehicleNormals; 13 | float *pCombat_VehicleTexCoords = Combat_VehicleTexCoords; 14 | 15 | float *pSnow_covered_CottageOBJVerts = Snow_covered_CottageOBJVerts; 16 | float *pSnow_covered_CottageOBJNormals = Snow_covered_CottageOBJNormals; 17 | float *pSnow_covered_CottageOBJTexCoords = Snow_covered_CottageOBJTexCoords; 18 | 19 | float *pFarmhouse_OBJVerts = Farmhouse_OBJVerts; 20 | float *pFarmhouse_OBJNormals = Farmhouse_OBJNormals; 21 | float *pFarmhouse_OBJTexCoords = Farmhouse_OBJTexCoords; 22 | 23 | float *pFelReaverMountVerts = FelReaverMountVerts; 24 | float *pFelReaverMountNormals = FelReaverMountNormals; 25 | float *pFelReaverMountTexCoords = FelReaverMountTexCoords; 26 | 27 | float *pRaptorVerts = raptorVerts; 28 | float *pRaptorNormals = raptorNormals; 29 | float *pRaptorTexCoords = raptorTexCoords; 30 | -------------------------------------------------------------------------------- /reaverInMap-swift/ObjConvert.h: -------------------------------------------------------------------------------- 1 | // 2 | // ObjConvert.h 3 | // reaverInMap 4 | // 5 | // Created by 翁乐 on 16/12/2016. 6 | // Copyright © 2016 Autonavi. All rights reserved. 7 | // 8 | 9 | #ifndef ObjConvert_h 10 | #define ObjConvert_h 11 | 12 | #include "Combat_Vehicle.h" 13 | #include "Snow covered CottageOBJ.h" 14 | #include "Farmhouse OBJ.h" 15 | #include "FelReaverMount.h" 16 | #include "raptor.h" 17 | 18 | extern float *pCombat_VehicleVerts; 19 | extern float *pCombat_VehicleNormals; 20 | extern float *pCombat_VehicleTexCoords; 21 | 22 | extern float *pSnow_covered_CottageOBJVerts; 23 | extern float *pSnow_covered_CottageOBJNormals; 24 | extern float *pSnow_covered_CottageOBJTexCoords; 25 | 26 | extern float *pFarmhouse_OBJVerts; 27 | extern float *pFarmhouse_OBJNormals; 28 | extern float *pFarmhouse_OBJTexCoords; 29 | 30 | extern float *pFelReaverMountVerts; 31 | extern float *pFelReaverMountNormals; 32 | extern float *pFelReaverMountTexCoords; 33 | 34 | extern float *pRaptorVerts; 35 | extern float *pRaptorNormals; 36 | extern float *pRaptorTexCoords; 37 | 38 | #endif /* ObjConvert_h */ 39 | -------------------------------------------------------------------------------- /reaverInMap-swift/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // reaverInMap-swift 4 | // 5 | // Created by 翁乐 on 16/12/2016. 6 | // Copyright © 2016 Autonavi. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | class ViewController: UIViewController, MAMapViewDelegate, AMap3DObjectOverlayRendererDelegate, UIGestureRecognizerDelegate { 12 | 13 | var _selfMapView: MAMapView! 14 | 15 | var mapView: MAMapView! { 16 | get { 17 | if _selfMapView == nil { 18 | _selfMapView = MAMapView(frame: self.view.bounds) 19 | _selfMapView.centerCoordinate = CLLocationCoordinate2DMake(39.991647, 116.475237) 20 | _selfMapView.zoomLevel = 15.0 21 | _selfMapView.isAllowDecreaseFrame = false 22 | _selfMapView.isShowsBuildings = false 23 | _selfMapView.isShowsLabels = false 24 | _selfMapView.mapType = .navi 25 | } 26 | return _selfMapView 27 | } 28 | } 29 | var airPlaneOverlay: AMap3DObjectOverlay! 30 | var carOverlay: AMap3DObjectOverlay! 31 | var monsterOverlay: AMap3DObjectOverlay! 32 | var house1: AMap3DObjectOverlay! 33 | var house2: AMap3DObjectOverlay! 34 | 35 | required init?(coder aDecoder: NSCoder) { 36 | // self._record = CLLocationCoordinate2DMake(0, 0) 37 | super.init(coder: aDecoder) 38 | } 39 | 40 | // func currentOverlayCenterCoordinate(coordinate: CLLocationCoordinate2D) { 41 | // mapView.setCenter(coordinate, animated: false) 42 | // } 43 | 44 | func currentOverlayCenter(_ coordinate: CLLocationCoordinate2D) { 45 | mapView.setCenter(coordinate, animated: false) 46 | } 47 | 48 | func mapView(_ mapView: MAMapView!, rendererFor overlay: MAOverlay!) -> MAOverlayRenderer! { 49 | if overlay.isKind(of: AMap3DObjectOverlay.self) { 50 | let objOverlay:AMap3DObjectOverlay = overlay as! AMap3DObjectOverlay 51 | 52 | let reaverRender: AMap3DObjectOverlayRenderer = AMap3DObjectOverlayRenderer(objectOverlay: overlay as! AMap3DObjectOverlay) 53 | 54 | let image:UIImage = UIImage.init(named: objOverlay.textureName)! 55 | 56 | reaverRender.loadStrokeTextureImage(image) 57 | 58 | return reaverRender 59 | } 60 | 61 | return nil 62 | } 63 | 64 | func mapView(_ mapView: MAMapView!, didAddOverlayRenderers overlayRenderers: [Any]!) { 65 | perform(#selector(action1), with: nil, afterDelay: 0.5) 66 | perform(#selector(action2), with: nil, afterDelay: 0.5 + 3) 67 | } 68 | 69 | @objc func action1() { 70 | mapView.setZoomLevel(17, animated: true) 71 | mapView.setCenter(airPlaneOverlay.coordinate, animated: true) 72 | mapView.setCameraDegree(60, animated: true, duration: 1) 73 | 74 | let render: AMap3DObjectOverlayRenderer = mapView.renderer(for: airPlaneOverlay) as! AMap3DObjectOverlayRenderer 75 | 76 | render.customerDelegate = self 77 | render.move(toNewCoordinate: CLLocationCoordinate2DMake(39.995001, 116.480644), andDuration: 3) 78 | } 79 | 80 | @objc func action2() { 81 | mapView.setZoomLevel(19, animated: true) 82 | mapView.setRotationDegree(40, animated: true, duration: 1) 83 | mapView.setCameraDegree(60, animated: true, duration: 1) 84 | mapView.setCenter(carOverlay.coordinate, animated: true) 85 | 86 | let render: AMap3DObjectOverlayRenderer = mapView.renderer(for: carOverlay) as! AMap3DObjectOverlayRenderer 87 | render.customerDelegate = self 88 | 89 | render.move(toNewCoordinate: CLLocationCoordinate2DMake(39.99537, 116.477174), andDuration: 8) 90 | } 91 | 92 | func houseInit() { 93 | 94 | house1 = AMap3DObjectOverlay(center: CLLocationCoordinate2DMake(39.993266, 116.473269), 95 | size: 150, 96 | vertexPointer: pSnow_covered_CottageOBJVerts, 97 | texCoordPointer: pSnow_covered_CottageOBJTexCoords, 98 | vertsNum: Snow_covered_CottageOBJNumVerts) 99 | 100 | self.house1.angle = 315 101 | self.house1.altitude = 5 102 | self.house1.textureName = "Cottage_Texture.jpg" 103 | self.mapView.add(self.house1) 104 | 105 | self.house2 = AMap3DObjectOverlay(center: CLLocationCoordinate2DMake(39.994794, 116.47762), 106 | size: 150, 107 | vertexPointer: pFarmhouse_OBJVerts, 108 | texCoordPointer: pFarmhouse_OBJTexCoords, 109 | vertsNum: Farmhouse_OBJNumVerts) 110 | 111 | self.house2.angle = 40 112 | self.house2.altitude = 5 113 | self.house2.textureName = "Farmhouse_Texture.jpg" 114 | self.mapView.add(self.house2) 115 | } 116 | 117 | func monsterInit() { 118 | 119 | self.monsterOverlay = AMap3DObjectOverlay(center: CLLocationCoordinate2DMake(39.996965, 116.478548), 120 | size: 300, 121 | vertexPointer: pFelReaverMountVerts, 122 | texCoordPointer: pFelReaverMountTexCoords, 123 | vertsNum: FelReaverMountNumVerts) 124 | 125 | self.monsterOverlay.angle = 200 126 | self.monsterOverlay.altitude = 130 127 | self.monsterOverlay.textureName = "FelReaverMount.png" 128 | self.mapView.add(self.monsterOverlay) 129 | } 130 | 131 | func carInit() { 132 | self.carOverlay = AMap3DObjectOverlay(center: CLLocationCoordinate2DMake(39.991289, 116.472575), 133 | size: 35, 134 | vertexPointer: pCombat_VehicleVerts, 135 | texCoordPointer: pCombat_VehicleTexCoords, 136 | vertsNum: Combat_VehicleNumVerts) 137 | self.carOverlay.angle = 40 138 | self.carOverlay.altitude = 4 139 | self.carOverlay.textureName = "V_body.png" 140 | self.mapView.add(self.carOverlay) 141 | } 142 | 143 | func airPlaneInit() { 144 | self.airPlaneOverlay = AMap3DObjectOverlay(center: CLLocationCoordinate2DMake(39.984479, 116.494635), 145 | size: 100, 146 | vertexPointer: pRaptorVerts, 147 | texCoordPointer: pRaptorTexCoords, 148 | vertsNum: raptorNumVerts) 149 | self.airPlaneOverlay.angle = 128 150 | self.airPlaneOverlay.altitude = 10 151 | self.airPlaneOverlay.textureName = "FA-22_Raptor_P01.png" 152 | self.mapView.add(self.airPlaneOverlay) 153 | } 154 | 155 | override func viewDidAppear(_ animated: Bool) { 156 | super.viewDidAppear(animated) 157 | 158 | airPlaneInit() 159 | carInit() 160 | monsterInit() 161 | houseInit() 162 | 163 | } 164 | 165 | override func viewDidLoad() { 166 | super.viewDidLoad() 167 | 168 | AMapServices.shared().enableHTTPS = true 169 | 170 | //set up mapView 171 | view.addSubview(mapView) 172 | mapView.delegate = self 173 | } 174 | 175 | override func didReceiveMemoryWarning() { 176 | super.didReceiveMemoryWarning() 177 | // Dispose of any resources that can be recreated. 178 | } 179 | 180 | 181 | } 182 | 183 | -------------------------------------------------------------------------------- /reaverInMap.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 196BC8641D6B1A6100EBF216 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 196BC8631D6B1A6100EBF216 /* Assets.xcassets */; }; 11 | 19E2250C1E0B85C4009F2797 /* ObjConvert.c in Sources */ = {isa = PBXBuildFile; fileRef = 19E2250A1E0B85C4009F2797 /* ObjConvert.c */; }; 12 | 19E2250D1E0B8BBA009F2797 /* AMap3DObjectOverlay.m in Sources */ = {isa = PBXBuildFile; fileRef = 81B61EBF1D66A20900415DAD /* AMap3DObjectOverlay.m */; }; 13 | 19E2250E1E0B8BBC009F2797 /* AMap3DObjectOverlayRenderer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 81B61EC21D66A41100415DAD /* AMap3DObjectOverlayRenderer.mm */; }; 14 | 19EFDB071E039451004702D3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19EFDB061E039451004702D3 /* AppDelegate.swift */; }; 15 | 19EFDB091E039451004702D3 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 19EFDB081E039451004702D3 /* ViewController.swift */; }; 16 | 19EFDB0C1E039451004702D3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 19EFDB0A1E039451004702D3 /* Main.storyboard */; }; 17 | 19EFDB111E039451004702D3 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 19EFDB0F1E039451004702D3 /* LaunchScreen.storyboard */; }; 18 | 19EFDB4B1E078DD0004702D3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 19EFDB4A1E078DD0004702D3 /* Assets.xcassets */; }; 19 | 3AEECB9D1F750712001BE65C /* FelReaverMount.png in Resources */ = {isa = PBXBuildFile; fileRef = 3AEECB981F750711001BE65C /* FelReaverMount.png */; }; 20 | 3AEECB9E1F750712001BE65C /* V_body.png in Resources */ = {isa = PBXBuildFile; fileRef = 3AEECB991F750711001BE65C /* V_body.png */; }; 21 | 3AEECB9F1F750712001BE65C /* Cottage_Texture.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 3AEECB9A1F750711001BE65C /* Cottage_Texture.jpg */; }; 22 | 3AEECBA01F750712001BE65C /* Farmhouse_Texture.jpg in Resources */ = {isa = PBXBuildFile; fileRef = 3AEECB9B1F750712001BE65C /* Farmhouse_Texture.jpg */; }; 23 | 3AEECBA11F750712001BE65C /* FA-22_Raptor_P01.png in Resources */ = {isa = PBXBuildFile; fileRef = 3AEECB9C1F750712001BE65C /* FA-22_Raptor_P01.png */; }; 24 | 81B61EC01D66A20900415DAD /* AMap3DObjectOverlay.m in Sources */ = {isa = PBXBuildFile; fileRef = 81B61EBF1D66A20900415DAD /* AMap3DObjectOverlay.m */; }; 25 | 81B61EC31D66A41100415DAD /* AMap3DObjectOverlayRenderer.mm in Sources */ = {isa = PBXBuildFile; fileRef = 81B61EC21D66A41100415DAD /* AMap3DObjectOverlayRenderer.mm */; }; 26 | 8DDFCBC6229ACF1523D24210 /* libPods-reaverInMap.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 52950540D3CDE5FAA9A06E08 /* libPods-reaverInMap.a */; }; 27 | C87E3AEC1C57245E000ACF0C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C87E3AEB1C57245E000ACF0C /* main.m */; }; 28 | C87E3AEF1C57245E000ACF0C /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C87E3AEE1C57245E000ACF0C /* AppDelegate.m */; }; 29 | C87E3AF21C57245E000ACF0C /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C87E3AF11C57245E000ACF0C /* ViewController.m */; }; 30 | C87E3AF51C57245E000ACF0C /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C87E3AF31C57245E000ACF0C /* Main.storyboard */; }; 31 | C87E3AFA1C57245E000ACF0C /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C87E3AF81C57245E000ACF0C /* LaunchScreen.storyboard */; }; 32 | D9F65BF41E2E04EE002BBD5C /* reaverInMapUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = D9F65BF31E2E04EE002BBD5C /* reaverInMapUITests.m */; }; 33 | EC657A67B8D1F8DDC0E15E6B /* libPods-reaverInMap-swift.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B07C6B626E42F28A90C29A7 /* libPods-reaverInMap-swift.a */; }; 34 | /* End PBXBuildFile section */ 35 | 36 | /* Begin PBXContainerItemProxy section */ 37 | D9F65BF61E2E04EE002BBD5C /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = C87E3ADF1C57245D000ACF0C /* Project object */; 40 | proxyType = 1; 41 | remoteGlobalIDString = C87E3AE61C57245D000ACF0C; 42 | remoteInfo = reaverInMap; 43 | }; 44 | /* End PBXContainerItemProxy section */ 45 | 46 | /* Begin PBXFileReference section */ 47 | 196BC8601D6B14A100EBF216 /* Farmhouse OBJ.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "Farmhouse OBJ.h"; path = "reaver/Farmhouse OBJ.h"; sourceTree = ""; }; 48 | 196BC8611D6B16C300EBF216 /* Snow covered CottageOBJ.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "Snow covered CottageOBJ.h"; path = "reaver/Snow covered CottageOBJ.h"; sourceTree = ""; }; 49 | 196BC8621D6B1A3F00EBF216 /* Combat_Vehicle.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Combat_Vehicle.h; path = reaver/Combat_Vehicle.h; sourceTree = ""; }; 50 | 196BC8631D6B1A6100EBF216 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 51 | 196BC8651D6B1DBB00EBF216 /* raptor.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = raptor.h; path = reaver/raptor.h; sourceTree = ""; }; 52 | 19E2250A1E0B85C4009F2797 /* ObjConvert.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ObjConvert.c; sourceTree = ""; }; 53 | 19E2250B1E0B85C4009F2797 /* ObjConvert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ObjConvert.h; sourceTree = ""; }; 54 | 19EFDB041E039451004702D3 /* reaverInMap-swift.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "reaverInMap-swift.app"; sourceTree = BUILT_PRODUCTS_DIR; }; 55 | 19EFDB061E039451004702D3 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 56 | 19EFDB081E039451004702D3 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 57 | 19EFDB0B1E039451004702D3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 58 | 19EFDB101E039451004702D3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 59 | 19EFDB121E039451004702D3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 60 | 19EFDB161E039AB5004702D3 /* BridgeHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BridgeHeader.h; sourceTree = ""; }; 61 | 19EFDB4A1E078DD0004702D3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = reaverInMap/Assets.xcassets; sourceTree = SOURCE_ROOT; }; 62 | 3AEECB981F750711001BE65C /* FelReaverMount.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = FelReaverMount.png; path = reaver/FelReaverMount.png; sourceTree = ""; }; 63 | 3AEECB991F750711001BE65C /* V_body.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = V_body.png; path = reaver/V_body.png; sourceTree = ""; }; 64 | 3AEECB9A1F750711001BE65C /* Cottage_Texture.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = Cottage_Texture.jpg; path = reaver/Cottage_Texture.jpg; sourceTree = ""; }; 65 | 3AEECB9B1F750712001BE65C /* Farmhouse_Texture.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; name = Farmhouse_Texture.jpg; path = reaver/Farmhouse_Texture.jpg; sourceTree = ""; }; 66 | 3AEECB9C1F750712001BE65C /* FA-22_Raptor_P01.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = "FA-22_Raptor_P01.png"; path = "reaver/FA-22_Raptor_P01.png"; sourceTree = ""; }; 67 | 52950540D3CDE5FAA9A06E08 /* libPods-reaverInMap.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-reaverInMap.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 68 | 6EE88CC9B58D6300B917AA4F /* Pods-reaverInMap-swift.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-reaverInMap-swift.debug.xcconfig"; path = "Pods/Target Support Files/Pods-reaverInMap-swift/Pods-reaverInMap-swift.debug.xcconfig"; sourceTree = ""; }; 69 | 7DB8CED35D49AE0312DE0D28 /* Pods-reaverInMap-swift.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-reaverInMap-swift.release.xcconfig"; path = "Pods/Target Support Files/Pods-reaverInMap-swift/Pods-reaverInMap-swift.release.xcconfig"; sourceTree = ""; }; 70 | 81B61EBE1D66A20900415DAD /* AMap3DObjectOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AMap3DObjectOverlay.h; sourceTree = ""; }; 71 | 81B61EBF1D66A20900415DAD /* AMap3DObjectOverlay.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AMap3DObjectOverlay.m; sourceTree = ""; }; 72 | 81B61EC11D66A41100415DAD /* AMap3DObjectOverlayRenderer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AMap3DObjectOverlayRenderer.h; sourceTree = ""; }; 73 | 81B61EC21D66A41100415DAD /* AMap3DObjectOverlayRenderer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AMap3DObjectOverlayRenderer.mm; sourceTree = ""; }; 74 | 9B07C6B626E42F28A90C29A7 /* libPods-reaverInMap-swift.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-reaverInMap-swift.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 75 | C87E3AE71C57245E000ACF0C /* reaverInMap.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = reaverInMap.app; sourceTree = BUILT_PRODUCTS_DIR; }; 76 | C87E3AEB1C57245E000ACF0C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 77 | C87E3AED1C57245E000ACF0C /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 78 | C87E3AEE1C57245E000ACF0C /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 79 | C87E3AF01C57245E000ACF0C /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 80 | C87E3AF11C57245E000ACF0C /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 81 | C87E3AF41C57245E000ACF0C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 82 | C87E3AF91C57245E000ACF0C /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 83 | C87E3AFB1C57245E000ACF0C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 84 | C8D009031C57358E003C075A /* FelReaverMount.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FelReaverMount.h; path = reaver/FelReaverMount.h; sourceTree = ""; }; 85 | CDF9302E7AD6AD506F415181 /* Pods-reaverInMap.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-reaverInMap.release.xcconfig"; path = "Pods/Target Support Files/Pods-reaverInMap/Pods-reaverInMap.release.xcconfig"; sourceTree = ""; }; 86 | D9F65BF11E2E04EE002BBD5C /* reaverInMapUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = reaverInMapUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 87 | D9F65BF31E2E04EE002BBD5C /* reaverInMapUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = reaverInMapUITests.m; sourceTree = ""; }; 88 | D9F65BF51E2E04EE002BBD5C /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 89 | DB73DC24840701C027D05BDE /* Pods-reaverInMap.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-reaverInMap.debug.xcconfig"; path = "Pods/Target Support Files/Pods-reaverInMap/Pods-reaverInMap.debug.xcconfig"; sourceTree = ""; }; 90 | /* End PBXFileReference section */ 91 | 92 | /* Begin PBXFrameworksBuildPhase section */ 93 | 19EFDB011E039451004702D3 /* Frameworks */ = { 94 | isa = PBXFrameworksBuildPhase; 95 | buildActionMask = 2147483647; 96 | files = ( 97 | EC657A67B8D1F8DDC0E15E6B /* libPods-reaverInMap-swift.a in Frameworks */, 98 | ); 99 | runOnlyForDeploymentPostprocessing = 0; 100 | }; 101 | C87E3AE41C57245D000ACF0C /* Frameworks */ = { 102 | isa = PBXFrameworksBuildPhase; 103 | buildActionMask = 2147483647; 104 | files = ( 105 | 8DDFCBC6229ACF1523D24210 /* libPods-reaverInMap.a in Frameworks */, 106 | ); 107 | runOnlyForDeploymentPostprocessing = 0; 108 | }; 109 | D9F65BEE1E2E04EE002BBD5C /* Frameworks */ = { 110 | isa = PBXFrameworksBuildPhase; 111 | buildActionMask = 2147483647; 112 | files = ( 113 | ); 114 | runOnlyForDeploymentPostprocessing = 0; 115 | }; 116 | /* End PBXFrameworksBuildPhase section */ 117 | 118 | /* Begin PBXGroup section */ 119 | 19EFDB051E039451004702D3 /* reaverInMap-swift */ = { 120 | isa = PBXGroup; 121 | children = ( 122 | 19EFDB061E039451004702D3 /* AppDelegate.swift */, 123 | 19EFDB081E039451004702D3 /* ViewController.swift */, 124 | 19EFDB161E039AB5004702D3 /* BridgeHeader.h */, 125 | 19E2250A1E0B85C4009F2797 /* ObjConvert.c */, 126 | 19E2250B1E0B85C4009F2797 /* ObjConvert.h */, 127 | 19EFDB4A1E078DD0004702D3 /* Assets.xcassets */, 128 | 19EFDB0A1E039451004702D3 /* Main.storyboard */, 129 | 19EFDB0F1E039451004702D3 /* LaunchScreen.storyboard */, 130 | 19EFDB121E039451004702D3 /* Info.plist */, 131 | ); 132 | path = "reaverInMap-swift"; 133 | sourceTree = ""; 134 | }; 135 | B6031342AA2AACF8E44E507C /* Pods */ = { 136 | isa = PBXGroup; 137 | children = ( 138 | DB73DC24840701C027D05BDE /* Pods-reaverInMap.debug.xcconfig */, 139 | CDF9302E7AD6AD506F415181 /* Pods-reaverInMap.release.xcconfig */, 140 | 6EE88CC9B58D6300B917AA4F /* Pods-reaverInMap-swift.debug.xcconfig */, 141 | 7DB8CED35D49AE0312DE0D28 /* Pods-reaverInMap-swift.release.xcconfig */, 142 | ); 143 | name = Pods; 144 | sourceTree = ""; 145 | }; 146 | C87E3ADE1C57245D000ACF0C = { 147 | isa = PBXGroup; 148 | children = ( 149 | C87E3AE91C57245E000ACF0C /* reaverInMap */, 150 | 19EFDB051E039451004702D3 /* reaverInMap-swift */, 151 | D9F65BF21E2E04EE002BBD5C /* reaverInMapUITests */, 152 | C87E3AE81C57245E000ACF0C /* Products */, 153 | B6031342AA2AACF8E44E507C /* Pods */, 154 | CD146C76BC4A44DA81A98CFE /* Frameworks */, 155 | ); 156 | sourceTree = ""; 157 | }; 158 | C87E3AE81C57245E000ACF0C /* Products */ = { 159 | isa = PBXGroup; 160 | children = ( 161 | C87E3AE71C57245E000ACF0C /* reaverInMap.app */, 162 | 19EFDB041E039451004702D3 /* reaverInMap-swift.app */, 163 | D9F65BF11E2E04EE002BBD5C /* reaverInMapUITests.xctest */, 164 | ); 165 | name = Products; 166 | sourceTree = ""; 167 | }; 168 | C87E3AE91C57245E000ACF0C /* reaverInMap */ = { 169 | isa = PBXGroup; 170 | children = ( 171 | C87E3B071C573228000ACF0C /* reaver */, 172 | C87E3AED1C57245E000ACF0C /* AppDelegate.h */, 173 | C87E3AEE1C57245E000ACF0C /* AppDelegate.m */, 174 | C87E3AF01C57245E000ACF0C /* ViewController.h */, 175 | C87E3AF11C57245E000ACF0C /* ViewController.m */, 176 | 196BC8631D6B1A6100EBF216 /* Assets.xcassets */, 177 | C87E3AF31C57245E000ACF0C /* Main.storyboard */, 178 | C87E3AF81C57245E000ACF0C /* LaunchScreen.storyboard */, 179 | C87E3AFB1C57245E000ACF0C /* Info.plist */, 180 | C87E3AEA1C57245E000ACF0C /* Supporting Files */, 181 | ); 182 | path = reaverInMap; 183 | sourceTree = ""; 184 | }; 185 | C87E3AEA1C57245E000ACF0C /* Supporting Files */ = { 186 | isa = PBXGroup; 187 | children = ( 188 | C87E3AEB1C57245E000ACF0C /* main.m */, 189 | ); 190 | name = "Supporting Files"; 191 | sourceTree = ""; 192 | }; 193 | C87E3B071C573228000ACF0C /* reaver */ = { 194 | isa = PBXGroup; 195 | children = ( 196 | 3AEECB9A1F750711001BE65C /* Cottage_Texture.jpg */, 197 | 3AEECB9C1F750712001BE65C /* FA-22_Raptor_P01.png */, 198 | 3AEECB9B1F750712001BE65C /* Farmhouse_Texture.jpg */, 199 | 3AEECB981F750711001BE65C /* FelReaverMount.png */, 200 | 3AEECB991F750711001BE65C /* V_body.png */, 201 | 196BC8651D6B1DBB00EBF216 /* raptor.h */, 202 | 196BC8621D6B1A3F00EBF216 /* Combat_Vehicle.h */, 203 | 196BC8611D6B16C300EBF216 /* Snow covered CottageOBJ.h */, 204 | 196BC8601D6B14A100EBF216 /* Farmhouse OBJ.h */, 205 | C8D009031C57358E003C075A /* FelReaverMount.h */, 206 | 81B61EBE1D66A20900415DAD /* AMap3DObjectOverlay.h */, 207 | 81B61EBF1D66A20900415DAD /* AMap3DObjectOverlay.m */, 208 | 81B61EC11D66A41100415DAD /* AMap3DObjectOverlayRenderer.h */, 209 | 81B61EC21D66A41100415DAD /* AMap3DObjectOverlayRenderer.mm */, 210 | ); 211 | name = reaver; 212 | sourceTree = ""; 213 | }; 214 | CD146C76BC4A44DA81A98CFE /* Frameworks */ = { 215 | isa = PBXGroup; 216 | children = ( 217 | 52950540D3CDE5FAA9A06E08 /* libPods-reaverInMap.a */, 218 | 9B07C6B626E42F28A90C29A7 /* libPods-reaverInMap-swift.a */, 219 | ); 220 | name = Frameworks; 221 | sourceTree = ""; 222 | }; 223 | D9F65BF21E2E04EE002BBD5C /* reaverInMapUITests */ = { 224 | isa = PBXGroup; 225 | children = ( 226 | D9F65BF31E2E04EE002BBD5C /* reaverInMapUITests.m */, 227 | D9F65BF51E2E04EE002BBD5C /* Info.plist */, 228 | ); 229 | path = reaverInMapUITests; 230 | sourceTree = ""; 231 | }; 232 | /* End PBXGroup section */ 233 | 234 | /* Begin PBXNativeTarget section */ 235 | 19EFDB031E039451004702D3 /* reaverInMap-swift */ = { 236 | isa = PBXNativeTarget; 237 | buildConfigurationList = 19EFDB151E039451004702D3 /* Build configuration list for PBXNativeTarget "reaverInMap-swift" */; 238 | buildPhases = ( 239 | B8A6276FDC0C340D53941503 /* [CP] Check Pods Manifest.lock */, 240 | 19EFDB001E039451004702D3 /* Sources */, 241 | 19EFDB011E039451004702D3 /* Frameworks */, 242 | 19EFDB021E039451004702D3 /* Resources */, 243 | 92B90F8C01B837928B970F68 /* [CP] Copy Pods Resources */, 244 | ); 245 | buildRules = ( 246 | ); 247 | dependencies = ( 248 | ); 249 | name = "reaverInMap-swift"; 250 | productName = "reaverInMap-swift"; 251 | productReference = 19EFDB041E039451004702D3 /* reaverInMap-swift.app */; 252 | productType = "com.apple.product-type.application"; 253 | }; 254 | C87E3AE61C57245D000ACF0C /* reaverInMap */ = { 255 | isa = PBXNativeTarget; 256 | buildConfigurationList = C87E3AFE1C57245E000ACF0C /* Build configuration list for PBXNativeTarget "reaverInMap" */; 257 | buildPhases = ( 258 | DC28799ADB8962AD6DF53C23 /* [CP] Check Pods Manifest.lock */, 259 | C87E3AE31C57245D000ACF0C /* Sources */, 260 | C87E3AE41C57245D000ACF0C /* Frameworks */, 261 | C87E3AE51C57245D000ACF0C /* Resources */, 262 | D1BE4B81774E264C08A2097A /* [CP] Copy Pods Resources */, 263 | ); 264 | buildRules = ( 265 | ); 266 | dependencies = ( 267 | ); 268 | name = reaverInMap; 269 | productName = reaverInMap; 270 | productReference = C87E3AE71C57245E000ACF0C /* reaverInMap.app */; 271 | productType = "com.apple.product-type.application"; 272 | }; 273 | D9F65BF01E2E04EE002BBD5C /* reaverInMapUITests */ = { 274 | isa = PBXNativeTarget; 275 | buildConfigurationList = D9F65BFA1E2E04EF002BBD5C /* Build configuration list for PBXNativeTarget "reaverInMapUITests" */; 276 | buildPhases = ( 277 | D9F65BED1E2E04EE002BBD5C /* Sources */, 278 | D9F65BEE1E2E04EE002BBD5C /* Frameworks */, 279 | D9F65BEF1E2E04EE002BBD5C /* Resources */, 280 | ); 281 | buildRules = ( 282 | ); 283 | dependencies = ( 284 | D9F65BF71E2E04EE002BBD5C /* PBXTargetDependency */, 285 | ); 286 | name = reaverInMapUITests; 287 | productName = reaverInMapUITests; 288 | productReference = D9F65BF11E2E04EE002BBD5C /* reaverInMapUITests.xctest */; 289 | productType = "com.apple.product-type.bundle.ui-testing"; 290 | }; 291 | /* End PBXNativeTarget section */ 292 | 293 | /* Begin PBXProject section */ 294 | C87E3ADF1C57245D000ACF0C /* Project object */ = { 295 | isa = PBXProject; 296 | attributes = { 297 | LastSwiftUpdateCheck = 0820; 298 | LastUpgradeCheck = 0900; 299 | ORGANIZATIONNAME = Autonavi; 300 | TargetAttributes = { 301 | 19EFDB031E039451004702D3 = { 302 | CreatedOnToolsVersion = 8.2; 303 | DevelopmentTeam = YMJ372W38W; 304 | ProvisioningStyle = Manual; 305 | }; 306 | C87E3AE61C57245D000ACF0C = { 307 | CreatedOnToolsVersion = 7.2; 308 | DevelopmentTeam = YMJ372W38W; 309 | ProvisioningStyle = Manual; 310 | }; 311 | D9F65BF01E2E04EE002BBD5C = { 312 | CreatedOnToolsVersion = 8.2; 313 | DevelopmentTeam = YMJ372W38W; 314 | ProvisioningStyle = Manual; 315 | TestTargetID = C87E3AE61C57245D000ACF0C; 316 | }; 317 | }; 318 | }; 319 | buildConfigurationList = C87E3AE21C57245D000ACF0C /* Build configuration list for PBXProject "reaverInMap" */; 320 | compatibilityVersion = "Xcode 3.2"; 321 | developmentRegion = English; 322 | hasScannedForEncodings = 0; 323 | knownRegions = ( 324 | English, 325 | en, 326 | Base, 327 | ); 328 | mainGroup = C87E3ADE1C57245D000ACF0C; 329 | productRefGroup = C87E3AE81C57245E000ACF0C /* Products */; 330 | projectDirPath = ""; 331 | projectRoot = ""; 332 | targets = ( 333 | C87E3AE61C57245D000ACF0C /* reaverInMap */, 334 | 19EFDB031E039451004702D3 /* reaverInMap-swift */, 335 | D9F65BF01E2E04EE002BBD5C /* reaverInMapUITests */, 336 | ); 337 | }; 338 | /* End PBXProject section */ 339 | 340 | /* Begin PBXResourcesBuildPhase section */ 341 | 19EFDB021E039451004702D3 /* Resources */ = { 342 | isa = PBXResourcesBuildPhase; 343 | buildActionMask = 2147483647; 344 | files = ( 345 | 19EFDB111E039451004702D3 /* LaunchScreen.storyboard in Resources */, 346 | 19EFDB4B1E078DD0004702D3 /* Assets.xcassets in Resources */, 347 | 19EFDB0C1E039451004702D3 /* Main.storyboard in Resources */, 348 | ); 349 | runOnlyForDeploymentPostprocessing = 0; 350 | }; 351 | C87E3AE51C57245D000ACF0C /* Resources */ = { 352 | isa = PBXResourcesBuildPhase; 353 | buildActionMask = 2147483647; 354 | files = ( 355 | 3AEECBA01F750712001BE65C /* Farmhouse_Texture.jpg in Resources */, 356 | 3AEECB9E1F750712001BE65C /* V_body.png in Resources */, 357 | 3AEECB9D1F750712001BE65C /* FelReaverMount.png in Resources */, 358 | C87E3AFA1C57245E000ACF0C /* LaunchScreen.storyboard in Resources */, 359 | 196BC8641D6B1A6100EBF216 /* Assets.xcassets in Resources */, 360 | C87E3AF51C57245E000ACF0C /* Main.storyboard in Resources */, 361 | 3AEECBA11F750712001BE65C /* FA-22_Raptor_P01.png in Resources */, 362 | 3AEECB9F1F750712001BE65C /* Cottage_Texture.jpg in Resources */, 363 | ); 364 | runOnlyForDeploymentPostprocessing = 0; 365 | }; 366 | D9F65BEF1E2E04EE002BBD5C /* Resources */ = { 367 | isa = PBXResourcesBuildPhase; 368 | buildActionMask = 2147483647; 369 | files = ( 370 | ); 371 | runOnlyForDeploymentPostprocessing = 0; 372 | }; 373 | /* End PBXResourcesBuildPhase section */ 374 | 375 | /* Begin PBXShellScriptBuildPhase section */ 376 | 92B90F8C01B837928B970F68 /* [CP] Copy Pods Resources */ = { 377 | isa = PBXShellScriptBuildPhase; 378 | buildActionMask = 2147483647; 379 | files = ( 380 | ); 381 | inputPaths = ( 382 | "${PODS_ROOT}/Target Support Files/Pods-reaverInMap-swift/Pods-reaverInMap-swift-resources.sh", 383 | "${PODS_ROOT}/AMap3DMap/MAMapKit.framework/AMap.bundle", 384 | ); 385 | name = "[CP] Copy Pods Resources"; 386 | outputPaths = ( 387 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AMap.bundle", 388 | ); 389 | runOnlyForDeploymentPostprocessing = 0; 390 | shellPath = /bin/sh; 391 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-reaverInMap-swift/Pods-reaverInMap-swift-resources.sh\"\n"; 392 | showEnvVarsInLog = 0; 393 | }; 394 | B8A6276FDC0C340D53941503 /* [CP] Check Pods Manifest.lock */ = { 395 | isa = PBXShellScriptBuildPhase; 396 | buildActionMask = 2147483647; 397 | files = ( 398 | ); 399 | inputPaths = ( 400 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 401 | "${PODS_ROOT}/Manifest.lock", 402 | ); 403 | name = "[CP] Check Pods Manifest.lock"; 404 | outputPaths = ( 405 | "$(DERIVED_FILE_DIR)/Pods-reaverInMap-swift-checkManifestLockResult.txt", 406 | ); 407 | runOnlyForDeploymentPostprocessing = 0; 408 | shellPath = /bin/sh; 409 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 410 | showEnvVarsInLog = 0; 411 | }; 412 | D1BE4B81774E264C08A2097A /* [CP] Copy Pods Resources */ = { 413 | isa = PBXShellScriptBuildPhase; 414 | buildActionMask = 2147483647; 415 | files = ( 416 | ); 417 | inputPaths = ( 418 | "${PODS_ROOT}/Target Support Files/Pods-reaverInMap/Pods-reaverInMap-resources.sh", 419 | "${PODS_ROOT}/AMap3DMap/MAMapKit.framework/AMap.bundle", 420 | ); 421 | name = "[CP] Copy Pods Resources"; 422 | outputPaths = ( 423 | "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AMap.bundle", 424 | ); 425 | runOnlyForDeploymentPostprocessing = 0; 426 | shellPath = /bin/sh; 427 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-reaverInMap/Pods-reaverInMap-resources.sh\"\n"; 428 | showEnvVarsInLog = 0; 429 | }; 430 | DC28799ADB8962AD6DF53C23 /* [CP] Check Pods Manifest.lock */ = { 431 | isa = PBXShellScriptBuildPhase; 432 | buildActionMask = 2147483647; 433 | files = ( 434 | ); 435 | inputPaths = ( 436 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 437 | "${PODS_ROOT}/Manifest.lock", 438 | ); 439 | name = "[CP] Check Pods Manifest.lock"; 440 | outputPaths = ( 441 | "$(DERIVED_FILE_DIR)/Pods-reaverInMap-checkManifestLockResult.txt", 442 | ); 443 | runOnlyForDeploymentPostprocessing = 0; 444 | shellPath = /bin/sh; 445 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 446 | showEnvVarsInLog = 0; 447 | }; 448 | /* End PBXShellScriptBuildPhase section */ 449 | 450 | /* Begin PBXSourcesBuildPhase section */ 451 | 19EFDB001E039451004702D3 /* Sources */ = { 452 | isa = PBXSourcesBuildPhase; 453 | buildActionMask = 2147483647; 454 | files = ( 455 | 19EFDB091E039451004702D3 /* ViewController.swift in Sources */, 456 | 19EFDB071E039451004702D3 /* AppDelegate.swift in Sources */, 457 | 19E2250C1E0B85C4009F2797 /* ObjConvert.c in Sources */, 458 | 19E2250E1E0B8BBC009F2797 /* AMap3DObjectOverlayRenderer.mm in Sources */, 459 | 19E2250D1E0B8BBA009F2797 /* AMap3DObjectOverlay.m in Sources */, 460 | ); 461 | runOnlyForDeploymentPostprocessing = 0; 462 | }; 463 | C87E3AE31C57245D000ACF0C /* Sources */ = { 464 | isa = PBXSourcesBuildPhase; 465 | buildActionMask = 2147483647; 466 | files = ( 467 | C87E3AF21C57245E000ACF0C /* ViewController.m in Sources */, 468 | 81B61EC31D66A41100415DAD /* AMap3DObjectOverlayRenderer.mm in Sources */, 469 | C87E3AEF1C57245E000ACF0C /* AppDelegate.m in Sources */, 470 | 81B61EC01D66A20900415DAD /* AMap3DObjectOverlay.m in Sources */, 471 | C87E3AEC1C57245E000ACF0C /* main.m in Sources */, 472 | ); 473 | runOnlyForDeploymentPostprocessing = 0; 474 | }; 475 | D9F65BED1E2E04EE002BBD5C /* Sources */ = { 476 | isa = PBXSourcesBuildPhase; 477 | buildActionMask = 2147483647; 478 | files = ( 479 | D9F65BF41E2E04EE002BBD5C /* reaverInMapUITests.m in Sources */, 480 | ); 481 | runOnlyForDeploymentPostprocessing = 0; 482 | }; 483 | /* End PBXSourcesBuildPhase section */ 484 | 485 | /* Begin PBXTargetDependency section */ 486 | D9F65BF71E2E04EE002BBD5C /* PBXTargetDependency */ = { 487 | isa = PBXTargetDependency; 488 | target = C87E3AE61C57245D000ACF0C /* reaverInMap */; 489 | targetProxy = D9F65BF61E2E04EE002BBD5C /* PBXContainerItemProxy */; 490 | }; 491 | /* End PBXTargetDependency section */ 492 | 493 | /* Begin PBXVariantGroup section */ 494 | 19EFDB0A1E039451004702D3 /* Main.storyboard */ = { 495 | isa = PBXVariantGroup; 496 | children = ( 497 | 19EFDB0B1E039451004702D3 /* Base */, 498 | ); 499 | name = Main.storyboard; 500 | sourceTree = ""; 501 | }; 502 | 19EFDB0F1E039451004702D3 /* LaunchScreen.storyboard */ = { 503 | isa = PBXVariantGroup; 504 | children = ( 505 | 19EFDB101E039451004702D3 /* Base */, 506 | ); 507 | name = LaunchScreen.storyboard; 508 | sourceTree = ""; 509 | }; 510 | C87E3AF31C57245E000ACF0C /* Main.storyboard */ = { 511 | isa = PBXVariantGroup; 512 | children = ( 513 | C87E3AF41C57245E000ACF0C /* Base */, 514 | ); 515 | name = Main.storyboard; 516 | sourceTree = ""; 517 | }; 518 | C87E3AF81C57245E000ACF0C /* LaunchScreen.storyboard */ = { 519 | isa = PBXVariantGroup; 520 | children = ( 521 | C87E3AF91C57245E000ACF0C /* Base */, 522 | ); 523 | name = LaunchScreen.storyboard; 524 | sourceTree = ""; 525 | }; 526 | /* End PBXVariantGroup section */ 527 | 528 | /* Begin XCBuildConfiguration section */ 529 | 19EFDB131E039451004702D3 /* Debug */ = { 530 | isa = XCBuildConfiguration; 531 | baseConfigurationReference = 6EE88CC9B58D6300B917AA4F /* Pods-reaverInMap-swift.debug.xcconfig */; 532 | buildSettings = { 533 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 534 | CLANG_ANALYZER_NONNULL = YES; 535 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 536 | CLANG_WARN_INFINITE_RECURSION = YES; 537 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 538 | DEVELOPMENT_TEAM = YMJ372W38W; 539 | INFOPLIST_FILE = "reaverInMap-swift/Info.plist"; 540 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 541 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 542 | PRODUCT_BUNDLE_IDENTIFIER = "com.autonavi.reaverInMap-swift"; 543 | PRODUCT_NAME = "$(TARGET_NAME)"; 544 | PROVISIONING_PROFILE = "262ce89f-36c1-471e-b3aa-17585737754f"; 545 | PROVISIONING_PROFILE_SPECIFIER = openPlatform_development; 546 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; 547 | SWIFT_OBJC_BRIDGING_HEADER = "reaverInMap-swift/BridgeHeader.h"; 548 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 549 | SWIFT_VERSION = 4.0; 550 | TARGETED_DEVICE_FAMILY = "1,2"; 551 | }; 552 | name = Debug; 553 | }; 554 | 19EFDB141E039451004702D3 /* Release */ = { 555 | isa = XCBuildConfiguration; 556 | baseConfigurationReference = 7DB8CED35D49AE0312DE0D28 /* Pods-reaverInMap-swift.release.xcconfig */; 557 | buildSettings = { 558 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 559 | CLANG_ANALYZER_NONNULL = YES; 560 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 561 | CLANG_WARN_INFINITE_RECURSION = YES; 562 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 563 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; 564 | DEVELOPMENT_TEAM = YMJ372W38W; 565 | INFOPLIST_FILE = "reaverInMap-swift/Info.plist"; 566 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 567 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 568 | PRODUCT_BUNDLE_IDENTIFIER = "com.autonavi.reaverInMap-swift"; 569 | PRODUCT_NAME = "$(TARGET_NAME)"; 570 | PROVISIONING_PROFILE = "37bcbefd-c99d-44d5-a048-5ff502582130"; 571 | PROVISIONING_PROFILE_SPECIFIER = openPlatformInhouse; 572 | SWIFT_OBJC_BRIDGING_HEADER = "reaverInMap-swift/BridgeHeader.h"; 573 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 574 | SWIFT_VERSION = 4.0; 575 | TARGETED_DEVICE_FAMILY = "1,2"; 576 | }; 577 | name = Release; 578 | }; 579 | C87E3AFC1C57245E000ACF0C /* Debug */ = { 580 | isa = XCBuildConfiguration; 581 | buildSettings = { 582 | ALWAYS_SEARCH_USER_PATHS = NO; 583 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 584 | CLANG_CXX_LIBRARY = "libc++"; 585 | CLANG_ENABLE_MODULES = YES; 586 | CLANG_ENABLE_OBJC_ARC = YES; 587 | CLANG_WARN_BOOL_CONVERSION = YES; 588 | CLANG_WARN_CONSTANT_CONVERSION = YES; 589 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 590 | CLANG_WARN_EMPTY_BODY = YES; 591 | CLANG_WARN_ENUM_CONVERSION = YES; 592 | CLANG_WARN_INT_CONVERSION = YES; 593 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 594 | CLANG_WARN_UNREACHABLE_CODE = YES; 595 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 596 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 597 | COPY_PHASE_STRIP = NO; 598 | DEBUG_INFORMATION_FORMAT = dwarf; 599 | ENABLE_STRICT_OBJC_MSGSEND = YES; 600 | ENABLE_TESTABILITY = YES; 601 | GCC_C_LANGUAGE_STANDARD = gnu99; 602 | GCC_DYNAMIC_NO_PIC = NO; 603 | GCC_NO_COMMON_BLOCKS = YES; 604 | GCC_OPTIMIZATION_LEVEL = 0; 605 | GCC_PREPROCESSOR_DEFINITIONS = ( 606 | "DEBUG=1", 607 | "$(inherited)", 608 | ); 609 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 610 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 611 | GCC_WARN_UNDECLARED_SELECTOR = YES; 612 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 613 | GCC_WARN_UNUSED_FUNCTION = YES; 614 | GCC_WARN_UNUSED_VARIABLE = YES; 615 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 616 | MTL_ENABLE_DEBUG_INFO = YES; 617 | ONLY_ACTIVE_ARCH = YES; 618 | SDKROOT = iphoneos; 619 | }; 620 | name = Debug; 621 | }; 622 | C87E3AFD1C57245E000ACF0C /* Release */ = { 623 | isa = XCBuildConfiguration; 624 | buildSettings = { 625 | ALWAYS_SEARCH_USER_PATHS = NO; 626 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 627 | CLANG_CXX_LIBRARY = "libc++"; 628 | CLANG_ENABLE_MODULES = YES; 629 | CLANG_ENABLE_OBJC_ARC = YES; 630 | CLANG_WARN_BOOL_CONVERSION = YES; 631 | CLANG_WARN_CONSTANT_CONVERSION = YES; 632 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 633 | CLANG_WARN_EMPTY_BODY = YES; 634 | CLANG_WARN_ENUM_CONVERSION = YES; 635 | CLANG_WARN_INT_CONVERSION = YES; 636 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 637 | CLANG_WARN_UNREACHABLE_CODE = YES; 638 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 639 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 640 | COPY_PHASE_STRIP = NO; 641 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 642 | ENABLE_NS_ASSERTIONS = NO; 643 | ENABLE_STRICT_OBJC_MSGSEND = YES; 644 | GCC_C_LANGUAGE_STANDARD = gnu99; 645 | GCC_NO_COMMON_BLOCKS = YES; 646 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 647 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 648 | GCC_WARN_UNDECLARED_SELECTOR = YES; 649 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 650 | GCC_WARN_UNUSED_FUNCTION = YES; 651 | GCC_WARN_UNUSED_VARIABLE = YES; 652 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 653 | MTL_ENABLE_DEBUG_INFO = NO; 654 | SDKROOT = iphoneos; 655 | VALIDATE_PRODUCT = YES; 656 | }; 657 | name = Release; 658 | }; 659 | C87E3AFF1C57245E000ACF0C /* Debug */ = { 660 | isa = XCBuildConfiguration; 661 | baseConfigurationReference = DB73DC24840701C027D05BDE /* Pods-reaverInMap.debug.xcconfig */; 662 | buildSettings = { 663 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 664 | DEVELOPMENT_TEAM = YMJ372W38W; 665 | INFOPLIST_FILE = reaverInMap/Info.plist; 666 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 667 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 668 | PRODUCT_BUNDLE_IDENTIFIER = com.autonavi.reaverInMap; 669 | PRODUCT_NAME = "$(TARGET_NAME)"; 670 | PROVISIONING_PROFILE = "48216a7c-4edd-4f5d-9389-95ffbd3ea775"; 671 | PROVISIONING_PROFILE_SPECIFIER = openPlatform_development; 672 | }; 673 | name = Debug; 674 | }; 675 | C87E3B001C57245E000ACF0C /* Release */ = { 676 | isa = XCBuildConfiguration; 677 | baseConfigurationReference = CDF9302E7AD6AD506F415181 /* Pods-reaverInMap.release.xcconfig */; 678 | buildSettings = { 679 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 680 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution"; 681 | DEVELOPMENT_TEAM = YMJ372W38W; 682 | INFOPLIST_FILE = reaverInMap/Info.plist; 683 | IPHONEOS_DEPLOYMENT_TARGET = 7.0; 684 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 685 | PRODUCT_BUNDLE_IDENTIFIER = com.autonavi.reaverInMap; 686 | PRODUCT_NAME = "$(TARGET_NAME)"; 687 | PROVISIONING_PROFILE = "a892512d-fe94-4702-b716-0b66880b936d"; 688 | PROVISIONING_PROFILE_SPECIFIER = openPlatformInhouse; 689 | }; 690 | name = Release; 691 | }; 692 | D9F65BF81E2E04EF002BBD5C /* Debug */ = { 693 | isa = XCBuildConfiguration; 694 | buildSettings = { 695 | CLANG_ANALYZER_NONNULL = YES; 696 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 697 | CLANG_WARN_INFINITE_RECURSION = YES; 698 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 699 | DEVELOPMENT_TEAM = YMJ372W38W; 700 | INFOPLIST_FILE = reaverInMapUITests/Info.plist; 701 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 702 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 703 | PRODUCT_BUNDLE_IDENTIFIER = com.autonavi.reaverInMapUITests; 704 | PRODUCT_NAME = "$(TARGET_NAME)"; 705 | PROVISIONING_PROFILE = "8014ae4e-33b6-4937-87e3-3725a2aad4f7"; 706 | PROVISIONING_PROFILE_SPECIFIER = openPlatform_development; 707 | TEST_TARGET_NAME = reaverInMap; 708 | }; 709 | name = Debug; 710 | }; 711 | D9F65BF91E2E04EF002BBD5C /* Release */ = { 712 | isa = XCBuildConfiguration; 713 | buildSettings = { 714 | CLANG_ANALYZER_NONNULL = YES; 715 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 716 | CLANG_WARN_INFINITE_RECURSION = YES; 717 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 718 | DEVELOPMENT_TEAM = YMJ372W38W; 719 | INFOPLIST_FILE = reaverInMapUITests/Info.plist; 720 | IPHONEOS_DEPLOYMENT_TARGET = 10.2; 721 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 722 | PRODUCT_BUNDLE_IDENTIFIER = com.autonavi.reaverInMapUITests; 723 | PRODUCT_NAME = "$(TARGET_NAME)"; 724 | PROVISIONING_PROFILE = "8014ae4e-33b6-4937-87e3-3725a2aad4f7"; 725 | PROVISIONING_PROFILE_SPECIFIER = openPlatform_development; 726 | TEST_TARGET_NAME = reaverInMap; 727 | }; 728 | name = Release; 729 | }; 730 | /* End XCBuildConfiguration section */ 731 | 732 | /* Begin XCConfigurationList section */ 733 | 19EFDB151E039451004702D3 /* Build configuration list for PBXNativeTarget "reaverInMap-swift" */ = { 734 | isa = XCConfigurationList; 735 | buildConfigurations = ( 736 | 19EFDB131E039451004702D3 /* Debug */, 737 | 19EFDB141E039451004702D3 /* Release */, 738 | ); 739 | defaultConfigurationIsVisible = 0; 740 | defaultConfigurationName = Release; 741 | }; 742 | C87E3AE21C57245D000ACF0C /* Build configuration list for PBXProject "reaverInMap" */ = { 743 | isa = XCConfigurationList; 744 | buildConfigurations = ( 745 | C87E3AFC1C57245E000ACF0C /* Debug */, 746 | C87E3AFD1C57245E000ACF0C /* Release */, 747 | ); 748 | defaultConfigurationIsVisible = 0; 749 | defaultConfigurationName = Release; 750 | }; 751 | C87E3AFE1C57245E000ACF0C /* Build configuration list for PBXNativeTarget "reaverInMap" */ = { 752 | isa = XCConfigurationList; 753 | buildConfigurations = ( 754 | C87E3AFF1C57245E000ACF0C /* Debug */, 755 | C87E3B001C57245E000ACF0C /* Release */, 756 | ); 757 | defaultConfigurationIsVisible = 0; 758 | defaultConfigurationName = Release; 759 | }; 760 | D9F65BFA1E2E04EF002BBD5C /* Build configuration list for PBXNativeTarget "reaverInMapUITests" */ = { 761 | isa = XCConfigurationList; 762 | buildConfigurations = ( 763 | D9F65BF81E2E04EF002BBD5C /* Debug */, 764 | D9F65BF91E2E04EF002BBD5C /* Release */, 765 | ); 766 | defaultConfigurationIsVisible = 0; 767 | defaultConfigurationName = Release; 768 | }; 769 | /* End XCConfigurationList section */ 770 | }; 771 | rootObject = C87E3ADF1C57245D000ACF0C /* Project object */; 772 | } 773 | -------------------------------------------------------------------------------- /reaverInMap.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /reaverInMap.xcodeproj/xcshareddata/xcschemes/reaverInMap-swift.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 33 | 34 | 40 | 41 | 42 | 43 | 44 | 45 | 56 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 75 | 77 | 83 | 84 | 85 | 86 | 88 | 89 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /reaverInMap.xcodeproj/xcshareddata/xcschemes/reaverInMap.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 31 | 32 | 34 | 40 | 41 | 42 | 43 | 44 | 50 | 51 | 52 | 53 | 54 | 55 | 66 | 68 | 74 | 75 | 76 | 77 | 78 | 79 | 85 | 87 | 93 | 94 | 95 | 96 | 98 | 99 | 102 | 103 | 104 | -------------------------------------------------------------------------------- /reaverInMap.xcodeproj/xcshareddata/xcschemes/reaverInMapUITests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 16 | 18 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 41 | 42 | 43 | 44 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /reaverInMap.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /reaverInMap/AMap3DObjectOverlay.h: -------------------------------------------------------------------------------- 1 | // 2 | // AMap3DObjectOverlay.h 3 | // reaverInMap 4 | // 5 | // Created by xiaoming han on 16/8/19. 6 | // Copyright © 2016年 Autonavi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AMap3DObjectOverlay : NSObject 12 | 13 | @property (nonatomic, assign) CLLocationCoordinate2D coordinate; 14 | @property (nonatomic, assign) CLLocationDistance size; 15 | @property (nonatomic, assign) CGFloat altitude; 16 | @property (nonatomic, strong) NSString *textureName; 17 | @property (nonatomic, assign) CGFloat angle; 18 | 19 | @property (nonatomic, readonly) float *vertexPointer; 20 | @property (nonatomic, readonly) float *normalPointer; 21 | @property (nonatomic, readonly) float *texCoordPointer; 22 | @property (nonatomic, readonly) unsigned int vertsNum; 23 | 24 | + (instancetype)objectOverlayWithCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate 25 | size:(CLLocationDistance)size 26 | vertexPointer:(float *)vertexPointer 27 | texCoordPointer:(float *)texCoordPointer 28 | vertsNum:(unsigned int)vertsNum; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /reaverInMap/AMap3DObjectOverlay.m: -------------------------------------------------------------------------------- 1 | // 2 | // AMap3DObjectOverlay.m 3 | // reaverInMap 4 | // 5 | // Created by xiaoming han on 16/8/19. 6 | // Copyright © 2016年 Autonavi. All rights reserved. 7 | // 8 | 9 | #import "AMap3DObjectOverlay.h" 10 | 11 | @interface AMap3DObjectOverlay() 12 | { 13 | float *_vertexPointer; 14 | float *_normalPointer; 15 | float *_texCoordPointer; 16 | unsigned int _vertsNum; 17 | } 18 | @property (nonatomic, readwrite) MAMapRect boundingMapRect; 19 | @property (nonatomic, assign) BOOL needsUpdateBoundingMapRect; 20 | 21 | @end 22 | 23 | @implementation AMap3DObjectOverlay 24 | 25 | + (instancetype)objectOverlayWithCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate 26 | size:(CLLocationDistance)size 27 | vertexPointer:(float *)vertexPointer 28 | texCoordPointer:(float *)texCoordPointer 29 | vertsNum:(unsigned int)vertsNum 30 | { 31 | return [[self alloc] initWithCenterCoordinate:centerCoordinate size:size vertexPointer:vertexPointer texCoordPointer:texCoordPointer vertsNum:vertsNum]; 32 | } 33 | 34 | - (instancetype)initWithCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate 35 | size:(CLLocationDistance)size 36 | vertexPointer:(float *)vertexPointer 37 | texCoordPointer:(float *)texCoordPointer 38 | vertsNum:(unsigned int)vertsNum 39 | { 40 | if (self = [super init]) 41 | { 42 | self.coordinate = centerCoordinate; 43 | self.size = size; 44 | _vertexPointer = vertexPointer; 45 | _texCoordPointer = texCoordPointer; 46 | _vertsNum = vertsNum; 47 | self.needsUpdateBoundingMapRect = NO; 48 | [self constructBoundingMapRect]; 49 | } 50 | return self; 51 | } 52 | 53 | 54 | #pragma mark - Interfaces 55 | 56 | - (void)setCoordinate:(CLLocationCoordinate2D)coordinate 57 | { 58 | if (_coordinate.latitude != coordinate.latitude || _coordinate.longitude != coordinate.longitude) 59 | { 60 | _coordinate = coordinate; 61 | self.needsUpdateBoundingMapRect = YES; 62 | } 63 | } 64 | 65 | - (void)setSize:(CLLocationDistance)size 66 | { 67 | if (_size != size) 68 | { 69 | _size = size; 70 | self.needsUpdateBoundingMapRect = YES; 71 | } 72 | } 73 | 74 | - (MAMapRect)boundingMapRect 75 | { 76 | if (self.needsUpdateBoundingMapRect) 77 | { 78 | [self constructBoundingMapRect]; 79 | self.needsUpdateBoundingMapRect = NO; 80 | } 81 | return _boundingMapRect; 82 | } 83 | 84 | - (void)constructBoundingMapRect 85 | { 86 | MAMapPoint centerPoint = MAMapPointForCoordinate(self.coordinate); 87 | double lengthInMapPoint = self.size * MAMapPointsPerMeterAtLatitude(self.coordinate.latitude); 88 | self.boundingMapRect = MAMapRectMake(centerPoint.x - lengthInMapPoint * 0.5, centerPoint.y - lengthInMapPoint * 0.5, lengthInMapPoint, lengthInMapPoint); 89 | } 90 | 91 | 92 | @end 93 | -------------------------------------------------------------------------------- /reaverInMap/AMap3DObjectOverlayRenderer.h: -------------------------------------------------------------------------------- 1 | // 2 | // AMap3DObjectOverlayRenderer.h 3 | // reaverInMap 4 | // 5 | // Created by xiaoming han on 16/8/19. 6 | // Copyright © 2016年 Autonavi. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AMap3DObjectOverlay.h" 11 | 12 | @protocol AMap3DObjectOverlayRendererDelegate 13 | 14 | @optional 15 | - (void)currentOverlayCenterCoordinate:(CLLocationCoordinate2D)coordinate; 16 | 17 | @end 18 | 19 | @interface AMap3DObjectOverlayRenderer : MAOverlayRenderer 20 | 21 | @property (nonatomic, readonly) AMap3DObjectOverlay *objOverlay; 22 | @property (nonatomic, weak) id customerDelegate; 23 | 24 | - (instancetype)initWithObjectOverlay:(AMap3DObjectOverlay *)objOverlay; 25 | 26 | - (void)moveToNewCoordinate:(CLLocationCoordinate2D)coordinate andDuration:(NSTimeInterval)duration; 27 | 28 | @end 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /reaverInMap/AMap3DObjectOverlayRenderer.mm: -------------------------------------------------------------------------------- 1 | // 2 | // AMap3DObjectOverlayRenderer.m 3 | // reaverInMap 4 | // 5 | // Created by xiaoming han on 16/8/19. 6 | // Copyright © 2016年 Autonavi. All rights reserved. 7 | // 8 | 9 | #import "AMap3DObjectOverlayRenderer.h" 10 | #import 11 | #import 12 | 13 | struct AMap3DObjectVertex { 14 | float x; 15 | float y; 16 | float z; 17 | }; 18 | typedef struct AMap3DObjectVertex AMap3DObjectVertex; 19 | 20 | @interface AMap3DObjectOverlayRenderer() 21 | 22 | @property (nonatomic, assign)BOOL isNeedDoMoveCoordinate; 23 | 24 | @end 25 | 26 | @implementation AMap3DObjectOverlayRenderer 27 | { 28 | AMap3DObjectVertex _centerGL; 29 | // CGFloat _sizeGL; 30 | // BOOL _isNeedDoMoveCoordinate; 31 | CLLocationCoordinate2D _fromValue; 32 | CLLocationCoordinate2D _toValue; 33 | CFTimeInterval _duration; 34 | CFTimeInterval _elapse; 35 | CFTimeInterval _currentTime; 36 | 37 | float _scale[16]; 38 | 39 | GLuint _program; 40 | GLuint _vertexLocation; 41 | GLuint _indicesLocation; 42 | GLuint _textureCodeLocation; 43 | GLuint _rotateLocation; 44 | 45 | GLuint _viewMatrixLocation; 46 | GLuint _projectionMatrixLocation; 47 | GLuint _scaleMatrixLocation; 48 | 49 | } 50 | 51 | - (void)setIsNeedDoMoveCoordinate:(BOOL)isNeedDoMoveCoordinate 52 | { 53 | _isNeedDoMoveCoordinate = isNeedDoMoveCoordinate; 54 | } 55 | 56 | - (void)initShader 57 | { 58 | NSString *vertexShader = @"precision highp float;\n\ 59 | attribute vec3 aVertex;\n\ 60 | attribute vec2 aTextureCoord;\n\ 61 | uniform vec3 aRotate;\n\ 62 | uniform mat4 aViewMatrix;\n\ 63 | uniform mat4 aProjectionMatrix;\n\ 64 | uniform mat4 aTransformMatrix;\n\ 65 | uniform mat4 aScaleMatrix;\n\ 66 | varying vec2 texture;\n\ 67 | mat4 rotationMatrix(vec3 axis, float angle)\n\ 68 | {\n\ 69 | axis = normalize(axis);\n\ 70 | float s = sin(angle);\n\ 71 | float c = cos(angle);\n\ 72 | float oc = 1.0 - c;\n\ 73 | return mat4(oc * axis.x * axis.x + c, oc * axis.x * axis.y - axis.z * s, oc * axis.z * axis.x + axis.y * s, 0.0,\n\ 74 | oc * axis.x * axis.y + axis.z * s, oc * axis.y * axis.y + c, oc * axis.y * axis.z - axis.x * s, 0.0,\n\ 75 | oc * axis.z * axis.x - axis.y * s, oc * axis.y * axis.z + axis.x * s, oc * axis.z * axis.z + c, 0.0,\n\ 76 | 0.0, 0.0, 0.0, 1.0);\n\ 77 | }\n\ 78 | void main(){\n\ 79 | mat4 rotateMatrix = rotationMatrix(vec3(1,0,0),aRotate.x) * rotationMatrix(vec3(0,1,0),aRotate.y) * rotationMatrix(vec3(0,0,1),aRotate.z);\n\ 80 | gl_Position = aProjectionMatrix * aViewMatrix * rotateMatrix * aScaleMatrix * vec4(aVertex, 1.0);\n\ 81 | texture = aTextureCoord;\n\ 82 | }"; 83 | 84 | NSString *fragmentShader = @"\n\ 85 | precision highp float;\n\ 86 | varying vec2 texture;\n\ 87 | uniform sampler2D aTextureUnit0;\n\ 88 | void main(){\n\ 89 | gl_FragColor = texture2D(aTextureUnit0, texture);\n\ 90 | }"; 91 | 92 | 93 | _program = glCreateProgram(); 94 | 95 | GLuint vShader = glCreateShader(GL_VERTEX_SHADER); 96 | 97 | GLuint fShader = glCreateShader(GL_FRAGMENT_SHADER); 98 | 99 | GLint vlength = (GLint)[vertexShader length]; 100 | 101 | GLint flength = (GLint)[fragmentShader length]; 102 | 103 | 104 | const GLchar *vByte = [vertexShader UTF8String]; 105 | const GLchar *fByte = [fragmentShader UTF8String]; 106 | 107 | glShaderSource(vShader, 1, &vByte, &vlength); 108 | 109 | glShaderSource(fShader, 1, &fByte, &flength); 110 | 111 | 112 | glCompileShader(vShader); 113 | 114 | glCompileShader(fShader); 115 | 116 | 117 | glAttachShader(_program, vShader); 118 | 119 | 120 | glAttachShader(_program, fShader); 121 | 122 | 123 | glLinkProgram(_program); 124 | 125 | 126 | 127 | _vertexLocation = glGetAttribLocation(_program, "aVertex"); 128 | 129 | 130 | _viewMatrixLocation = glGetUniformLocation(_program,"aViewMatrix"); 131 | 132 | 133 | _projectionMatrixLocation = glGetUniformLocation(_program,"aProjectionMatrix"); 134 | 135 | 136 | _scaleMatrixLocation = glGetUniformLocation(_program, "aScaleMatrix"); 137 | 138 | _textureCodeLocation = glGetAttribLocation(_program,"aTextureCoord"); 139 | 140 | _rotateLocation = glGetUniformLocation(_program, "aRotate"); 141 | 142 | } 143 | 144 | #pragma mark - Interface 145 | 146 | - (double)linearBySlice:(double)slice start:(double)start end:(double)end 147 | { 148 | double t = slice; 149 | 150 | return start + t * (end - start); 151 | } 152 | 153 | - (void)setOverlayCoordinate:(CLLocationCoordinate2D)coordinate 154 | { 155 | self.objOverlay.coordinate = coordinate; 156 | if (self.customerDelegate != nil && [self.customerDelegate respondsToSelector:@selector(currentOverlayCenterCoordinate:)]) { 157 | [self.customerDelegate currentOverlayCenterCoordinate:self.objOverlay.coordinate]; 158 | } 159 | 160 | } 161 | 162 | - (void)moveToNewCoordinate:(CLLocationCoordinate2D)coordinate andDuration:(NSTimeInterval)duration 163 | { 164 | _fromValue = self.objOverlay.coordinate; 165 | _toValue = coordinate; 166 | _duration = duration; 167 | _elapse = 0; 168 | _currentTime = CACurrentMediaTime(); 169 | self.isNeedDoMoveCoordinate = YES; 170 | } 171 | 172 | - (void)didMoveCoordinate 173 | { 174 | if (_elapse >= _duration) { 175 | 176 | [self setOverlayCoordinate:_toValue]; 177 | 178 | self.isNeedDoMoveCoordinate = NO; 179 | 180 | return; 181 | } 182 | 183 | CFTimeInterval lastTime = _currentTime; 184 | _currentTime = CACurrentMediaTime(); 185 | 186 | 187 | CGFloat slices = _elapse / _duration; 188 | 189 | 190 | [self setOverlayCoordinate:CLLocationCoordinate2DMake([self linearBySlice:slices start:_fromValue.latitude end:_toValue.latitude], 191 | [self linearBySlice:slices start:_fromValue.longitude end:_toValue.longitude])]; 192 | 193 | _elapse += _currentTime - lastTime; 194 | } 195 | 196 | - (AMap3DObjectOverlay *)objOverlay 197 | { 198 | return (AMap3DObjectOverlay *)self.overlay; 199 | } 200 | 201 | #pragma mark - Override 202 | 203 | - (void)updateOverlayCenter 204 | { 205 | AMap3DObjectOverlay *objOverlay = self.objOverlay; 206 | 207 | CGPoint centerInGL = [self glPointForMapPoint:MAMapPointForCoordinate(self.overlay.coordinate)]; 208 | _centerGL.x = centerInGL.x; 209 | _centerGL.y = centerInGL.y; 210 | _centerGL.z = objOverlay.altitude * MAMapPointsPerMeterAtLatitude(self.overlay.coordinate.latitude); 211 | } 212 | 213 | void translateM(float* m, int mOffset,float x, float y, float z) { 214 | for (int i=0 ; i<4 ; i++) { 215 | int mi = mOffset + i; 216 | m[12 + mi] += m[mi] * x + m[4 + mi] * y + m[8 + mi] * z; 217 | } 218 | } 219 | 220 | /* OpenGL绘制。 */ 221 | - (void)glRender 222 | { 223 | [super glRender]; 224 | 225 | if (_program == 0) { 226 | [self initShader]; 227 | 228 | float scale[] = { 229 | 1.0f, 0.0f, 0.0f, 0.0f, 230 | 0.0f, 1.0f, 0.0f, 0.0f, 231 | 0.0f, 0.0f, 1.0f, 0.0f, 232 | 0.0f, 0.0f, 0.0f, 1.0f 233 | }; 234 | 235 | for (int i = 0; i < 16; i++) { 236 | _scale[i] = scale[i]; 237 | } 238 | 239 | CGFloat scaleValue = [self calculateSizeInGLReference]; 240 | 241 | _scale[0] = scaleValue; 242 | _scale[5] = scaleValue; 243 | _scale[10] = scaleValue; 244 | } 245 | 246 | AMap3DObjectOverlay *objOverlay = self.objOverlay; 247 | 248 | if (self.isNeedDoMoveCoordinate) { 249 | [self didMoveCoordinate]; 250 | } 251 | 252 | if (objOverlay.vertsNum == 0) 253 | { 254 | return; 255 | } 256 | 257 | glUseProgram(_program); 258 | 259 | glEnable(GL_DEPTH_TEST); 260 | glDepthMask(GL_TRUE); 261 | 262 | glBindTexture(GL_TEXTURE_2D, self.strokeTextureID); 263 | 264 | glEnableVertexAttribArray(_vertexLocation); 265 | 266 | glVertexAttribPointer(_vertexLocation, 3, GL_FLOAT, false, 0, objOverlay.vertexPointer); 267 | 268 | glEnableVertexAttribArray(_textureCodeLocation); 269 | 270 | glVertexAttribPointer(_textureCodeLocation, 2, GL_FLOAT, false, 0, objOverlay.texCoordPointer); 271 | 272 | 273 | 274 | if ([self.objOverlay.textureName isEqualToString:@"FA-22_Raptor_P01.png"] && objOverlay.altitude < 500) { 275 | _centerGL.z = [self calculateSizeInGLReference] / objOverlay.size * objOverlay.altitude; 276 | objOverlay.altitude += 2; 277 | } 278 | 279 | if ([self.objOverlay.textureName isEqualToString:@"FelReaverMount.png"]) { 280 | objOverlay.angle += 1; 281 | } 282 | 283 | [self updateOverlayCenter]; 284 | 285 | 286 | glUniformMatrix4fv(_scaleMatrixLocation, 1, false, _scale); 287 | 288 | glUniform3f(_rotateLocation, - 90.0 * M_PI / 180.0f, -(GLfloat)objOverlay.angle * M_PI / 180.f,0.0f); 289 | 290 | float * viewMatrix = [self getViewMatrix]; 291 | 292 | float viewMatrixCopy[16]; 293 | for (int i = 0; i < 16; i++) { 294 | viewMatrixCopy[i] = viewMatrix[i]; 295 | } 296 | 297 | translateM(viewMatrixCopy, 0, _centerGL.x, _centerGL.y, _centerGL.z); 298 | 299 | float * projectionMatrix = [self getProjectionMatrix]; 300 | 301 | glUniformMatrix4fv(_viewMatrixLocation, 1, false, viewMatrixCopy); 302 | 303 | glUniformMatrix4fv(_projectionMatrixLocation, 1, false, projectionMatrix); 304 | 305 | glDrawArrays(GL_TRIANGLES, 0, objOverlay.vertsNum); 306 | 307 | glDisableVertexAttribArray(_vertexLocation); 308 | 309 | glDisableVertexAttribArray(_textureCodeLocation); 310 | 311 | glDepthMask(GL_FALSE); 312 | glDisable(GL_DEPTH_TEST); 313 | 314 | glUseProgram(0); 315 | // 316 | // 317 | // glDepthFunc(GL_LESS); 318 | // 319 | // glEnable(GL_BLEND); 320 | // glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 321 | // 322 | // glEnable(GL_TEXTURE_2D); 323 | // glEnableClientState(GL_VERTEX_ARRAY); 324 | // glEnableClientState(GL_TEXTURE_COORD_ARRAY); 325 | // 326 | // glBindTexture(GL_TEXTURE_2D, self.strokeTextureID); 327 | // glColor4f(1, 1, 1, 1); 328 | // 329 | // glPushMatrix(); 330 | // 331 | // if ([self.objOverlay.textureName isEqualToString:@"FA-22_Raptor_P01"] && objOverlay.altitude < 500) { 332 | // _centerGL.z = [self calculateSizeInGLReference] / objOverlay.size * objOverlay.altitude; 333 | // objOverlay.altitude += 2; 334 | // } 335 | // glTranslatef(_centerGL.x, _centerGL.y, _centerGL.z); 336 | // glRotatef(90, 1, 0, 0); 337 | // 338 | // glRotatef(objOverlay.angle, 0, 1, 0); 339 | // if ([self.objOverlay.textureName isEqualToString:@"FelReaverMount"]) { 340 | // objOverlay.angle += 1; 341 | // } 342 | // 343 | // glScalef(_sizeGL, _sizeGL, _sizeGL); 344 | // 345 | // glVertexPointer(3, GL_FLOAT, 0, objOverlay.vertexPointer); 346 | // glNormalPointer(GL_FLOAT, 0, objOverlay.normalPointer); 347 | // glTexCoordPointer(2, GL_FLOAT, 0, objOverlay.texCoordPointer); 348 | // 349 | // glDrawArrays(GL_TRIANGLES, 0, objOverlay.vertsNum); 350 | // 351 | // glPopMatrix(); 352 | // 353 | // glDisable(GL_TEXTURE_2D); 354 | // glDisableClientState(GL_VERTEX_ARRAY); 355 | // glDisableClientState(GL_TEXTURE_COORD_ARRAY); 356 | // 357 | // glDisable(GL_BLEND); 358 | // glDisable(GL_DEPTH_TEST); 359 | 360 | } 361 | 362 | #pragma mark - Helper 363 | 364 | - (CGFloat)lengthBetweenPointA:(CGPoint)a andPointB:(CGPoint)b 365 | { 366 | CGFloat deltaX = a.x - b.x; 367 | CGFloat deltaY = a.y - b.y; 368 | return sqrt(deltaX*deltaX + deltaY*deltaY); 369 | } 370 | 371 | - (CGFloat)calculateSizeInGLReference 372 | { 373 | AMap3DObjectOverlay *objOverlay = self.objOverlay; 374 | 375 | MAMapRect bounding = [objOverlay boundingMapRect]; 376 | MAMapPoint mapEdge[2]; 377 | mapEdge[0] = bounding.origin; 378 | mapEdge[1] = MAMapPointMake(bounding.origin.x + bounding.size.width, bounding.origin.y); 379 | 380 | CGPoint * glEdge = [self glPointsForMapPoints:mapEdge count:2]; 381 | 382 | return [self lengthBetweenPointA:glEdge[0] andPointB:glEdge[1]]; 383 | } 384 | 385 | #pragma mark - Init 386 | 387 | - (instancetype)initWithObjectOverlay:(AMap3DObjectOverlay *)objOverlay 388 | { 389 | self = [super initWithOverlay:objOverlay]; 390 | if (self) 391 | { 392 | 393 | } 394 | return self; 395 | } 396 | 397 | - (instancetype)initWithOverlay:(id)overlay 398 | { 399 | if ([overlay isKindOfClass:[AMap3DObjectOverlay class]]) 400 | { 401 | return nil; 402 | } 403 | 404 | return [self initWithObjectOverlay:overlay]; 405 | } 406 | 407 | @end 408 | -------------------------------------------------------------------------------- /reaverInMap/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // reaverInMap 4 | // 5 | // Created by yi chen on 1/26/16. 6 | // Copyright © 2016 Autonavi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /reaverInMap/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // reaverInMap 4 | // 5 | // Created by yi chen on 1/26/16. 6 | // Copyright © 2016 Autonavi. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import 11 | #import 12 | 13 | @interface AppDelegate () 14 | 15 | @end 16 | 17 | @implementation AppDelegate 18 | 19 | - (void)configureAPIKey 20 | { 21 | [AMapServices sharedServices].apiKey = @"4984bb62589b5f1e542e1bc96c6f1bda"; 22 | } 23 | 24 | 25 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 26 | // Override point for customization after application launch. 27 | [self configureAPIKey]; 28 | return YES; 29 | } 30 | 31 | - (void)applicationWillResignActive:(UIApplication *)application { 32 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 33 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 34 | } 35 | 36 | - (void)applicationDidEnterBackground:(UIApplication *)application { 37 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 38 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 39 | } 40 | 41 | - (void)applicationWillEnterForeground:(UIApplication *)application { 42 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 43 | } 44 | 45 | - (void)applicationDidBecomeActive:(UIApplication *)application { 46 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 47 | } 48 | 49 | - (void)applicationWillTerminate:(UIApplication *)application { 50 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 51 | } 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /reaverInMap/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "size" : "1024x1024", 46 | "scale" : "1x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } -------------------------------------------------------------------------------- /reaverInMap/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /reaverInMap/Assets.xcassets/Cottage_Texture.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Cottage_Texture.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /reaverInMap/Assets.xcassets/Cottage_Texture.imageset/Cottage_Texture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/iOS-map-game/24e410ad39f7711fe5c05929cbc7c64a78e96cde/reaverInMap/Assets.xcassets/Cottage_Texture.imageset/Cottage_Texture.jpg -------------------------------------------------------------------------------- /reaverInMap/Assets.xcassets/FA-22_Raptor_P01.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "FA-22_Raptor_P01.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /reaverInMap/Assets.xcassets/FA-22_Raptor_P01.imageset/FA-22_Raptor_P01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/iOS-map-game/24e410ad39f7711fe5c05929cbc7c64a78e96cde/reaverInMap/Assets.xcassets/FA-22_Raptor_P01.imageset/FA-22_Raptor_P01.png -------------------------------------------------------------------------------- /reaverInMap/Assets.xcassets/Farmhouse_Texture.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "Farmhouse_Texture.jpg", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /reaverInMap/Assets.xcassets/Farmhouse_Texture.imageset/Farmhouse_Texture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/iOS-map-game/24e410ad39f7711fe5c05929cbc7c64a78e96cde/reaverInMap/Assets.xcassets/Farmhouse_Texture.imageset/Farmhouse_Texture.jpg -------------------------------------------------------------------------------- /reaverInMap/Assets.xcassets/FelReaverMount.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "FelReaverMount.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /reaverInMap/Assets.xcassets/FelReaverMount.imageset/FelReaverMount.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/iOS-map-game/24e410ad39f7711fe5c05929cbc7c64a78e96cde/reaverInMap/Assets.xcassets/FelReaverMount.imageset/FelReaverMount.png -------------------------------------------------------------------------------- /reaverInMap/Assets.xcassets/V_body.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "V_body.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /reaverInMap/Assets.xcassets/V_body.imageset/V_body.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/iOS-map-game/24e410ad39f7711fe5c05929cbc7c64a78e96cde/reaverInMap/Assets.xcassets/V_body.imageset/V_body.png -------------------------------------------------------------------------------- /reaverInMap/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /reaverInMap/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /reaverInMap/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSAppTransportSecurity 6 | 7 | NSAllowsArbitraryLoads 8 | 9 | 10 | CFBundleDevelopmentRegion 11 | en 12 | CFBundleExecutable 13 | $(EXECUTABLE_NAME) 14 | CFBundleIdentifier 15 | $(PRODUCT_BUNDLE_IDENTIFIER) 16 | CFBundleInfoDictionaryVersion 17 | 6.0 18 | CFBundleName 19 | $(PRODUCT_NAME) 20 | CFBundlePackageType 21 | APPL 22 | CFBundleShortVersionString 23 | 1.0 24 | CFBundleSignature 25 | ???? 26 | CFBundleVersion 27 | 1 28 | LSRequiresIPhoneOS 29 | 30 | UILaunchStoryboardName 31 | LaunchScreen 32 | UIMainStoryboardFile 33 | Main 34 | UIRequiredDeviceCapabilities 35 | 36 | armv7 37 | 38 | UISupportedInterfaceOrientations 39 | 40 | UIInterfaceOrientationPortrait 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /reaverInMap/ObjConvert.c: -------------------------------------------------------------------------------- 1 | // 2 | // ObjConvert.c 3 | // reaverInMap 4 | // 5 | // Created by 翁乐 on 16/12/2016. 6 | // Copyright © 2016 Autonavi. All rights reserved. 7 | // 8 | 9 | #include "ObjConvert.h" 10 | -------------------------------------------------------------------------------- /reaverInMap/ObjConvert.h: -------------------------------------------------------------------------------- 1 | // 2 | // ObjConvert.h 3 | // reaverInMap 4 | // 5 | // Created by 翁乐 on 16/12/2016. 6 | // Copyright © 2016 Autonavi. All rights reserved. 7 | // 8 | 9 | #ifndef ObjConvert_h 10 | #define ObjConvert_h 11 | 12 | 13 | #endif /* ObjConvert_h */ 14 | -------------------------------------------------------------------------------- /reaverInMap/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // reaverInMap 4 | // 5 | // Created by yi chen on 1/26/16. 6 | // Copyright © 2016 Autonavi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /reaverInMap/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // reaverInMap 4 | // 5 | // Created by yi chen on 1/26/16. 6 | // Copyright © 2016 Autonavi. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import 11 | 12 | #import "AMap3DObjectOverlayRenderer.h" 13 | #import "FelReaverMount.h" 14 | #import "Farmhouse OBJ.h" 15 | #import "Snow covered CottageOBJ.h" 16 | #import "Combat_Vehicle.h" 17 | #import "raptor.h" 18 | 19 | 20 | @interface ViewController () 21 | 22 | @property (nonatomic, strong) MAMapView * mapView; 23 | 24 | @property (nonatomic, strong) AMap3DObjectOverlay *airPlaneOverlay; 25 | 26 | @property (nonatomic, strong) AMap3DObjectOverlay *carOverlay; 27 | 28 | @property (nonatomic, strong) AMap3DObjectOverlay *monsterOverlay; 29 | 30 | @property (nonatomic, strong) AMap3DObjectOverlay *house1; 31 | 32 | @property (nonatomic, strong) AMap3DObjectOverlay *house2; 33 | 34 | @end 35 | 36 | @implementation ViewController 37 | 38 | #pragma mark - overlay delegate 39 | 40 | - (void)currentOverlayCenterCoordinate:(CLLocationCoordinate2D)coordinate 41 | { 42 | [self.mapView setCenterCoordinate:coordinate animated:NO]; 43 | } 44 | 45 | #pragma mark - map delegate 46 | 47 | - (MAOverlayRenderer *)mapView:(MAMapView *)mapView rendererForOverlay:(id )overlay 48 | { 49 | if ([overlay isKindOfClass:[AMap3DObjectOverlay class]]) 50 | { 51 | AMap3DObjectOverlay *objOverlay = (AMap3DObjectOverlay *)overlay; 52 | AMap3DObjectOverlayRenderer * reaverRenderer = [[AMap3DObjectOverlayRenderer alloc] initWithObjectOverlay:overlay]; 53 | UIImage *image = [UIImage imageNamed:objOverlay.textureName]; 54 | reaverRenderer.strokeImage = image; 55 | // [reaverRenderer loadStrokeTextureImage:image]; 56 | return reaverRenderer; 57 | } 58 | 59 | return nil; 60 | } 61 | 62 | - (void)mapView:(MAMapView *)mapView didAddOverlayRenderers:(NSArray *)overlayRenderers 63 | { 64 | [self performSelector:@selector(action1) withObject:nil afterDelay:0.5]; 65 | 66 | [self performSelector:@selector(action2) withObject:nil afterDelay:0.5 + 3]; 67 | } 68 | 69 | 70 | #pragma mark - action 71 | - (void)action1 72 | { 73 | [self.mapView setZoomLevel:17 animated:YES]; 74 | [self.mapView setCenterCoordinate:self.airPlaneOverlay.coordinate animated:YES]; 75 | [self.mapView setCameraDegree:60 animated:YES duration:1]; 76 | 77 | AMap3DObjectOverlayRenderer *render = (AMap3DObjectOverlayRenderer *)[self.mapView rendererForOverlay:self.airPlaneOverlay]; 78 | 79 | render.customerDelegate = self; 80 | [render moveToNewCoordinate:CLLocationCoordinate2DMake(39.995001, 116.480644) andDuration:3]; 81 | } 82 | 83 | - (void)action2 84 | { 85 | 86 | [self.mapView setZoomLevel:19 animated:YES]; 87 | [self.mapView setRotationDegree:40 animated:YES duration:1]; 88 | [self.mapView setCameraDegree:60 animated:YES duration:1]; 89 | [self.mapView setCenterCoordinate:self.carOverlay.coordinate animated:YES]; 90 | 91 | AMap3DObjectOverlayRenderer *render = (AMap3DObjectOverlayRenderer *)[self.mapView rendererForOverlay:self.carOverlay]; 92 | 93 | render.customerDelegate = self; 94 | [render moveToNewCoordinate:CLLocationCoordinate2DMake(39.99537, 116.477174) andDuration:8]; 95 | } 96 | 97 | #pragma mark - overlay init 98 | 99 | - (void)houseInit 100 | { 101 | self.house1 = [AMap3DObjectOverlay objectOverlayWithCenterCoordinate:CLLocationCoordinate2DMake(39.993266, 116.473269) 102 | size:150 103 | vertexPointer:Snow_covered_CottageOBJVerts 104 | texCoordPointer:Snow_covered_CottageOBJTexCoords 105 | vertsNum:Snow_covered_CottageOBJNumVerts]; 106 | 107 | self.house1.angle = 315; 108 | self.house1.altitude = 5; 109 | self.house1.textureName = @"Cottage_Texture.jpg"; 110 | 111 | [self.mapView addOverlay:self.house1]; 112 | 113 | 114 | self.house2 = [AMap3DObjectOverlay objectOverlayWithCenterCoordinate:CLLocationCoordinate2DMake(39.994794, 116.47762) 115 | size:150 116 | vertexPointer:Farmhouse_OBJVerts 117 | texCoordPointer:Farmhouse_OBJTexCoords 118 | vertsNum:Farmhouse_OBJNumVerts]; 119 | 120 | self.house2.angle = 40; 121 | self.house2.altitude = 5; 122 | self.house2.textureName = @"Farmhouse_Texture.jpg"; 123 | 124 | [self.mapView addOverlay:self.house2]; 125 | 126 | 127 | } 128 | 129 | - (void)monsterInit 130 | { 131 | self.monsterOverlay = [AMap3DObjectOverlay objectOverlayWithCenterCoordinate:CLLocationCoordinate2DMake(39.996965, 116.478548) 132 | size:300 133 | vertexPointer:FelReaverMountVerts 134 | texCoordPointer:FelReaverMountTexCoords 135 | vertsNum:FelReaverMountNumVerts]; 136 | 137 | self.monsterOverlay.angle = 200; 138 | self.monsterOverlay.altitude = 130; 139 | self.monsterOverlay.textureName = @"FelReaverMount.png"; 140 | 141 | [self.mapView addOverlay:self.monsterOverlay]; 142 | } 143 | 144 | - (void)carInit 145 | { 146 | self.carOverlay = [AMap3DObjectOverlay objectOverlayWithCenterCoordinate:CLLocationCoordinate2DMake(39.991289, 116.472575) 147 | size:35 148 | vertexPointer:Combat_VehicleVerts 149 | texCoordPointer:Combat_VehicleTexCoords 150 | vertsNum:Combat_VehicleNumVerts]; 151 | self.carOverlay.angle = 40; 152 | self.carOverlay.altitude = 4; 153 | self.carOverlay.textureName = @"V_body.png"; 154 | 155 | [self.mapView addOverlay:self.carOverlay]; 156 | 157 | } 158 | 159 | - (void)airPlaneInit 160 | { 161 | self.airPlaneOverlay = [AMap3DObjectOverlay objectOverlayWithCenterCoordinate:CLLocationCoordinate2DMake(39.984479, 116.494635) 162 | size:100 163 | vertexPointer:raptorVerts 164 | texCoordPointer:raptorTexCoords 165 | vertsNum:raptorNumVerts]; 166 | self.airPlaneOverlay.angle = 128; 167 | self.airPlaneOverlay.altitude = 10; 168 | self.airPlaneOverlay.textureName = @"FA-22_Raptor_P01.png"; 169 | 170 | [self.mapView addOverlay:self.airPlaneOverlay]; 171 | } 172 | 173 | 174 | 175 | #pragma mark - override 176 | 177 | - (MAMapView *)mapView 178 | { 179 | if (_mapView == nil) 180 | { 181 | _mapView = [[MAMapView alloc] initWithFrame:self.view.bounds]; 182 | _mapView.centerCoordinate = CLLocationCoordinate2DMake(39.991647, 116.475237); 183 | _mapView.zoomLevel = 15.0; 184 | _mapView.isAllowDecreaseFrame = NO; 185 | _mapView.showsBuildings = NO; 186 | _mapView.showsLabels = NO; 187 | _mapView.mapType = MAMapTypeNavi; 188 | } 189 | 190 | return _mapView; 191 | } 192 | 193 | #pragma mark - life cycle 194 | 195 | - (void)viewDidAppear:(BOOL)animated { 196 | [self airPlaneInit]; 197 | [self carInit]; 198 | [self monsterInit]; 199 | [self houseInit]; 200 | } 201 | 202 | - (void)viewDidLoad { 203 | [super viewDidLoad]; 204 | 205 | //set up mapView 206 | [self.view addSubview:self.mapView]; 207 | self.mapView.delegate = self; 208 | 209 | 210 | } 211 | 212 | @end 213 | -------------------------------------------------------------------------------- /reaverInMap/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // reaverInMap 4 | // 5 | // Created by yi chen on 1/26/16. 6 | // Copyright © 2016 Autonavi. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /reaverInMap/reaver/Cottage_Texture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/iOS-map-game/24e410ad39f7711fe5c05929cbc7c64a78e96cde/reaverInMap/reaver/Cottage_Texture.jpg -------------------------------------------------------------------------------- /reaverInMap/reaver/FA-22_Raptor_P01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/iOS-map-game/24e410ad39f7711fe5c05929cbc7c64a78e96cde/reaverInMap/reaver/FA-22_Raptor_P01.png -------------------------------------------------------------------------------- /reaverInMap/reaver/Farmhouse_Texture.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/iOS-map-game/24e410ad39f7711fe5c05929cbc7c64a78e96cde/reaverInMap/reaver/Farmhouse_Texture.jpg -------------------------------------------------------------------------------- /reaverInMap/reaver/FelReaverMount.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/iOS-map-game/24e410ad39f7711fe5c05929cbc7c64a78e96cde/reaverInMap/reaver/FelReaverMount.png -------------------------------------------------------------------------------- /reaverInMap/reaver/ReaverOverlay.h: -------------------------------------------------------------------------------- 1 | // 2 | // StereoOverlay.h 3 | // MAMapKit_Debug 4 | // 5 | // Created by yi chen on 1/12/16. 6 | // Copyright © 2016 Autonavi. All rights reserved. 7 | // 8 | 9 | 10 | #import 11 | 12 | @interface ReaverOverlay : MAShape 13 | 14 | @property (nonatomic, readwrite) CLLocationCoordinate2D coordinate; 15 | 16 | @property (nonatomic, readwrite) CLLocationDistance size; 17 | 18 | @property (nonatomic, readonly) MAMapRect boundingMapRect; 19 | 20 | + (instancetype)ReaverOverlayWithCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate 21 | size:(CLLocationDistance)size; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /reaverInMap/reaver/ReaverOverlay.m: -------------------------------------------------------------------------------- 1 | // 2 | // StereoOverlay.m 3 | // MAMapKit_Debug 4 | // 5 | // Created by yi chen on 1/12/16. 6 | // Copyright © 2016 Autonavi. All rights reserved. 7 | // 8 | 9 | #import "ReaverOverlay.h" 10 | 11 | @interface ReaverOverlay() 12 | 13 | @property (nonatomic, readwrite) MAMapRect boundingMapRect; 14 | 15 | @property (nonatomic, assign) BOOL needsUpdateBoundingMapRect; 16 | 17 | @end 18 | 19 | 20 | @implementation ReaverOverlay 21 | 22 | @synthesize coordinate = _coordinate; 23 | @synthesize size = _size; 24 | @synthesize boundingMapRect = _boundingMapRect; 25 | 26 | - (void)setCoordinate:(CLLocationCoordinate2D)coordinate 27 | { 28 | if (_coordinate.latitude != coordinate.latitude || _coordinate.longitude != coordinate.longitude) 29 | { 30 | _coordinate = coordinate; 31 | self.needsUpdateBoundingMapRect = YES; 32 | } 33 | } 34 | 35 | - (void)setSize:(CLLocationDistance)size 36 | { 37 | if (_size != size) 38 | { 39 | _size = size; 40 | self.needsUpdateBoundingMapRect = YES; 41 | } 42 | } 43 | 44 | - (MAMapRect)boundingMapRect 45 | { 46 | if (self.needsUpdateBoundingMapRect) 47 | { 48 | [self constructBoundingMapRect]; 49 | self.needsUpdateBoundingMapRect = NO; 50 | } 51 | return _boundingMapRect; 52 | } 53 | 54 | - (void)constructBoundingMapRect 55 | { 56 | MAMapPoint centerPoint = MAMapPointForCoordinate(self.coordinate); 57 | double lengthInMapPoint = self.size * MAMapPointsPerMeterAtLatitude(self.coordinate.latitude); 58 | self.boundingMapRect = MAMapRectMake(centerPoint.x - lengthInMapPoint * 0.5, centerPoint.y - lengthInMapPoint * 0.5, lengthInMapPoint, lengthInMapPoint); 59 | } 60 | 61 | + (instancetype)ReaverOverlayWithCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate 62 | size:(CLLocationDistance)size 63 | { 64 | return [[self alloc] initWithCenterCoordinate:centerCoordinate size:size]; 65 | } 66 | 67 | - (instancetype)initWithCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate 68 | size:(CLLocationDistance)size 69 | { 70 | if (self = [super init]) 71 | { 72 | self.coordinate = centerCoordinate; 73 | self.size = size; 74 | 75 | self.needsUpdateBoundingMapRect = NO; 76 | [self constructBoundingMapRect]; 77 | } 78 | return self; 79 | } 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /reaverInMap/reaver/ReaverOverlayRenderer.h: -------------------------------------------------------------------------------- 1 | // 2 | // StereoOverlayRenderer.h 3 | // MAMapKit_Debug 4 | // 5 | // Created by yi chen on 1/12/16. 6 | // Copyright © 2016 Autonavi. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ReaverOverlay.h" 11 | 12 | @interface ReaverOverlayRenderer : MAOverlayRenderer 13 | 14 | - (instancetype)initWithReaverOverlay:(ReaverOverlay *)ReaverOverlay; 15 | 16 | @property (nonatomic, readonly) ReaverOverlay *reaverOverlay; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /reaverInMap/reaver/ReaverOverlayRenderer.mm: -------------------------------------------------------------------------------- 1 | // 2 | // StereoOverlayRenderer.m 3 | // MAMapKit_Debug 4 | // 5 | // Created by yi chen on 1/12/16. 6 | // Copyright © 2016 Autonavi. All rights reserved. 7 | // 8 | 9 | 10 | #import "ReaverOverlayRenderer.h" 11 | #import 12 | #import 13 | //#import "FelReaverMount.h" 14 | 15 | template 16 | struct Vector3 { 17 | Vector3() {} 18 | Vector3(T x, T y, T z) : x(x), y(y), z(z) {} 19 | T x; 20 | T y; 21 | T z; 22 | }; 23 | 24 | typedef Vector3 Vertex; 25 | 26 | @interface ReaverOverlayRenderer() 27 | 28 | @end 29 | 30 | 31 | @implementation ReaverOverlayRenderer 32 | { 33 | Vertex _centerGL; 34 | CGFloat _sizeGL; 35 | } 36 | 37 | #pragma mark - Interface 38 | 39 | - (ReaverOverlay *)reaverOverlay 40 | { 41 | return (ReaverOverlay *)self.overlay; 42 | } 43 | 44 | #pragma mark - Override 45 | 46 | /* 计算经纬度坐标对应的OpenGL坐标,每次地图坐标系有变化均会调用这个方法。 */ 47 | - (void)referenceDidChange 48 | { 49 | [super referenceDidChange]; 50 | 51 | _sizeGL = [self calculateSizeInGLReference]; 52 | 53 | CGPoint centerInGL = [self glPointForMapPoint:MAMapPointForCoordinate(self.overlay.coordinate)]; 54 | _centerGL.x = centerInGL.x; 55 | _centerGL.y = centerInGL.y; 56 | _centerGL.z = _sizeGL; 57 | } 58 | 59 | /* OpenGL绘制。 */ 60 | - (void)glRender 61 | { 62 | glEnable(GL_DEPTH_TEST); 63 | glDepthFunc(GL_LESS); 64 | 65 | glEnable(GL_BLEND); 66 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); 67 | 68 | glEnable(GL_TEXTURE_2D); 69 | glEnableClientState(GL_VERTEX_ARRAY); 70 | glEnableClientState(GL_TEXTURE_COORD_ARRAY); 71 | 72 | glBindTexture(GL_TEXTURE_2D, self.strokeTextureID); 73 | glColor4f(1, 1, 1, 1); 74 | 75 | glPushMatrix(); 76 | 77 | glTranslatef(_centerGL.x, _centerGL.y, _centerGL.z); 78 | glRotatef(90, 1, 0, 0); 79 | 80 | static float rotateZ = 0.0; 81 | glRotatef(rotateZ, 0, 1, 0); 82 | rotateZ += 5.0; 83 | 84 | glScalef(_sizeGL, _sizeGL, _sizeGL); 85 | 86 | // glVertexPointer(3, GL_FLOAT, 0, FelReaverMountVerts); 87 | // glTexCoordPointer(2, GL_FLOAT, 0, FelReaverMountTexCoords); 88 | 89 | // glDrawArrays(GL_TRIANGLES, 0, FelReaverMountNumVerts); 90 | 91 | glPopMatrix(); 92 | 93 | glDisable(GL_TEXTURE_2D); 94 | glDisableClientState(GL_VERTEX_ARRAY); 95 | glDisableClientState(GL_TEXTURE_COORD_ARRAY); 96 | 97 | glDisable(GL_BLEND); 98 | glDisable(GL_DEPTH_TEST); 99 | 100 | } 101 | 102 | #pragma mark - Helper 103 | 104 | - (CGFloat)lengthBetweenPointA:(CGPoint)a andPointB:(CGPoint)b 105 | { 106 | CGFloat deltaX = a.x - b.x; 107 | CGFloat deltaY = a.y - b.y; 108 | return sqrt(deltaX*deltaX + deltaY*deltaY); 109 | } 110 | 111 | - (CGFloat)calculateSizeInGLReference 112 | { 113 | ReaverOverlay * reaverOverlay = self.reaverOverlay; 114 | 115 | MAMapRect bounding = [reaverOverlay boundingMapRect]; 116 | MAMapPoint mapEdge[2]; 117 | mapEdge[0] = bounding.origin; 118 | mapEdge[1] = MAMapPointMake(bounding.origin.x + bounding.size.width, bounding.origin.y); 119 | 120 | CGPoint * glEdge = [self glPointsForMapPoints:mapEdge count:2]; 121 | 122 | return [self lengthBetweenPointA:glEdge[0] andPointB:glEdge[1]]; 123 | } 124 | 125 | #pragma mark - Init 126 | 127 | - (instancetype)initWithReaverOverlay:(ReaverOverlay *)ReaverOverlay 128 | { 129 | self = [super initWithOverlay:ReaverOverlay]; 130 | if (self) 131 | { 132 | } 133 | 134 | return self; 135 | } 136 | 137 | - (instancetype)initWithOverlay:(id)overlay 138 | { 139 | if ([overlay isKindOfClass:[ReaverOverlay class]]) 140 | { 141 | return nil; 142 | } 143 | 144 | return [self initWithReaverOverlay:overlay]; 145 | } 146 | 147 | @end 148 | -------------------------------------------------------------------------------- /reaverInMap/reaver/V_body.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amap-demo/iOS-map-game/24e410ad39f7711fe5c05929cbc7c64a78e96cde/reaverInMap/reaver/V_body.png -------------------------------------------------------------------------------- /reaverInMapUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /reaverInMapUITests/reaverInMapUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // reaverInMapUITests.m 3 | // reaverInMapUITests 4 | // 5 | // Created by eidan on 17/1/17. 6 | // Copyright © 2017年 Autonavi. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface reaverInMapUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation reaverInMapUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | XCTestExpectation *e = [self expectationWithDescription:@"empty wait"]; 37 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(15 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 38 | [e fulfill]; 39 | }); 40 | [self waitForExpectationsWithTimeout:20 handler:nil]; 41 | } 42 | 43 | @end 44 | --------------------------------------------------------------------------------