Skip to content

Commit

Permalink
设置apikey
Browse files Browse the repository at this point in the history
  • Loading branch information
googlb committed Oct 22, 2018
1 parent 3a274fd commit a177b26
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 32 deletions.
2 changes: 1 addition & 1 deletion amap3DSwift/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
platform :ios, '10.1'

target 'amap3DSwift' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
Expand Down
28 changes: 9 additions & 19 deletions amap3DSwift/amap3DSwift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@
67AD2D0E1E92481A00A9AE71 /* Sources */,
67AD2D0F1E92481A00A9AE71 /* Frameworks */,
67AD2D101E92481A00A9AE71 /* Resources */,
25AE5719AEBADD0AF976D075 /* [CP] Embed Pods Frameworks */,
73A3A9745ACCA6D6728A2AAF /* [CP] Copy Pods Resources */,
);
buildRules = (
Expand Down Expand Up @@ -202,30 +201,18 @@
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
25AE5719AEBADD0AF976D075 /* [CP] Embed Pods Frameworks */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-amap3DSwift/Pods-amap3DSwift-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
73A3A9745ACCA6D6728A2AAF /* [CP] Copy Pods Resources */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${SRCROOT}/Pods/Target Support Files/Pods-amap3DSwift/Pods-amap3DSwift-resources.sh",
"${PODS_ROOT}/AMap3DMap/MAMapKit.framework/AMap.bundle",
);
name = "[CP] Copy Pods Resources";
outputPaths = (
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/AMap.bundle",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand All @@ -238,13 +225,16 @@
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-amap3DSwift-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_ROOT}/../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";
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";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
Expand Down Expand Up @@ -409,7 +399,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "amap3DSwift-Bridging-Header.h";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Debug;
};
Expand All @@ -425,7 +415,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.BrodyGao.amap3DSwift;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "amap3DSwift-Bridging-Header.h";
SWIFT_VERSION = 4.0;
SWIFT_VERSION = 4.2;
};
name = Release;
};
Expand Down
2 changes: 1 addition & 1 deletion amap3DSwift/amap3DSwift/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
let viewController = ViewController()
self.window?.rootViewController = UINavigationController.init(rootViewController: viewController)
Expand Down
2 changes: 1 addition & 1 deletion amap3DSwift/amap3DSwift/BaseViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class BaseViewController: UIViewController {
self.view.backgroundColor = UIColor.white
}

func backAction(){
@objc func backAction(){
_ = self.navigationController?.popViewController(animated: true)
}
}
4 changes: 2 additions & 2 deletions amap3DSwift/amap3DSwift/SerialLocationViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class SerialLocationViewController: BaseViewController,MAMapViewDelegate ,AMapLo
self.setToolbarItems([flexble,showItem,flexble], animated: true)
}

func showSegmentAction(sender:UISegmentedControl){
@objc func showSegmentAction(sender:UISegmentedControl){
if sender.selectedSegmentIndex == 1 {
self.locationManager.stopUpdatingLocation()
self.mapView.removeAnnotations(self.mapView.annotations)
Expand All @@ -66,7 +66,7 @@ class SerialLocationViewController: BaseViewController,MAMapViewDelegate ,AMapLo
}

//MARK:- AMapLocationManager Delegate
func amapLocationManager(_ manager: AMapLocationManager!, didFailWithError error: Error!) {
func amapLocationManager(_ manager: AMapLocationManager!, didFailWithError error: Error) {
print(" amapLoctionManager error\(error)")
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ class SingleLocaitonAloneViewController: BaseViewController ,AMapLocationManager
self.view.addSubview(displayLabel)
}

func clearAction(){
@objc func clearAction(){
self.locationManager.stopUpdatingLocation()
self.locationManager.delegate = nil
self.displayLabel.text = nil
}

func reGeocodeAction(){
@objc func reGeocodeAction(){
self.locationManager.requestLocation(withReGeocode: true, completionBlock: {location,regeocode,error -> Void in
if (error != nil) {
print(error!)
Expand All @@ -81,7 +81,7 @@ class SingleLocaitonAloneViewController: BaseViewController ,AMapLocationManager
})
}

func locAction(){
@objc func locAction(){

self.locationManager.requestLocation(withReGeocode: false, completionBlock: { location, regeocode, error -> Void in
if (error != nil) {
Expand Down
6 changes: 3 additions & 3 deletions amap3DSwift/amap3DSwift/SingleLocationViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ class SingleLocationViewController: BaseViewController,MAMapViewDelegate,AMapSea
self.setToolbarItems([flexble,reGeocodeItem,flexble,locItem], animated: true)
}

func clearAction(){
@objc func clearAction(){
self.locationManager.stopUpdatingLocation()
self.locationManager.delegate = nil
self.mapView.removeAnnotations(self.mapView.annotations)
}

func reGeocodeAction(){
@objc func reGeocodeAction(){
self.mapView.removeAnnotations(self.mapView.annotations)
self.locationManager.requestLocation(withReGeocode: true, completionBlock: {location,regeocode,error -> Void in
if (error != nil) {
Expand All @@ -88,7 +88,7 @@ class SingleLocationViewController: BaseViewController,MAMapViewDelegate,AMapSea
})
}

func locAction(){
@objc func locAction(){
self.mapView.removeAnnotations(self.mapView.annotations)
self.locationManager.requestLocation(withReGeocode: false, completionBlock: { location, regeocode, error -> Void in
if (error != nil) {
Expand Down
5 changes: 3 additions & 2 deletions amap3DSwift/amap3DSwift/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ class ViewController: UIViewController,UITableViewDataSource,UITableViewDelegate
}

func initTableView(){
self.tableView = UITableView.init(frame: CGRect(x: 0, y: 0, width: self.view.bounds.width, height: self.view.bounds.height), style: UITableViewStyle.grouped)
self.tableView = UITableView.init(frame: CGRect(x: 0, y: 0, width: self.view.bounds.width, height: self.view.bounds.height), style: UITableView.Style.grouped)
tableView.dataSource = self
tableView.delegate = self
tableView.rowHeight = UITableViewAutomaticDimension
tableView.rowHeight = UITableView.automaticDimension

self.view.addSubview(tableView)
}
Expand All @@ -74,6 +74,7 @@ class ViewController: UIViewController,UITableViewDataSource,UITableViewDelegate
self.present(alertController, animated: true, completion: nil)

}
//设置api key
AMapServices.shared().apiKey = APIKey.APIkey as String?
}

Expand Down

0 comments on commit a177b26

Please sign in to comment.