ソースを参照

APEX Mobile 2.70.190412 修复service location 位置,地图中心位置,增加访问日志等

Ray Zhang 7 年 前
コミット
8a76bbf9c3
25 ファイル変更476 行追加783 行削除
  1. 7 1
      Apex Mobile/Apex Mobile.xcodeproj/project.pbxproj
  2. BIN
      Apex Mobile/Apex Mobile.xcodeproj/project.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate
  3. 95 734
      Apex Mobile/Apex Mobile.xcodeproj/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  4. 2 2
      Apex Mobile/Apex Mobile/Apex Mobile-Info.plist
  5. 3 2
      Apex Mobile/Apex Mobile/AppDelegate.m
  6. 3 1
      Apex Mobile/Apex Mobile/DetailPageViewController.m
  7. 21 6
      Apex Mobile/Apex Mobile/DetailTabBarController.m
  8. 8 2
      Apex Mobile/Apex Mobile/HomeViewController.m
  9. 2 1
      Apex Mobile/Apex Mobile/LocationViewController.h
  10. 104 20
      Apex Mobile/Apex Mobile/LocationViewController.m
  11. 3 3
      Apex Mobile/Apex Mobile/NewImages.xcassets/new_location_pod.imageset/Contents.json
  12. BIN
      Apex Mobile/Apex Mobile/NewImages.xcassets/new_location_pod.imageset/appicon-1.png
  13. BIN
      Apex Mobile/Apex Mobile/NewImages.xcassets/new_location_pod.imageset/appicon-2.png
  14. BIN
      Apex Mobile/Apex Mobile/NewImages.xcassets/new_location_pod.imageset/appicon.png
  15. 3 3
      Apex Mobile/Apex Mobile/NewImages.xcassets/new_location_pol.imageset/Contents.json
  16. BIN
      Apex Mobile/Apex Mobile/NewImages.xcassets/new_location_pol.imageset/appicon-1.png
  17. BIN
      Apex Mobile/Apex Mobile/NewImages.xcassets/new_location_pol.imageset/appicon-2.png
  18. BIN
      Apex Mobile/Apex Mobile/NewImages.xcassets/new_location_pol.imageset/appicon.png
  19. 2 1
      Apex Mobile/Apex Mobile/RANetwork.h
  20. 40 0
      Apex Mobile/Apex Mobile/RANetwork.m
  21. 1 1
      Apex Mobile/Apex Mobile/ShipMap/AMShipMap.h
  22. 3 3
      Apex Mobile/Apex Mobile/ShipMap/AMShipMap.m
  23. 3 3
      Apex Mobile/Apex Mobile/config.h
  24. 20 0
      common/MapNavigation/CLLocation+Sino.h
  25. 156 0
      common/MapNavigation/CLLocation+Sino.m

+ 7 - 1
Apex Mobile/Apex Mobile.xcodeproj/project.pbxproj

@@ -79,6 +79,7 @@
 		42FB6ECC21F2C0E300F694AB /* ApexResultBLInfoModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 42FB6ECB21F2C0E300F694AB /* ApexResultBLInfoModel.m */; };
 		42FB6ECF21F3136300F694AB /* ApexResultMenuItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 42FB6ECE21F3136300F694AB /* ApexResultMenuItem.m */; };
 		7101BEC82031389A00CC6E3A /* DetailCellKVNew.m in Sources */ = {isa = PBXBuildFile; fileRef = 7101BEC72031389A00CC6E3A /* DetailCellKVNew.m */; };
+		7103C84B22549E7F00261926 /* CLLocation+Sino.m in Sources */ = {isa = PBXBuildFile; fileRef = 7103C84922549E7E00261926 /* CLLocation+Sino.m */; };
 		711BA6C1191E0525002EDE6F /* MessageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 711BA6C0191E0525002EDE6F /* MessageViewController.m */; };
 		711BA6C4191E0553002EDE6F /* MessageItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 711BA6C3191E0553002EDE6F /* MessageItem.m */; };
 		711DC6B218C30A4800FB1749 /* TableCellEdit.m in Sources */ = {isa = PBXBuildFile; fileRef = 711DC6B118C30A4800FB1749 /* TableCellEdit.m */; };
