|
@@ -30,6 +30,7 @@
|
|
|
|
|
|
@property(nonatomic,strong)CLLocationManager *locaationManager;
|
|
@property(nonatomic,strong)CLLocationManager *locaationManager;
|
|
@property(nonatomic,strong)NSString *placeAdr;
|
|
@property(nonatomic,strong)NSString *placeAdr;
|
|
|
|
+@property(nonatomic,strong)NSString *placeLli;
|
|
@property(nonatomic,assign)BOOL isLocation;
|
|
@property(nonatomic,assign)BOOL isLocation;
|
|
|
|
|
|
|
|
|
|
@@ -85,7 +86,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
return _clipboardView;
|
|
return _clipboardView;
|
|
}
|
|
}
|
|
|
|
|
|
-//进度条
|
|
|
|
|
|
+//进 条
|
|
- (UIProgressView *)progressView
|
|
- (UIProgressView *)progressView
|
|
{
|
|
{
|
|
if (_progressView == nil) {
|
|
if (_progressView == nil) {
|
|
@@ -422,6 +423,10 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
NSDictionary *dict = @{@"type":@"string",
|
|
NSDictionary *dict = @{@"type":@"string",
|
|
@"value":[self jsGetLocation:paramdict]};
|
|
@"value":[self jsGetLocation:paramdict]};
|
|
completionHandler([self convertToJsonData:dict]);
|
|
completionHandler([self convertToJsonData:dict]);
|
|
|
|
+ }else if (type && [type isEqualToString:@"getLLitude"]) {
|
|
|
|
+ NSDictionary *dict = @{@"type":@"string",
|
|
|
|
+ @"value":[self jsGetLLitude:paramdict]};
|
|
|
|
+ completionHandler([self convertToJsonData:dict]);
|
|
}else if (type && [type isEqualToString:@"readRight"]) {
|
|
}else if (type && [type isEqualToString:@"readRight"]) {
|
|
NSDictionary *dict = @{@"type":@"string",
|
|
NSDictionary *dict = @{@"type":@"string",
|
|
@"value":[self jsReadRight:paramdict]};
|
|
@"value":[self jsReadRight:paramdict]};
|
|
@@ -538,6 +543,7 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
// Do any additional setup after loading the view.
|
|
// Do any additional setup after loading the view.
|
|
NSLog(@"首页初始化");
|
|
NSLog(@"首页初始化");
|
|
self.placeAdr = [NSString new];
|
|
self.placeAdr = [NSString new];
|
|
|
|
+ self.placeLli = [NSString new];
|
|
self.view.backgroundColor = [UIColor whiteColor];
|
|
self.view.backgroundColor = [UIColor whiteColor];
|
|
|
|
|
|
|
|
|
|
@@ -1144,6 +1150,28 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
return self.placeAdr;
|
|
return self.placeAdr;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+-(NSString *)jsGetLLitude:(NSDictionary *)dict {
|
|
|
|
+ NSLog(@"------开始调用获取经纬度:%@",self.placeLli);
|
|
|
|
+ if (!self.isLocation) {
|
|
|
|
+ if ([self checkLocationServiceIsEnabled]) {
|
|
|
|
+ [self createCLManager];
|
|
|
|
+ self.isLocation = YES; //只请求一次
|
|
|
|
+ }else{
|
|
|
|
+ NSLog(@"定位不可用");
|
|
|
|
+ self.isLocation = NO;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ NSLog(@"即将返回经纬度信息-%@",self.placeLli);
|
|
|
|
+ if ([@"" isNotNULL:self.placeLli]&&self.placeLli.length>0&&[self.placeLli isKindOfClass:[NSString class]]) {
|
|
|
|
+
|
|
|
|
+ }else {
|
|
|
|
+ self.placeLli = @"";
|
|
|
|
+ }
|
|
|
|
+ return self.placeLli;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
|
|
-(void)jsChooseTab:(NSDictionary *)dict {
|
|
-(void)jsChooseTab:(NSDictionary *)dict {
|
|
NSInteger indexTab = [dict[@"indexTab"] integerValue];
|
|
NSInteger indexTab = [dict[@"indexTab"] integerValue];
|
|
@@ -1753,6 +1781,9 @@ NSString *const new_AesKey_1 = @"mGlAgnIBB8bx2nch";
|
|
if (newLocation.horizontalAccuracy < 0) {
|
|
if (newLocation.horizontalAccuracy < 0) {
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ self.placeLli = [NSString stringWithFormat:@"%f_%f",newLocation.coordinate.longitude,newLocation.coordinate.latitude];
|
|
|
|
+ NSLog(@"回调经纬度:%@",self.placeLli);
|
|
|
|
+
|
|
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
|
|
CLGeocoder *geocoder = [[CLGeocoder alloc] init];
|
|
[geocoder reverseGeocodeLocation:newLocation completionHandler:^(NSArray *placemarks, NSError *error) {
|
|
[geocoder reverseGeocodeLocation:newLocation completionHandler:^(NSArray *placemarks, NSError *error) {
|
|
for (CLPlacemark *placeMark in placemarks) {
|
|
for (CLPlacemark *placeMark in placemarks) {
|