Commit 13ccff88 authored by 陈业泓's avatar 陈业泓

更新了SDK代码

parent 0e47d8a0
......@@ -4,8 +4,6 @@ platform :ios, '9.0'
target 'SYCSDK_Example' do
use_frameworks!
pod 'SYCSDK', :path => '../'
target 'SYCSDK_Tests' do
......@@ -14,10 +12,4 @@ use_frameworks!
end
pre_install do |installer|
# workaround for https://github.com/CocoaPods/CocoaPods/issues/3289
Pod::Installer::Xcode::TargetValidator.send(:define_method, :verify_no_static_framework_transitive_dependencies) {}
end
end
PODS:
- BaiduMapKit (6.1.0):
- BaiduMapKit/Base (= 6.1.0)
- BaiduMapKit/Cloud (= 6.1.0)
- BaiduMapKit/Map (= 6.1.0)
- BaiduMapKit/Search (= 6.1.0)
- BaiduMapKit/Utils (= 6.1.0)
- BaiduMapKit/Base (6.1.0)
- BaiduMapKit/Cloud (6.1.0):
- BaiduMapKit/Base
- BaiduMapKit/Map (6.1.0):
- BaiduMapKit/Base
- BaiduMapKit/Search (6.1.0):
- BaiduMapKit/Base
- BaiduMapKit/Utils (6.1.0):
- BaiduMapKit/Base
- BMKLocationKit (2.0.0)
- BRPickerView (2.7.3):
- BRPickerView/AddressPickerView (= 2.7.3)
- BRPickerView/Base (= 2.7.3)
......@@ -27,11 +11,7 @@ PODS:
- BRPickerView/Base
- BRPickerView/StringPickerView (2.7.3):
- BRPickerView/Base
- Bugly (2.5.90)
- DACircularProgress (2.3.1)
- EZOpenSDK (4.8.3)
- EZUIKit (2.0):
- EZOpenSDK (= 4.8.3)
- IQKeyboardManager (6.5.6)
- JKCategories (1.9.1):
- JKCategories/CoreData (= 1.9.1)
......@@ -182,71 +162,53 @@ PODS:
- SDWebImage/Core (5.9.1)
- SGQRCode (3.0.1)
- STCBinder (1.0.0)
- SYCSDK (0.1.7):
- SYCSDK/BaiduMap (= 0.1.7)
- SYCSDK/BRPickerView (= 0.1.7)
- SYCSDK/Bugly (= 0.1.7)
- SYCSDK/DACircularProgress (= 0.1.7)
- SYCSDK/EZUIKit (= 0.1.7)
- SYCSDK/IQKeyboardManager (= 0.1.7)
- SYCSDK/JKCategories (= 0.1.7)
- SYCSDK/JXCategoryView (= 0.1.7)
- SYCSDK/JXPagingViewPager (= 0.1.7)
- SYCSDK/MBProgressHUD (= 0.1.7)
- SYCSDK/MJExtension (= 0.1.7)
- SYCSDK/MJRefresh (= 0.1.7)
- SYCSDK/SDWebImage (= 0.1.7)
- SYCSDK/SGQRCode (= 0.1.7)
- SYCSDK/STCBinder (= 0.1.7)
- SYCSDK/TTGTagCollectionView (= 0.1.7)
- SYCSDK/UMCCommon (= 0.1.7)
- SYCSDK/ViewUtil (= 0.1.7)
- SYCSDK/YYText (= 0.1.7)
- SYCSDK/BaiduMap (0.1.7):
- BaiduMapKit (= 6.1.0)
- BMKLocationKit (= 2.0.0)
- SYCSDK/BRPickerView (0.1.7):
- SYCSDK (0.1.8):
- SYCSDK/BRPickerView (= 0.1.8)
- SYCSDK/DACircularProgress (= 0.1.8)
- SYCSDK/IQKeyboardManager (= 0.1.8)
- SYCSDK/JKCategories (= 0.1.8)
- SYCSDK/JXCategoryView (= 0.1.8)
- SYCSDK/JXPagingViewPager (= 0.1.8)
- SYCSDK/MBProgressHUD (= 0.1.8)
- SYCSDK/MJExtension (= 0.1.8)
- SYCSDK/MJRefresh (= 0.1.8)
- SYCSDK/SDWebImage (= 0.1.8)
- SYCSDK/SGQRCode (= 0.1.8)
- SYCSDK/STCBinder (= 0.1.8)
- SYCSDK/TTGTagCollectionView (= 0.1.8)
- SYCSDK/ViewUtil (= 0.1.8)
- SYCSDK/YYText (= 0.1.8)
- SYCSDK/BRPickerView (0.1.8):
- BRPickerView (= 2.7.3)
- SYCSDK/Bugly (0.1.7):
- Bugly (= 2.5.90)
- SYCSDK/DACircularProgress (0.1.7):
- SYCSDK/DACircularProgress (0.1.8):
- DACircularProgress (= 2.3.1)
- SYCSDK/EZUIKit (0.1.7):
- EZUIKit (= 2.0)
- SYCSDK/IQKeyboardManager (0.1.7):
- SYCSDK/IQKeyboardManager (0.1.8):
- IQKeyboardManager (= 6.5.6)
- SYCSDK/JKCategories (0.1.7):
- SYCSDK/JKCategories (0.1.8):
- JKCategories (= 1.9.1)
- SYCSDK/JXCategoryView (0.1.7):
- SYCSDK/JXCategoryView (0.1.8):
- JXCategoryView (= 1.5.8)
- SYCSDK/JXPagingViewPager (0.1.7):
- SYCSDK/JXPagingViewPager (0.1.8):
- JXPagingView/Pager (= 2.1.0)
- SYCSDK/MBProgressHUD (0.1.7):
- SYCSDK/MBProgressHUD (0.1.8):
- MBProgressHUD (= 1.2.0)
- SYCSDK/MJExtension (0.1.7):
- SYCSDK/MJExtension (0.1.8):
- MJExtension (= 3.2.2)
- SYCSDK/MJRefresh (0.1.7):
- SYCSDK/MJRefresh (0.1.8):
- MJRefresh (= 3.5.0)
- SYCSDK/SDWebImage (0.1.7):
- SYCSDK/SDWebImage (0.1.8):
- SDWebImage (= 5.9.1)
- SYCSDK/SGQRCode (0.1.7):
- SYCSDK/SGQRCode (0.1.8):
- SGQRCode (= 3.0.1)
- SYCSDK/STCBinder (0.1.7):
- SYCSDK/STCBinder (0.1.8):
- STCBinder (= 1.0.0)
- SYCSDK/TTGTagCollectionView (0.1.7):
- SYCSDK/TTGTagCollectionView (0.1.8):
- TTGTagCollectionView (~> 1.11.1)
- SYCSDK/UMCCommon (0.1.7):
- UMCCommon (~> 7.2.9)
- SYCSDK/ViewUtil (0.1.7):
- SYCSDK/ViewUtil (0.1.8):
- Masonry
- SYCSDK/YYText (0.1.7):
- SYCSDK/YYText (0.1.8):
- YYText (= 1.0.7)
- TTGTagCollectionView (1.11.2)
- UMAPM (1.5.6)
- UMCCommon (7.2.9):
- UMAPM
- UMDevice
- UMDevice (2.2.1)
- YYText (1.0.7)
DEPENDENCIES:
......@@ -254,13 +216,8 @@ DEPENDENCIES:
SPEC REPOS:
trunk:
- BaiduMapKit
- BMKLocationKit
- BRPickerView
- Bugly
- DACircularProgress
- EZOpenSDK
- EZUIKit
- IQKeyboardManager
- JKCategories
- JXCategoryView
......@@ -273,9 +230,6 @@ SPEC REPOS:
- SGQRCode
- STCBinder
- TTGTagCollectionView
- UMAPM
- UMCCommon
- UMDevice
- YYText
EXTERNAL SOURCES:
......@@ -283,13 +237,8 @@ EXTERNAL SOURCES:
:path: "../"
SPEC CHECKSUMS:
BaiduMapKit: 223daf970a1a3e8d87014e5c7310b18b8bdf4114
BMKLocationKit: 097814ef672b1e57e86e6c1968d7892fb78002bf
BRPickerView: 9cc11880ac79c4872d081ccb88f306224c1501d7
Bugly: 88bc32c0acc6fef7b74d610f0319ee7560d6b9fe
DACircularProgress: 4dd437c0fc3da5161cb289e07ac449493d41db71
EZOpenSDK: 355c8ae8e9660a52bbd877898cf46e1f67dc7d8f
EZUIKit: 45134cb675f154a62a5b2a7e0d78014672bfc328
IQKeyboardManager: 2a6e97afdafc7becf0cb17a9a8d795e3a980717f
JKCategories: 5bd36ff325c80652cc2e47b689bfc0e81c563d76
JXCategoryView: 778a620f76070d6598fd8d7239991b8da8326170
......@@ -301,13 +250,10 @@ SPEC CHECKSUMS:
SDWebImage: a990c053fff71e388a10f3357edb0be17929c9c5
SGQRCode: bf02d60e18d6660a9d75ff1c8b9b467f064f054e
STCBinder: 439487688e719d92d7690c0b12c0c1dab8ddcb07
SYCSDK: e856fe75c1a9a6553879701fb99ac580a200785b
SYCSDK: 05b0cb6e5c30637a979660528e8ecaa848af8a95
TTGTagCollectionView: 949030356ed27954f39dd29d78978c0f5c35a745
UMAPM: 5ab988b8bedfd090ee2307cb80530ba79b8ac264
UMCCommon: fcb46c918758f47dbb568421642e195db0d7b641
UMDevice: 053478c4b4d7292f31f0a275c227d3c4007a5571
YYText: 5c461d709e24d55a182d1441c41dc639a18a4849
PODFILE CHECKSUM: 464d43ac632d1f761cc0743dd055f05f2a443811
PODFILE CHECKSUM: 32da94b045a2579a8e3c39aebfad5abc91c9f0f4
COCOAPODS: 1.11.2
MIT License
Copyright (c) 2017 jiangfangsheng
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
# BMKLocationKit
Baidu IOS LOC Framework
//
// BMKGeoFenceManager.h
// BMKLocationKit
//
// Created by baidu on 2017/3/2.
// Copyright © 2017年 baidu. All rights reserved.
//
#import "BMKGeoFenceRegion.h"
@protocol BMKGeoFenceManagerDelegate;
///地理围栏监听状态类型
typedef NS_OPTIONS(NSUInteger, BMKGeoFenceActiveAction)
{
BMKGeoFenceActiveActionNone = 0, ///< 不进行监听
BMKGeoFenceActiveActionInside = 1 << 0, ///< 在范围内
BMKGeoFenceActiveActionOutside = 1 << 1, ///< 在范围外
BMKGeoFenceActiveActionStayed = 1 << 2, ///< 停留(在范围内超过10分钟)
};
///BMKGeoFence errorDomain
FOUNDATION_EXPORT NSErrorDomain const _Nonnull BMKGeoFenceErrorDomain;
///地理围栏错误码
typedef NS_ENUM(NSInteger, BMKGeoFenceErrorCode) {
BMKGeoFenceErrorUnknown = 1, ///< 未知错误
BMKGeoFenceErrorInvalidParameter = 2, ///< 参数错误
BMKGeoFenceErrorFailureConnection = 3, ///< 网络连接异常
BMKGeoFenceErrorFailureAuth = 4, ///< 鉴权失败
BMKGeoFenceErrorNoValidFence = 5, ///< 无可用围栏
BMKGeoFenceErroFailureLocating = 6, ///< 定位错误
};
///地理围栏管理类
@interface BMKGeoFenceManager : NSObject
///实现了 BMKGeoFenceManagerDelegate 协议的类指针。
@property (nonatomic, weak, nullable) id<BMKGeoFenceManagerDelegate> delegate;
///需要进行通知的行为,默认为BMKGeoFenceActiveActionInside。
@property (nonatomic, assign) BMKGeoFenceActiveAction activeAction;
///指定定位是否会被系统自动暂停。默认为NO。
@property (nonatomic, assign) BOOL pausesLocationUpdatesAutomatically;
///是否允许后台定位。默认为NO。只在iOS 9.0及之后起作用。设置为YES的时候必须保证 Background Modes 中的 Location updates 处于选中状态,否则会抛出异常。
@property (nonatomic, assign) BOOL allowsBackgroundLocationUpdates;
/**
* @brief 添加一个圆形围栏
* @param center 围栏的中心点经纬度坐标
* @param radius 围栏的半径,单位:米,要求大于0
* @param type 围栏的坐标系类型
* @param customID 用户自定义ID,可选,SDK原值返回
*/
- (void)addCircleRegionForMonitoringWithCenter:(CLLocationCoordinate2D)center radius:(CLLocationDistance)radius coorType:(BMKLocationCoordinateType)type customID:(NSString * _Nullable)customID;
/**
* @brief 根据经纬度坐标数据添加一个闭合的多边形围栏,点与点之间按顺序尾部相连, 第一个点与最后一个点相连
* @param coordinates 经纬度坐标点数据,coordinates对应的内存会拷贝,调用者负责该内存的释放
* @param count 经纬度坐标点的个数,不可小于3个
* @param type 围栏的坐标系类型
* @param customID 用户自定义ID,可选,SDK原值返回
*/
- (void)addPolygonRegionForMonitoringWithCoordinates:(CLLocationCoordinate2D * _Nonnull)coordinates count:(NSInteger)count coorType:(BMKLocationCoordinateType)type customID:(NSString * _Nullable)customID;
/**
* @brief 根据customID获得指定的围栏,如果customID传nil,则返回全部围栏
* @param customID 用户执行添加围栏函数时传入的customID
* @return 获得的围栏构成的数组,如果没有结果,返回nil
*/
- (NSArray * _Nullable)geoFenceRegionsWithCustomID:(NSString * _Nullable)customID;
/**
* @brief 移除指定围栏
* @param region 要停止监控的围栏
*/
- (void)removeTheGeoFenceRegion:(BMKGeoFenceRegion * _Nonnull)region;
/**
* @brief 移除指定customID的围栏
* @param customID 用户执行添加围栏函数时传入的customID
*/
- (void)removeGeoFenceRegionsWithCustomID:(NSString * _Nullable)customID;
/**
* @brief 移除所有围栏
*/
- (void)removeAllGeoFenceRegions;
@end
///地理围栏代理协议,该协议定义了获取地理围栏相关回调方法,包括添加、状态改变等。
@protocol BMKGeoFenceManagerDelegate <NSObject>
@optional
/**
* @brief 为了适配app store关于新的后台定位的审核机制(app store要求如果开发者只配置了使用期间定位,则代码中不能出现申请后台定位的逻辑),当开发者在plist配置NSLocationAlwaysUsageDescription或者NSLocationAlwaysAndWhenInUseUsageDescription时,需要在该delegate中调用后台定位api:[locationManager requestAlwaysAuthorization]。开发者如果只配置了NSLocationWhenInUseUsageDescription,且只有使用期间的定位需求,则无需在delegate中实现逻辑。
* @param manager 定位 BMKGeoFenceManager 类。
* @param locationManager 系统 CLLocationManager 类 。
* @since 1.7.0
*/
- (void)BMKGeoFenceManager:(BMKGeoFenceManager * _Nonnull)manager doRequestAlwaysAuthorization:(CLLocationManager * _Nonnull)locationManager;
/**
* @brief 添加地理围栏完成后的回调,成功与失败都会调用
* @param manager 地理围栏管理类
* @param regions 成功添加的一个或多个地理围栏构成的数组
* @param customID 用户执行添加围栏函数时传入的customID
* @param error 添加失败的错误信息
*/
- (void)BMKGeoFenceManager:(BMKGeoFenceManager * _Nonnull)manager didAddRegionForMonitoringFinished:(NSArray <BMKGeoFenceRegion *> * _Nullable)regions customID:(NSString * _Nullable)customID error:(NSError * _Nullable)error;
/**
* @brief 地理围栏状态改变时回调,当围栏状态的值发生改变,定位失败都会调用
* @param manager 地理围栏管理类
* @param region 状态改变的地理围栏
* @param customID 用户执行添加围栏函数时传入的customID
* @param error 错误信息,如定位相关的错误
*/
- (void)BMKGeoFenceManager:(BMKGeoFenceManager * _Nonnull)manager didGeoFencesStatusChangedForRegion:(BMKGeoFenceRegion * _Nullable)region customID:(NSString * _Nullable)customID error:(NSError * _Nullable)error;
@end
//
// BMKGeoFenceRegion.h
// BMKLocationKit
//
// Created by baidu on 2017/3/2.
// Copyright © 2017年 baidu. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import "BMKLocationManager.h"
///BMKGeoFence Region State
typedef NS_ENUM(NSInteger, BMKGeoFenceRegionStatus)
{
BMKGeoFenceRegionStatusUnknown = 0, ///< 未知
BMKGeoFenceRegionStatusInside = 1, ///< 在范围内
BMKGeoFenceRegionStatusOutside = 1 << 1, ///< 在范围外
BMKGeoFenceRegionStatusStayed = 1 << 2, ///< 停留(在范围内超过10分钟)
};
#pragma mark - BMKGeoFenceRegion
///地理围栏基类,不可直接使用
@interface BMKGeoFenceRegion : NSObject<NSCopying>
///BMKGeoFenceRegion的唯一标识符
@property (nonatomic, copy, readonly) NSString *identifier;
///用户自定义ID,可为nil。
@property (nonatomic, copy, readonly) NSString *customID;
///坐标点和围栏的关系,比如用户的位置和围栏的关系
@property (nonatomic, assign) BMKGeoFenceRegionStatus fenceStatus;
///设定围栏坐标系类型。默认为 BMKLocationCoordinateTypeGCJ02。
@property(nonatomic, readonly) BMKLocationCoordinateType coordinateType;
///上次发生状态变化的时间
@property(nonatomic, assign)NSTimeInterval lastEventTime;
/**
* @brief 判断位置与围栏状态
* @param CLLocationCoordinate2D 坐标值
* @return 返回BMKGeoFenceRegionStatus状态
*/
-(BMKGeoFenceRegionStatus)judgeStatusWithCoor:(CLLocationCoordinate2D)coor;
@end
#pragma mark - BMKLocationCircleRegion
///圆形地理围栏
@interface BMKGeoFenceCircleRegion : BMKGeoFenceRegion
///中心点的经纬度坐标
@property (nonatomic, readonly) CLLocationCoordinate2D center;
///半径,单位:米
@property (nonatomic, readonly) CLLocationDistance radius;
/**
* @brief 构造圆形围栏
* @param customid 用户自定义ID
* @param identityid 识别id
* @param center 中心坐标
* @param radius 围栏半径
* @param type 坐标系类型
* @return BMKGeoFenceCircleRegion id
*/
- (id)initWithCustomID:(NSString *)customid identityID:(NSString *)identityid center:(CLLocationCoordinate2D)center radius:(CLLocationDistance)radius coor:(BMKLocationCoordinateType)type;
@end
#pragma mark -BMKGeoFencePolygonRegion
///多边形地理围栏
@interface BMKGeoFencePolygonRegion : BMKGeoFenceRegion
///经纬度坐标点数据
@property (nonatomic, readonly) CLLocationCoordinate2D *coordinates;
///经纬度坐标点的个数
@property (nonatomic, readonly) NSInteger count;
/**
* @brief 构造多边形围栏
* @param customid 用户自定义ID
* @param identityid 识别id
* @param coor 多边形顶点
* @param count 顶点个数
* @param type 坐标系类型
* @return BMKGeoFencePolygonRegion id
*/
- (id)initWithCustomID:(NSString *)customid identityID:(NSString *)identityid coor:(CLLocationCoordinate2D *)coor count:(NSInteger)count coor:(BMKLocationCoordinateType)type;
@end
//
// BMKLocation.h
// LocationComponent
//
// Created by baidu on 2017/8/16.
// Copyright © 2017年 baidu. All rights reserved.
//
#ifndef BMKLocation_h
#define BMKLocation_h
#import <CoreLocation/CoreLocation.h>
#import "BMKLocationReGeocode.h"
/**
* BMKLocationProvider 位置数据来源,分iOS系统定位和其他定位服务结果两种,目前仅支持iOS系统定位服务
*
*/
typedef NS_ENUM(int, BMKLocationProvider) {
BMKLocationProviderIOS = 0, //!<位置来源于iOS本身定位
BMKLocationProviderOther //!<位置来源于其他定位服务
};
///描述百度iOS 定位数据
@interface BMKLocation : NSObject
///BMKLocation 位置数据
@property(nonatomic, copy, readonly) CLLocation * _Nullable location;
///BMKLocation 地址数据
@property(nonatomic, copy) BMKLocationReGeocode * _Nullable rgcData;
///BMKLocation 位置来源
@property(nonatomic, assign) BMKLocationProvider provider;
///BMKLocation 位置ID
@property(nonatomic, retain) NSString * _Nullable locationID;
/*
* floorString
*
* Discussion:
* 室内定位成功时返回的楼层信息,ex:f1
*/
@property(readonly, nonatomic, copy, nullable) NSString *floorString;
/*
* buildingID
*
* Discussion:
* 室内定位成功时返回的百度建筑物ID
*/
@property(readonly, nonatomic, copy, nullable) NSString *buildingID;
/*
* buildingName
*
* Discussion:
* 室内定位成功时返回的百度建筑物名称
*/
@property(readonly, nonatomic, copy, nullable) NSString *buildingName;
/*
* extraInfo
*
* Discussion:
* 定位附加信息,如停车位code识别结果、停车位code示例、vdr推算结果置信度等
*/
@property(readonly, nonatomic, copy, nullable) NSDictionary * extraInfo;
/**
* @brief 初始化BMKLocation实例
* @param loc CLLocation对象
* @param rgc BMKLocationReGeocode对象
* @return BMKLocation id
*/
- (id _Nonnull)initWithLocation:(CLLocation * _Nullable)loc withRgcData:(BMKLocationReGeocode * _Nullable)rgc;
/**
* @brief 构造BMKLocation
* @param location CLLocation
* @param floorString 楼层字符串
* @param buildingID 建筑物ID
* @param buildingName 建筑物名称
* @param info 位置附加信息
* @return BMKLocation id
*/
-(id _Nonnull)initWithLocation:(CLLocation * _Nullable)location floorString:(NSString * _Nullable)floorString buildingID:(NSString * _Nullable)buildingID
buildingName:(NSString * _Nullable)buildingName extraInfo:(NSDictionary * _Nullable)info withRgcData:(BMKLocationReGeocode * _Nullable)rgc;
@end
#endif /* BMKLocation_h */
//
// BMKLocationAuth.h
// LocationComponent
//
// Created by baidu on 2017/4/10.
// Copyright © 2017年 baidu. All rights reserved.
//
#ifndef BMKLocationAuth_h
#define BMKLocationAuth_h
///定位鉴权错误码
typedef NS_ENUM(NSInteger, BMKLocationAuthErrorCode) {
BMKLocationAuthErrorUnknown = -1, ///< 未知错误
BMKLocationAuthErrorSuccess = 0, ///< 鉴权成功
BMKLocationAuthErrorNetworkFailed = 1, ///< 因网络鉴权失败
BMKLocationAuthErrorFailed = 2, ///< KEY非法鉴权失败
};
///通知Delegate
@protocol BMKLocationAuthDelegate <NSObject>
@optional
/**
*@brief 返回授权验证错误
*@param iError 错误号 : 为0时验证通过,具体参加BMKLocationAuthErrorCode
*/
- (void)onCheckPermissionState:(BMKLocationAuthErrorCode)iError;
@end
///BMKLocationAuth类。用于鉴权
@interface BMKLocationAuth : NSObject
///鉴权状态0:成功; 1:网络错误; 2:授权失败
@property(nonatomic, readonly, assign) BMKLocationAuthErrorCode permisionState;
/**
* @brief 得到BMKLocationAuth的单例
*/
+ (BMKLocationAuth*)sharedInstance;
/**
*@brief 启动引擎
*@param key 申请的有效key
*@param delegate 回调是否鉴权成功
*/
-(void)checkPermisionWithKey:(NSString*)key authDelegate:(id<BMKLocationAuthDelegate>)delegate;
@end
#endif /* BMKLocationAuth_h */
//
// BMKLocationComponent.h
// LocationComponent
//
// Created by Baidu on 3/31/14.
// Copyright (c) 2014 baidu. All rights reserved.
//
#import "BMKLocationManager.h"
#import "BMKLocationKitVersion.h"
#import "BMKLocationPoi.h"
#import "BMKLocation.h"
#import "BMKGeoFenceRegion.h"
#import "BMKGeoFenceManager.h"
#import "BMKLocationReGeocode.h"
#import "BMKLocationAuth.h"
//
// BMKLocationKitVersion.h
// BMKLocationKit
//
// Created by baidu on 17/9/9.
// Copyright © 2017年 baidu. All rights reserved.
//
#ifndef BMKLocationKitVersion_h
#define BMKLocationKitVersion_h
#import <UIKit/UIKit.h>
/**
*获取当前定位sdk 的版本号
*当前定位sdk版本 : 2.0.0
*@return 返回当前定位sdk 的版本号
*/
UIKIT_EXTERN NSString* BMKLocationKitVersion();
/**
*获取当前定位sdk 的float版本号
*当前定位sdk版本 : 2.0
*@return 返回当前定位sdk 的float版本号
*/
UIKIT_EXTERN float BMKLocationKitFloatVersion();
#endif /* BMKLocationKitVersion_h */
//
// BMKLocationPoi.h
// BMKLocationKit
//
// Created by baidu on 2017/3/2.
// Copyright © 2017年 baidu. All rights reserved.
//
///描述Poi各属性
@interface BMKLocationPoi : NSObject
///BMKLocationPoi的id属性
@property(nonatomic, copy, readonly) NSString *uid;
///BMKLocationPoi的名字属性
@property(nonatomic, copy, readonly) NSString *name;
///BMKLocationPoi的标签属性
@property(nonatomic, copy, readonly) NSString *tags;
///BMKLocationPoi的地址属性
@property(nonatomic, copy, readonly) NSString *addr;
///BMKLocationPoi的可信度
@property(nonatomic, assign, readonly) float relaiability;
/**
* @brief 通过NSDictionary初始化方法一
*/
- (id)initWithDictionary:(NSDictionary *)dictionary;
/**
* @brief 通过NSDictionary初始化方法二
*/
- (id)initWithTwoDictionary:(NSDictionary *)dictionary;
@end
//
// BMKLocationPoiRegion.h
// LocationComponent
//
// Created by Jiang,Fangsheng on 2019/9/4.
// Copyright © 2019 baidu. All rights reserved.
//
#ifndef BMKLocationPoiRegion_h
#define BMKLocationPoiRegion_h
///描述PoiRegion各属性
@interface BMKLocationPoiRegion : NSObject
///BMKLocationPoiRegion的方向属性,如『内』、『外』
@property(nonatomic, copy, readonly) NSString *directionDesc;
///BMKLocationPoiRegion的名字属性
@property(nonatomic, copy, readonly) NSString *name;
///BMKLocationPoiRegion的标签属性
@property(nonatomic, copy, readonly) NSString *tags;
/**
* @brief 通过NSDictionary初始化方法一
*/
- (id)initWithDictionary:(NSDictionary *)dictionary;
@end
#endif /* BMKLocationPoiRegion_h */
//
// BMKLocationReGeocode.h
// BMKLocationKit
//
// Created by baidu on 2017/3/2.
// Copyright © 2017年 baidu. All rights reserved.
//
#import <Foundation/Foundation.h>
#import "BMKLocationPoi.h"
#import "BMKLocationPoiRegion.h"
///BMKLocationReGeocode类。描述跟地址有关的信息.
@interface BMKLocationReGeocode : NSObject
///国家名字属性
@property(nonatomic, copy, readonly) NSString *country;
///国家编码属性
@property(nonatomic, copy, readonly) NSString *countryCode;
///省份名字属性
@property(nonatomic, copy, readonly) NSString *province;
///城市名字属性
@property(nonatomic, copy, readonly) NSString *city;
///区名字属性
@property(nonatomic, copy, readonly) NSString *district;
///乡镇名字属性
@property(nonatomic, copy, readonly) NSString *town;
///街道名字属性
@property(nonatomic, copy, readonly) NSString *street;
///街道号码属性
@property(nonatomic, copy, readonly) NSString *streetNumber;
///城市编码属性
@property(nonatomic, copy, readonly) NSString *cityCode;
///行政区划编码属性
@property(nonatomic, copy, readonly) NSString *adCode;
///位置语义化结果的定位点在什么地方周围的描述信息
@property(nonatomic, copy, readonly) NSString *locationDescribe;
///位置语义化结果的属性,该定位点周围的poi列表信息
@property(nonatomic, retain, readonly) NSArray<BMKLocationPoi *> *poiList;
///位置语义化结果的定位点在什么地方周围的描述信息
@property(nonatomic, strong, readonly) BMKLocationPoiRegion *poiRegion;
/**
* @brief 通过NSData初始化方法
*/
- (id)initWithReGeocodeString:(NSData *)reGeocodeString;
/**
* @brief 通过JSON初始化方法
*/
- (id)initWithJsonString:(NSData *)jsonString withHighAccuracy:(BOOL)highAcc;
@end
1、版本:
百度地图iOS定位SDK v2.0.0
2、是否带IDFA:
3、是否为Bitcode:
4、集成方法:
http://lbsyun.baidu.com/index.php?title=ios-locsdk
//
// BaseComponent.h
// BaseComponent
//
// Created by baidu on 14-3-17.
// Copyright (c) 2014年 baidu. All rights reserved.
//
#import "BMKGeneralDelegate.h"
#import "BMKMapManager.h"
#import "BMKTypes.h"
#import "BMKUserLocation.h"
#import "BMKVersion.h"
//
// BMKGeneralDelegate.h
// BMapKit
//
// Copyright 2011 Baidu Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
///通知Delegate
@protocol BMKGeneralDelegate <NSObject>
@optional
/**
*返回网络错误
*@param iError 错误号
*/
- (void)onGetNetworkState:(int)iError;
/**
*返回授权验证错误
*@param iError 错误号 : 为0时验证通过,具体参加BMKPermissionCheckResultCode
*/
- (void)onGetPermissionState:(int)iError;
@end
//
// BMKMapManager.h
// BaiduMapAPI_Base
//
// Created by Daniel Bey on 2018年07月05日.
// Copyright © 2018 Baidu. All rights reserved.
//
#define BMKMapManagerInstance [BMKMapManager sharedInstance]
#import "BMKGeneralDelegate.h"
#import <UIKit/UIKit.h>
#import "BMKTypes.h"
///主引擎类
@interface BMKMapManager : NSObject
//获得实例对象
+ (BMKMapManager*) sharedInstance;
/**
全局设置地图SDK与开发者交互时的坐标类型。不调用此方法时,
设置此坐标类型意味着2个方面的约定:
1. 地图SDK认为开发者传入的所有坐标均为此类型;
2. 所有地图SDK返回给开发者的坐标均为此类型;
地图SDK默认使用BD09LL(BMK_COORDTYPE_BD09LL)坐标。
如需使用GCJ02坐标,传入参数值为BMK_COORDTYPE_COMMON即可。
本方法不支持传入WGS84(BMK_COORDTYPE_GPS)坐标。
@param coorType 地图SDK全局使用的坐标类型
@return 设置成功返回YES,设置失败返回False
*/
+ (BOOL)setCoordinateTypeUsedInBaiduMapSDK:(BMK_COORD_TYPE)coorType;
/**
获取地图SDK与开发者交互时使用的全局坐标类型
@return 坐标类型
*/
+ (BMK_COORD_TYPE)getCoordinateTypeUsedInBaiduMapSDK;
/**
打开某模块的日志,默认不打印日志
debug时,建议打开,有利于调试程序;release时建议关闭
@param enable 是否开启日志打印
@param mapModule 开启哪个模块的日志
*/
+ (void)logEnable:(BOOL)enable module:(BMKMapModule)mapModule;
/**
启动引擎,主要是进行鉴权并初始化引擎。鉴权结果通过BMKGeneralDelegate中的方法回调给开发者
@param key AK
@param delegate 回调对象
@return 参数错误或引擎内部异常则返回NO;鉴权请求发送成功则返回YES
*/
- (BOOL)start:(NSString *)key generalDelegate:(id <BMKGeneralDelegate>)delegate;
/**
获取所有在线服务消耗的发送流量,单位:字节
@return 发送流量
*/
- (NSUInteger)getTotalSendFlaxLength;
/**
获取所有在线服务消耗的接收流量,单位:字节
@return 接收流量
*/
- (NSUInteger)getTotalRecvFlaxLength;
/**
停止引擎
*/
- (BOOL)stop;
@end
//
// BMKUserLocation.h
// BaseComponent
//
// Created by Baidu on 3/26/14.
// Copyright (c) 2014 baidu. All rights reserved.
//
#import <CoreLocation/CoreLocation.h>
#ifndef BMKUserLocation_h
#define BMKUserLocation_h
@interface BMKUserLocation : NSObject
/// 位置更新状态,如果正在更新位置信息,则该值为YES
@property (nonatomic, assign, getter=isUpdating) BOOL updating;
/// 位置信息,尚未定位成功,则该值为nil
@property (nonatomic, strong) CLLocation *location;
/// heading信息,尚未定位成功,则该值为nil
@property (nonatomic, strong) CLHeading *heading;
/// 定位标注点要显示的标题信息
@property (nonatomic, copy) NSString *title;
/// 定位标注点要显示的子标题信息
@property (nonatomic, copy) NSString *subtitle;
@end
#endif
//
// BMKVersion.h
// BMapKit
//
// Copyright 2011 Baidu Inc. All rights reserved.
//
#import <UIKit/UIKit.h>
/**
*获取当前地图API的版本号
*return 返回当前API的版本号
*/
UIKIT_EXTERN NSString* BMKGetMapApiVersion(void);
/**
*获取当前地图API base组件 的版本号
*return 返回当前API base组件 的版本号
*/
UIKIT_EXTERN NSString* BMKGetMapApiBaseComponentVersion(void);
framework module BaiduMapAPI_Base {
umbrella header "BMKBaseComponent.h"
export *
module * { export * }
}
/*
* BMKCloudPOIList.h
* BMapKit
*
* Copyright 2013 Baidu Inc. All rights reserved.
*
*/
#import <BaiduMapAPI_Base/BMKTypes.h>
/// 云检索结果列表类
@interface BMKCloudPOIList : NSObject {
NSInteger _status;
NSInteger _total;
NSInteger _size;
NSInteger _pageNum;
NSArray *_POIs;
}
///搜索状态
@property (nonatomic, assign) NSInteger status;
///结果总数
@property (nonatomic, assign) NSInteger total;
///当前页返回数量
@property (nonatomic, assign) NSInteger size;
///页数
@property (nonatomic, assign) NSInteger pageNum;
///POI结果列表
@property (nonatomic, strong) NSArray *POIs;
@end
/// 云检索结果信息类
@interface BMKCloudPOIInfo : NSObject {
int _uid;
NSString *_poiId;
int _geotableId;
NSString *_title;
NSString *_address;
NSString *_province;
NSString *_city;
NSString *_district;
double _latitude;
double _longitude;
NSString *_tags;
float _distance;
float _weight;
NSMutableDictionary *_customDict;
int _creattime;
int _modifytime;
int _type;
}
///poi数据id,废弃
@property (nonatomic, assign) int uid __deprecated_msg("自4.4.0开始废弃");
///poi数据id
@property (nonatomic, strong) NSString *poiId;
///所属table的id
@property (nonatomic, assign) int geotableId;
///poi名称
@property (nonatomic, strong) NSString *title;
///poi地址
@property (nonatomic, strong) NSString *address;
///poi所属省
@property (nonatomic, strong) NSString *province;
///poi所属城市
@property (nonatomic, strong) NSString *city;
///poi所属区县
@property (nonatomic, strong) NSString *district;
///poi所处位置的纬度
@property (nonatomic, assign) double latitude;
///poi所处位置的经度
@property (nonatomic, assign) double longitude;
///poi标签
@property (nonatomic, strong) NSString *tags;
///poi距离
@property (nonatomic, assign) float distance;
///权重
@property (nonatomic, assign) float weight;
///自定义列
@property (nonatomic, strong) NSMutableDictionary *customDict;
///创建时间
@property (nonatomic, assign) int creattime;
///修改时间
@property (nonatomic, assign) int modifytime;
///类型
@property (nonatomic, assign) int type;
///处于位置点的方向
@property (nonatomic, strong) NSString *direction;
@end
/// 云检索结果百度地图POI信息类
@interface BMKCloudMapPOIInfo : NSObject
///poi名称
@property (nonatomic, strong) NSString *name;
///poi uid
@property (nonatomic, strong) NSString *uid;
///POI坐标
@property (nonatomic, assign) CLLocationCoordinate2D pt;
///poi地址
@property (nonatomic, strong) NSString *address;
///poi标签
@property (nonatomic, strong) NSString *tags;
///poi距离
@property (nonatomic, assign) CGFloat distance;
///处于位置点的方向
@property (nonatomic, strong) NSString* direction;
@end
/// 云RGC检索结果类
@interface BMKCloudReverseGeoCodeResult : NSObject
///层次化地址信息
@property (nonatomic, strong) BMKAddressComponent* addressDetail;
///地址名称
@property (nonatomic, strong) NSString* address;
///地址坐标
@property (nonatomic) CLLocationCoordinate2D location;
///用户定义位置描述
@property (nonatomic, strong) NSString* customLocationDescription;
///推荐的位置描述(结合poiList和customPoiList计算推荐结果)
@property (nonatomic, strong) NSString* recommendedLocationDescription;
///地址周边百度地图POI信息,成员类型为BMKCloudMapPOIInfo
@property (nonatomic, strong) NSArray* poiList;
///地址周边POI信息,成员类型为BMKCloudPOIInfo
@property (nonatomic, strong) NSArray* customPoiList;
@end
/*
* BMKCloudSearch.h
* BMapKit
*
* Copyright 2013 Baidu Inc. All rights reserved.
*
*/
#import <Foundation/Foundation.h>
#import "BMKCloudSearchInfo.h"
#import "BMKCloudPOIList.h"
@protocol BMKCloudSearchDelegate;
/// 云检索类型
typedef enum
{
BMK_NONE_SEARCH = 0,
BMK_CLOUD_LOCAL_SEARCH = 1,///<本地云检索
BMK_CLOUD_NEARBY_SEARCH = 2,///<周边云检索
BMK_CLOUD_BOUND_SEARCH = 3,///<区域云检索
BMK_CLOUD_DETAIL_SEARCH = 4,///<POI详情
BMK_CLOUD_RGC_SEARCH = 5///<云RGC检索
}BMKCloudSearchType;
//云检索结果状态码
typedef enum{
BMK_CLOUD_PERMISSION_UNFINISHED = -4,///<还未完成鉴权,请在鉴权通过后重试
BMK_CLOUD_NETWOKR_ERROR = -3,///<网络连接错误
BMK_CLOUD_NETWOKR_TIMEOUT = -2,///<网络连接超时
BMK_CLOUD_RESULT_NOT_FOUND = -1,///<没有找到检索结果
BMK_CLOUD_NO_ERROR = 0,///<检索结果正常返回
BMK_CLOUD_SERVER_ERROR = 1,///<云检索服务器内部错误
BMK_CLOUD_PARAM_ERROR = 2,///<输入参数有误(geoTableId或者其它参数有误)
/*
*更多云检索状态码请参考:
*http://developer.baidu.com/map/index.php?title=lbscloud/api/appendix
*/
}BMKCloudErrorCode;
/// 云检索服务
@interface BMKCloudSearch : NSObject
/// 云检索模块的Delegate
@property (nonatomic, weak) id<BMKCloudSearchDelegate> delegate;
/**
*本地云检索
*异步函数,返回结果在BMKCloudSearchDelegate的onGetCloudPoiResult通知
*@param searchInfo 搜索参数
*@return 成功返回YES,否则返回NO
*/
- (BOOL)localSearchWithSearchInfo:(BMKCloudLocalSearchInfo *)searchInfo;
/**
*周边云检索
*异步函数,返回结果在BMKCloudSearchDelegate的onGetCloudPoiResult通知
*@param searchInfo 搜索参数
*@return 成功返回YES,否则返回NO
*/
- (BOOL)nearbySearchWithSearchInfo:(BMKCloudNearbySearchInfo *)searchInfo;
/**
*矩形云检索
*异步函数,返回结果在BMKCloudSearchDelegate的onGetCloudPoiResult通知
*@param searchInfo 搜索参数
*@return 成功返回YES,否则返回NO
*/
- (BOOL)boundSearchWithSearchInfo:(BMKCloudBoundSearchInfo *)searchInfo;
/**
*详情云检索
*异步函数,返回结果在BMKCloudSearchDelegate的onGetCloudPoiDetailResult通知
*@param searchInfo 搜索参数
*@return 成功返回YES,否则返回NO
*/
- (BOOL)detailSearchWithSearchInfo:(BMKCloudDetailSearchInfo *)searchInfo;
/**
*云RGC检索:根据地理坐标获取地址信息
*异步函数,返回结果在BMKCloudSearchDelegate的onGetCloudReverseGeoCodeResult通知
*@param searchInfo 云RGC检索信息类
*@return 成功返回YES,否则返回NO
*/
- (BOOL)cloudReverseGeoCodeSearch:(BMKCloudReverseGeoCodeSearchInfo *)searchInfo;
@end
///云检索delegate,用于获取云检索结果
@protocol BMKCloudSearchDelegate<NSObject>
@optional
/**
*返回云检索POI列表结果
*@param poiResultList 云检索结果列表,成员类型为BMKCloudPOIList
*@param type 返回结果类型: BMK_CLOUD_LOCAL_SEARCH,BMK_CLOUD_NEARBY_SEARCH,BMK_CLOUD_BOUND_SEARCH
*@param error 错误号,@see BMKCloudErrorCode
*/
- (void)onGetCloudPoiResult:(NSArray*)poiResultList searchType:(int)type errorCode:(int)error;
/**
*返回云检索POI详情
*@param poiDetailResult 类型为BMKCloudPOIInfo
*@param type 返回结果类型: BMK_CLOUD_DETAIL_SEARCH
*@param error 错误号,@see BMKCloudErrorCode
*/
- (void)onGetCloudPoiDetailResult:(BMKCloudPOIInfo*)poiDetailResult searchType:(int)type errorCode:(int)error;
/**
*返回云RGC检索结果
*@param cloudRGCResult 搜索结果
*@param type 返回结果类型: BMK_CLOUD_RGC_SEARCH
*@param error 错误号,@see BMKCloudErrorCode
*/
- (void)onGetCloudReverseGeoCodeResult:(BMKCloudReverseGeoCodeResult*)cloudRGCResult searchType:(BMKCloudSearchType) type errorCode:(NSInteger)error;
@end
//
// LBSSearchComponent.h
// LBSSearchComponent
//
// Created by baidu on 14-3-10.
// Copyright (c) 2014年 baidu. All rights reserved.
//
#import "BMKCloudVersion.h"
#import "BMKCloudPOIList.h"
#import "BMKCloudSearch.h"
#import "BMKCloudSearchInfo.h"
/*
* BMKCloudSearchInfo.h
* BMapKit
*
* Copyright 2013 Baidu Inc. All rights reserved.
*
*/
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
/// 云检索基础信息类,所有类型云检索的基类
@interface BMKBaseCloudSearchInfo : NSObject
{
NSString *_ak;
NSString *_sn;
int _geoTableId;
}
///access_key(必须),最大长度50
@property (nonatomic, strong) NSString *ak;
///用户的权限签名,(可选),最大长度50
@property (nonatomic, strong) NSString *sn;
///geo table 表主键(必须)
@property (nonatomic, assign) int geoTableId;
@end
/// 本地,周边,矩形云检索基础信息类
@interface BMKCloudSearchInfo : BMKBaseCloudSearchInfo {
NSString *_keyword;
NSString *_tags;
NSString *_sortby;
NSString *_filter;
NSInteger _pageIndex;
NSInteger _pageSize;
}
///检索关键字,可选。最长45个字符
@property (nonatomic, strong) NSString *keyword;
///标签,可选,空格分隔的多字符串,最长45个字符,样例:美食 小吃
@property (nonatomic, strong) NSString *tags;
/**
* 排序字段,可选: sortby={keyname}:1 升序;sortby={keyname}:-1 降序。
* 以下keyname为系统预定义的:
* 1.distance 距离排序
* 2.weight 权重排序
* 默认为按weight排序
* 如果需要自定义排序则指定排序字段
* 样例:按照价格由便宜到贵排序sortby=price:1
*/
///排序字段,可选: sortby={keyname}:1 升序;sortby={keyname}:-1 降序
@property (nonatomic, strong) NSString *sortby;
/**
* 过滤条件,可选
* '|'竖线分隔的多个key-value对
* key为筛选字段的名称(存储服务中定义)
* value可以是整形或者浮点数的一个区间:格式为“small,big”逗号分隔的2个数字
* 样例:筛选价格为9.99到19.99并且生产时间为2013年的项:price:9.99,19.99|time:2012,2012
*/
///过滤条件,可选:'|'竖线分隔的多个key-value对,price:9.99,19.99|time:2012,2012
@property (nonatomic, strong) NSString *filter;
///分页索引,可选,默认为0
@property (nonatomic, assign) NSInteger pageIndex;
///分页数量,可选,默认为10,最多为50
@property (nonatomic, assign) NSInteger pageSize;
@end
///本地云检索参数信息类
@interface BMKCloudLocalSearchInfo : BMKCloudSearchInfo {
NSString *_region;
}
///区域名称(市或区的名字,如北京市,海淀区),必选, 必须最长25个字符
@property (nonatomic, strong) NSString *region;
@end
///周边云检索参数信息类
@interface BMKCloudNearbySearchInfo : BMKCloudSearchInfo {
NSString *_location;
int _radius;
}
///检索的中心点,逗号分隔的经纬度(116.4321,38.76623),string(25)
@property (nonatomic, strong) NSString *location;
///周边检索半径
@property (nonatomic, assign) int radius;
@end
///矩形云检索参数信息类
@interface BMKCloudBoundSearchInfo : BMKCloudSearchInfo {
NSString *_bounds;
}
///矩形区域,左下角和右上角的经纬度坐标点。2个点用;号分隔(116.30,36.20;117.30,37.20),string(25)
@property (nonatomic, strong) NSString *bounds;
@end
///详情云检索参数信息类
@interface BMKCloudDetailSearchInfo : BMKBaseCloudSearchInfo {
NSString *_uid;
}
///uid为poi点的id值
@property (nonatomic, strong) NSString *uid;
@end
///云RGC检索参数信息类
@interface BMKCloudReverseGeoCodeSearchInfo : NSObject
///geo table 表主键(必须)
@property (nonatomic, assign) NSInteger geoTableId;
///经纬度
@property (nonatomic, assign) CLLocationCoordinate2D reverseGeoPoint;
@end
//
// BMKCloudVersion.h
// LBSSearchComponent
//
// Created by wzy on 15/9/9.
// Copyright © 2015年 baidu. All rights reserved.
//
#ifndef BMKCloudVersion_h
#define BMKCloudVersion_h
#import <UIKit/UIKit.h>
/**
*重要:
*base组件的版本和Cloud组件的版本必须一致,否则不能正常使用
*/
/**
*获取当前地图API cloud组件 的版本号
*return 返回当前API cloud组件 的版本号
*/
UIKIT_EXTERN NSString* BMKGetMapApiCloudComponentVersion(void);
/**
*检查cloud组件的版本号是否和base组件的版本号一致
*return 版本号一致返回YES
*/
UIKIT_EXTERN BOOL BMKCheckCloudComponentIsLegal(void);
#endif /* BMKCloudVersion_h */
framework module BaiduMapAPI_Cloud {
umbrella header "BMKCloudSearchComponent.h"
export *
module * { export * }
}
/*
* BMKActionPaopaoView.h
* BMapKit
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import <UIKit/UIKit.h>
/**
* 该类用于定义一个PaopaoView
* 注意:如果在BMKActionPaopaoView中添加手势,会覆盖原本的点击和长按拖动的事件,不推荐这样使用。
* 如必须添加,请将手势的delegate设置到BMKActionPaopaoView中。
*/
@interface BMKActionPaopaoView : UIView
/**
*初始化并返回一个BMKActionPaopaoView
*@param customView 自定义View,customView=nil时返回默认的PaopaoView
*@return 初始化成功则返回BMKActionPaopaoView,否则返回nil
*/
- (instancetype)initWithCustomView:(UIView *)customView;
@end
//
// BMKAnnotation.h
// BMapKit
//
// Copyright 2011 Baidu Inc. All rights reserved.
//
#import <CoreGraphics/CoreGraphics.h>
#import <CoreLocation/CoreLocation.h>
#import <Foundation/Foundation.h>
/// 该类为标注点的protocol,提供了标注类的基本信息函数
@protocol BMKAnnotation <NSObject>
///标注view中心坐标.
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
@optional
/**
*获取annotation标题
*@return 返回annotation的标题信息
*/
- (NSString *)title;
/**
*获取annotation副标题
*@return 返回annotation的副标题信息
*/
- (NSString *)subtitle;
/**
*设置标注的坐标,在拖拽时会被调用.
*@param newCoordinate 新的坐标值
*/
- (void)setCoordinate:(CLLocationCoordinate2D)newCoordinate;
@end
/*
* BMKAnnotationView.h
* BMapKit
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import <UIKit/UIKit.h>
#import "BMKActionPaopaoView.h"
#if __IPHONE_3_2 <= __IPHONE_OS_VERSION_MAX_ALLOWED
enum {
BMKAnnotationViewDragStateNone = 0, ///< 静止状态.
BMKAnnotationViewDragStateStarting, ///< 开始拖动
BMKAnnotationViewDragStateDragging, ///< 拖动中
BMKAnnotationViewDragStateCanceling, ///< 取消拖动
BMKAnnotationViewDragStateEnding ///< 拖动结束
};
typedef NSUInteger BMKAnnotationViewDragState;
#endif
typedef float BMKFeatureDisplayPriority;
//常规annotationView级别高
static const BMKFeatureDisplayPriority BMKFeatureDisplayPriorityDefaultHigh = 750;
//常规annotationView级别中,其中罗盘模式下,罗盘中的图片使用本级别,精度圈使用本级别。
static const BMKFeatureDisplayPriority BMKFeatureDisplayPriorityDefaultMiddle = 500;
//常规annotationView级别低
static const BMKFeatureDisplayPriority BMKFeatureDisplayPriorityDefaultLow = 250;
@class BMKAnnotationViewInternal;
@protocol BMKAnnotation;
@class BMKMapView;
@class BMKMapViewInternal;
/**
* 标注view
* 注意:如果在BMKAnnotationView中添加手势,会覆盖原本的点击和长按事件,不推荐这样使用。
* 如必须添加,请将手势的delegate设置到BMKAnnotationView中。
*/
@interface BMKAnnotationView : UIView
{
@private
BOOL _enabled3D;
CGPoint _originPt;
CGPoint startPoint;
}
/**
*初始化并返回一个annotation view
*@param annotation 关联的annotation对象
*@param reuseIdentifier 如果要重用view,传入一个字符串,否则设为nil,建议重用view
*@return 初始化成功则返回annotation view,否则返回nil
*/
- (instancetype)initWithAnnotation:(id <BMKAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier;
///复用标志
@property (nonatomic, copy) NSString *reuseIdentifier;
///paopaoView
@property (nonatomic, strong) BMKActionPaopaoView *paopaoView;
/**
*当view从reuse队列里取出时被调用
*默认不做任何事
*/
- (void)prepareForReuse;
///关联的annotation
@property (nonatomic, strong) id <BMKAnnotation> annotation;
///annotation view显示的图像
@property (nonatomic, strong) UIImage *image;
///默认情况下, annotation view的中心位于annotation的坐标位置,可以设置centerOffset改变view的位置,正的偏移使view朝右下方移动,负的朝左上方,单位是像素
@property (nonatomic, assign) CGPoint centerOffset;
///默认情况下, 弹出的气泡位于view正中上方,可以设置calloutOffset改变view的位置,正的偏移使view朝右下方移动,负的朝左上方,单位是像素
@property (nonatomic, assign) CGPoint calloutOffset;
///默认情况下,标注没有3D效果,可以设置enabled3D改变使用3D效果,使得标注在地图旋转和俯视时跟随旋转、俯视
@property (nonatomic) BOOL enabled3D;
///默认为YES,当为NO时view忽略触摸事件
@property (nonatomic, getter=isEnabled) BOOL enabled;
///默认为NO,初始化时设置为YES时会默认弹出气泡。V5.2.0以后版本可以直接设置该值来控制隐藏和弹出气泡,无需调用强制刷新
@property (nonatomic, getter=isSelected) BOOL selected;
/**
*设定view的选中状态
*该方法被BMKMapView调用
*@param selected 如果view需要显示为选中状态,该值为YES
*@param animated 如果需要动画效果,该值为YES,暂不支持
*/
- (void)setSelected:(BOOL)selected animated:(BOOL)animated;
///当为YES时,view被选中时会弹出气泡,annotation必须实现了title这个方法
@property (nonatomic, assign) BOOL canShowCallout;
///显示在气泡左侧的view(使用默认气泡时,view的width最大值为32,height最大值为41,大于则使用最大值)
@property (strong, nonatomic) UIView *leftCalloutAccessoryView;
///显示在气泡右侧的view(使用默认气泡时,view的width最大值为32,height最大值为41,大于则使用最大值)
@property (strong, nonatomic) UIView *rightCalloutAccessoryView;
///当设为YES并实现了setCoordinate:方法时,支持将view在地图上拖动, iOS 3.2以后支持
@property (nonatomic, assign, getter=isDraggable) BOOL draggable __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_2);
///当前view的拖动状态, iOS 3.2以后支持
@property (nonatomic, assign) BMKAnnotationViewDragState dragState __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_3_2);
///当发生单击地图事件时,当前的annotation的泡泡是否隐藏,默认值为YES,V4.2.1以后支持
@property (nonatomic, assign) BOOL hidePaopaoWhenSingleTapOnMap;
///当发生双击地图事件时,当前的annotation的泡泡是否隐藏,默认值为NO,V4.2.1以后支持
@property (nonatomic, assign) BOOL hidePaopaoWhenDoubleTapOnMap;
///当发生两个手指点击地图(缩小地图)事件时,当前的annotation的泡泡是否隐藏,默认值为NO,V4.2.1以后支持
@property (nonatomic, assign) BOOL hidePaopaoWhenTwoFingersTapOnMap;
///当选中其他annotation时,当前annotation的泡泡是否隐藏,默认值为YES,V4.2.1以后支持
@property (nonatomic, assign) BOOL hidePaopaoWhenSelectOthers;
///当拖拽当前的annotation时,当前annotation的泡泡是否隐藏,默认值为NO,V4.2.1以后支持
@property (nonatomic, assign) BOOL hidePaopaoWhenDrag;
///当拖拽其他annotation时,当前annotation的泡泡是否隐藏,默认值为NO,V4.2.1以后支持
@property (nonatomic, assign) BOOL hidePaopaoWhenDragOthers;
///annotationView展示优先级,提供三种级别,其他级别开发者可自行设置,
///默认值为BMKFeatureDisplayPriorityDefaultMiddle,V4.2.1以后支持,
///级别数值越大越优先展示,同级别按照添加的先后顺序进行覆盖展示。
@property (nonatomic, assign) BMKFeatureDisplayPriority displayPriority;
@end
/*
* BMKArcline.h
* BMapKit
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import "BMKMultiPoint.h"
#import "BMKOverlay.h"
/// 此类用于定义一段圆弧
@interface BMKArcline : BMKMultiPoint <BMKOverlay>
{
BMKMapRect _boundingMapRect;
// bool isYouArc;
}
/**
*根据指定坐标点生成一段圆弧
*@param points 指定的直角坐标点数组(需传入3个点)
*@return 新生成的圆弧对象
*/
+ (instancetype)arclineWithPoints:(BMKMapPoint *)points;
/**
*根据指定经纬度生成一段圆弧
*@param coords 指定的经纬度坐标点数组(需传入3个点)
*@return 新生成的圆弧对象
*/
+ (instancetype)arclineWithCoordinates:(CLLocationCoordinate2D *)coords;
/**
*重新设置圆弧坐标
*@param points 指定的直角坐标点数组(需传入3个点)
*@return 是否设置成功
*/
- (BOOL)setArclineWithPoints:(BMKMapPoint *)points;
/**
*重新设置圆弧坐标
*@param coords 指定的经纬度坐标点数组(需传入3个点)
*@return 是否设置成功
*/
- (BOOL)setArclineWithCoordinates:(CLLocationCoordinate2D *)coords;
@end
/*
* BMKArclineView.h
* BMapKit
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import <UIKit/UIKit.h>
#import "BMKArcline.h"
#import "BMKOverlayGLBasicView.h"
/// 此类用于定义一个圆弧View
@interface BMKArclineView : BMKOverlayGLBasicView
/**
*根据指定的弧线生成一个圆弧View
*@param arcline 指定的弧线数据对象
*@return 新生成的弧线View
*/
- (instancetype)initWithArcline:(BMKArcline *)arcline;
/// 该View对应的圆弧数据对象
@property (nonatomic, readonly) BMKArcline *arcline;
@end
//
// BMKBaseIndoorMapInfo.h
// MapComponent
//
// Created by wzy on 16/4/2.
// Copyright © 2016年 baidu. All rights reserved.
//
#ifndef BMKBaseIndoorMapInfo_h
#define BMKBaseIndoorMapInfo_h
#import <CoreLocation/CoreLocation.h>
#import <Foundation/Foundation.h>
#import <QuartzCore/QuartzCore.h>
///此类表示室内图基础信息
@interface BMKBaseIndoorMapInfo : NSObject
/// 室内ID
@property (nonatomic, strong) NSString *strID;
/// 当前楼层
@property (nonatomic, strong) NSString *strFloor;
/// 所有楼层信息
@property (nonatomic, strong) NSArray *arrStrFloors;
@end
#endif /* BMKBaseIndoorMapInfo_h */
/*
* BMKCircle.h
* BMapKit
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import "BMKShape.h"
#import "BMKMultiPoint.h"
#import "BMKOverlay.h"
/// 该类用于定义一个圆
@interface BMKCircle : BMKMultiPoint <BMKOverlay> {
@package
BOOL _invalidate;
CLLocationCoordinate2D _coordinate;
CLLocationDistance _radius;
BMKMapRect _boundingMapRect;
}
/**
*根据中心点和半径生成圆
*@param coord 中心点的经纬度坐标
*@param radius 半径,单位:米
*@return 新生成的圆
*/
+ (instancetype)circleWithCenterCoordinate:(CLLocationCoordinate2D)coord
radius:(CLLocationDistance)radius;
/**
*根据指定的直角坐标矩形生成圆,半径由较长的那条边决定,radius = MAX(width, height)/2
*@param mapRect 指定的直角坐标矩形
*@return 新生成的圆
*/
+ (instancetype)circleWithMapRect:(BMKMapRect)mapRect;
/// 中心点坐标
@property (nonatomic, assign) CLLocationCoordinate2D coordinate;
/// 半径,单位:米
@property (nonatomic, assign) CLLocationDistance radius;
/// 该圆的外接矩形
@property (nonatomic, readonly) BMKMapRect boundingMapRect;
///设置中空区域,用来创建中间带空洞的复杂图形。注意:传入的overlay只支持BMKPolgon类型和BMKCircle类型. since 5.0.0
@property (nonatomic, strong) NSArray<id<BMKOverlay>> *hollowShapes;
/**
*设置圆的中心点和半径
*@param coord 中心点的经纬度坐标
*@param radius 半径,单位:米
*@return 是否设置成功
*/
- (BOOL)setCircleWithCenterCoordinate:(CLLocationCoordinate2D)coord radius:(CLLocationDistance)radius;
/**
*根据指定的直角坐标矩形设置圆,半径由较长的那条边决定,radius = MAX(width, height)/2
*@param mapRect 指定的直角坐标矩形
*@return 是否设置成功
*/
- (BOOL)setCircleWithMapRect:(BMKMapRect)mapRect;
@end
/*
* BMKCircleView.h
* BMapKit
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import <UIKit/UIKit.h>
#import "BMKCircle.h"
#import "BMKOverlayGLBasicView.h"
/// 该类用于定义圆对应的View
@interface BMKCircleView : BMKOverlayGLBasicView
/**
*根据指定圆生成对应的View
*@param circle 指定的圆
*@return 生成的View
*/
- (instancetype)initWithCircle:(BMKCircle *)circle;
/// 该View对应的圆
@property (nonatomic, readonly) BMKCircle *circle;
@end
//
// BMKCustomMapOption.h
// MapComponent
//
// Created by zhaoxiangru on 2019/9/10.
// Copyright © 2019 Baidu. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface BMKCustomMapStyleOption : NSObject
/// 个性化地图样式ID,可从百度地图开放平台控制台http://lbsyun.baidu.com/apiconsole/custommap获取个性化样式ID
@property(nonatomic, copy)NSString *customMapStyleID;
/// 个性化地图文件路径,通过id加载失败时,将会从本地加载此路径下的个性化样式
@property(nonatomic, copy)NSString *customMapStyleFilePath;
@end
/*
* BMKGradient.h
* BMapKit
*
* Copyright 2013 Baidu Inc. All rights reserved.
*
*/
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
///此类表示热力图渐变色
@interface BMKGradient : NSObject{
}
///渐变色用到的所有颜色数组,数组成员类型为UIColor
@property (nonatomic,strong) NSArray* mColors;
///每一个颜色的起始点数组,,数组成员类型为 [0,1]的double值, given as a percentage of the maximum intensity,个数和mColors的个数必须相同,数组内元素必须时递增的
@property (nonatomic,strong) NSArray* mStartPoints;
//渐变色的初始化方法,使用默认colorMapSize1000进行初始化
- (id)initWithColors:(NSArray*)colors startPoints:(NSArray*)startPoints;
@end
/*
* BMKGroundOverlay.h
* BMapKit
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import "BMKMultiPoint.h"
#import "BMKOverlay.h"
/// 该类用于定义一个图片图层
@interface BMKGroundOverlay : BMKMultiPoint<BMKOverlay>
{
@public
float zoomLevel;
CLLocationCoordinate2D _pt;
BMKCoordinateBounds _bound;
CGPoint _anchor;
UIImage* _icon;
int iconID;
BOOL isCenterPt;
int left;
int bottom;
int width;
int height;
}
/// 两种绘制GroundOverlay的方式之一:绘制的位置地理坐标,与anchor配对使用
@property (nonatomic,assign) CLLocationCoordinate2D pt;
/// 用位置绘制时图片的锚点,图片左上角为(0.0f,0.0f),向右向下为正
/// 使用groundOverlayWithPosition初始化时生效
@property (nonatomic,assign) CGPoint anchor;
/// 两种绘制GroundOverlay的方式之二:绘制的地理区域范围,图片在此区域内合理缩放
@property (nonatomic,assign) BMKCoordinateBounds bound;
/// 绘制图片
@property(nonatomic, strong) UIImage *icon;
///图片纹理透明度,最终透明度 = 纹理透明度 * alpha,取值范围为[0.0f, 1.0f],默认为1.0f
@property(nonatomic) GLfloat alpha;
/**
*根据指定经纬度坐标生成一个groundOverlay
*@param position 指定的经纬度坐标
*@param zoomLevel 不损失精度绘制原始图片的地图等级
*@param anchor 绘制图片的锚点
*@param icon 绘制使用的图片
*@return 新生成的groundOverlay对象
*/
+ (BMKGroundOverlay *)groundOverlayWithPosition:(CLLocationCoordinate2D)position
zoomLevel:(CGFloat)zoomLevel
anchor:(CGPoint)anchor
icon:(UIImage*)icon;
/**
*根据指定区域生成一个groundOverlay
*@param bounds 指定的经纬度区域
*@param icon 绘制使用的图片
*@return 新生成的groundOverlay对象
*/
+ (BMKGroundOverlay *)groundOverlayWithBounds:(BMKCoordinateBounds)bounds
icon:(UIImage*)icon;
@end
\ No newline at end of file
/*
* BMKGroundOverlayView.h
* BMapKit
*
* Copyright 2013 Baidu Inc. All rights reserved.
*
*/
#import <UIKit/UIKit.h>
#import "BMKGroundOverlay.h"
#import "BMKOverlayPathView.h"
/// 该类用于定义一个BMKGroundOverlayView
@interface BMKGroundOverlayView : BMKOverlayView
/**
*根据指定的groundOverlay生成一个View
*@param groundOverlay 指定的groundOverlay数据对象
*@return 新生成的View
*/
- (id)initWithGroundOverlay:(BMKGroundOverlay *)groundOverlay;
/// 该View对应的ground数据对象
@property (nonatomic, readonly) BMKGroundOverlay *groundOverlay;
@end
/*
* BMKHeatMap.h
* BMapKit
*
* Copyright 2013 Baidu Inc. All rights reserved.
*
*/
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#ifdef USE_NAVI
#import <BaiduMapAPI_Base_Navi/BMKTypes.h>
#else
#import <BaiduMapAPI_Base/BMKTypes.h>
#endif
#import "BMKGradient.h"
///热力图节点信息
@interface BMKHeatMapNode : NSObject{
double _intensity;
CLLocationCoordinate2D _pt;
}
///点的强度权值
@property (nonatomic) double intensity;
///点的位置坐标
@property (nonatomic) CLLocationCoordinate2D pt;
@end
///热力图的绘制数据和显示样式类
@interface BMKHeatMap : NSObject
{
int _mRadius; //Heatmap point radius
BMKGradient* _mGradient;//Gradient of the color map
double _mOpacity;//Opacity of the overall heatmap overlay [0...1]
NSMutableArray* _mData;
}
///设置热力图点半径,默认为12ps
@property (nonatomic, assign) int mRadius;
///设置热力图渐变,有默认值 DEFAULT_GRADIENT
@property (nonatomic, strong) BMKGradient* mGradient;
///设置热力图层透明度,默认 0.6
@property (nonatomic, assign) double mOpacity;
///用户传入的热力图数据,数组,成员类型为BMKHeatMapNode
@property (nonatomic, strong) NSMutableArray* mData;
@end
//
// BMKLineDrawType.h
// MapComponent
//
// Created by zhangbaojin on 2019/8/7.
// Copyright © 2019 Baidu. All rights reserved.
//
#ifndef BMKLineDrawType_h
#define BMKLineDrawType_h
///line拐角处理方式(不支持虚线)
enum BMKLineJoinType
{
kBMKLineJoinBevel = 0, ///< 平角衔接
kBMKLineJoinMiter, ///< 尖角衔接(尖角过长(大于线宽)按平角处理)
kBMKLineJoinRound, ///< 圆⻆角衔接
kBMKLineJoinBerzier ///< 贝塞尔平滑衔接(仅支持多纹理和多颜色的polyline绘制) 此衔接不可以与kBMKLineCapRound配合使用
};
typedef enum BMKLineJoinType BMKLineJoinType;
///line头尾处理方式(不支持虚线)
enum BMKLineCapType
{
kBMKLineCapButt = 0, ///< 普通头
kBMKLineCapRound ///< 圆形头
};
typedef enum BMKLineCapType BMKLineCapType;
///虚线绘制样式
enum BMKLineDashType
{
kBMKLineDashTypeNone = 0, ///<实折线
kBMKLineDashTypeSquare, ///<方块样式
kBMKLineDashTypeDot, ///<圆点样式
};
typedef enum BMKLineDashType BMKLineDashType;
#endif /* BMKLineDrawType_h */
/*
* BMKLocationViewDisplayParam.h
* BMapKit
*
* Copyright 2013 Baidu Inc. All rights reserved.
*
*/
#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
/**
LocationView在mapview上显示的层级
- LOCATION_VIEW_HIERARCHY_TOP: locationView在最上层
- LOCATION_VIEW_HIERARCHY_BOTTOM: locationView在最下层
*/
typedef NS_ENUM(NSUInteger, LocationViewHierarchy) {
LOCATION_VIEW_HIERARCHY_TOP,
LOCATION_VIEW_HIERARCHY_BOTTOM,
};
///此类表示定位图层自定义样式参数
@interface BMKLocationViewDisplayParam : NSObject <NSCopying>
///定位图标X轴偏移量(屏幕坐标)
@property (nonatomic, assign) CGFloat locationViewOffsetX;
///定位图标Y轴偏移量(屏幕坐标)
@property (nonatomic, assign) CGFloat locationViewOffsetY;
///精度圈是否显示,默认YES
@property (nonatomic, assign) BOOL isAccuracyCircleShow;
///精度圈 填充颜色
@property (nonatomic, strong) UIColor *accuracyCircleFillColor;
///精度圈 边框颜色
@property (nonatomic, strong) UIColor *accuracyCircleStrokeColor;
///跟随态旋转角度是否生效,默认YES
@property (nonatomic, assign) BOOL isRotateAngleValid;
///定位图标名称,需要将该图片放到 mapapi.bundle/images 目录下
@property (nonatomic, strong) NSString *locationViewImgName;
///用户自定义定位图标,V4.2.1以后支持
@property (nonatomic, strong) UIImage *locationViewImage;
///是否显示气泡,默认YES
@property (nonatomic, assign) BOOL canShowCallOut;
///locationView在mapview上的层级 默认值为LOCATION_VIEW_HIERARCHY_BOTTOM
@property (nonatomic, assign) LocationViewHierarchy locationViewHierarchy;
@end
/*
* BMKMapComponent.h
* BMKMapComponent
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import "BMKMapVersion.h"
#import "BMKAnnotation.h"
#import "BMKAnnotationView.h"
#import "BMKMapView.h"
#import "BMKBaseIndoorMapInfo.h"
#import "BMKOfflineMap.h"
#import "BMKOfflineMapType.h"
#import "BMKOverlay.h"
#import "BMKShape.h"
#import "BMKPointAnnotation.h"
#import "BMKPinAnnotationView.h"
#import "BMKMultiPoint.h"
#import "BMKArcline.h"
#import "BMKPolyline.h"
#import "BMKPolygon.h"
#import "BMKCircle.h"
#import "BMKOverlayView.h"
#import "BMKOverlayPathView.h"
#import "BMKOverlayGLBasicView.h"
#import "BMKPolygonView.h"
#import "BMKPolylineView.h"
#import "BMKCircleView.h"
#import "BMKArclineView.h"
#import "BMKGroundOverlay.h"
#import "BMKGroundOverlayView.h"
#import "BMKGradient.h"
#import "BMKTileLayer.h"
#import "BMKTileLayerView.h"
/*
* BMKMapStatus.h
* BMapKit
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import <CoreLocation/CoreLocation.h>
#import <UIKit/UIKit.h>
#ifdef USE_NAVI
#import <BaiduMapAPI_Base_Navi/BMKTypes.h>
#else
#import <BaiduMapAPI_Base/BMKTypes.h>
#endif
//#import <QuartzCore/QuartzCore.h>
///此类表示地图状态信息
@interface BMKMapStatus : NSObject
{
float _fLevel; // 缩放比例,4-21级
float _fRotation; // 旋转角度
float _fOverlooking; // 俯视角度
CGPoint _targetScreenPt;//屏幕坐标(中心点)
CLLocationCoordinate2D _targetGeoPt;//地理坐标(中心点)
}
///缩放级别:[4~21]
@property (nonatomic, assign) float fLevel;
///旋转角度
@property (nonatomic, assign) float fRotation;
///俯视角度:[-79~0]
@property (nonatomic, assign) float fOverlooking;
///屏幕中心点坐标:在屏幕内,超过无效
@property (nonatomic) CGPoint targetScreenPt;
///地理中心点坐标:经纬度
@property (nonatomic) CLLocationCoordinate2D targetGeoPt;
///当前地图范围,采用直角坐标系表示,向右向下增长
@property (nonatomic, assign, readonly) BMKMapRect visibleMapRect;
@end
//
// BMKMapVersion.h
// MapComponent
//
// Created by wzy on 15/9/9.
// Copyright © 2015年 baidu. All rights reserved.
//
#ifndef BMKMapVersion_h
#define BMKMapVersion_h
#import <UIKit/UIKit.h>
/**
*重要:
*map组件的版本和base组件的版本必须一致,否则不能正常使用
*/
/**
*获取当前地图API map组件 的版本号
*return 返回当前API map组件 的版本号
*/
UIKIT_EXTERN NSString* BMKGetMapApiMapComponentVersion(void);
/**
*检查map组件的版本号是否和base组件的版本号一致
*return 版本号一致返回YES
*/
UIKIT_EXTERN BOOL BMKCheckMapComponentIsLegal(void);
#endif /* BMKMapVersion_h */
/*
* BMKMultiPoint.h
* BMapKit
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import <Foundation/Foundation.h>
#ifdef USE_NAVI
#import <BaiduMapAPI_Base_Navi/BMKTypes.h>
#else
#import <BaiduMapAPI_Base/BMKTypes.h>
#endif
#import "BMKShape.h"
/// 该类定义多个点,是个由多个点组成的虚基类, 不能直接实例化对象, 要使用其子类BMKPolyline,BMKPolygon来实例化
@interface BMKMultiPoint : BMKShape {
@package
BMKMapPoint *_points;
NSUInteger _pointCount;
BMKMapRect _boundingRect;
}
/// 坐标点数组
@property (nonatomic, readonly) BMKMapPoint *points;
/// 坐标点的个数
@property (nonatomic, readonly) NSUInteger pointCount;
/**
*将内部的直角坐标数据转换为经纬度坐标点数据,并拷贝到指定的数组中
*@param coords 经纬度坐标数组,转换后的坐标将存储到该数组中,该数组长度必须大于等于要拷贝的坐标点的个数(range.length)
*@param range 指定要拷贝的数据段
*/
- (void)getCoordinates:(CLLocationCoordinate2D *)coords range:(NSRange)range;
@end
/*
* BMKOfflineMap.h
* BMapKit
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import <Foundation/Foundation.h>
#import "BMKOfflineMapType.h"
@protocol BMKOfflineMapDelegate;
///离线地图事件类型
enum {
TYPE_OFFLINE_UPDATE = 0, ///<下载或更新
TYPE_OFFLINE_ZIPCNT = 1, ///<检测到的压缩包个数
TYPE_OFFLINE_UNZIP = 2, ///<当前解压的离线包
TYPE_OFFLINE_ERRZIP = 3, ///<错误的离线包
TYPE_OFFLINE_NEWVER = 4, ///<有新版本
TYPE_OFFLINE_UNZIPFINISH = 5, ///<扫描完毕
TYPE_OFFLINE_ADD = 6 ///<新增离线包
};
///离线地图服务
@interface BMKOfflineMap : NSObject
@property (nonatomic, weak) id<BMKOfflineMapDelegate> delegate;
/**
*自2.9.0起废弃,不支持扫描导入离线包
*扫描离线地图压缩包,异步函数
*@return 成功返回YES,否则返回NO
*/
- (BOOL)scan:(BOOL)deleteFailedr __deprecated_msg("废弃方法(空实现),自2.9.0起废弃,不支持扫描导入离线包");
/**
*启动下载指定城市id的离线地图
*@param cityID 指定的城市id
*@return 成功返回YES,否则返回NO
*/
- (BOOL)start:(int)cityID;
/**
*启动更新指定城市id的离线地图
*@param cityID 指定的城市id
*@return 成功返回YES,否则返回NO
*/
- (BOOL)update:(int)cityID;
/**
*暂停下载指定城市id的离线地图
*@param cityID 指定的城市id
*@return 成功返回YES,否则返回NO
*/
- (BOOL)pause:(int)cityID;
/**
*删除下载指定城市id的离线地图
*@param cityID 指定的城市id
*@return 成功返回YES,否则返回NO
*/
- (BOOL)remove:(int)cityID;
/**
*返回热门城市列表
*@return 热门城市列表,用户需要显示释放该数组,数组元素为BMKOLSearchRecord
*/
- (NSArray*)getHotCityList;
/**
*返回所有支持离线地图的城市列表
*@return 支持离线地图的城市列表,用户需要显示释放该数组,数组元素为BMKOLSearchRecord
*/
- (NSArray*)getOfflineCityList;
/**
*根据城市名搜索该城市离线地图记录
*@param cityName 城市名
*@return 该城市离线地图记录,用户需要显示释放该数组,数组元素为BMKOLSearchRecord
*/
- (NSArray*)searchCity:(NSString*)cityName;
/**
*返回各城市离线地图更新信息
*@return 各城市离线地图更新信息,用户需要显示释放该数组,数组元素为BMKOLUpdateElement
*/
- (NSArray*)getAllUpdateInfo;
/**
*返回指定城市id离线地图更新信息
*@param cityID 指定的城市id
*@return 指定城市id离线地图更新信息
*/
- (BMKOLUpdateElement*)getUpdateInfo:(int)cityID;
@end
///离线地图delegate,用于获取通知
@protocol BMKOfflineMapDelegate<NSObject>
/**
*返回通知结果
*@param type 事件类型: TYPE_OFFLINE_UPDATE,TYPE_OFFLINE_ZIPCNT,TYPE_OFFLINE_UNZIP, TYPE_OFFLINE_ERRZIP, TYPE_VER_UPDATE, TYPE_OFFLINE_UNZIPFINISH, TYPE_OFFLINE_ADD
*@param state 事件状态,当type为TYPE_OFFLINE_UPDATE时,表示正在下载或更新城市id为state的离线包,当type为TYPE_OFFLINE_ZIPCNT时,表示检测到state个离线压缩包,当type为TYPE_OFFLINE_ADD时,表示新安装的离线地图数目,当type为TYPE_OFFLINE_UNZIP时,表示正在解压第state个离线包,当type为TYPE_OFFLINE_ERRZIP时,表示有state个错误包,当type为TYPE_VER_UPDATE时,表示id为state的城市离线包有更新,当type为TYPE_OFFLINE_UNZIPFINISH时,表示扫瞄完成,成功导入state个离线包
*/
- (void)onGetOfflineMapState:(int)type withState:(int)state;
@end
/*
* BMKOffineMapType.h
* BMapKit
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
///离线地图搜索城市记录结构
@interface BMKOLSearchRecord : NSObject
{
NSString* _cityName;
int64_t _size;
int _cityID;
int _cityType;
NSArray* _childCities;
}
///城市名称
@property (nonatomic, strong) NSString* cityName;
///数据包总大小
@property (nonatomic) int64_t size;
///城市ID
@property (nonatomic) int cityID;
///城市类型 0:全国;1:省份;2:城市;如果是省份,可以通过childCities得到子城市列表
@property (nonatomic) int cityType;
///子城市列表
@property (nonatomic, strong) NSArray* childCities;
@end
///离线地图更新信息
@interface BMKOLUpdateElement : NSObject
{
NSString* _cityName;
int _cityID;
int64_t _size;
int64_t _serversize;
BOOL _update;
int _ratio;
int _status;
CLLocationCoordinate2D _pt;
}
///城市名称
@property (nonatomic, strong) NSString* cityName;
///城市ID
@property (nonatomic) int cityID;
///已下载数据大小,单位:字节
@property (nonatomic) int64_t size;
///服务端数据大小,当update为YES时有效,单位:字节
@property (nonatomic) int64_t serversize;
///下载比率,100为下载完成,下载完成后会自动导入,status为4时离线包导入完成
@property (nonatomic) int ratio;
///下载状态, -1:未定义 1:正在下载 2:等待下载 3:已暂停 4:完成 5:校验失败 6:网络异常 7:读写异常 8:Wifi网络异常 9:离线包数据格式异常,需重新下载离线包 10:离线包导入中
@property (nonatomic) int status;
///更新状态,离线包是否有更新(有更新需重新下载)
@property (nonatomic) BOOL update;
///城市中心点
@property (nonatomic) CLLocationCoordinate2D pt;
@end
/*
* BMKOverlay.h
* BMapKit
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import "BMKAnnotation.h"
#ifdef USE_NAVI
#import <BaiduMapAPI_Base_Navi/BMKTypes.h>
#else
#import <BaiduMapAPI_Base/BMKTypes.h>
#endif
/// 该类是地图覆盖物的基类,所有地图的覆盖物需要继承自此类
@protocol BMKOverlay <BMKAnnotation>
@required
/// 返回区域中心坐标.
@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
/// 返回区域外接矩形
@property (nonatomic, readonly) BMKMapRect boundingMapRect;
@optional
/**
*判断指定的矩形是否与本Overlay相交,用于更精确的控制overlay view的显示.
*默认使用BMKMapRectIntersectsRect([overlay boundingRect], mapRect)代替.
*@param mapRect 指定的BMKMapRect
*@return 如果相交返回YES,否则返回NO
*/
- (BOOL)intersectsMapRect:(BMKMapRect)mapRect;
@end
/*
* BMKOverlayGLBasicView.h
* BMapKit
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import <UIKit/UIKit.h>
#import "BMKOverlayView.h"
/// 该类定义了一个用opengl绘制的OverlayView的基类,如果需要用gdi进行绘制请继承于BMKOverlayPathView类
@interface BMKOverlayGLBasicView : BMKOverlayView {
}
/// 填充颜色
/// 注:请使用 - (UIColor *)initWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha; 初始化UIColor,使用[UIColor ***Color]初始化时,个别case转换成RGB后会有问题
@property (strong, nonatomic) UIColor *fillColor;
/// 画笔颜色
/// 注:请使用 - (UIColor *)initWithRed:(CGFloat)red green:(CGFloat)green blue:(CGFloat)blue alpha:(CGFloat)alpha; 初始化UIColor,使用[UIColor ***Color]初始化时,个别case转换成RGB后会有问题
@property (strong, nonatomic) UIColor *strokeColor;
/// 画笔宽度,默认为0
@property (nonatomic, assign) CGFloat lineWidth;
/// path对象
@property CGPathRef path;
/// 是否为虚线样式,默认NO
@property (nonatomic) BOOL lineDash __deprecated_msg("已废弃since 5.0.0,已废弃,请使用lineDashType绘制虚线");
/// 是否纹理图片平铺绘制,默认NO
@property (assign, nonatomic) BOOL tileTexture __deprecated_msg("已废弃since 5.0.0");
/// 纹理图片是否缩放,默认NO
@property (assign, nonatomic) BOOL keepScale;
/// LineJoinType,默认是kBMKLineJoinBevel(不支持虚线)
@property (assign, nonatomic) BMKLineJoinType lineJoinType;
/// LineCapType,默认是kBMKLineCapButt (不支持虚线)
@property (assign, nonatomic) BMKLineCapType lineCapType;
/// 虚线类型, since 5.0.0,默认kBMKLineDashTypeNone (仅支持颜色虚线)
@property (assign, nonatomic) BMKLineDashType lineDashType;
@end
/*
* BMKOverlayPathView.h
* BMapKit
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import <UIKit/UIKit.h>
#import "BMKOverlayView.h"
/// 该类定义了一个基本的OverlayView
@interface BMKOverlayPathView : BMKOverlayView {
@package
UIColor *_fillColor;
UIColor *_strokeColor;
CGFloat _lineWidth;
CGLineJoin _lineJoin;
CGLineCap _lineCap;
CGFloat _miterLimit;
CGFloat _lineDashPhase;
NSArray *_lineDashPattern;
CGPathRef _path;
}
/// 填充颜色
@property (strong) UIColor *fillColor;
/// 画笔颜色
@property (strong) UIColor *strokeColor;
/// 画笔宽度,默认为0
@property CGFloat lineWidth;
/// LineJoin,默认为kCGLineJoinRound
@property CGLineJoin lineJoin;
/// LineCap,默认为kCGLineCapRound
@property CGLineCap lineCap;
/// miterLimit,在样式为kCGLineJoinMiter时有效,默认为10
@property CGFloat miterLimit;
/// lineDashPhase, 默认为0
@property CGFloat lineDashPhase;
/// lineDashPattern,一个NSNumbers的数组,默认为nil
@property (copy) NSArray *lineDashPattern;
/**
*生成要绘制的path,子类需要重写此函数,并且对path属性赋值:self.path = newPath;
*/
- (void)createPath;
/// path对象
@property CGPathRef path;
/**
*刷新path,调用该函数将会使已经缓存的path失效,将会重新调用createPath来生成新的path对象
*/
- (void)invalidatePath;
/**
*应用画笔属性
*@param context CGContext对象
*@param zoomScale 当前的zoomScale
*/
- (void)applyStrokePropertiesToContext:(CGContextRef)context
atZoomScale:(BMKZoomScale)zoomScale;
/**
*应用画刷属性
*@param context CGContext对象
*@param zoomScale 当前的zoomScale
*/
- (void)applyFillPropertiesToContext:(CGContextRef)context
atZoomScale:(BMKZoomScale)zoomScale;
/**
*绘制path
*@param path 要绘制的CGPath
*@param context CGContext对象
*/
- (void)strokePath:(CGPathRef)path inContext:(CGContextRef)context;
/**
*填充path
*@param path 要绘制的CGPath
*@param context CGContext对象
*/
- (void)fillPath:(CGPathRef)path inContext:(CGContextRef)context;
@end
/*
* BMKPinAnnotationView.h
* BMapKit
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import "BMKAnnotationView.h"
enum {
BMKPinAnnotationColorRed = 0,
BMKPinAnnotationColorGreen,
BMKPinAnnotationColorPurple
};
typedef NSUInteger BMKPinAnnotationColor;
///提供类似大头针效果的annotation view
@interface BMKPinAnnotationView : BMKAnnotationView
{
@private
BMKPinAnnotationColor _pinColor;
BOOL _animatesDrop;
}
///大头针的颜色,有BMKPinAnnotationColorRed, BMKPinAnnotationColorGreen, BMKPinAnnotationColorPurple三种
@property (nonatomic) BMKPinAnnotationColor pinColor;
///动画效果
@property (nonatomic) BOOL animatesDrop;
@end
/*
* BMKPointAnnotation.h
* BMapKit
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import <Foundation/Foundation.h>
#import "BMKShape.h"
#import <CoreLocation/CLLocation.h>
///表示一个点的annotation
@interface BMKPointAnnotation : BMKShape {
@package
CLLocationCoordinate2D _coordinate;
BOOL _lockedToScreen;
CGPoint _lockedScreenPoint;
}
///该点的坐标
@property (nonatomic, assign) CLLocationCoordinate2D coordinate;
///标注固定在指定屏幕位置, 必须与screenPointToLock一起使用。 注意:拖动Annotation isLockedToScreen会被设置为false。
///若isLockedToScreen为true,拖动地图时annotaion不会跟随移动;
///若isLockedToScreen为false,拖动地图时annotation会跟随移动。
@property (nonatomic, assign) BOOL isLockedToScreen;
///标注锁定在屏幕上的位置,注意:地图初始化后才能设置screenPointToLock。可以在地图加载完成的回调方法:mapViewDidFinishLoading中使用此属性。
@property (nonatomic, assign) CGPoint screenPointToLock;
@end
/*
* BMKPolygon.h
* BMapKit
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import <Foundation/Foundation.h>
#import "BMKMultiPoint.h"
#import "BMKOverlay.h"
/// 此类用于定义一个多边形区域
@interface BMKPolygon : BMKMultiPoint <BMKOverlay>
/// 设置中空区域,用来创建中间带空洞的复杂图形。注意:传入的overlay只支持BMKPolgon类型和BMKCircle类型. since 5.0.0
@property (nonatomic, strong) NSArray<id<BMKOverlay>> *hollowShapes;
/**
*根据多个点生成多边形
*@param points 直角坐标点数组,这些点将被拷贝到生成的多边形对象中
*@param count points数组中点的个数
*@return 新生成的多边形对象
*/
+ (instancetype)polygonWithPoints:(BMKMapPoint *)points count:(NSUInteger)count;
/**
*根据多个点生成多边形
*@param coords 经纬度坐标点数组,这些点将被拷贝到生成的多边形对象中
*@param count coords数组中点的个数
*@return 新生成的多边形对象
*/
+ (instancetype)polygonWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count;
/**
*重新设置多边形顶点
*@param points 指定的直角坐标点数组
*@param count points数组中坐标点的个数
*@return 是否设置成功
*/
- (BOOL)setPolygonWithPoints:(BMKMapPoint *)points count:(NSInteger) count;
/**
*重新设置多边形顶点
*@param coords 指定的经纬度坐标点数组
*@param count coords数组中坐标点的个数
*@return 是否设置成功
*/
- (BOOL)setPolygonWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSInteger) count;
@end
/*
* BMKPolygonView.h
* BMapKit
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import <UIKit/UIKit.h>
#import "BMKPolygon.h"
#import "BMKOverlayGLBasicView.h"
/// 此类用于定义一个多边形View
@interface BMKPolygonView : BMKOverlayGLBasicView
/**
*根据指定的多边形生成一个多边形View
*@param polygon 指定的多边形数据对象
*@return 新生成的多边形View
*/
- (instancetype)initWithPolygon:(BMKPolygon *)polygon;
/// 该View对应的多边形数据
@property (nonatomic, readonly) BMKPolygon *polygon;
@end
/*
* BMKPolyline.h
* BMapKit
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import "BMKMultiPoint.h"
#import "BMKOverlay.h"
/// 此类用于定义一段折线
@interface BMKPolyline : BMKMultiPoint <BMKOverlay>
/// 是否需要对Polyline坐标数据进行抽稀,默认为YES
@property (nonatomic, assign) BOOL isThined;
/**
*根据指定坐标点生成一段折线
*@param points 指定的直角坐标点数组
*@param count points数组中坐标点的个数
*@return 新生成的折线对象
*/
+ (instancetype)polylineWithPoints:(BMKMapPoint *)points count:(NSUInteger)count;
/**
*根据指定坐标点生成一段折线
*@param coords 指定的经纬度坐标点数组
*@param count coords数组中坐标点的个数
*@return 新生成的折线对象
*/
+ (instancetype)polylineWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSUInteger)count;
/**
*重新设置折线坐标点
*@param points 指定的直角坐标点数组
*@param count points数组中坐标点的个数
*@return 是否设置成功
*/
- (BOOL)setPolylineWithPoints:(BMKMapPoint *)points count:(NSInteger) count;
/**
*重新设置折线坐标点
*@param coords 指定的经纬度坐标点数组
*@param count coords数组中坐标点的个数
*@return 是否设置成功
*/
- (BOOL)setPolylineWithCoordinates:(CLLocationCoordinate2D *)coords count:(NSInteger) count;
#pragma mark - 以下方法和属性只适用于分段纹理绘制和分段颜色绘制
///纹理索引数组(颜色索引数组)
@property (nonatomic, strong) NSArray<NSNumber *> *textureIndex;
/**
*分段纹理绘制/分段颜色绘制,根据指定坐标点生成一段折线
*
*分段纹理绘制:其对应的BMKPolylineView必须使用 - (BOOL)loadStrokeTextureImages:(NSArray <UIImage *>*)textureImages; 加载纹理图片;否则使用默认的灰色纹理绘制
*分段颜色绘制:其对应的BMKPolylineView必须设置colors属性
*
*@param points 指定的直角坐标点数组
*@param count points数组中坐标点的个数
*@param textureIndex 纹理索引数组(颜色索引数组),成员为NSNumber,且为非负数,负数按0处理
*@return 新生成的折线对象
*/
+ (instancetype)polylineWithPoints:(BMKMapPoint *)points
count:(NSUInteger)count
textureIndex:(NSArray<NSNumber *> *) textureIndex;
/**
*根据指定坐标点生成一段折线
*
*分段纹理绘制:其对应的BMKPolylineView必须使用 - (BOOL)loadStrokeTextureImages:(NSArray <UIImage *>*)textureImages; 加载纹理图片;否则使用默认的灰色纹理绘制
*分段颜色绘制:其对应的BMKPolylineView必须设置colors属性
*
*@param coords 指定的经纬度坐标点数组
*@param count coords数组中坐标点的个数
*@param textureIndex 纹理索引数组(颜色索引数组),成员为NSNumber,且为非负数,负数按0处理
*@return 新生成的折线对象
*/
+ (instancetype)polylineWithCoordinates:(CLLocationCoordinate2D *)coords
count:(NSUInteger)count
textureIndex:(NSArray<NSNumber *> *)textureIndex;
/**
*重新设置折线坐标点 和 纹理索引
*@param points 指定的直角坐标点数组
*@param count points数组中坐标点的个数
*@param textureIndex 纹理索引数组(颜色索引数组),成员为NSNumber,且为非负数,负数按0处理
*@return 是否设置成功
*/
- (BOOL)setPolylineWithPoints:(BMKMapPoint *)points
count:(NSInteger)count
textureIndex:(NSArray<NSNumber *> *)textureIndex;
/**
*重新设置折线坐标点
*@param coords 指定的经纬度坐标点数组
*@param count coords数组中坐标点的个数
*@param textureIndex 纹理索引数组(颜色索引数组),成员为NSNumber,且为非负数,负数按0处理
*@return 是否设置成功
*/
- (BOOL)setPolylineWithCoordinates:(CLLocationCoordinate2D *)coords
count:(NSInteger)count
textureIndex:(NSArray<NSNumber *> *)textureIndex;
@end
/*
* BMKPolylineView.h
* BMapKit
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import <UIKit/UIKit.h>
#import "BMKPolyline.h"
#import "BMKOverlayGLBasicView.h"
/// 此类用于定义一个折线View
@interface BMKPolylineView : BMKOverlayGLBasicView
/**
*根据指定的折线生成一个折线View
*@param polyline 指定的折线数据对象
*@return 新生成的折线View
*/
- (instancetype)initWithPolyline:(BMKPolyline *)polyline;
/// 该View对应的折线数据对象
@property (nonatomic, readonly) BMKPolyline *polyline;
#pragma mark - 以下方法和属性只适用于分段纹理绘制/分段颜色绘制
/// 是否分段纹理/分段颜色绘制(突出显示),默认YES,YES:使用分段纹理绘制 NO:使用默认的灰色纹理绘制
@property (nonatomic, assign) BOOL isFocus __deprecated_msg("已废弃since 5.0.0");
@end
/*
* BMKShape.h
* BMapKit
*
* Copyright 2011 Baidu Inc. All rights reserved.
*
*/
#import <Foundation/Foundation.h>
#import"BMKAnnotation.h"
/// 该类为一个抽象类,定义了基于BMKAnnotation的BMKShape类的基本属性和行为,不能直接使用,必须子类化之后才能使用
@interface BMKShape : NSObject <BMKAnnotation> {
}
/// 要显示的标题;注意:如果不设置title,无法点击annotation,也无法使用回调函数;
@property (copy) NSString *title;
/// 要显示的副标题
@property (copy) NSString *subtitle;
@end
//
// BMKTileLayer.h
// MapComponent
//
// Created by wzy on 15/8/7.
// Copyright © 2015年 baidu. All rights reserved.
//
#ifndef BMKTileLayer_h
#define BMKTileLayer_h
#import "BMKOverlay.h"
/**
@brief 该类是覆盖在球面墨卡托投影上的图片tiles的数据源,是抽象类,不能直接使用该类添加瓦片图,需要使用其子类(BMKURLTileLayer或BMKSyncTileLayer)
*瓦片图片是jpeg或者png格式,size为256x256
*/
@interface BMKTileLayer : NSObject <BMKOverlay>
/// tileLayer的可见最小Zoom值,默认3
@property (nonatomic, assign) NSInteger minZoom;
/// tileLayer的可见最大Zoom值,默认21,且不能小于minZoom
@property (nonatomic, assign) NSInteger maxZoom;
/// tileOverlay的可渲染区域,默认世界范围
@property (nonatomic) BMKMapRect visibleMapRect;
@end
/**
@brief 通过提供url模板的方法,提供数据源。不应该继承该类,且必须通过 initWithURLTemplate: 来初始化
*瓦片图片是jpeg或者png格式,size为256x256
*/
@interface BMKURLTileLayer : BMKTileLayer
/// 同initWithURLTemplate:中的URLTemplate
@property (readonly) NSString *URLTemplate;
/**
@brief 根据指定的URLTemplate生成tileOverlay
@param URLTemplate 是一个包含"{x}","{y}","{z}"的字符串,"{x}","{y}"表示tile的坐标,"{z}"表示当tile显示的级别。"{x}","{y}","{z}"会被tile的坐标值所替换,并生成用来加载tile图片数据的URL 。例如: http://server/path?x={x}&y={y}&z={z}。
@return 以指定的URLTemplate字符串生成tileOverlay
*/
- (id)initWithURLTemplate:(NSString *)URLTemplate;
/**
@brief 清除当前瓦片图层缓存图片
*/
- (BOOL)cleanTileDataCache;
@end
/**
@brief 通过同步方法获取瓦片数据,是一个抽象类,需要通过继承该类,并重载 tileForX:y:zoom: 方法
*瓦片图片是jpeg或者png格式,size为256x256
*/
@interface BMKSyncTileLayer : BMKTileLayer
/**
@brief 通过同步方法获取瓦片数据,子类必须实现该方法
这个方法会在多个线程中调用,需要考虑线程安全
@param x 瓦片坐标
@param y 瓦片坐标
@param zoom 瓦片坐标
@return (x, y, zoom)所对应瓦片的UIImage对象
*/
- (UIImage *)tileForX:(NSInteger)x y:(NSInteger)y zoom:(NSInteger)zoom;
@end
/**
@brief 通过异步方法获取瓦片数据,是一个抽象类,需要通过继承该类,并重载 loadTileForX:y:zoom:result: 方法
*瓦片图片是jpeg或者png格式,size为256x256
*/
@interface BMKAsyncTileLayer : BMKTileLayer
/**
@brief 通过异步方法获取瓦片数据,子类必须实现该方法
@param x 瓦片坐标
@param y 瓦片坐标
@param zoom 瓦片坐标
@param result 用来传入瓦片数据或加载瓦片失败的error访问的回调block
*/
- (void)loadTileForX:(NSInteger)x y:(NSInteger)y zoom:(NSInteger)zoom result:(void (^)(UIImage *tileImage, NSError *error))result;
@end
#endif /* BMKTileLayer_h */
//
// BMKTileLayerView.h
// MapComponent
//
// Created by wzy on 15/8/7.
// Copyright © 2015年 baidu. All rights reserved.
//
#ifndef BMKTileLayerView_h
#define BMKTileLayerView_h
#import "BMKOverlayView.h"
#import "BMKTileLayer.h"
/// 该类用于定义一个BMKTileLayerView
@interface BMKTileLayerView : BMKOverlayView
/**
*@brief 根据指定的tileLayer生成将tiles显示在地图上的View
*@param tileLayer 制定了覆盖图片,以及图片的覆盖区域
*@return 以tileLayer新生成View
*/
- (id)initWithTileLayer:(BMKTileLayer*) tileLayer;
/// 该View对应的tileLayer数据对象
@property (nonatomic, readonly) BMKTileLayer *tileLayer;
@end
#endif /* BMKTileLayerView_h */
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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