@@ -344,6 +345,8 @@
 		42FB6ECE21F3136300F694AB /* ApexResultMenuItem.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ApexResultMenuItem.m; sourceTree = "<group>"; };
 		7101BEC62031389A00CC6E3A /* DetailCellKVNew.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DetailCellKVNew.h; sourceTree = "<group>"; };
 		7101BEC72031389A00CC6E3A /* DetailCellKVNew.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DetailCellKVNew.m; sourceTree = "<group>"; };
+		7103C84922549E7E00261926 /* CLLocation+Sino.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = "CLLocation+Sino.m"; path = "../../common/MapNavigation/CLLocation+Sino.m"; sourceTree = "<group>"; };
+		7103C84A22549E7E00261926 /* CLLocation+Sino.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "CLLocation+Sino.h"; path = "../../common/MapNavigation/CLLocation+Sino.h"; sourceTree = "<group>"; };
 		711BA6BF191E0525002EDE6F /* MessageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessageViewController.h; sourceTree = "<group>"; };
 		711BA6C0191E0525002EDE6F /* MessageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MessageViewController.m; sourceTree = "<group>"; };
 		711BA6C2191E0553002EDE6F /* MessageItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MessageItem.h; sourceTree = "<group>"; };
@@ -1092,6 +1095,8 @@
 		719A51AC18C5A6A80080C075 /* Location */ = {
 			isa = PBXGroup;
 			children = (
+				7103C84A22549E7E00261926 /* CLLocation+Sino.h */,
+				7103C84922549E7E00261926 /* CLLocation+Sino.m */,
 				7120DD0218BE273900E7546F /* LocationViewController.h */,
 				7120DD0318BE273900E7546F /* LocationViewController.m */,
 				42BCACC8209AE243009DDA43 /* AMAnnotationView.h */,
@@ -1463,7 +1468,7 @@
 			};
 			buildConfigurationList = 719EF8D818BB839F00EFFF5F /* Build configuration list for PBXProject "Apex Mobile" */;
 			compatibilityVersion = "Xcode 3.2";
-			developmentRegion = English;
+			developmentRegion = en;
 			hasScannedForEncodings = 0;
 			knownRegions = (
 				en,
@@ -1594,6 +1599,7 @@
 				71AE427318C47AF900B8EC3D /* SearchViewController.m in Sources */,
 				715643BE2019AA9B00B04267 /* LoginViewController.m in Sources */,
 				4225E43321E08A54009D2364 /* ApexResultContainerCell.m in Sources */,
+				7103C84B22549E7F00261926 /* CLLocation+Sino.m in Sources */,
 				71308AF7191E7B0E0024B2B0 /* MessageDetailItem.m in Sources */,
 				71A565D918C20F5900CDAC07 /* SearchTableAdapter.m in Sources */,
 				719EF8FA18BB839F00EFFF5F /* ApexMobileFirstViewController.m in Sources */,

BIN
Apex Mobile/Apex Mobile.xcodeproj/project.xcworkspace/xcuserdata/Ray.xcuserdatad/UserInterfaceState.xcuserstate


ファイルの差分が大きいため隠しています
+ 95 - 734
Apex Mobile/Apex Mobile.xcodeproj/xcuserdata/Ray.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist


+ 2 - 2
Apex Mobile/Apex Mobile/Apex Mobile-Info.plist

@@ -17,11 +17,11 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>2.66</string>
+	<string>2.70</string>
 	<key>CFBundleSignature</key>
 	<string>????</string>
 	<key>CFBundleVersion</key>
-	<string>190316</string>
+	<string>190403</string>
 	<key>LSRequiresIPhoneOS</key>
 	<true/>
 	<key>NSAppTransportSecurity</key>

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

@@ -200,12 +200,13 @@ void UncaughtExceptionHandler(NSException *exception) {
 }
 -(void)Logout
 {
+
+//    self.sessionid=nil;
+    [RANetwork Logout];
     self.isLogin = NO;
     self.user = nil;
     self.password=nil;
     self.personalmode = NO;
-//    self.sessionid=nil;
-    [RANetwork Logout];
     NSUserDefaults *defaults =[NSUserDefaults standardUserDefaults];
     [defaults setBool:false forKey:@"autologin"];
     

+ 3 - 1
Apex Mobile/Apex Mobile/DetailPageViewController.m

@@ -1426,9 +1426,11 @@
     NSMutableDictionary* segment = [self.content.segments[indexPath.section] mutableCopy];
     NSString* type =[segment valueForKey:@"_type"];
     
+    NSString* port = self.content.originContent[@"backup_port"];
+    
     if([type isEqualToString:@"tracking"]) {
         NSDictionary *location = [segment objectForKey:@"location"];
-        [self.shipMap showShipAnnotaion:location];
+        [self.shipMap showShipAnnotaion:location backupLocation:port];
         self.containerSelectedIndexPath = indexPath;
     }
     

+ 21 - 6
Apex Mobile/Apex Mobile/DetailTabBarController.m

@@ -12,6 +12,7 @@
 #import "RAUtils.h"
 #import "DetailShareItemProvider.h"
 
+#import "ApexResultViewController.h"
 @interface DetailTabBarController () <UITabBarControllerDelegate>
 
 @end
@@ -325,12 +326,26 @@
     
     if (hbol.length) {
         
-        AMResultViewController *resultVC = [[AMResultViewController alloc] initWithNibName:@"Result" bundle:nil];
-        resultVC.params = [@{
-                            @"bol" : hbol,
-                            @"module_name" : @"Download Document"
-                            } mutableCopy];
-        [self.navigationController pushViewController:resultVC animated:YES];
+        
+
+        
+//        AMResultViewController *resultVC = [[AMResultViewController alloc] initWithNibName:@"Result" bundle:nil];
+//        resultVC.params = [@{
+//                            @"bol" : hbol,
+//                            @"module_name" : @"Download Document"
+//                            } mutableCopy];
+//        [self.navigationController pushViewController:resultVC animated:YES];
+        
+        
+        NSMutableDictionary* params = [@{
+                                         @"bol" : hbol,
+                                         @"module_name" : @"Download Document"
+                                         } mutableCopy];
+        
+        ApexResultViewController *vc = [ApexResultViewController resultViewController:params];
+        [self.navigationController pushViewController:vc animated:YES];
+        
+        
     } else {
         
         UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:nil message:@"There is no hbol to search" preferredStyle:UIAlertControllerStyleAlert];

+ 8 - 2
Apex Mobile/Apex Mobile/HomeViewController.m

@@ -957,8 +957,14 @@ typedef enum {
         return;
     NSDictionary *item = [self.shipArray objectAtIndex:indexPath.section];
     NSDictionary *locationInfo = [item objectForKey:@"locations"];
-    
-    [self.mapView showShipAnnotaion:locationInfo];
+    NSString* port = @"";
+    if([item[@"location_eta"] boolValue])
+        port=@"pod";
+    else
+        if([item[@"location_etd"] boolValue])
+            port=@"pol";
+
+    [self.mapView showShipAnnotaion:locationInfo backupLocation:port];
     
 }
 

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

@@ -21,7 +21,8 @@
 @property (strong,nonatomic) NSMutableDictionary * params;
 -(void)  updateLocation;
 -(void) addLocation;
-@property (strong,nonatomic) NSArray* Locations;
+//@property (strong,nonatomic) NSArray* Locations;
+//@property (strong,nonatomic) NSDictionary* locationJson;
 @property (strong, nonatomic) IBOutlet UIView *mapContainer;
 @property BOOL showNavigation;
 @property (strong,nonatomic) UINavigationController * aBNewPersonNav;

+ 104 - 20
Apex Mobile/Apex Mobile/LocationViewController.m

@@ -14,6 +14,8 @@
 #import "AMMapAnnotaion.h"
 #import "AMAnnotationView.h"
 #import "AMMapView.h"
+#import "CLLocation+Sino.h"
+#import "RAUtils.h"
 
 #pragma mark - Button
 
@@ -34,6 +36,8 @@
 
 @property (nonatomic,assign) BOOL useGoogleMap;
 
+
+@property (nonatomic,strong) NSMutableDictionary* locationjson;
 @end
 
 @implementation LocationViewController  {
@@ -478,15 +482,21 @@
     //    [UIView commitAnimations];
     dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
         
-        bool bupdate=[RANetwork UpdateServiceLocation];
+        NSDictionary* locationJson=[RANetwork RequestServiceLocation];
         
         dispatch_async(dispatch_get_main_queue(), ^{
-            if(bupdate) {
-                if (self.useGoogleMap) {
-                    [self addLocation];
-                } else{
-                    [self addOfficeLocation];
-                }
+            int result = [locationJson[@"result"] intValue];
+            if(result==RESULT_TRUE) {
+//                if (self.useGoogleMap) {
+//                    [self addLocation];
+//                } else{
+                self.locationjson = [locationJson mutableCopy];
+                [self addOfficeLocation];
+//                }
+            }
+            else
+            {
+                
             }
                 
             
@@ -620,29 +630,52 @@
                                                               constant:0];
     [self.view addConstraints:@[top,left,bottom,right]];
     
-    
+        NSString* path = [[RAUtils appCacheDirectory] stringByAppendingPathComponent:@"service_location.json"];
+    NSFileManager* fm = [NSFileManager defaultManager];
+    BOOL isDir = NO;
+    if ([fm fileExistsAtPath:path isDirectory:&isDir])
+    {
+        self.locationjson=[NSDictionary dictionaryWithContentsOfFile:path].mutableCopy;
+        self.locationjson[@"iscache"]=@(true);
     [self addOfficeLocation];
+    }
+
 }
 
 - (void)addOfficeLocation {
     
     [myMapView removeAnnotations:myMapView.annotations];
-    self.Locations = [ApexMobileDB get_Location];
+//    self.Locations = [ApexMobileDB get_Location];
     UIImage *image;
     image = [UIImage imageNamed:@"ic_marker.png"];
-    for (int i = 0; i < self.Locations.count ; i ++) {
+    
+    NSDictionary* objrecords = [self.locationjson objectForKey:@"records"];
+        int total = [[self.locationjson valueForKey:@"total"] intValue];
+    for(int i=0;i<total;i++)
+    {
+        NSDictionary* objlocation = [objrecords objectForKey:[NSString stringWithFormat:@"record%d",i]];
+        NSString* area = [objlocation valueForKey:@"area"];
+        NSString* company = [objlocation valueForKey:@"company"];
+        NSString* city = [objlocation valueForKey:@"city"];
+        double  longitude = [[objlocation valueForKey:@"longitude"]doubleValue] ;
+        double  latitude = [[objlocation valueForKey:@"latitude"]doubleValue] ;
+        bool amap_china =[[objlocation valueForKey:@"amap_china"] boolValue] ;
+       CLLocationCoordinate2D c2d ;
         
-        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* country =[NSLocale currentLocale].countryCode;
+        
+        if([country isEqualToString:@"CN"]&&amap_china)
+        {
+            c2d= [CLLocation CoordMars:latitude :longitude ];
+        }
+        else
+        {
+            c2d= CLLocationCoordinate2DMake(latitude, longitude);
+        }
         
-        // 创建大头针(标注)的数据模型(此处不创建视图,视图通过MKMapView的委托设置回调方法来生成的)
         AMMapAnnotaion *ann = [[AMMapAnnotaion alloc] init];
-        ann.params = location;
-        CLLocationCoordinate2D c2d = CLLocationCoordinate2DMake(latitude, longitude);
+        ann.params = objlocation;
+        
         // 指定大头针的经纬度坐标(位置)以及附加的信息
         ann.coordinate = c2d;
         ann.title = company;
@@ -650,8 +683,59 @@
         
         // 将大头针数据模型添加到MKMapView上管理
         [myMapView addAnnotation:ann];
-//        break;
     }
+    
+//
+//    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];
+//
+//                CLLocationCoordinate2D c2d ;
+//
+////        if let countryCode = (Locale.current as NSLocale).object(forKey: .countryCode) as? String {
+////            print("Code => \(countryCode)") //FR
+////        }
+//        NSString* country =[NSLocale currentLocale].countryCode;
+//
+//        if([country isEqualToString:@"CN"]&&([[[area lowercaseString] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] isEqualToString:@"southern china"]||[[[area lowercaseString] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] isEqualToString:@"northern china"]||[[[area lowercaseString] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] isEqualToString:@"eastern china"]))
+//        {
+//            c2d= [CLLocation CoordMars:latitude :longitude ];
+//        }
+//        else
+//        {
+//            c2d= CLLocationCoordinate2DMake(latitude, longitude);
+//        }
+//
+////
+////
+////        {
+////            //                    Log.d("service location", "cn 变形: "+area);
+////            //                    Log.d("service location", "cn 变形前: "+dlatitude+","+dlongitude);
+////            double bd[] = GeoUtils.wgs84tobd09(dlongitude,dlatitude);
+////            dlongitude = bd[0];
+////            dlatitude = bd[1];
+////            //                    Log.d("service location", "cn 变形: "+dlatitude+","+dlongitude);
+////
+////        }
+//
+//        // 创建大头针(标注)的数据模型(此处不创建视图,视图通过MKMapView的委托设置回调方法来生成的)
+//        AMMapAnnotaion *ann = [[AMMapAnnotaion alloc] init];
+//        ann.params = location;
+//
+//        // 指定大头针的经纬度坐标(位置)以及附加的信息
+//        ann.coordinate = c2d;
+//        ann.title = company;
+//        ann.subtitle = [[NSString stringWithFormat:@"%@\n%@",city,area] stringByAppendingString:NSLocalizedString(@"ask_click", nil)];
+//
+//        // 将大头针数据模型添加到MKMapView上管理
+//        [myMapView addAnnotation:ann];
+////        break;
+//    }
 }
 
 #pragma mark - iOS Map Delegate

+ 3 - 3
Apex Mobile/Apex Mobile/NewImages.xcassets/new_location_pod.imageset/Contents.json

@@ -2,17 +2,17 @@
   "images" : [
     {
       "idiom" : "universal",
-      "filename" : "new_location_pod.png",
+      "filename" : "appicon.png",
       "scale" : "1x"
     },
     {
       "idiom" : "universal",
-      "filename" : "new_location_pod@2x.png",
+      "filename" : "appicon-1.png",
       "scale" : "2x"
     },
     {
       "idiom" : "universal",
-      "filename" : "new_location_pod@3x.png",
+      "filename" : "appicon-2.png",
       "scale" : "3x"
     }
   ],

BIN
Apex Mobile/Apex Mobile/NewImages.xcassets/new_location_pod.imageset/appicon-1.png


BIN
Apex Mobile/Apex Mobile/NewImages.xcassets/new_location_pod.imageset/appicon-2.png


BIN
Apex Mobile/Apex Mobile/NewImages.xcassets/new_location_pod.imageset/appicon.png


+ 3 - 3
Apex Mobile/Apex Mobile/NewImages.xcassets/new_location_pol.imageset/Contents.json

@@ -2,17 +2,17 @@
   "images" : [
     {
       "idiom" : "universal",
-      "filename" : "new_location_pol.png",
+      "filename" : "appicon.png",
       "scale" : "1x"
     },
     {
       "idiom" : "universal",
-      "filename" : "new_location_pol@2x.png",
+      "filename" : "appicon-1.png",
       "scale" : "2x"
     },
     {
       "idiom" : "universal",
-      "filename" : "new_location_pol@3x.png",
+      "filename" : "appicon-2.png",
       "scale" : "3x"
     }
   ],

BIN
Apex Mobile/Apex Mobile/NewImages.xcassets/new_location_pol.imageset/appicon-1.png


BIN
Apex Mobile/Apex Mobile/NewImages.xcassets/new_location_pol.imageset/appicon-2.png


BIN
Apex Mobile/Apex Mobile/NewImages.xcassets/new_location_pol.imageset/appicon.png


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

@@ -35,7 +35,8 @@
 //+(bool) IsHostAvailable : (NSString*) url;
 +(int) RetrievePassword : (NSString*) user  email:(NSString*) email;
 +(int) ChangePassword : (NSString*) newpass user:(NSString*) user oldpass:(NSString*) oldpass;
-+(bool) UpdateServiceLocation;
+//+(bool) UpdateServiceLocation;
++(NSDictionary *) RequestServiceLocation;
 + (NSDictionary *)collectErrMsg:(NSString *)errMsg DeviceInfo:(NSString *)deviceInfo Time:(NSString *)time;
 + (NSDictionary *)requestHome;
 + (NSDictionary *)search:(NSMutableDictionary *)params;

+ 40 - 0
Apex Mobile/Apex Mobile/RANetwork.m

@@ -108,6 +108,7 @@
     [params setValue:uuid.UUIDString forKey:@"deviceid"];
 #endif
     
+    params[@"os"]=@"iOS";
     return params;
 }
 
@@ -662,6 +663,9 @@
 +(void)post_without_return : (NSString*) url parameters:(NSMutableDictionary *) params //delegate:(id < NSURLConnectionDelegate >)delegate
 {
     
+    
+    params = [self prepare_addtional_params:params];
+    
 //    [self get_json:url parameters:params file:nil err_recorder:nil result_handler:nil decrypt_handler:nil];
     
 //    AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate];
@@ -927,6 +931,42 @@
     
     return json;
     
+}
++(NSDictionary*) RequestServiceLocation
+{
+    if(![NetworkUtils IsNetworkAvailable])
+        return false;//RESULT_NET_NOTAVAILABLE;
+    
+    NSMutableDictionary* params = [[NSMutableDictionary alloc] init];
+    [params setValue:@"Location" forKey:@"module_name"];
+    [params setValue:@"search" forKey:@"action_type"];
+    [params setValue:@"999" forKey:@"limit"];
+    
+    NSData* json=[self get_json:URL_LOCATIONS parameters:params file:nil];
+    if (json==nil)
+    {
+        return @{
+                 @"result" : @RESULT_NET_ERROR,
+                 @"err_msg" : MSG_NET_ERROR
+                 };
+    }
+    
+    NSError *error=nil;
+    NSDictionary *jsobj = [NSJSONSerialization JSONObjectWithData:json options:NSJSONReadingMutableLeaves error:&error];
+    
+    
+    NSString* path = [[RAUtils appCacheDirectory] stringByAppendingPathComponent:@"service_location.json"];
+    if(jsobj!=nil&&[jsobj[@"result"] intValue]!=RESULT_NET_ERROR&&[jsobj[@"result"] intValue]!=RESULT_NET_NOTAVAILABLE)
+    {
+        
+        [jsobj writeToFile:path atomically:YES];
+//        return ret;
+    }
+    
+    return jsobj;
+    
+   
+    
 }
 +(bool) UpdateServiceLocation
 {

+ 1 - 1
Apex Mobile/Apex Mobile/ShipMap/AMShipMap.h

@@ -31,7 +31,7 @@
 
 @property (nonatomic,weak) id<AMShipMapDelegate> delegate;
 
-- (void)showShipAnnotaion:(NSDictionary *)annotation;
+- (void)showShipAnnotaion:(NSDictionary *)annotation backupLocation:(NSString*)port;
 
 - (void)shipMapWillAppear;///<视图显示的时候开启Current位置点闪烁Timer
 - (void)shipMapWillDisappear;///<视图消失的时候关闭Current位置点闪烁Timer

+ 3 - 3
Apex Mobile/Apex Mobile/ShipMap/AMShipMap.m

@@ -113,7 +113,7 @@ typedef enum {
     
 }
 
-- (void)showShipAnnotaion:(NSDictionary *)annotation {
+- (void)showShipAnnotaion:(NSDictionary *)annotation backupLocation:(NSString*)port{
     
     if (annotation == nil) {
         return;
@@ -173,9 +173,9 @@ typedef enum {
         if (current && self.showCurrent) {
             [self moveToLocation:current];
             
-        } else if (pol && self.showPol) {
+        } else if ([port isEqualToString:@"pol"]&& pol && self.showPol) {
             [self moveToLocation:pol];
-        } else if (pod && self.showPod) {
+        } else if ([port isEqualToString:@"pod"]&&pod && self.showPod) {
             [self moveToLocation:pod];
         }
     }

+ 3 - 3
Apex Mobile/Apex Mobile/config.h

@@ -13,7 +13,7 @@
 # ifdef DEBUG
 #define DEBUG_DB
 
-//#define test_server 
+//#define test_server
 //#define old_server
 
 # endif
@@ -30,7 +30,7 @@
     #define URL_REQUEST_DETAIL      @"http://192.168.0.138:8899/main_new_26.php"
     #define URL_ANNOUNCEMENTS       @"http://192.168.0.138:8899/mobile_news.php"
     #define URL_NEWS                @"http://192.168.0.138:8899/mobile_news.php"
-    #define URL_LOCATIONS           @"http://192.168.0.138:8899/mobile_news.php"
+    #define URL_LOCATIONS           @"http://192.168.0.138:8899/mobile_news26.php"
     #define URL_PUSH                @"http://192.168.0.138:8899/main_new_26.php"
     #define URL_KPI                 @"http://192.168.0.138:8899/main_new_26.php"
     #define URL_ERR_LOG             @""
@@ -74,7 +74,7 @@
         #define URL_REQUEST_DETAIL      @"https://ra.apexshipping.com/main_new_26.php"
         #define URL_ANNOUNCEMENTS       @"https://ra.apexshipping.com/mobile_news.php"
         #define URL_NEWS                @"https://ra.apexshipping.com/mobile_news.php"
-        #define URL_LOCATIONS           @"https://ra.apexshipping.com/mobile_news.php"
+        #define URL_LOCATIONS           @"https://ra.apexshipping.com/mobile_news26.php"
         #define URL_PUSH                @"https://ra.apexshipping.com/main_new_26.php"
         #define URL_KPI                 @"https://ra.apexshipping.com/main_new_26.php"
         #define URL_ERR_LOG             @""

+ 20 - 0
common/MapNavigation/CLLocation+Sino.h

@@ -0,0 +1,20 @@
+//
+//  CLLocation+Sino.h
+//
+//  Created by i0xbean@gmail.com on 13-4-26.
+//  火星坐标系转换扩展
+//
+//  earth(国外 WGS84), mars(国内 GCJ-02), bearPaw(百度 BD-09) 坐标系间相互转换
+//  未包含 mars2earth. 需要这个可参考 http://xcodev.com/131.html
+
+#import <CoreLocation/CoreLocation.h>
+
+@interface CLLocation (Sino)
+
+- (CLLocation*)locationMarsFromEarth;
+//- (CLLocation*)locationEarthFromMars; // 未实现
+
+- (CLLocation*)locationBearPawFromMars;
+- (CLLocation*)locationMarsFromBearPaw;
++(CLLocationCoordinate2D) CoordMars:(double)lat :(double)lng;
+@end

+ 156 - 0
common/MapNavigation/CLLocation+Sino.m

@@ -0,0 +1,156 @@
+//
+//  CLLocation+Sino.h
+//
+//  Created by i0xbean@gmail.com on 13-4-26.
+//  火星坐标系转换扩展
+
+#import "CLLocation+Sino.h"
+
+void transform_earth_2_mars(double lat, double lng, double* tarLat, double* tarLng);
+void transform_mars_2_bear_paw(double lat, double lng, double* tarLat, double* tarLng);
+void transform_bear_paw_2_mars(double lat, double lng, double* tarLat, double* tarLng);
+
+@implementation CLLocation (Sino)
+
+- (CLLocation*)locationMarsFromEarth;
+{
+    double lat = 0.0;
+    double lng = 0.0;
+    transform_earth_2_mars(self.coordinate.latitude, self.coordinate.longitude, &lat, &lng);
+    return [[CLLocation alloc] initWithCoordinate:CLLocationCoordinate2DMake(lat, lng)
+                                         altitude:self.altitude
+                               horizontalAccuracy:self.horizontalAccuracy
+                                 verticalAccuracy:self.verticalAccuracy
+                                           course:self.course
+                                            speed:self.speed
+                                        timestamp:self.timestamp];
+}
++(CLLocationCoordinate2D) CoordMars:(double)lat :(double)lng
+{
+    double marslat = 0.0;
+    double marslng = 0.0;
+    transform_earth_2_mars( lat,  lng, &marslat, &marslng);
+    CLLocationCoordinate2D cMars = CLLocationCoordinate2DMake(marslat, marslng);
+    return cMars;
+}
+- (CLLocation*)locationEarthFromMars;
+{
+    // 二分法查纠偏文件
+    // http://xcodev.com/131.html
+    return nil;
+}
+
+- (CLLocation*)locationBearPawFromMars;
+{
+    double lat = 0.0;
+    double lng = 0.0;
+    transform_mars_2_bear_paw(self.coordinate.latitude, self.coordinate.longitude, &lat, &lng);
+    return [[CLLocation alloc] initWithCoordinate:CLLocationCoordinate2DMake(lat, lng)
+                                         altitude:self.altitude
+                               horizontalAccuracy:self.horizontalAccuracy
+                                 verticalAccuracy:self.verticalAccuracy
+                                           course:self.course
+                                            speed:self.speed
+                                        timestamp:self.timestamp];
+}
+
+- (CLLocation*)locationMarsFromBearPaw;
+{
+    double lat = 0.0;
+    double lng = 0.0;
+    transform_bear_paw_2_mars(self.coordinate.latitude, self.coordinate.longitude, &lat, &lng);
+    return [[CLLocation alloc] initWithCoordinate:CLLocationCoordinate2DMake(lat, lng)
+                                         altitude:self.altitude
+                               horizontalAccuracy:self.horizontalAccuracy
+                                 verticalAccuracy:self.verticalAccuracy
+                                           course:self.course
+                                            speed:self.speed
+                                        timestamp:self.timestamp];
+}
+
+@end
+
+
+
+// --- transform_earth_2_mars ---
+// 参考来源:https://on4wp7.codeplex.com/SourceControl/changeset/view/21483#353936
+// Krasovsky 1940
+//
+// a = 6378245.0, 1/f = 298.3
+// b = a * (1 - f)
+// ee = (a^2 - b^2) / a^2;
+const double a = 6378245.0;
+const double ee = 0.00669342162296594323;
+
+bool transform_sino_out_china(double lat, double lon)
+{
+    if (lon < 72.004 || lon > 137.8347)
+        return true;
+    if (lat < 0.8293 || lat > 55.8271)
+        return true;
+    return false;
+}
+
+double transform_earth_2_mars_lat(double x, double y)
+{
+    double ret = -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * sqrt(abs(x));
+    ret += (20.0 * sin(6.0 * x * M_PI) + 20.0 * sin(2.0 * x * M_PI)) * 2.0 / 3.0;
+    ret += (20.0 * sin(y * M_PI) + 40.0 * sin(y / 3.0 * M_PI)) * 2.0 / 3.0;
+    ret += (160.0 * sin(y / 12.0 * M_PI) + 320 * sin(y * M_PI / 30.0)) * 2.0 / 3.0;
+    return ret;
+}
+
+double transform_earth_2_mars_lng(double x, double y)
+{
+    double ret = 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * sqrt(abs(x));
+    ret += (20.0 * sin(6.0 * x * M_PI) + 20.0 * sin(2.0 * x * M_PI)) * 2.0 / 3.0;
+    ret += (20.0 * sin(x * M_PI) + 40.0 * sin(x / 3.0 * M_PI)) * 2.0 / 3.0;
+    ret += (150.0 * sin(x / 12.0 * M_PI) + 300.0 * sin(x / 30.0 * M_PI)) * 2.0 / 3.0;
+    return ret;
+}
+
+void transform_earth_2_mars(double lat, double lng, double* tarLat, double* tarLng)
+{
+    if (transform_sino_out_china(lat, lng))
+    {
+        *tarLat = lat;
+        *tarLng = lng;
+        return;
+    }
+    double dLat = transform_earth_2_mars_lat(lng - 105.0, lat - 35.0);
+    double dLon = transform_earth_2_mars_lng(lng - 105.0, lat - 35.0);
+    double radLat = lat / 180.0 * M_PI;
+    double magic = sin(radLat);
+    magic = 1 - ee * magic * magic;
+    double sqrtMagic = sqrt(magic);
+    dLat = (dLat * 180.0) / ((a * (1 - ee)) / (magic * sqrtMagic) * M_PI);
+    dLon = (dLon * 180.0) / (a / sqrtMagic * cos(radLat) * M_PI);
+    *tarLat = lat + dLat;
+    *tarLng = lng + dLon;
+}
+
+// --- transform_earth_2_mars end ---
+
+// --- transform_mars_vs_bear_paw ---
+// 参考来源:http://blog.woodbunny.com/post-68.html
+const double x_pi = M_PI * 3000.0 / 180.0;
+
+void transform_mars_2_bear_paw(double gg_lat, double gg_lon, double *bd_lat, double *bd_lon)
+{
+    double x = gg_lon, y = gg_lat;
+    double z = sqrt(x * x + y * y) + 0.00002 * sin(y * x_pi);
+    double theta = atan2(y, x) + 0.000003 * cos(x * x_pi);
+    *bd_lon = z * cos(theta) + 0.0065;
+    *bd_lat = z * sin(theta) + 0.006;
+}
+
+void transform_bear_paw_2_mars(double bd_lat, double bd_lon, double *gg_lat, double *gg_lon)
+{
+    double x = bd_lon - 0.0065, y = bd_lat - 0.006;
+    double z = sqrt(x * x + y * y) - 0.00002 * sin(y * x_pi);
+    double theta = atan2(y, x) - 0.000003 * cos(x * x_pi);
+    *gg_lon = z * cos(theta);
+    *gg_lat = z * sin(theta);
+}
+
+// --- transform_mars_vs_bear_paw end ---

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません