Commit 54dcbd9d authored by luyueming's avatar luyueming

添加的文件

parent 9b7d1d72
......@@ -27,7 +27,6 @@ PODS:
- GMShareSDK
- MBProgressHUD
- SDWebImage
- SnapKit (= 4.2.0)
- "UITableView+FDTemplateLayoutCell (= 1.4)"
- GMCache (1.0.1):
- TMCache (= 2.1.0)
......@@ -161,7 +160,7 @@ SPEC CHECKSUMS:
AFNetworking: 5e0e199f73d8626b11e79750991f5d173d1f8b67
BDOpenSDKKit: 3fb530ce73f85a7d6ee69e7fd3d9158444c5bd09
DouyinOpenSDK: 5ba83de22963ba7a3ba70c8ff11dfcb2885ecc2b
GMBase: 070cc24cc99b5a839174cc4cc8905f5fd6f54a69
GMBase: 2f05a06e886f8ea355e6f8be4276b667611140b4
GMCache: b78d8e46db864405e91d226ce640cc80d966c611
GMFoundation: 59cdf19ad5bdc479162da975cc739cf5cb418ab6
GMHud: 18d41f4900a204f27be14e9504fcee2060ae3b2c
......
......@@ -18,12 +18,13 @@ Pod::Spec.new do |s|
s.dependency 'GMHud'
s.dependency 'GMKit'
s.dependency 'SDWebImage'
s.dependency 'SnapKit','4.2.0'
# s.dependency 'SnapKit', '4.0.0'
s.dependency 'GMShareSDK'
# s.dependency 'PLMediaStreamingKit'
# s.dependency 'PLPlayerKit'
# s.dependency 'GMAlbum'
# SnapKit 4.2.0
s.dependency 'SnapKit', '4.2.0'
# s.dependency 'SnapKit', '4.2.0'
s.swift_version = '4.2'
s.static_framework = true
......
//
// GMBaseTool.h
// GMBase
//
// Created by 卢悦明 on 2020/5/13.
//
#import <Foundation/Foundation.h>
#import <GMbase/GMNavigationController.h>
NS_ASSUME_NONNULL_BEGIN
@interface GMBaseTool : NSObject
/// 获取当前控制器
+ (UIViewController *)getCurrentViewController;
/// 获取window
+ (UIWindow *)mainWindow;
/// 获取导航控制器
+ (GMNavigationController *)getNavigation;
+ (void)userIsAllowPush:(void (^)(BOOL))isOpenPushBlock;
@end
NS_ASSUME_NONNULL_END
//
// GMBaseTool.m
// GMBase
//
// Created by 卢悦明 on 2020/5/13.
//
#import "GMBaseTool.h"
#import <UserNotifications/UserNotifications.h>
@implementation GMBaseTool
+ (UIViewController *)getRootViewController{
UIWindow* window = [[[UIApplication sharedApplication] delegate] window];
return window.rootViewController;
}
+ (UIViewController *)getCurrentViewController{
UIViewController* currentViewController = [self getRootViewController];
BOOL runLoopFind = YES;
while (runLoopFind) {
if (currentViewController.presentedViewController) {
currentViewController = currentViewController.presentedViewController;
} else if ([currentViewController isKindOfClass:[UINavigationController class]]) {
UINavigationController* navigationController = (UINavigationController* )currentViewController;
currentViewController = [navigationController.childViewControllers lastObject];
} else if ([currentViewController isKindOfClass:[UITabBarController class]]) {
UITabBarController* tabBarController = (UITabBarController* )currentViewController;
currentViewController = tabBarController.selectedViewController;
} else {
NSUInteger childViewControllerCount = currentViewController.childViewControllers.count;
if (childViewControllerCount > 0) {
currentViewController = currentViewController.childViewControllers.lastObject;
return currentViewController;
} else {
return currentViewController;
}
}
}
return currentViewController;
}
//获取当前window
+ (UIWindow *)mainWindow
{
UIApplication *app = [UIApplication sharedApplication];
if ([app.delegate respondsToSelector:@selector(window)]) {
return [app.delegate window];
} else {
return [app keyWindow];
}
}
+ (GMNavigationController *)getNavigation {
UIViewController* rootVC = [self getRootViewController];
if ([rootVC isKindOfClass:[GMNavigationController class]]) {
return (GMNavigationController *)rootVC;
} else {
return nil;
}
}
#pragma mark - 判断用户是否允许推送
+ (void)userIsAllowPush:(void (^)(BOOL))isOpenPushBlock {
if (@available(iOS 10.0, *)) {
[[UNUserNotificationCenter currentNotificationCenter] getNotificationSettingsWithCompletionHandler:^(UNNotificationSettings * _Nonnull settings) {
dispatch_async(dispatch_get_main_queue(), ^{
if (settings.authorizationStatus == UNAuthorizationStatusNotDetermined){
//未选择---没有选择允许或者不允许,按不允许处理
isOpenPushBlock(NO);
} else if (settings.authorizationStatus == UNAuthorizationStatusDenied){
//未授权--不允许推送
isOpenPushBlock(NO);
} else if (settings.authorizationStatus == UNAuthorizationStatusAuthorized){
//已授权--允许推送
isOpenPushBlock(YES);
}
});
}];
} else {
dispatch_async(dispatch_get_main_queue(), ^{
UIUserNotificationSettings *settings = [[UIApplication sharedApplication] currentUserNotificationSettings];
BOOL isAllow = (settings.types != UIUserNotificationTypeNone);
isOpenPushBlock(isAllow);
});
}
}
@end
//
// GMFloatWindow.h
// Gengmei
//
// Created by licong on 2018/1/25.
// Copyright © 2018年 更美互动信息科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GMFloatWindow : UIView <UIGestureRecognizerDelegate>
//标记当前直播/回放页面是否是浮窗状态还是全屏状态, true -> 全屏, false -> 浮窗
@property (nonatomic, assign) BOOL isExpanded;
@property (nonatomic, assign) BOOL isShowingAnimation;
@property (nonatomic, strong) UITapGestureRecognizer *tapGesture;
- (void)showController:(UIViewController *)controller;
- (void)hide;
- (void)hideWithNoAnimation;
- (void)zoomToSmall;
- (void)videoZoomToSmall;
- (void)expandAction:(UITapGestureRecognizer *)tapGesture;
@end
//
// GMFloatWindow.m
// Gengmei
//
// Created by licong on 2018/1/25.
// Copyright © 2018年 更美互动信息科技有限公司. All rights reserved.
//
#import "GMFloatWindow.h"
//#import "GMLoginManager.h"
//#import "UITabBar+ViewConstant.h"
#import "GMFloatWindowProtocol.h"
#import "GMBaseTool.h"
@import GMKit;
@interface GMFloatWindow()<CAAnimationDelegate> {
UIViewController *_controller;
}
@property (nonatomic, strong) UIPanGestureRecognizer *panGesture;
@end
@implementation GMFloatWindow
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:[UIScreen mainScreen].bounds];
if (self) {
self.clipsToBounds = YES;
self.backgroundColor = [UIColor clearColor];
_tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(expandAction:)];
_tapGesture.delegate = self;
_panGesture =[[UIPanGestureRecognizer alloc]initWithTarget:self action:@selector(panAction:)];
_panGesture.minimumNumberOfTouches = 1;
_panGesture.maximumNumberOfTouches = 1;
_panGesture.delegate = self;
self.isExpanded = YES;
}
return self;
}
- (void)showController:(UIViewController *)controller {
if (self.superview == nil) {
[[UIApplication sharedApplication].keyWindow addSubview:self];
// [[AppDelegate shareInstance].window addSubview:self];
}
_controller = controller;
[self addSubview:controller.view];
self.isShowingAnimation = YES;
if (_isExpanded) {
//当前没有小浮窗
//transform 要设置在前面因为它会印象frame
self.transform = CGAffineTransformMakeScale(1, 1);
self.frame = CGRectMake(0, MAINSCREEN_HEIGHT, MAINSCREEN_WIDTH, MAINSCREEN_HEIGHT);
self.layer.cornerRadius = 0;
self.hidden = NO;
[UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^{
self.top = 0;
} completion:^(BOOL finished) {
self.isShowingAnimation = NO;
}];
}else {
//当前已经有小浮窗,需要关闭当前小浮窗,在打开新的浮窗,具体实现其实是换了window的rootCtroller
//先移除手势
[self addGestureRecognizer:self.tapGesture];
[self addGestureRecognizer:self.panGesture];
//去掉圆角
self.layer.cornerRadius = 0;
//window大小还原,将window刚好放在屏幕下面
self.transform = CGAffineTransformMakeScale(1, 1);
self.frame = CGRectMake(0, MAINSCREEN_HEIGHT, MAINSCREEN_WIDTH, MAINSCREEN_HEIGHT);
[UIView animateWithDuration:0.25 delay:0.1 options:UIViewAnimationOptionCurveEaseIn animations:^{
self.top = 0;
} completion:^(BOOL finished) {
self.isShowingAnimation = NO;
}];
}
}
- (void)hideWithNoAnimation{
self.hidden = YES;
//恢复成默认值
self.isExpanded = YES;
}
- (void)hide {
[UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveEaseIn animations:^{
self.top = MAINSCREEN_HEIGHT;
} completion:^(BOOL finished) {
[self hideWithNoAnimation];
_controller = nil;
}];
}
- (void)expandAction:(UITapGestureRecognizer *)tapGesture{
[[GMBaseTool getCurrentViewController].view endEditing:YES];
self.layer.cornerRadius = 0;
self.hidden = NO;
[UIView animateWithDuration:0.25f animations:^{
self.transform = CGAffineTransformMakeScale(1, 1);
self.frame = CGRectMake(0, 0, MAINSCREEN_WIDTH, MAINSCREEN_HEIGHT);
} completion:^(BOOL finished) {
[self removeGestureRecognizer:self.tapGesture];
[self removeGestureRecognizer:self.panGesture];
}];
[(id<GMFloatWindowProtocol>)_controller showOtherViews];
_isExpanded = YES;
}
-(void)panAction:(UIPanGestureRecognizer *)recognizer {
UIWindow *window = [UIApplication sharedApplication].keyWindow;
CGPoint translatedPoint = [recognizer translationInView:window];
switch (recognizer.state) {
case UIGestureRecognizerStateBegan:
{
break;
}
case UIGestureRecognizerStateChanged:
{
CGFloat x = recognizer.view.center.x + translatedPoint.x;
CGFloat y = recognizer.view.center.y + translatedPoint.y;
if (x < recognizer.view.width / 2.0) {
x = recognizer.view.width / 2.0;
} else if (x + recognizer.view.width / 2.0 > MAINSCREEN_WIDTH) {
x = MAINSCREEN_WIDTH - recognizer.view.width / 2.0;
}
if (y < recognizer.view.height / 2.0) {
y = recognizer.view.height / 2.0;
} else if (y + recognizer.view.height / 2.0> MAINSCREEN_HEIGHT) {
y = MAINSCREEN_HEIGHT - recognizer.view.height / 2.0;
}
recognizer.view.center = CGPointMake(x, y);
UIWindow *window = [UIApplication sharedApplication].keyWindow;
[recognizer setTranslation:CGPointMake(0, 0) inView:window];
break;
}
case UIGestureRecognizerStateCancelled:
case UIGestureRecognizerStateEnded:
default:
break;
}
}
- (void)zoomToSmall {
if (_controller == nil) {
return;
}
[(id<GMFloatWindowProtocol>)_controller hideOtherViews];
self.layer.cornerRadius = 18;
_isExpanded = NO;
[UIView animateWithDuration:0.25f animations:^{
self.transform = CGAffineTransformMakeScale(0.35, 0.35);
self.frame = CGRectMake(MAINSCREEN_WIDTH * 0.65, 85, MAINSCREEN_WIDTH * 0.35, MAINSCREEN_HEIGHT * 0.35);
} completion:^(BOOL finished) {
[self addGestureRecognizer:self.tapGesture];
[self addGestureRecognizer:self.panGesture];
}];
}
// 视频缩小,宽是屏幕1/4,宽高比3:5
- (void)videoZoomToSmall {
if (_controller == nil) {
return;
}
[(id<GMFloatWindowProtocol>)_controller hideOtherViews];
self.layer.cornerRadius = 28;
_isExpanded = NO;
[UIView animateWithDuration:0.25f animations:^{
self.transform = CGAffineTransformMakeScale(0.35, 0.35);
self.frame = CGRectMake(MAINSCREEN_WIDTH * 0.75, MAINSCREEN_HEIGHT * 0.16, MAINSCREEN_WIDTH * 0.25, MAINSCREEN_WIDTH * 0.417);
} completion:^(BOOL finished) {
[self addGestureRecognizer:self.tapGesture];
[self addGestureRecognizer:self.panGesture];
}];
}
#pragma mark- Gesture Delagate
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer{
return YES;
}
@end
//
// GMFloatWindowProtocol.h
// Gengmei
//
// Created by wangyang on 2018/5/2.
// Copyright © 2018年 更美互动信息科技有限公司. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol GMFloatWindowProtocol <NSObject>
/**
GMFloatWindow 由全屏模式到小窗口模式,会调用此方法
*/
- (void)hideOtherViews;
/**
GMFloatWindow 由小窗口模式到全屏模式,会调用此方法
*/
- (void)showOtherViews;
@end
//
// WMLocationManager.h
// Gengmei
//
// Created by wangyang on 5/6/15.
// Copyright (c) 2015 Wanmeichuangyi. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#define kLastLocation @"lastLocation"
typedef void(^LocationFinishBlock)(CLLocation *location);
/**
保证新用户在有网络的情况下弹出 授权框 不然调不起地理位置弹框
*/
//typedef void(^RequestLocationAuthorization)();
@interface GMLocationManager : NSObject <CLLocationManagerDelegate>
@property (nonatomic, readonly) CLLocation *location;
@property (nonatomic, assign, readonly) NSInteger statusWhenAppBackground;
+ (instancetype)shareInstance;
/**
* @author wangyang, 16-03-11 17:03:21
*
* @brief 定位成功的回调
* @since 5.9.2
*/
- (void)addBlock:(LocationFinishBlock)block;
/**
* @author wangyang, 16-03-11 17:03:31
*
* @brief 在dealloc时需要手动移除先前添加的block
* @since 5.9.2
*/
- (void)removeLast;
/**
* @author wangyang, 16-02-24 15:02:11
*
* @brief 尝试使用定位功能。如果没有权限会有提示,如果有权限直接重新定位
* @since 5.9.1
*/
- (void)tryLocationService;
//@property (nonatomic, copy) RequestLocationAuthorization *authorizationBlock;
/**
保证有网络的l时候调用 不然那会失败
*/
-(void)notDeterminedShowLocationAuthorize;
/**
尝试使用定位功能。如果没有权限会有提示,并只提示一次
@param key 如果key不为nil,那么该key下的无权限提示只会展示一次,直到app删除。
如果key为nil,相当于调用tryLocationService
*/
- (void)tryLocationServiceForKey:(NSString *)key;
/**
* @author wangyang, 16-03-10 14:03:57
*
* @brief 静默的尝试重新定位,而不会有任何提示
* @since 5.9.2
*/
- (void)updateLocation;
/**
* @author wangyang, 16-03-10 12:03:57
*
* @brief 会判断是否允许定位服务
* @return YES表示允许
* @since 5.9.2
*/
+ (BOOL)hasOpenLocationService;
/**
* @author wangyang, 16-03-10 18:03:03
*
* @brief 跳转到定位服务的系统设置页
* @since 5.9.2
*/
+ (void)jumpToSettings;
/**
* @author wangyang, 16-03-10 12:03:21
*
* @brief 会判断是否允许定位服务,如果不允许会弹出alert
* @since 5.9.2
*/
+ (void)showAlertIfNotAllowed;
@end
This diff is collapsed.
//
// JZLocationConverter.h
// Gengmei
//
// Created by wangyang on 2017/8/15.
// Copyright © 2017年 更美互动信息科技有限公司. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
@interface JZLocationConverter : NSObject
/**
* @brief 世界标准地理坐标(WGS-84) 转换成 中国国测局地理坐标(GCJ-02)<火星坐标>
*
* ####只在中国大陆的范围的坐标有效,以外直接返回世界标准坐标
*
* @param location 世界标准地理坐标(WGS-84)
*
* @return 中国国测局地理坐标(GCJ-02)<火星坐标>
*/
+ (CLLocationCoordinate2D)wgs84ToGcj02:(CLLocationCoordinate2D)location;
/**
* @brief 中国国测局地理坐标(GCJ-02) 转换成 世界标准地理坐标(WGS-84)
*
* ####此接口有1-2米左右的误差,需要精确定位情景慎用
*
* @param location 中国国测局地理坐标(GCJ-02)
*
* @return 世界标准地理坐标(WGS-84)
*/
+ (CLLocationCoordinate2D)gcj02ToWgs84:(CLLocationCoordinate2D)location;
/**
* @brief 世界标准地理坐标(WGS-84) 转换成 百度地理坐标(BD-09)
*
* @param location 世界标准地理坐标(WGS-84)
*
* @return 百度地理坐标(BD-09)
*/
+ (CLLocationCoordinate2D)wgs84ToBd09:(CLLocationCoordinate2D)location;
/**
* @brief 中国国测局地理坐标(GCJ-02)<火星坐标> 转换成 百度地理坐标(BD-09)
*
* @param location 中国国测局地理坐标(GCJ-02)<火星坐标>
*
* @return 百度地理坐标(BD-09)
*/
+ (CLLocationCoordinate2D)gcj02ToBd09:(CLLocationCoordinate2D)location;
/**
* @brief 百度地理坐标(BD-09) 转换成 中国国测局地理坐标(GCJ-02)<火星坐标>
*
* @param location 百度地理坐标(BD-09)
*
* @return 中国国测局地理坐标(GCJ-02)<火星坐标>
*/
+ (CLLocationCoordinate2D)bd09ToGcj02:(CLLocationCoordinate2D)location;
/**
* @brief 百度地理坐标(BD-09) 转换成 世界标准地理坐标(WGS-84)
*
* ####此接口有1-2米左右的误差,需要精确定位情景慎用
*
* @param location 百度地理坐标(BD-09)
*
* @return 世界标准地理坐标(WGS-84)
*/
+ (CLLocationCoordinate2D)bd09ToWgs84:(CLLocationCoordinate2D)location;
@end
//
// JZLocationConverter.m
// Gengmei
//
// Created by wangyang on 2017/8/15.
// Copyright © 2017年 更美互动信息科技有限公司. All rights reserved.
//
#import "JZLocationConverter.h"
@implementation JZLocationConverter
#define LAT_OFFSET_0(x,y) -100.0 + 2.0 * x + 3.0 * y + 0.2 * y * y + 0.1 * x * y + 0.2 * sqrt(fabs(x))
#define LAT_OFFSET_1 (20.0 * sin(6.0 * x * M_PI) + 20.0 * sin(2.0 * x * M_PI)) * 2.0 / 3.0
#define LAT_OFFSET_2 (20.0 * sin(y * M_PI) + 40.0 * sin(y / 3.0 * M_PI)) * 2.0 / 3.0
#define LAT_OFFSET_3 (160.0 * sin(y / 12.0 * M_PI) + 320 * sin(y * M_PI / 30.0)) * 2.0 / 3.0
#define LON_OFFSET_0(x,y) 300.0 + x + 2.0 * y + 0.1 * x * x + 0.1 * x * y + 0.1 * sqrt(fabs(x))
#define LON_OFFSET_1 (20.0 * sin(6.0 * x * M_PI) + 20.0 * sin(2.0 * x * M_PI)) * 2.0 / 3.0
#define LON_OFFSET_2 (20.0 * sin(x * M_PI) + 40.0 * sin(x / 3.0 * M_PI)) * 2.0 / 3.0
#define LON_OFFSET_3 (150.0 * sin(x / 12.0 * M_PI) + 300.0 * sin(x / 30.0 * M_PI)) * 2.0 / 3.0
#define X_PI ((M_PI * 3000.0) / 180.0)
#define RANGE_LON_MAX 137.8347
#define RANGE_LON_MIN 72.004
#define RANGE_LAT_MAX 55.8271
#define RANGE_LAT_MIN 0.8293
// jzA = 6378245.0, 1/f = 298.3
// b = a * (1 - f)
// ee = (a^2 - b^2) / a^2;
#define jzA 6378245.0
#define jzEE 0.00669342162296594323
+ (double)transformLat:(double)x bdLon:(double)y
{
double ret = LAT_OFFSET_0(x, y);
ret += LAT_OFFSET_1;
ret += LAT_OFFSET_2;
ret += LAT_OFFSET_3;
return ret;
}
+ (double)transformLon:(double)x bdLon:(double)y
{
double ret = LON_OFFSET_0(x, y);
ret += LON_OFFSET_1;
ret += LON_OFFSET_2;
ret += LON_OFFSET_3;
return ret;
}
+ (BOOL)outOfChina:(double)lat bdLon:(double)lon
{
if (lon < RANGE_LON_MIN || lon > RANGE_LON_MAX)
return true;
if (lat < RANGE_LAT_MIN || lat > RANGE_LAT_MAX)
return true;
return false;
}
+ (CLLocationCoordinate2D)gcj02Encrypt:(double)ggLat bdLon:(double)ggLon
{
CLLocationCoordinate2D resPoint;
double mgLat;
double mgLon;
if ([self outOfChina:ggLat bdLon:ggLon]) {
resPoint.latitude = ggLat;
resPoint.longitude = ggLon;
return resPoint;
}
double dLat = [self transformLat:(ggLon - 105.0)bdLon:(ggLat - 35.0)];
double dLon = [self transformLon:(ggLon - 105.0) bdLon:(ggLat - 35.0)];
double radLat = ggLat / 180.0 * M_PI;
double magic = sin(radLat);
magic = 1 - jzEE * magic * magic;
double sqrtMagic = sqrt(magic);
dLat = (dLat * 180.0) / ((jzA * (1 - jzEE)) / (magic * sqrtMagic) * M_PI);
dLon = (dLon * 180.0) / (jzA / sqrtMagic * cos(radLat) * M_PI);
mgLat = ggLat + dLat;
mgLon = ggLon + dLon;
resPoint.latitude = mgLat;
resPoint.longitude = mgLon;
return resPoint;
}
+ (CLLocationCoordinate2D)gcj02Decrypt:(double)gjLat gjLon:(double)gjLon {
CLLocationCoordinate2D gPt = [self gcj02Encrypt:gjLat bdLon:gjLon];
double dLon = gPt.longitude - gjLon;
double dLat = gPt.latitude - gjLat;
CLLocationCoordinate2D pt;
pt.latitude = gjLat - dLat;
pt.longitude = gjLon - dLon;
return pt;
}
+ (CLLocationCoordinate2D)bd09Decrypt:(double)bdLat bdLon:(double)bdLon
{
CLLocationCoordinate2D gcjPt;
double x = bdLon - 0.0065, y = bdLat - 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);
gcjPt.longitude = z * cos(theta);
gcjPt.latitude = z * sin(theta);
return gcjPt;
}
+(CLLocationCoordinate2D)bd09Encrypt:(double)ggLat bdLon:(double)ggLon
{
CLLocationCoordinate2D bdPt;
double x = ggLon, y = ggLat;
double z = sqrt(x * x + y * y) + 0.00002 * sin(y * X_PI);
double theta = atan2(y, x) + 0.000003 * cos(x * X_PI);
bdPt.longitude = z * cos(theta) + 0.0065;
bdPt.latitude = z * sin(theta) + 0.006;
return bdPt;
}
+ (CLLocationCoordinate2D)wgs84ToGcj02:(CLLocationCoordinate2D)location
{
return [self gcj02Encrypt:location.latitude bdLon:location.longitude];
}
+ (CLLocationCoordinate2D)gcj02ToWgs84:(CLLocationCoordinate2D)location
{
return [self gcj02Decrypt:location.latitude gjLon:location.longitude];
}
+ (CLLocationCoordinate2D)wgs84ToBd09:(CLLocationCoordinate2D)location
{
CLLocationCoordinate2D gcj02Pt = [self gcj02Encrypt:location.latitude
bdLon:location.longitude];
return [self bd09Encrypt:gcj02Pt.latitude bdLon:gcj02Pt.longitude] ;
}
+ (CLLocationCoordinate2D)gcj02ToBd09:(CLLocationCoordinate2D)location
{
return [self bd09Encrypt:location.latitude bdLon:location.longitude];
}
+ (CLLocationCoordinate2D)bd09ToGcj02:(CLLocationCoordinate2D)location
{
return [self bd09Decrypt:location.latitude bdLon:location.longitude];
}
+ (CLLocationCoordinate2D)bd09ToWgs84:(CLLocationCoordinate2D)location
{
CLLocationCoordinate2D gcj02 = [self bd09ToGcj02:location];
return [self gcj02Decrypt:gcj02.latitude gjLon:gcj02.longitude];
}
@end
//
// WMAlertParameterObject.h
// Gengmei
//
// Created by Sean Lee on 9/8/15.
// Copyright (c) 2015 Wanmeichuangyi. All rights reserved.
//
#import <GMBase/GMObject.h>
/**
* @author licong, 15-11-27 15:11:44
*
* H5执行OC方法时候,传过来的参数
*
*/
@interface WMAlertParameterObject : GMObject
@property (nonatomic, strong) NSString * title;
@property (nonatomic, strong) NSString * content;
@property (nonatomic, strong) NSString * confirmText;
@property (nonatomic, strong) NSString * cancelText;
@property (nonatomic, strong) NSString * confirmCallback;
@property (nonatomic, strong) NSString * cancelCallback;
@end
@interface WMToastParameterObject : GMObject
@property (nonatomic, strong) NSString * text;
@property (nonatomic, assign) NSInteger duration;
@end
\ No newline at end of file
//
// WMAlertParameterObject.m
// Gengmei
//
// Created by Sean Lee on 9/8/15.
// Copyright (c) 2015 Wanmeichuangyi. All rights reserved.
//
#import "WMAlertParameterObject.h"
@implementation WMAlertParameterObject
@end
@implementation WMToastParameterObject
@end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment