FMGLMapView

概述

地图核心类,提供地图描画、图层切换、缩放、标注、事件等功能

函数

-initWithFrame:

通过frame初始化地图对象

PARAMETERS

参数 类型 说明
frame CGRect 地图大小设置

RETURN VALUE

instancetype

-initWithFrame: styleURL:

通过frame和式样URL初始化地图对象

PARAMETERS

名称 类型 说明
frame CGRect 地图大小设置
styleURL NSURL 地图式样URL

RETURN VALUE

instancetype

-reloadStyle:

重新加载地图式样

PARAMETERS

名称 类型 说明
sender id 地图式样URL

RETURN VALUE

IBAction

-hasStyleClass:

判断是否有式样class

PARAMETERS

名称 类型 说明
styleClass NSString 地图式样

RETURN VALUE

BOOL

-addStyleClass:

添加式样class

PARAMETERS

名称 类型 说明
styleClass NSString 地图式样

RETURN VALUE

void

-removeStyleClass:

移除指定式样class

PARAMETERS

名称 类型 说明
styleClass NSString 地图式样

RETURN VALUE

void

-setUserTrackingMode: animated:

设置用于跟踪用户位置的模式

PARAMETERS

名称 类型 说明
mode FFMGLUserTrackingMode 定位跟踪模式
animated BOOL 动画效果

RETURN VALUE

void

-setUserLocationVerticalAlignment:animated:

设置用户位置注释对齐方式

PARAMETERS

名称 类型 说明
alignment FFMGLAnnotationVerticalAlignment 对齐方式
animated BOOL 动画效果

RETURN VALUE

void

-setTargetCoordinate:animated:

设置观察地理坐标

PARAMETERS

名称 类型 说明
targetCoordinate CLLocationCoordinate2D 坐标
animated BOOL 动画效果

RETURN VALUE

void

-setCenterCoordinate: animated:

设定地图中心坐标

PARAMETERS

名称 类型 说明
coordinate CLLocationCoordinate2D 坐标
animated BOOL 动画效果

RETURN VALUE

void

-setCenterCoordinate: zoomLevel: animated:

设定地图中心坐标、缩放级别

PARAMETERS

名称 类型 说明
centerCoordinate CLLocationCoordinate2D 坐标
zoomLevel double 缩放级别
animated BOOL 动画效果

RETURN VALUE

void

-setCenterCoordinate: zoomLevel: direction: animated:

设定地图中心坐标、缩放级别、朝向

PARAMETERS

名称 类型 说明
centerCoordinate CLLocationCoordinate2D 坐标
zoomLevel double 缩放级别
direction CLLocationDirection 偏移角度(正北逆时针)
animated BOOL 动画效果

RETURN VALUE

void

-setCenterCoordinate: zoomLevel: direction: animated:completionHandler:

设定地图中心坐标、缩放级别、朝向,在结束后调用一个处理(回调)

PARAMETERS

名称 类型 说明
centerCoordinate CLLocationCoordinate2D 坐标
zoomLevel double 缩放级别
direction CLLocationDirection 偏移角度(正北逆时针)
animated BOOL 动画效果
completion (nullable void (^)(void)) 设置结束回调

RETURN VALUE

void

-setZoomLevel: animated:

设定地图缩放级别

PARAMETERS

名称 类型 说明
zoomLevel double 缩放级别
animated BOOL 动画效果

RETURN VALUE

void

-setDirection: animated:

设定地图视角朝向

PARAMETERS

名称 类型 说明
direction CLLocationDirection 偏移角度(正北逆时针)
animated BOOL 动画效果

RETURN VALUE

void

-resetNorth

重设地图视角朝向(设置朝北)

PARAMETERS

名称 类型 说明

RETURN VALUE

void

-setVisibleCoordinateBounds: animated:

设定地图显示范围

PARAMETERS

名称 类型 说明
bounds FMGLCoordinateBounds 范围大小
animated BOOL 动画效果

RETURN VALUE

void

-setVisibleCoordinateBounds:edgePadding: animated:

设定设定地图显示范围和边距

PARAMETERS

名称 类型 说明
bounds FMGLCoordinateBounds 范围大小
insets UIEdgeInsets 边距
animated BOOL 动画效果

RETURN VALUE

void

-setVisibleCoordinates: count:edgePadding: animated:

地图根据给定的坐标和边距显示合适的窗口

PARAMETERS

名称 类型 说明
coordinates CLLocationCoordinate2D 坐标
count NSUInteger 坐标数量
insets UIEdgeInsets 边距
animated BOOL 动画效果

