Bläddra i källkod

1.修改iOS Apex Mobil移除GoogleMap。

Pen Li 8 år sedan
förälder
incheckning
91051eefcb

+ 0 - 24
Apex Mobile/Apex Mobile.xcodeproj/project.pbxproj

@@ -44,10 +44,6 @@
 		426F39822033D0930025C568 /* ResultCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 426F39812033D0930025C568 /* ResultCell.m */; };
 		427CF5D02023F5560041472A /* NewImages.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 427CF5CF2023F5560041472A /* NewImages.xcassets */; };
 		427CF5E0202452460041472A /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 427CF5DF202452450041472A /* Accelerate.framework */; };
-		427CF5E5202454750041472A /* GoogleMaps.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 427CF5E2202454750041472A /* GoogleMaps.framework */; };
-		427CF5E6202454750041472A /* GoogleMapsBase.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 427CF5E3202454750041472A /* GoogleMapsBase.framework */; };
-		427CF5E7202454750041472A /* GoogleMapsCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 427CF5E4202454750041472A /* GoogleMapsCore.framework */; };
-		427CF5E9202454860041472A /* GoogleMaps.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 427CF5E8202454860041472A /* GoogleMaps.bundle */; };
 		42BB7402208431DA00B9B6E4 /* KPILegendCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 42BB7401208431DA00B9B6E4 /* KPILegendCell.m */; };
 		42BB740620846B4500B9B6E4 /* KPITableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 42BB740420846B4500B9B6E4 /* KPITableCell.m */; };
 		42BB740720846B4500B9B6E4 /* KPITableCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 42BB740520846B4500B9B6E4 /* KPITableCell.xib */; };
@@ -261,10 +257,6 @@
 		427994B120300E7300746EDC /* Apex Mobile.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = "Apex Mobile.entitlements"; sourceTree = "<group>"; };
 		427CF5CF2023F5560041472A /* NewImages.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = NewImages.xcassets; sourceTree = "<group>"; };
 		427CF5DF202452450041472A /* Accelerate.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Accelerate.framework; path = System/Library/Frameworks/Accelerate.framework; sourceTree = SDKROOT; };
-		427CF5E2202454750041472A /* GoogleMaps.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = GoogleMaps.framework; sourceTree = "<group>"; };
-		427CF5E3202454750041472A /* GoogleMapsBase.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = GoogleMapsBase.framework; sourceTree = "<group>"; };
-		427CF5E4202454750041472A /* GoogleMapsCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = GoogleMapsCore.framework; sourceTree = "<group>"; };
-		427CF5E8202454860041472A /* GoogleMaps.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = GoogleMaps.bundle; path = GoogleMaps.framework/Versions/A/Resources/GoogleMaps.bundle; sourceTree = "<group>"; };
 		42BB7400208431DA00B9B6E4 /* KPILegendCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KPILegendCell.h; sourceTree = "<group>"; };
 		42BB7401208431DA00B9B6E4 /* KPILegendCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KPILegendCell.m; sourceTree = "<group>"; };
 		42BB740320846B4500B9B6E4 /* KPITableCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KPITableCell.h; sourceTree = "<group>"; };
@@ -514,17 +506,14 @@
 			buildActionMask = 2147483647;
 			files = (
 				426F397F2033CEE80025C568 /* AudioToolbox.framework in Frameworks */,
-				427CF5E5202454750041472A /* GoogleMaps.framework in Frameworks */,
 				427CF5E0202452460041472A /* Accelerate.framework in Frameworks */,
 				71514ED2191B7E2500009C00 /* AddressBookUI.framework in Frameworks */,
 				719E7E3518C0395E003408FF /* libsqlite3.dylib in Frameworks */,
 				7120DD0118BE266000E7546F /* SystemConfiguration.framework in Frameworks */,
-				427CF5E6202454750041472A /* GoogleMapsBase.framework in Frameworks */,
 				7120DCFF18BE265100E7546F /* QuartzCore.framework in Frameworks */,
 				7120DCFD18BE264300E7546F /* OpenGLES.framework in Frameworks */,
 				7120DCFB18BE263800E7546F /* libz.dylib in Frameworks */,
 				7120DCF918BE262E00E7546F /* libicucore.dylib in Frameworks */,
-				427CF5E7202454750041472A /* GoogleMapsCore.framework in Frameworks */,
 				7120DCF718BE262300E7546F /* libc++.dylib in Frameworks */,
 				7120DCF518BE261500E7546F /* ImageIO.framework in Frameworks */,
 				7120DCF318BE260700E7546F /* GLKit.framework in Frameworks */,
@@ -704,17 +693,6 @@
 			path = ../../common/customUI/Alert;
 			sourceTree = "<group>";
 		};
-		427CF5E1202454750041472A /* GoogleMap */ = {
-			isa = PBXGroup;
-			children = (
-				427CF5E8202454860041472A /* GoogleMaps.bundle */,
-				427CF5E2202454750041472A /* GoogleMaps.framework */,
-				427CF5E3202454750041472A /* GoogleMapsBase.framework */,
-				427CF5E4202454750041472A /* GoogleMapsCore.framework */,
-			);
-			path = GoogleMap;
-			sourceTree = "<group>";
-		};
 		713AA79E1917366A00B44092 /* documents */ = {
 			isa = PBXGroup;
 			children = (
@@ -1066,7 +1044,6 @@
 			isa = PBXGroup;
 			children = (
 				426F397E2033CEE80025C568 /* AudioToolbox.framework */,
-				427CF5E1202454750041472A /* GoogleMap */,
 				427CF5DF202452450041472A /* Accelerate.framework */,
 				71514ED1191B7E2500009C00 /* AddressBookUI.framework */,
 				719E7E3418C0395E003408FF /* libsqlite3.dylib */,
@@ -1323,7 +1300,6 @@
 				42541ACF207C49610072BC5A /* fake_home.json in Resources */,
 				71625470201C5205009E3A41 /* fake_container_list.json in Resources */,
 				7162546B201C3AF1009E3A41 /* readme.txt in Resources */,
-				427CF5E9202454860041472A /* GoogleMaps.bundle in Resources */,
 				42604129201C57A7002374A8 /* ShipSearch.storyboard in Resources */,
 				715643DC201C117300B04267 /* search.json in Resources */,
 				420DEF3120A189AA00720524 /* AMCommEditCell.xib in Resources */,

+ 2 - 1
Apex Mobile/Apex Mobile/AppDelegate.m

@@ -166,7 +166,8 @@ void UncaughtExceptionHandler(NSException *exception) {
     [self setupUncaughtExceptionHandler];
     [self handleErrMsg];
     
-    [GMSServices provideAPIKey:@"AIzaSyBqS2pF7m1DlR5zwhAX_rBSD_9bTnpjYbQ"];
+//    [GMSServices provideAPIKey:@"AIzaSyBqS2pF7m1DlR5zwhAX_rBSD_9bTnpjYbQ"];
+    
     if (! [ApexMobileDB initializeDb])
         // TODO: alert the user!
         DebugLog(@"couldn't init db");

+ 2 - 1
Apex Mobile/Apex Mobile/LocationViewController.h

@@ -7,7 +7,7 @@
 //
 
 #import <UIKit/UIKit.h>
-#import <GoogleMaps/GoogleMaps.h>
+//#import <GoogleMaps/GoogleMaps.h>
 
 #import "const.h"
 #import "RANetwork.h"
@@ -16,6 +16,7 @@
 #import <ContactsUI/ContactsUI.h>
 
 @interface LocationViewController : UIViewController<GMSMapViewDelegate,CNContactViewControllerDelegate>
+//@interface LocationViewController : UIViewController<GMSMapViewDelegate,CNContactViewControllerDelegate>
 
 @property (strong,nonatomic) NSMutableDictionary * params;
 -(void)  updateLocation;

+ 103 - 102
Apex Mobile/Apex Mobile/LocationViewController.m

@@ -37,7 +37,8 @@
 @end
 
 @implementation LocationViewController  {
-    GMSMapView *mapView_;
+    
+//    GMSMapView *mapView_;
     
     // 苹果原生的地图视图
     AMMapView *myMapView;
@@ -200,54 +201,54 @@
 
 - (void)initGoogleMap {
     
-    [self updateLocation];
-    
-    GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:39.833333
-                                                            longitude:-98.3583333
-                                                                 zoom:2.5
-                                                              bearing:0
-                                                         viewingAngle:0];
-    mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
-    mapView_.myLocationEnabled = YES;
-    mapView_.delegate = self;
-    
-    mapView_.translatesAutoresizingMaskIntoConstraints = NO;
-    [self.view addSubview:mapView_];
-    
-    NSLayoutConstraint *top = [NSLayoutConstraint constraintWithItem:mapView_
-                                                           attribute:NSLayoutAttributeTop
-                                                           relatedBy:NSLayoutRelationEqual
-                                                              toItem:self.topLayoutGuide
-                                                           attribute:NSLayoutAttributeBottom
-                                                          multiplier:1.0
-                                                            constant:0];
-    NSLayoutConstraint *left = [NSLayoutConstraint constraintWithItem:mapView_
-                                                            attribute:NSLayoutAttributeLeft
-                                                            relatedBy:NSLayoutRelationEqual
-                                                               toItem:self.view
-                                                            attribute:NSLayoutAttributeLeft
-                                                           multiplier:1.0
-                                                             constant:0];
-    NSLayoutConstraint *bottom = [NSLayoutConstraint constraintWithItem:mapView_
-                                                              attribute:NSLayoutAttributeBottom
-                                                              relatedBy:NSLayoutRelationEqual
-                                                                 toItem:self.bottomLayoutGuide
-                                                              attribute:NSLayoutAttributeTop
-                                                             multiplier:1.0
-                                                               constant:0];
-    NSLayoutConstraint *right = [NSLayoutConstraint constraintWithItem:mapView_
-                                                             attribute:NSLayoutAttributeRight
-                                                             relatedBy:NSLayoutRelationEqual
-                                                                toItem:self.view
-                                                             attribute:NSLayoutAttributeRight
-                                                            multiplier:1.0
-                                                              constant:0];
-    [self.view addConstraints:@[top,left,bottom,right]];
-    
-    
-    
-    
-    [self addLocation];
+//    [self updateLocation];
+//
+//    GMSCameraPosition *camera = [GMSCameraPosition cameraWithLatitude:39.833333
+//                                                            longitude:-98.3583333
+//                                                                 zoom:2.5
+//                                                              bearing:0
+//                                                         viewingAngle:0];
+//    mapView_ = [GMSMapView mapWithFrame:CGRectZero camera:camera];
+//    mapView_.myLocationEnabled = YES;
+//    mapView_.delegate = self;
+//
+//    mapView_.translatesAutoresizingMaskIntoConstraints = NO;
+//    [self.view addSubview:mapView_];
+//
+//    NSLayoutConstraint *top = [NSLayoutConstraint constraintWithItem:mapView_
+//                                                           attribute:NSLayoutAttributeTop
+//                                                           relatedBy:NSLayoutRelationEqual
+//                                                              toItem:self.topLayoutGuide
+//                                                           attribute:NSLayoutAttributeBottom
+//                                                          multiplier:1.0
+//                                                            constant:0];
+//    NSLayoutConstraint *left = [NSLayoutConstraint constraintWithItem:mapView_
+//                                                            attribute:NSLayoutAttributeLeft
+//                                                            relatedBy:NSLayoutRelationEqual
+//                                                               toItem:self.view
+//                                                            attribute:NSLayoutAttributeLeft
+//                                                           multiplier:1.0
+//                                                             constant:0];
+//    NSLayoutConstraint *bottom = [NSLayoutConstraint constraintWithItem:mapView_
+//                                                              attribute:NSLayoutAttributeBottom
+//                                                              relatedBy:NSLayoutRelationEqual
+//                                                                 toItem:self.bottomLayoutGuide
+//                                                              attribute:NSLayoutAttributeTop
+//                                                             multiplier:1.0
+//                                                               constant:0];
+//    NSLayoutConstraint *right = [NSLayoutConstraint constraintWithItem:mapView_
+//                                                             attribute:NSLayoutAttributeRight
+//                                                             relatedBy:NSLayoutRelationEqual
+//                                                                toItem:self.view
+//                                                             attribute:NSLayoutAttributeRight
+//                                                            multiplier:1.0
+//                                                              constant:0];
+//    [self.view addConstraints:@[top,left,bottom,right]];
+//
+//
+//
+//
+//    [self addLocation];
 }
 
 - (void)mapView:(GMSMapView *)mapView
@@ -406,59 +407,59 @@ didTapInfoWindowOfMarker:(GMSMarker *)marker
 -(void) addLocation
 {
     
-    [mapView_ clear];
-    self.Locations = [ApexMobileDB get_Location];
-    UIImage *image;
-    image = [UIImage imageNamed:@"ic_marker.png"];
-    for (int i = 0; i < self.Locations.count ; i ++)
-    {
-        
-        NSDictionary* location = self.Locations[i];
-        NSString* area = [location valueForKey:@"area"];
-        NSString* company = [location valueForKey:@"company"];
-        NSString* city = [location valueForKey:@"city"];
-        double longitude = [[location valueForKey:@"longitude"] doubleValue];
-        double latitude = [[location valueForKey:@"latitude"] doubleValue];
-        //                NSString* address = [location valueForKeyPath:@"address"];
-        //                NSString* telephone = [location valueForKeyPath:@"telephone"];
-        //                NSString* fax = [location valueForKeyPath:@"fax"];
-        //                NSString* contact = [location valueForKeyPath:@"contact"];
-        //                NSString* email = [location valueForKeyPath:@"email"];
-        
-        
-        //                NSString *markertext = parts[i];
-        //                NSString *city = parts[i + 1];
-        //                NSString *postext = parts[i + 2];
-        //                NSArray *point = [postext componentsSeparatedByString:NSLocalizedString(@",", nil)];//postext.split(",");
-        //
-        //                NSString *address = parts[i+3];
-        //                NSArray *tel = parts[i+4];
-        //                NSArray *fax = parts[i+5];
-        //                NSArray *contact = parts[i+6];
-        //                NSArray *email = parts[i+7];
-        
-        //                NSMutableDictionary* params = [[NSMutableDictionary alloc]init];
-        //                [params setObject:markertext forKey:@"name"];
-        //                [params setObject:address forKey:@"addr"];
-        //                [params setObject:telephone forKey:@"tel"];
-        //                [params setObject:fax forKey:@"fax"];
-        //                [params setObject:contact forKey:@"contact"];
-        //                [params setObject:email forKey:@"email"];
-        
-        //    // Creates a marker in the center of the map.
-        GMSMarker *marker = [[GMSMarker alloc] init];
-        marker.position = CLLocationCoordinate2DMake(latitude,longitude);
-        marker.title = company;
-        //        NSString* snippet = [city stringByAppendingString:@"\n Click for more detail"];
-        marker.snippet = [[NSString stringWithFormat:@"%@\n%@",city,area] stringByAppendingString:NSLocalizedString(@"ask_click", nil)];
-        marker.map = mapView_;
-        marker.userData = location;
-        marker.icon = image;
-        
-        DebugLog(@"create marker title:%@   snippet:%@",marker.title,marker.snippet);
-        
-        
-    }
+//    [mapView_ clear];
+//    self.Locations = [ApexMobileDB get_Location];
+//    UIImage *image;
+//    image = [UIImage imageNamed:@"ic_marker.png"];
+//    for (int i = 0; i < self.Locations.count ; i ++)
+//    {
+//
+//        NSDictionary* location = self.Locations[i];
+//        NSString* area = [location valueForKey:@"area"];
+//        NSString* company = [location valueForKey:@"company"];
+//        NSString* city = [location valueForKey:@"city"];
+//        double longitude = [[location valueForKey:@"longitude"] doubleValue];
+//        double latitude = [[location valueForKey:@"latitude"] doubleValue];
+//        //                NSString* address = [location valueForKeyPath:@"address"];
+//        //                NSString* telephone = [location valueForKeyPath:@"telephone"];
+//        //                NSString* fax = [location valueForKeyPath:@"fax"];
+//        //                NSString* contact = [location valueForKeyPath:@"contact"];
+//        //                NSString* email = [location valueForKeyPath:@"email"];
+//
+//
+//        //                NSString *markertext = parts[i];
+//        //                NSString *city = parts[i + 1];
+//        //                NSString *postext = parts[i + 2];
+//        //                NSArray *point = [postext componentsSeparatedByString:NSLocalizedString(@",", nil)];//postext.split(",");
+//        //
+//        //                NSString *address = parts[i+3];
+//        //                NSArray *tel = parts[i+4];
+//        //                NSArray *fax = parts[i+5];
+//        //                NSArray *contact = parts[i+6];
+//        //                NSArray *email = parts[i+7];
+//
+//        //                NSMutableDictionary* params = [[NSMutableDictionary alloc]init];
+//        //                [params setObject:markertext forKey:@"name"];
+//        //                [params setObject:address forKey:@"addr"];
+//        //                [params setObject:telephone forKey:@"tel"];
+//        //                [params setObject:fax forKey:@"fax"];
+//        //                [params setObject:contact forKey:@"contact"];
+//        //                [params setObject:email forKey:@"email"];
+//
+//        //    // Creates a marker in the center of the map.
+//        GMSMarker *marker = [[GMSMarker alloc] init];
+//        marker.position = CLLocationCoordinate2DMake(latitude,longitude);
+//        marker.title = company;
+//        //        NSString* snippet = [city stringByAppendingString:@"\n Click for more detail"];
+//        marker.snippet = [[NSString stringWithFormat:@"%@\n%@",city,area] stringByAppendingString:NSLocalizedString(@"ask_click", nil)];
+//        marker.map = mapView_;
+//        marker.userData = location;
+//        marker.icon = image;
+//
+//        DebugLog(@"create marker title:%@   snippet:%@",marker.title,marker.snippet);
+//
+//
+//    }
 }
 -(void) updateLocation
 {