RETURN VALUE

void

-setVisibleCoordinates: count: edgePadding: direction: duration: animationTimingFunction: completionHandler:

地图根据给定的坐标,边距,角度,动画变化显示合适的窗口

PARAMETERS

名称 类型 说明
coordinates CLLocationCoordinate2D 坐标
count NSUInteger 坐标数量
insets UIEdgeInsets 边距
direction CLLocationDirection 偏移角度(正北逆时针)
duration NSTimeInterval 动画时间
function CAMediaTimingFunction 动画
completion (nullable void (^)(void)) 设置回调

RETURN VALUE

void

-showAnnotations: animated:

显示标注

PARAMETERS

名称 类型 说明
annotations NS_ARRAY_OF(id ) 标注
animated BOOL 动画效果

RETURN VALUE

void

-showAnnotations:edgePadding:animated:

显示可见区域内的标注

PARAMETERS

名称 类型 说明
annotations NS_ARRAY_OF(id ) 标注
insets UIEdgeInsets 边距
animated BOOL 动画效果

RETURN VALUE

void

-setCamera: animated:

移动视角点(镜头点)

PARAMETERS

名称 类型 说明
camera FMGLMapCamera 视角参数
animated BOOL 动画效果

RETURN VALUE

void

-setCamera: withDuration:animationTimingFunction:

定时移动视角点(镜头点)

PARAMETERS

名称 类型 说明
camera FMGLMapCamera 视角参数
duration NSTimeInterval 时间
function CAMediaTimingFunction 动画

RETURN VALUE

void

-setCamera: withDuration: animationTimingFunction: completionHandler:

定时移动视角点(镜头点),结束后调用一个处理(回调)

PARAMETERS

名称 类型 说明
camera FMGLMapCamera 视角参数
duration NSTimeInterval 时间
function CAMediaTimingFunction 动画
completion (nullable void (^)(void)) 回调

RETURN VALUE

void

-flyToCamera: completionHandler:

动画方式移动到另一个视角点,结束后调用一个处理(回调)

PARAMETERS

名称 类型 说明
camera FMGLMapCamera 视角参数
completion (nullable void (^)(void)) 回调

RETURN VALUE

void

-flyToCamera: withDuration: completionHandler:

动画方式移动到另一个视角点,动画持续时间可调,结束后调用一个处理(回调)

PARAMETERS

名称 类型 说明
camera FMGLMapCamera 视角参数
duration NSTimeInterval 时间
completion (nullable void (^)(void)) 回调

RETURN VALUE

void

-flyToCamera: withDuration: peakAltitude: completionHandler:

设置高度和时间移动视角,视角移动回调

PARAMETERS

名称 类型 说明
camera FMGLMapCamera 视角参数
duration NSTimeInterval 时间
peakAltitude CLLocationDistance 时间
completion (nullable void (^)(void)) 回调

RETURN VALUE

void

-cameraThatFitsCoordinateBounds:

返回给定边界的视角

PARAMETERS

名称 类型 说明
bounds FMGLCoordinateBounds 坐标范围

RETURN VALUE

FMGLMapCamera

-cameraThatFitsCoordinateBounds:edgePadding:

返回有边界填充的视角

PARAMETERS

名称 类型 说明
bounds FMGLCoordinateBounds 坐标范围
insets UIEdgeInsets 边界

RETURN VALUE

FMGLMapCamera

-anchorPointForGesture:

返回手势的锚点

PARAMETERS

名称 类型 说明
gesture UIGestureRecognizer 手势

RETURN VALUE

CGPoint

-setContentInset:animated:

设置地图边框填充

PARAMETERS

名称 类型 说明
contentInset UIEdgeInsets 边界
animated BOOL 动画

RETURN VALUE

void

-convertPoint: toCoordinateFromView:

屏幕坐标转换为地理坐标

PARAMETERS

名称 类型 说明
point CGPoint 视图坐标点
view UIView 视图

RETURN VALUE

CLLocationCoordinate2D

-convertCoordinate:toPointToView:

地理坐标转换为屏幕坐标

PARAMETERS

名称 类型 说明
coordinate CLLocationCoordinate2D 地理坐标点
view UIView 视图

RETURN VALUE

CGPoint

-convertRect: toCoordinateBoundsFromView:

屏幕区域转换为地理区域

PARAMETERS

名称 类型 说明
rect CGRect 范围参数
view UIView 视图

RETURN VALUE

FMGLCoordinateBounds

-convertCoordinateBounds: toRectToView:

地理区域转换为屏幕区域

PARAMETERS

名称 类型 说明
bounds FMGLCoordinateBounds 范围参数
view UIView 视图

RETURN VALUE

CGRect

-metersPerPointAtLatitude:

在指定纬度每个纬度点代表的长度(米)

PARAMETERS

名称 类型 说明
latitude CLLocationDegrees 纬度值

RETURN VALUE

CLLocationDistance

-addAnnotation:

添加标注(单个)

PARAMETERS

名称 类型 说明
annotation FFMGLAnnotation 标注

RETURN VALUE

void

-addAnnotations:

添加标注(多个)

PARAMETERS

名称 类型 说明
annotations NS_ARRAY_OF(id 一组标注

RETURN VALUE

void

-removeAnnotation:

移除标注(单个)

PARAMETERS

名称 类型 说明
annotation FFMGLAnnotation 标注

RETURN VALUE

void

-removeAnnotations:

移除标注(多个)

PARAMETERS

名称 类型 说明
annotations NS_ARRAY_OF(id 一组标注

RETURN VALUE

void

-viewForAnnotation:

返回指定标注对应的视图对象

PARAMETERS

名称 类型 说明
annotation FFMGLAnnotation 标注

RETURN VALUE

FFMGLAnnotationView

-dequeueReusableAnnotationImageWithIdentifier:

返回指定标注的图片对象

PARAMETERS

名称 类型 说明
identifier NSString 标识

RETURN VALUE

FFMGLAnnotationImage

-dequeueReusableAnnotationViewWithIdentifier:

返回指定标注对应的视图对象

PARAMETERS

名称 类型 说明
identifier NSString 标识

RETURN VALUE

FFMGLAnnotationView

-selectAnnotation: animated:

选择标注并显示气泡

PARAMETERS

名称 类型 说明
annotation FFMGLAnnotation 标注
animated BOOL 动画

RETURN VALUE

void

-deselectAnnotation: animated:

取消选中标注并关闭气泡

PARAMETERS

名称 类型 说明
annotation FFMGLAnnotation 标注
animated BOOL 动画

RETURN VALUE

void

-addOverlay:

追加overlay标注(单个)

PARAMETERS

名称 类型 说明
overlay FMGLOverlay 覆盖物

RETURN VALUE

void

-addOverlays:

追加overlay标注(多个)

PARAMETERS

名称 类型 说明
overlays NS_ARRAY_OF(id 一组覆盖物

RETURN VALUE

void

-removeOverlay:

移除overlay标注(单个)

PARAMETERS

名称 类型 说明
overlay FMGLOverlay 覆盖物

RETURN VALUE

void

-removeOverlays:

移除overlay标注(多个)

PARAMETERS

名称 类型 说明
overlays NS_ARRAY_OF(id 一组覆盖物

RETURN VALUE

void

-visibleFeaturesAtPoint:

返回与指定点相交的渲染数组

PARAMETERS

名称 类型 说明
point CGPoint 视图点坐标

RETURN VALUE

NS_ARRAY_OF (id )

-visibleFeaturesAtPoint:inStyleLayersWithIdentifiers:

返回指定图层标志中与指定点相交的渲染数组

PARAMETERS

名称 类型 说明
point CGPoint 视图点坐标
styleLayerIdentifiers NS_SET_OF(NSString *) 标识集合

RETURN VALUE

NS_ARRAY_OF (id )

-visibleFeaturesInRect:

返回指定rect范围内渲染数组

PARAMETERS

名称 类型 说明
rect CGRect rect范围

RETURN VALUE

NS_ARRAY_OF (id )

-visibleFeaturesInRect:inStyleLayersWithIdentifiers:

返回指定标志图层中与指定点相交的渲染数组

PARAMETERS

名称 类型 说明
rect CGRect rect范围
styleLayerIdentifiers NS_SET_OF(NSString *) 标识集合

RETURN VALUE

NS_ARRAY_OF (id )

-cycleDebugOptions

循环显示debug信息

PARAMETERS

名称 类型 说明

RETURN VALUE

void

-emptyMemoryCache

清空瓦片缓存

PARAMETERS

名称 类型 说明

RETURN VALUE

void

-resetPosition

重设地图位置、缩放级别、朝向

PARAMETERS

名称 类型 说明

RETURN VALUE

void

-ImportChartData: mapIdentifier:

离线地图导图,字典类型<string,[string]>

PARAMETERS

名称 类型 说明
mapfile NSDictionary 离线地图字典
mapId NSString id字段

RETURN VALUE

void

-clearDBCache

清除当前地图图层的缓存

PARAMETERS

名称 类型 说明

RETURN VALUE

void

-ShowScaleBar: fontColor: lineWidth: fontSize: anchorPoint:

设定比例尺条

PARAMETERS

名称 类型 说明
lColor UIColor 线颜色
fColor UIColor 字体颜色
Width float 线宽
Size float 字体大小
point CGPoint 坐标

RETURN VALUE

void

-HideScaleBar:

隐藏比例尺

PARAMETERS

名称 类型 说明
hide BOOL 是否隐藏

RETURN VALUE

void

属性

delegate

FFMGLMapViewDelegate委托的对象,FFMGLMapView通过此对象调用其函数(函数由SDK上层实现),包括标注、事件等函数

声明

@property(nonatomic, weak, nullable) IBOutlet id<FFMGLMapViewDelegate> delegate;

styleURL

保存式样URL

声明

@property (nonatomic, null_resettable) NSURL *styleURL;

compassView

指南针图标的对象(view、只读)

声明

@property (nonatomic, readonly) UIImageView *compassView;

compassView

指南针图标的对象(view、只读)

声明

@property (nonatomic, readonly) UIImageView *compassView;

compassView

指南针图标的对象(view、只读

声明

@property (nonatomic, readonly) UIImageView *compassView;

logoView

logo图标的对象(view、只读)

声明

@property (nonatomic, readonly) UIImageView *logoView;

attributionButton

属性按钮的对象(只读)

声明

@property (nonatomic, readonly) UIButton *attributionButton;

styleClasses

保存式样URL的数组

声明

@property (nonatomic) NS_ARRAY_OF(NSString *) *styleClasses;

showsUserLocation

地图是否显示用户位置

声明

@property (nonatomic, assign) BOOL showsUserLocation;

userLocationVisible

设备是否显示用户位置(只读)

声明

@property (nonatomic, assign, readonly, getter=isUserLocationVisible) BOOL userLocationVisible;

userLocation

用户位置的标注(只读)

声明

@property (nonatomic, readonly, nullable) FFMGLUserLocation *userLocation;

userTrackingMode

用户追踪模式

声明

@property (nonatomic, assign) FFMGLUserTrackingMode userTrackingMode;

userLocationVerticalAlignment

用户位置注释内容的垂直对齐

声明

@property (nonatomic, assign) FFMGLAnnotationVerticalAlignment userLocationVerticalAlignment;

displayHeadingCalibration

是否显示朝向校准警报

声明

@property (nonatomic, assign) BOOL displayHeadingCalibration;

targetCoordinate

用户观察对象的地理坐标

声明

@property (nonatomic, assign) CLLocationCoordinate2D targetCoordinate;

zoomEnabled

地图缩放是否有效

声明

@property(nonatomic, getter=isZoomEnabled) BOOL zoomEnabled;

scrollEnabled

地图拖动是否有效

声明

@property(nonatomic, getter=isScrollEnabled) BOOL scrollEnabled;

rotateEnabled

地图旋转是否有效

声明

@property(nonatomic, getter=isRotateEnabled) BOOL rotateEnabled;

pitchEnabled

地图倾斜(3D视角)是否有效

声明

@property(nonatomic, getter=isPitchEnabled) BOOL pitchEnabled;

centerCoordinate

地图中心坐标

声明

@property (nonatomic) CLLocationCoordinate2D centerCoordinate;

zoomLevel

缩放级别

声明

@property (nonatomic) double zoomLevel;

minimumZoomLevel

地图最小缩放级别

声明

@property (nonatomic) double minimumZoomLevel;

maximumZoomLevel

地图最大缩放级别

声明

@property (nonatomic) double maximumZoomLevel;

direction

地图朝向

声明

@property (nonatomic) CLLocationDirection direction;

visibleCoordinateBounds

地图可见的边界区域

声明

@property (nonatomic) FMGLCoordinateBounds visibleCoordinateBounds;

camera

视角点(镜头点)

声明

@property (nonatomic, copy) FMGLMapCamera *camera;

contentInset

地图视图边框边距

声明

@property (nonatomic, assign) UIEdgeInsets contentInset;

annotations

标注列表

声明

@property (nonatomic, readonly, nullable) NS_ARRAY_OF(id <FFMGLAnnotation>) *annotations;

selectedAnnotations

当前选择的标注

声明

@property (nonatomic, copy) NS_ARRAY_OF(id <FFMGLAnnotation>) *selectedAnnotations;

debugActive

是否显示debug信息

声明

@property (nonatomic, getter=isDebugActive) BOOL debugActive;

results matching ""

    No results matching ""