Formatting Objective-C and Objective-C++ (#2492)

This commit is contained in:
Bart Louwers
2024-06-11 19:01:50 +02:00
committed by GitHub
parent 7437d800f6
commit 7b09da234a
153 changed files with 3099 additions and 2694 deletions

View File

@@ -8,7 +8,8 @@ NS_ASSUME_NONNULL_BEGIN
@interface MLNAnnotationContainerView : UIView
+ (instancetype)annotationContainerViewWithAnnotationContainerView:(MLNAnnotationContainerView *)annotationContainerView;
+ (instancetype)annotationContainerViewWithAnnotationContainerView:
(MLNAnnotationContainerView *)annotationContainerView;
- (void)addSubviews:(NSArray<MLNAnnotationView *> *)subviews;

View File

@@ -9,10 +9,10 @@ NS_ASSUME_NONNULL_BEGIN
annotations visually on a map view. Annotation image objects wrap `UIImage`
objects and may be recycled later and put into a reuse queue that is maintained
by the map view.
#### Related examples
TODO: Mark a place on the map with an image, learn how use an image
as a marker using `MLNAnnotationImage`.
as a marker using `MLNAnnotationImage`.
*/
MLN_EXPORT
@interface MLNAnnotationImage : NSObject <NSSecureCoding>
@@ -28,7 +28,8 @@ MLN_EXPORT
@return The initialized annotation image object or `nil` if there was a problem
initializing the object.
*/
+ (instancetype)annotationImageWithImage:(UIImage *)image reuseIdentifier:(NSString *)reuseIdentifier;
+ (instancetype)annotationImageWithImage:(UIImage *)image
reuseIdentifier:(NSString *)reuseIdentifier;
// MARK: Getting and Setting Attributes

View File

@@ -8,34 +8,34 @@ NS_ASSUME_NONNULL_BEGIN
/** These constants indicate the current drag state of an annotation view. */
typedef NS_ENUM(NSUInteger, MLNAnnotationViewDragState) {
/**
The view is not involved in a drag operation.
*/
MLNAnnotationViewDragStateNone = 0,
/**
An action occurred that indicated the view should begin dragging.
/**
The view is not involved in a drag operation.
*/
MLNAnnotationViewDragStateNone = 0,
/**
An action occurred that indicated the view should begin dragging.
The map view automatically moves draggable annotation views to this state
in response to the dragging the view after pressing and holding on it.
*/
MLNAnnotationViewDragStateStarting,
/**
The view is in the midst of a drag operation and is actively tracking the
user’s gesture.
*/
MLNAnnotationViewDragStateDragging,
/**
An action occurred that indicated the view should cancel the drag
operation.
*/
MLNAnnotationViewDragStateCanceling,
/**
An action occurred that indicated the view was dropped by the user.
The map view automatically moves draggable annotation views to this state
in response to the dragging the view after pressing and holding on it.
*/
MLNAnnotationViewDragStateStarting,
/**
The view is in the midst of a drag operation and is actively tracking the
user’s gesture.
*/
MLNAnnotationViewDragStateDragging,
/**
An action occurred that indicated the view should cancel the drag
operation.
*/
MLNAnnotationViewDragStateCanceling,
/**
An action occurred that indicated the view was dropped by the user.
The map view automatically moves annotation views to this state in response
to the user lifting their finger at the end of a drag gesture.
*/
MLNAnnotationViewDragStateEnding,
The map view automatically moves annotation views to this state in response
to the user lifting their finger at the end of a drag gesture.
*/
MLNAnnotationViewDragStateEnding,
};
/**
@@ -78,7 +78,7 @@ MLN_EXPORT
/**
Initializes and returns a new annotation view object.
Providing an annotation allows you to explicitly associate the annotation instance
with the new view and, in custom subclasses of `MLNAnnotationView`, customize the view
based on properties of the annotation instance in an overridden initializer. However,
@@ -86,16 +86,16 @@ MLN_EXPORT
same annotation they were initialized with. Also, annotation views that are in
the reuse queue will have a nil value for the annotation property. Passing an annotation
instance to the view is optional and the map view will automatically associate annotations
with views when views are provided to the map via the `-[MLNMapViewDelegate mapView:viewForAnnotation:]`
method.
with views when views are provided to the map via the `-[MLNMapViewDelegate
mapView:viewForAnnotation:]` method.
The reuse identifier provides a way for you to improve performance by recycling
annotation views as they enter and leave the map’s viewport. As an annotation
leaves the viewport, the map view moves its associated view to a reuse queue.
When a new annotation becomes visible, you can request a view for that
annotation by passing the appropriate reuse identifier string to the
`-[MLNMapView dequeueReusableAnnotationViewWithIdentifier:]` method.
@param annotation The annotation object to associate with the new view.
@param reuseIdentifier A unique string identifier for this view that allows you
to reuse this view with multiple similar annotations. You can set this
@@ -104,7 +104,8 @@ MLN_EXPORT
views.
@return The initialized annotation view object.
*/
- (instancetype)initWithAnnotation:(nullable id<MLNAnnotation>)annotation reuseIdentifier:(nullable NSString *)reuseIdentifier;
- (instancetype)initWithAnnotation:(nullable id<MLNAnnotation>)annotation
reuseIdentifier:(nullable NSString *)reuseIdentifier;
/**
Called when the view is removed from the reuse queue.
@@ -122,7 +123,7 @@ MLN_EXPORT
contains a non-`nil` value while the annotation view is visible on the map. If
the view is queued, waiting to be reused, the value is `nil`.
*/
@property (nonatomic, nullable) id <MLNAnnotation> annotation;
@property (nonatomic, nullable) id<MLNAnnotation> annotation;
/**
The string that identifies that this annotation view is reusable.
@@ -222,7 +223,7 @@ MLN_EXPORT
if it should display itself as unselected.
@param animated `YES` if the change in selection state is animated; `NO` if the
change is immediate.
#### Related examples
TODO: modify an `MLNAnnotationView`'s behavior when it is selected.
*/
@@ -253,7 +254,7 @@ MLN_EXPORT
attempting to stop an operation that has already been initiated; doing so can
lead to undefined behavior. Once begun, the drag operation should always
continue to completion.
#### Related examples
TODO: Enable users to drag `MLNAnnotationView` objects on your map.
*/
@@ -275,7 +276,8 @@ MLN_EXPORT
drags it. As the system detects user actions that would indicate a drag, it
calls this method to update the drag state.
*/
- (void)setDragState:(MLNAnnotationViewDragState)dragState animated:(BOOL)animated NS_REQUIRES_SUPER;
- (void)setDragState:(MLNAnnotationViewDragState)dragState
animated:(BOOL)animated NS_REQUIRES_SUPER;
@end

View File

@@ -1,5 +1,5 @@
#import "MLNAnnotationView.h"
#import "MLNAnnotation.h"
#import "MLNAnnotationView.h"
NS_ASSUME_NONNULL_BEGIN

View File

@@ -9,10 +9,10 @@ NS_ASSUME_NONNULL_BEGIN
/**
A protocol for a `UIView` subclass that displays information about a selected
annotation near that annotation.
To receive updates from an object that conforms to the `MLNCalloutView` protocol,
use the optional methods available in the `MLNCalloutViewDelegate` protocol.
#### Related examples
TODO: Display custom views as callouts by customizing an
`MLNCalloutView`.
@@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
An object conforming to the `MLNAnnotation` protocol whose details this callout
view displays.
*/
@property (nonatomic, strong) id <MLNAnnotation> representedObject;
@property (nonatomic, strong) id<MLNAnnotation> representedObject;
/**
A view that the user may tap to perform an action. This view is conventionally
@@ -47,14 +47,21 @@ NS_ASSUME_NONNULL_BEGIN
Presents a callout view by adding it to `view` and pointing at the given rect
of `view`’s bounds. Constrains the callout to the bounds of the given view.
*/
- (void)presentCalloutFromRect:(CGRect)rect inView:(UIView *)view constrainedToView:(UIView *)constrainedView animated:(BOOL)animated __attribute__((unavailable("Use `-presentCalloutFromRect:inView:constrainedToRect:animated:` instead.")));
- (void)presentCalloutFromRect:(CGRect)rect
inView:(UIView *)view
constrainedToView:(UIView *)constrainedView
animated:(BOOL)animated
__attribute__((
unavailable("Use `-presentCalloutFromRect:inView:constrainedToRect:animated:` instead.")));
/**
Presents a callout view by adding it to `view` and pointing at the given rect
of `view`’s bounds. Constrains the callout to the rect in the space of `view`.
*/
- (void)presentCalloutFromRect:(CGRect)rect inView:(UIView *)view constrainedToRect:(CGRect)constrainedRect animated:(BOOL)animated;
- (void)presentCalloutFromRect:(CGRect)rect
inView:(UIView *)view
constrainedToRect:(CGRect)constrainedRect
animated:(BOOL)animated;
/**
Dismisses the callout view.
@@ -67,19 +74,20 @@ NS_ASSUME_NONNULL_BEGIN
If implemented, should provide margins to expand the rect the callout is presented from.
These are used to determine positioning. Currently only the top and bottom properties of the return
value are used. For example, `{ .top = -50.0, .left = -10.0, .bottom = 0.0, .right = -10.0 }` indicates
a 50 point margin above the presentation origin rect (and 10 point margins to the left and the right)
in which the callout is assumed to be displayed.
value are used. For example, `{ .top = -50.0, .left = -10.0, .bottom = 0.0, .right = -10.0 }`
indicates a 50 point margin above the presentation origin rect (and 10 point margins to the left
and the right) in which the callout is assumed to be displayed.
There are no assumed defaults for these margins, as they should be calculated from the callout that
is to be presented. For example, `SMCalloutView` generates the top margin from the callout height, but
the left and right margins from a minimum width that the callout should have.
is to be presented. For example, `SMCalloutView` generates the top margin from the callout height,
but the left and right margins from a minimum width that the callout should have.
@param rect Rect that the callout is presented from. This should be the same as the one passed in
`-[MLNCalloutView presentCalloutFromRect:inView:constrainedToRect:animated:]`
@return `UIEdgeInsets` representing the margins. Values should be negative.
*/
- (UIEdgeInsets)marginInsetsHintForPresentationFromRect:(CGRect)rect NS_SWIFT_NAME(marginInsetsHintForPresentation(from:));
- (UIEdgeInsets)marginInsetsHintForPresentationFromRect:(CGRect)rect
NS_SWIFT_NAME(marginInsetsHintForPresentation(from:));
/**
A Boolean value indicating whether the callout view should be anchored to

View File

@@ -12,7 +12,8 @@
- `-mapView:regionDidChangeWithReason:animated:`
It's important to note that it's almost impossible to perform a rotate without zooming (in or out),
so if you'll often find `MLNCameraChangeReasonGesturePinch` set alongside `MLNCameraChangeReasonGestureRotate`.
so if you'll often find `MLNCameraChangeReasonGesturePinch` set alongside
`MLNCameraChangeReasonGestureRotate`.
Since there are several reasons why a zoom or rotation has occurred, it is worth considering
creating a combined constant, for example:
@@ -23,43 +24,44 @@
MLNCameraChangeReasonGestureZoomOut |
MLNCameraChangeReasonGestureOneFingerZoom;
static const MLNCameraChangeReason anyRotation = MLNCameraChangeReasonResetNorth | MLNCameraChangeReasonGestureRotate;
static const MLNCameraChangeReason anyRotation = MLNCameraChangeReasonResetNorth |
MLNCameraChangeReasonGestureRotate;
```
*/
typedef NS_OPTIONS(NSUInteger, MLNCameraChangeReason)
{
/// :nodoc: The reason for the camera change has not be specified.
MLNCameraChangeReasonNone = 0,
typedef NS_OPTIONS(NSUInteger, MLNCameraChangeReason) {
/// :nodoc: The reason for the camera change has not be specified.
MLNCameraChangeReasonNone = 0,
/// :nodoc: Set when a public API that moves the camera is called. This may be set for some gestures,
/// for example MLNCameraChangeReasonResetNorth.
MLNCameraChangeReasonProgrammatic = 1 << 0,
/// :nodoc: Set when a public API that moves the camera is called. This may be set for some
/// gestures, for example MLNCameraChangeReasonResetNorth.
MLNCameraChangeReasonProgrammatic = 1 << 0,
/// :nodoc: The user tapped the compass to reset the map orientation so North is up.
MLNCameraChangeReasonResetNorth = 1 << 1,
/// :nodoc: The user tapped the compass to reset the map orientation so North is up.
MLNCameraChangeReasonResetNorth = 1 << 1,
/// :nodoc: The user panned the map.
MLNCameraChangeReasonGesturePan = 1 << 2,
/// :nodoc: The user panned the map.
MLNCameraChangeReasonGesturePan = 1 << 2,
/// :nodoc: The user pinched to zoom in/out.
MLNCameraChangeReasonGesturePinch = 1 << 3,
/// :nodoc: The user pinched to zoom in/out.
MLNCameraChangeReasonGesturePinch = 1 << 3,
// :nodoc: The user rotated the map.
MLNCameraChangeReasonGestureRotate = 1 << 4,
// :nodoc: The user rotated the map.
MLNCameraChangeReasonGestureRotate = 1 << 4,
/// :nodoc: The user zoomed the map in (one finger double tap).
MLNCameraChangeReasonGestureZoomIn = 1 << 5,
/// :nodoc: The user zoomed the map in (one finger double tap).
MLNCameraChangeReasonGestureZoomIn = 1 << 5,
/// :nodoc: The user zoomed the map out (two finger single tap).
MLNCameraChangeReasonGestureZoomOut = 1 << 6,
/// :nodoc: The user zoomed the map out (two finger single tap).
MLNCameraChangeReasonGestureZoomOut = 1 << 6,
/// :nodoc: The user long pressed on the map for a quick zoom (single tap, then long press and drag up/down).
MLNCameraChangeReasonGestureOneFingerZoom = 1 << 7,
/// :nodoc: The user long pressed on the map for a quick zoom (single tap, then long press and
/// drag up/down).
MLNCameraChangeReasonGestureOneFingerZoom = 1 << 7,
// :nodoc: The user panned with two fingers to tilt the map (two finger drag).
MLNCameraChangeReasonGestureTilt = 1 << 8,
// :nodoc: The user panned with two fingers to tilt the map (two finger drag).
MLNCameraChangeReasonGestureTilt = 1 << 8,
// :nodoc: Cancelled
MLNCameraChangeReasonTransitionCancelled = 1 << 16
// :nodoc: Cancelled
MLNCameraChangeReasonTransitionCancelled = 1 << 16
};

View File

@@ -1,5 +1,5 @@
#import "SMCalloutView.h"
#import "MLNCalloutView.h"
#import "SMCalloutView.h"
/**
A concrete implementation of `MLNCalloutView` based on

View File

@@ -13,7 +13,8 @@ MLN_EXPORT
/**
The visibility of the compass button.
You can configure a compass button to be visible all the time or only when the compass heading changes.
You can configure a compass button to be visible all the time or only when the compass heading
changes.
*/
@property (nonatomic, assign) MLNOrnamentVisibility compassVisibility;

View File

@@ -21,7 +21,9 @@ MLN_EXPORT
/** The tag of the annotation represented by this element. */
@property (nonatomic) MLNAnnotationTag tag;
- (instancetype)initWithAccessibilityContainer:(id)container tag:(MLNAnnotationTag)identifier NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithAccessibilityContainer:(id)container
tag:(MLNAnnotationTag)identifier
NS_DESIGNATED_INITIALIZER;
@end
@@ -30,9 +32,10 @@ MLN_EXPORT
@interface MLNFeatureAccessibilityElement : MLNMapAccessibilityElement
/** The feature represented by this element. */
@property (nonatomic, strong) id <MLNFeature> feature;
@property (nonatomic, strong) id<MLNFeature> feature;
- (instancetype)initWithAccessibilityContainer:(id)container feature:(id <MLNFeature>)feature NS_DESIGNATED_INITIALIZER;
- (instancetype)initWithAccessibilityContainer:(id)container
feature:(id<MLNFeature>)feature NS_DESIGNATED_INITIALIZER;
@end

View File

@@ -18,7 +18,7 @@ MLN_EXPORT
@param mapView The map view the camera state to use for the initialization.
@return An initialized map projection.
*/
- (instancetype)initWithMapView:(MLNMapView*)mapView;
- (instancetype)initWithMapView:(MLNMapView *)mapView;
/**
A camera representing the current projection state
@@ -32,9 +32,9 @@ MLN_EXPORT
@param insets The insets applied on top of the camera be used in the projection calculation.
@note `MLNMapView` instance frame must not be changed since this projection is initialized,
otherwise the calculation may be wrong.
otherwise the calculation may be wrong.
*/
- (void)setCamera:(MLNMapCamera * _Nonnull)camera withEdgeInsets:(UIEdgeInsets)insets;
- (void)setCamera:(MLNMapCamera *_Nonnull)camera withEdgeInsets:(UIEdgeInsets)insets;
/**
Change the projection state to make the provided bounds visible with the specified inset.

View File

@@ -19,7 +19,7 @@ NS_ASSUME_NONNULL_BEGIN
// strips out the two underscores for display.
@property (nonatomic, nullable) IBInspectable NSString *styleURL__;
#endif // TARGET_INTERFACE_BUILDER
#endif // TARGET_INTERFACE_BUILDER
// Convenience properties related to the initial viewport. These properties
// are not meant to be used outside of Interface Builder. latitude and longitude

View File

@@ -4,78 +4,76 @@
#import "MLNBackendResource.h"
#import <UIKit/UIView.h>
#import <UIKit/UIImage.h>
#import <QuartzCore/CALayer.h>
#import <UIKit/UIImage.h>
#import <UIKit/UIView.h>
@class MLNMapView;
class MLNMapViewImpl : public mbgl::MapObserver {
public:
static std::unique_ptr<MLNMapViewImpl> Create(MLNMapView*);
public:
static std::unique_ptr<MLNMapViewImpl> Create(MLNMapView*);
MLNMapViewImpl(MLNMapView*);
virtual ~MLNMapViewImpl() = default;
MLNMapViewImpl(MLNMapView*);
virtual ~MLNMapViewImpl() = default;
virtual mbgl::gfx::RendererBackend& getRendererBackend() = 0;
virtual mbgl::gfx::RendererBackend& getRendererBackend() = 0;
// Returns a handle to the OpenGL context object if this view is rendered with OpenGL.
virtual EAGLContext* getEAGLContext() {
return nullptr;
}
// Returns a handle to the OpenGL context object if this view is rendered with OpenGL.
virtual EAGLContext* getEAGLContext() { return nullptr; }
// Gets called when the opaqueness of the view changes.
virtual void setOpaque(bool) = 0;
// Gets called when the opaqueness of the view changes.
virtual void setOpaque(bool) = 0;
// Triggers an immediate render of the underlying view.
virtual void display() = 0;
// Triggers an immediate render of the underlying view.
virtual void display() = 0;
// We update the transaction mode when the user adds annotation views that need to be layered on
// top of the view.
virtual void setPresentsWithTransaction(bool) = 0;
// We update the transaction mode when the user adds annotation views that need to be layered on
// top of the view.
virtual void setPresentsWithTransaction(bool) = 0;
// Called when initially creating the rendering view, and when resuming rendering after returning
// from the background.
virtual void createView() = 0;
// Called when initially creating the rendering view, and when resuming rendering after returning
// from the background.
virtual void createView() = 0;
// We expose the underlying UIView because we need it in order to add annotation views above it.
virtual UIView* getView() = 0;
// We expose the underlying UIView because we need it in order to add annotation views above it.
virtual UIView* getView() = 0;
// Called when the application goes to the background and we've replaced the interactively
// rendered map view with a static image.
virtual void deleteView() = 0;
// Called when the application goes to the background and we've replaced the interactively
// rendered map view with a static image.
virtual void deleteView() = 0;
// called before the application goes to the background. The resulting image is used as a place
// holder instead of the regular view. This allows us to drop the framebuffers associated with
// the rendering context and reduce memory while in the background.
virtual UIImage* snapshot() = 0;
// called before the application goes to the background. The resulting image is used as a place
// holder instead of the regular view. This allows us to drop the framebuffers associated with
// the rendering context and reduce memory while in the background.
virtual UIImage* snapshot() = 0;
// Called when UIView's layout has changed.
virtual void layoutChanged() {};
// Called when UIView's layout has changed.
virtual void layoutChanged() {};
// Called by the view delegate when it's time to render.
void render();
// Called by the view delegate when it's time to render.
void render();
virtual MLNBackendResource getObject() = 0;
virtual MLNBackendResource getObject() = 0;
// mbgl::MapObserver implementation
void onCameraWillChange(mbgl::MapObserver::CameraChangeMode) override;
void onCameraIsChanging() override;
void onCameraDidChange(mbgl::MapObserver::CameraChangeMode) override;
void onWillStartLoadingMap() override;
void onDidFinishLoadingMap() override;
void onDidFailLoadingMap(mbgl::MapLoadError mapError, const std::string& what) override;
void onWillStartRenderingFrame() override;
void onDidFinishRenderingFrame(mbgl::MapObserver::RenderFrameStatus) override;
void onWillStartRenderingMap() override;
void onDidFinishRenderingMap(mbgl::MapObserver::RenderMode) override;
void onDidFinishLoadingStyle() override;
void onSourceChanged(mbgl::style::Source& source) override;
void onDidBecomeIdle() override;
void onStyleImageMissing(const std::string& imageIdentifier) override;
bool onCanRemoveUnusedStyleImage(const std::string& imageIdentifier) override;
// mbgl::MapObserver implementation
void onCameraWillChange(mbgl::MapObserver::CameraChangeMode) override;
void onCameraIsChanging() override;
void onCameraDidChange(mbgl::MapObserver::CameraChangeMode) override;
void onWillStartLoadingMap() override;
void onDidFinishLoadingMap() override;
void onDidFailLoadingMap(mbgl::MapLoadError mapError, const std::string& what) override;
void onWillStartRenderingFrame() override;
void onDidFinishRenderingFrame(mbgl::MapObserver::RenderFrameStatus) override;
void onWillStartRenderingMap() override;
void onDidFinishRenderingMap(mbgl::MapObserver::RenderMode) override;
void onDidFinishLoadingStyle() override;
void onSourceChanged(mbgl::style::Source& source) override;
void onDidBecomeIdle() override;
void onStyleImageMissing(const std::string& imageIdentifier) override;
bool onCanRemoveUnusedStyleImage(const std::string& imageIdentifier) override;
protected:
/// Cocoa map view that this adapter bridges to.
__weak MLNMapView *mapView = nullptr;
protected:
/// Cocoa map view that this adapter bridges to.
__weak MLNMapView* mapView = nullptr;
};

View File

@@ -8,45 +8,41 @@
/// Adapter responsible for bridging calls from mbgl to MLNMapView and Cocoa.
class MLNMapViewMetalImpl final : public MLNMapViewImpl,
public mbgl::mtl::RendererBackend,
public mbgl::gfx::Renderable {
public:
MLNMapViewMetalImpl(MLNMapView*);
~MLNMapViewMetalImpl() override;
public mbgl::mtl::RendererBackend,
public mbgl::gfx::Renderable {
public:
MLNMapViewMetalImpl(MLNMapView*);
~MLNMapViewMetalImpl() override;
public:
void restoreFramebufferBinding();
public:
void restoreFramebufferBinding();
// Implementation of mbgl::gfx::RendererBackend
public:
mbgl::gfx::Renderable& getDefaultRenderable() override {
return *this;
}
// Implementation of mbgl::gfx::RendererBackend
public:
mbgl::gfx::Renderable& getDefaultRenderable() override { return *this; }
private:
void activate() override;
void deactivate() override;
// End implementation of mbgl::gfx::RendererBackend
private:
void activate() override;
void deactivate() override;
// End implementation of mbgl::gfx::RendererBackend
// Implementation of mbgl::gl::RendererBackend
public:
void updateAssumedState() override;
// End implementation of mbgl::gl::Rendererbackend
// Implementation of mbgl::gl::RendererBackend
public:
void updateAssumedState() override;
// End implementation of mbgl::gl::Rendererbackend
// Implementation of MLNMapViewImpl
public:
mbgl::gfx::RendererBackend& getRendererBackend() override {
return *this;
}
// Implementation of MLNMapViewImpl
public:
mbgl::gfx::RendererBackend& getRendererBackend() override { return *this; }
void setOpaque(bool) override;
void display() override;
void setPresentsWithTransaction(bool) override;
void createView() override;
UIView* getView() override;
void deleteView() override;
UIImage* snapshot() override;
void layoutChanged() override;
MLNBackendResource getObject() override;
// End implementation of MLNMapViewImpl
void setOpaque(bool) override;
void display() override;
void setPresentsWithTransaction(bool) override;
void createView() override;
UIView* getView() override;
void deleteView() override;
UIImage* snapshot() override;
void layoutChanged() override;
MLNBackendResource getObject() override;
// End implementation of MLNMapViewImpl
};

View File

@@ -10,52 +10,48 @@
class MLNMapViewOpenGLImpl final : public MLNMapViewImpl,
public mbgl::gl::RendererBackend,
public mbgl::gfx::Renderable {
public:
MLNMapViewOpenGLImpl(MLNMapView*);
~MLNMapViewOpenGLImpl() override;
public:
MLNMapViewOpenGLImpl(MLNMapView*);
~MLNMapViewOpenGLImpl() override;
public:
void restoreFramebufferBinding();
public:
void restoreFramebufferBinding();
#ifdef MLN_RECREATE_GL_IN_AN_EMERGENCY
private:
void emergencyRecreateGL();
private:
void emergencyRecreateGL();
#endif
// Implementation of mbgl::gfx::RendererBackend
public:
mbgl::gfx::Renderable& getDefaultRenderable() override {
return *this;
}
// Implementation of mbgl::gfx::RendererBackend
public:
mbgl::gfx::Renderable& getDefaultRenderable() override { return *this; }
private:
void activate() override;
void deactivate() override;
// End implementation of mbgl::gfx::RendererBackend
private:
void activate() override;
void deactivate() override;
// End implementation of mbgl::gfx::RendererBackend
// Implementation of mbgl::gl::RendererBackend
public:
void updateAssumedState() override;
// Implementation of mbgl::gl::RendererBackend
public:
void updateAssumedState() override;
private:
mbgl::gl::ProcAddress getExtensionFunctionPointer(const char* name) override;
// End implementation of mbgl::gl::Rendererbackend
private:
mbgl::gl::ProcAddress getExtensionFunctionPointer(const char* name) override;
// End implementation of mbgl::gl::Rendererbackend
// Implementation of MLNMapViewImpl
public:
mbgl::gfx::RendererBackend& getRendererBackend() override {
return *this;
}
// Implementation of MLNMapViewImpl
public:
mbgl::gfx::RendererBackend& getRendererBackend() override { return *this; }
EAGLContext* getEAGLContext() override;
void setOpaque(bool) override;
void display() override;
void setPresentsWithTransaction(bool) override;
void createView() override;
UIView* getView() override;
void deleteView() override;
UIImage* snapshot() override;
void layoutChanged() override;
MLNBackendResource getObject() override;
// End implementation of MLNMapViewImpl
EAGLContext* getEAGLContext() override;
void setOpaque(bool) override;
void display() override;
void setPresentsWithTransaction(bool) override;
void createView() override;
UIView* getView() override;
void deleteView() override;
UIImage* snapshot() override;
void layoutChanged() override;
MLNBackendResource getObject() override;
// End implementation of MLNMapViewImpl
};

View File

@@ -1,12 +1,12 @@
#import <UIKit/UIKit.h>
#import "MLNBackendResource.h"
#import "MLNCompassButton.h"
#import "MLNFoundation.h"
#import "MLNGeometry.h"
#import "MLNMapCamera.h"
#import "MLNTypes.h"
#import "MLNStyle.h"
#import "MLNBackendResource.h"
#import "MLNTypes.h"
NS_ASSUME_NONNULL_BEGIN
@@ -42,12 +42,12 @@ FOUNDATION_EXTERN MLN_EXPORT const MLNMapViewDecelerationRate MLNMapViewDecelera
`MLNMapView.userLocationVerticalAlignment`.
*/
typedef NS_ENUM(NSUInteger, MLNAnnotationVerticalAlignment) {
/** Aligns the annotation vertically in the center of the map view. */
MLNAnnotationVerticalAlignmentCenter = 0,
/** Aligns the annotation vertically at the top of the map view. */
MLNAnnotationVerticalAlignmentTop,
/** Aligns the annotation vertically at the bottom of the map view. */
MLNAnnotationVerticalAlignmentBottom,
/** Aligns the annotation vertically in the center of the map view. */
MLNAnnotationVerticalAlignmentCenter = 0,
/** Aligns the annotation vertically at the top of the map view. */
MLNAnnotationVerticalAlignmentTop,
/** Aligns the annotation vertically at the bottom of the map view. */
MLNAnnotationVerticalAlignmentBottom,
};
/**
@@ -58,14 +58,14 @@ typedef NS_ENUM(NSUInteger, MLNAnnotationVerticalAlignment) {
`MLNMapView.attributionButtonPosition`.
*/
typedef NS_ENUM(NSUInteger, MLNOrnamentPosition) {
/** Place the ornament in the top left of the map view. */
MLNOrnamentPositionTopLeft = 0,
/** Place the ornament in the top right of the map view. */
MLNOrnamentPositionTopRight,
/** Place the ornament in the bottom left of the map view. */
MLNOrnamentPositionBottomLeft,
/** Place the ornament in the bottom right of the map view. */
MLNOrnamentPositionBottomRight,
/** Place the ornament in the top left of the map view. */
MLNOrnamentPositionTopLeft = 0,
/** Place the ornament in the top right of the map view. */
MLNOrnamentPositionTopRight,
/** Place the ornament in the bottom left of the map view. */
MLNOrnamentPositionBottomLeft,
/** Place the ornament in the bottom right of the map view. */
MLNOrnamentPositionBottomRight,
};
/**
@@ -77,42 +77,42 @@ typedef NS_ENUM(NSUInteger, MLNOrnamentPosition) {
how each mode behaves.
*/
typedef NS_ENUM(NSUInteger, MLNUserTrackingMode) {
/** The map does not follow the user location. */
MLNUserTrackingModeNone = 0,
/** The map follows the user location. This tracking mode falls back
to `MLNUserTrackingModeNone` if the user pans the map view. */
MLNUserTrackingModeFollow,
/**
The map follows the user location and rotates when the heading changes.
The default user location annotation displays a fan-shaped indicator with
the current heading. The heading indicator represents the direction the
device is facing, which is sized according to the reported accuracy.
/** The map does not follow the user location. */
MLNUserTrackingModeNone = 0,
/** The map follows the user location. This tracking mode falls back
to `MLNUserTrackingModeNone` if the user pans the map view. */
MLNUserTrackingModeFollow,
/**
The map follows the user location and rotates when the heading changes.
The default user location annotation displays a fan-shaped indicator with
the current heading. The heading indicator represents the direction the
device is facing, which is sized according to the reported accuracy.
This tracking mode is disabled if the user pans the map view, but
remains enabled if the user zooms in. If the user rotates the map
view, this tracking mode will fall back to `MLNUserTrackingModeFollow`.
*/
MLNUserTrackingModeFollowWithHeading,
/**
The map follows the user location and rotates when the course changes.
Course represents the direction in which the device is traveling.
The default user location annotation shows a puck-shaped indicator
that rotates as the course changes.
This tracking mode is disabled if the user pans the map view, but
remains enabled if the user zooms in. If the user rotates the map
view, this tracking mode will fall back to `MLNUserTrackingModeFollow`.
*/
MLNUserTrackingModeFollowWithHeading,
/**
The map follows the user location and rotates when the course changes.
Course represents the direction in which the device is traveling.
The default user location annotation shows a puck-shaped indicator
that rotates as the course changes.
This tracking mode is disabled if the user pans the map view, but
remains enabled if the user zooms in. If the user rotates the map view,
this tracking mode will fall back to `MLNUserTrackingModeFollow`.
*/
MLNUserTrackingModeFollowWithCourse,
This tracking mode is disabled if the user pans the map view, but
remains enabled if the user zooms in. If the user rotates the map view,
this tracking mode will fall back to `MLNUserTrackingModeFollow`.
*/
MLNUserTrackingModeFollowWithCourse,
};
typedef NS_ENUM(NSUInteger, MLNPanScrollingMode) {
/** The map allows the user to only scroll horizontally. */
MLNPanScrollingModeHorizontal = 0,
/** The map allows the user to only scroll vertically. */
MLNPanScrollingModeVertical,
/** The map allows the user to scroll both horizontally and vertically. */
MLNPanScrollingModeDefault
/** The map allows the user to only scroll horizontally. */
MLNPanScrollingModeHorizontal = 0,
/** The map allows the user to only scroll vertically. */
MLNPanScrollingModeVertical,
/** The map allows the user to scroll both horizontally and vertically. */
MLNPanScrollingModeDefault
};
/** Options for `MLNMapView.preferredFramesPerSecond`. */
@@ -122,15 +122,19 @@ typedef NSInteger MLNMapViewPreferredFramesPerSecond NS_TYPED_EXTENSIBLE_ENUM;
The default frame rate. This can be either 30 FPS or 60 FPS, depending on
device capabilities.
*/
FOUNDATION_EXTERN MLN_EXPORT const MLNMapViewPreferredFramesPerSecond MLNMapViewPreferredFramesPerSecondDefault;
FOUNDATION_EXTERN MLN_EXPORT const MLNMapViewPreferredFramesPerSecond
MLNMapViewPreferredFramesPerSecondDefault;
/** A conservative frame rate; typically 30 FPS. */
FOUNDATION_EXTERN MLN_EXPORT const MLNMapViewPreferredFramesPerSecond MLNMapViewPreferredFramesPerSecondLowPower;
FOUNDATION_EXTERN MLN_EXPORT const MLNMapViewPreferredFramesPerSecond
MLNMapViewPreferredFramesPerSecondLowPower;
/** The maximum supported frame rate; typically 60 FPS. */
FOUNDATION_EXTERN MLN_EXPORT const MLNMapViewPreferredFramesPerSecond MLNMapViewPreferredFramesPerSecondMaximum;
FOUNDATION_EXTERN MLN_EXPORT const MLNMapViewPreferredFramesPerSecond
MLNMapViewPreferredFramesPerSecondMaximum;
FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNMissingLocationServicesUsageDescriptionException;
FOUNDATION_EXTERN MLN_EXPORT
MLNExceptionName const MLNMissingLocationServicesUsageDescriptionException;
FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNUserLocationAnnotationTypeException;
/**
@@ -161,9 +165,9 @@ FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNUserLocationAnnotationTyp
tap gesture fails:
```swift
let mapTapGestureRecognizer = UITapGestureRecognizer(target: self, action: #selector(myCustomFunction))
for recognizer in mapView.gestureRecognizers! where recognizer is UITapGestureRecognizer {
mapTapGestureRecognizer.require(toFail: recognizer)
let mapTapGestureRecognizer = UITapGestureRecognizer(target: self, action:
#selector(myCustomFunction)) for recognizer in mapView.gestureRecognizers! where recognizer is
UITapGestureRecognizer { mapTapGestureRecognizer.require(toFail: recognizer)
}
mapView.addGestureRecognizer(mapTapGestureRecognizer)
```
@@ -196,7 +200,7 @@ MLN_EXPORT
@return An initialized map view.
#### Related examples
- TODO: initialize an `MLNMapView` with a custom style
- TODO: how to initialize an `MLNMapView` with a third-party tile source
*/
@@ -212,7 +216,7 @@ MLN_EXPORT
annotations displayed on the map, such as the styles to apply to individual
annotations.
*/
@property(nonatomic, weak, nullable) IBOutlet id<MLNMapViewDelegate> delegate;
@property (nonatomic, weak, nullable) IBOutlet id<MLNMapViewDelegate> delegate;
// MARK: Configuring the Map’s Appearance
@@ -263,11 +267,11 @@ MLN_EXPORT
/**
A boolean value that indicates if whether the map view should automatically
adjust its content insets.
When this property is set to `YES` the map automatically updates its
`contentInset` property to account for any area not covered by navigation bars,
tab bars, toolbars, and other ancestors that obscure the map view.
*/
@property (assign) BOOL automaticallyAdjustsContentInset;
@@ -345,7 +349,6 @@ MLN_EXPORT
*/
@property (nonatomic, assign) CGPoint logoViewMargins;
/**
A view showing legally required copyright notices,
positioned at the bottom-right of the map view.
@@ -397,12 +400,12 @@ MLN_EXPORT
/**
A Boolean value indicating whether the map should prefetch tiles.
When this property is set to `YES`, the map view prefetches tiles designed for
a low zoom level and displays them until receiving more detailed tiles for the
current zoom level. The prefetched tiles typically contain simplified versions
of each shape, improving the map view’s perceived performance.
The default value of this property is `YES`.
*/
@property (nonatomic, assign) BOOL prefetchesTiles;
@@ -454,7 +457,7 @@ MLN_EXPORT
Setting this property to `YES` causes the map view to use the Core Location
framework to request authorization when authorizationStatus == kCLAuthorizationStatusNotDetermined.
The default value of this property is `YES`.
*/
@property (nonatomic, assign) BOOL shouldRequestAuthorizationToUseLocationServices;
@@ -489,7 +492,7 @@ MLN_EXPORT
/**
Deprecated. Sets the mode used to track the user location, with an optional transition.
To specify a completion handler to execute after the animation finishes, use
the `-setUserTrackingMode:animated:completionHandler:` method.
@@ -500,7 +503,9 @@ MLN_EXPORT
affects the initial transition; subsequent changes to the user location or
heading are always animated.
*/
- (void)setUserTrackingMode:(MLNUserTrackingMode)mode animated:(BOOL)animated __attribute__((deprecated("Use `-setUserTrackingMode:animated:completionHandler:` instead.")));
- (void)setUserTrackingMode:(MLNUserTrackingMode)mode
animated:(BOOL)animated
__attribute__((deprecated("Use `-setUserTrackingMode:animated:completionHandler:` instead.")));
/**
Sets the mode used to track the user location, with an optional transition and
@@ -514,7 +519,9 @@ MLN_EXPORT
heading are always animated.
@param completion The block executed after the animation finishes.
*/
- (void)setUserTrackingMode:(MLNUserTrackingMode)mode animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion;
- (void)setUserTrackingMode:(MLNUserTrackingMode)mode
animated:(BOOL)animated
completionHandler:(nullable void (^)(void))completion;
/**
The vertical alignment of the user location annotation within the receiver. The
@@ -524,7 +531,9 @@ MLN_EXPORT
transition. If you don’t want to animate the change, use the
`-setUserLocationVerticalAlignment:animated:` method instead.
*/
@property (nonatomic, assign) MLNAnnotationVerticalAlignment userLocationVerticalAlignment __attribute__((deprecated("Use `-[MLNMapViewDelegate mapViewUserLocationAnchorPoint:]` instead.")));
@property (nonatomic, assign) MLNAnnotationVerticalAlignment userLocationVerticalAlignment
__attribute__((
deprecated("Use `-[MLNMapViewDelegate mapViewUserLocationAnchorPoint:]` instead.")));
/**
Sets the vertical alignment of the user location annotation within the
@@ -535,7 +544,10 @@ MLN_EXPORT
position within the map view. If `NO`, the user location annotation
instantaneously moves to its new position.
*/
- (void)setUserLocationVerticalAlignment:(MLNAnnotationVerticalAlignment)alignment animated:(BOOL)animated __attribute__((deprecated("Use `-[MLNMapViewDelegate mapViewUserLocationAnchorPoint:]` instead.")));
- (void)setUserLocationVerticalAlignment:(MLNAnnotationVerticalAlignment)alignment
animated:(BOOL)animated
__attribute__((
deprecated("Use `-[MLNMapViewDelegate mapViewUserLocationAnchorPoint:]` instead.")));
/**
Updates the position of the user location annotation view by retreiving the user's last
@@ -606,7 +618,7 @@ MLN_EXPORT
This method has no effect if the `userTrackingMode` property is set to a value
other than `MLNUserTrackingModeFollowWithCourse`.
To specify a completion handler to execute after the animation finishes, use
the `-setTargetCoordinate:animated:completionHandler:` method.
@@ -614,7 +626,9 @@ MLN_EXPORT
@param animated If `YES`, the map animates to fit the target within the map
view. If `NO`, the map fits the target instantaneously.
*/
- (void)setTargetCoordinate:(CLLocationCoordinate2D)targetCoordinate animated:(BOOL)animated __attribute__((deprecated("Use `-setTargetCoordinate:animated:completionHandler:` instead.")));
- (void)setTargetCoordinate:(CLLocationCoordinate2D)targetCoordinate
animated:(BOOL)animated
__attribute__((deprecated("Use `-setTargetCoordinate:animated:completionHandler:` instead.")));
/**
Sets the geographic coordinate that is the subject of observation as the user
@@ -636,7 +650,9 @@ MLN_EXPORT
view. If `NO`, the map fits the target instantaneously.
@param completion The block executed after the animation finishes.
*/
- (void)setTargetCoordinate:(CLLocationCoordinate2D)targetCoordinate animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion;
- (void)setTargetCoordinate:(CLLocationCoordinate2D)targetCoordinate
animated:(BOOL)animated
completionHandler:(nullable void (^)(void))completion;
// MARK: Configuring How the User Interacts with the Map
@@ -652,7 +668,7 @@ MLN_EXPORT
value of this property to `NO`, you may still change the map zoom
programmatically.
*/
@property(nonatomic, getter=isZoomEnabled) BOOL zoomEnabled;
@property (nonatomic, getter=isZoomEnabled) BOOL zoomEnabled;
/**
A Boolean value that determines whether the user may scroll around the map,
@@ -665,7 +681,7 @@ MLN_EXPORT
value of this property to `NO`, you may still change the map location
programmatically.
*/
@property(nonatomic, getter=isScrollEnabled) BOOL scrollEnabled;
@property (nonatomic, getter=isScrollEnabled) BOOL scrollEnabled;
/**
The scrolling mode the user is allowed to use to interact with the map.
@@ -692,7 +708,7 @@ MLN_EXPORT
value of this property to `NO`, you may still rotate the map
programmatically.
*/
@property(nonatomic, getter=isRotateEnabled) BOOL rotateEnabled;
@property (nonatomic, getter=isRotateEnabled) BOOL rotateEnabled;
/**
A Boolean value that determines whether the user may change the pitch (tilt) of
@@ -707,13 +723,13 @@ MLN_EXPORT
The default value of this property is `YES`.
*/
@property(nonatomic, getter=isPitchEnabled) BOOL pitchEnabled;
@property (nonatomic, getter=isPitchEnabled) BOOL pitchEnabled;
/**
A Boolean value that determines whether gestures are anchored to the center coordinate of the map while rotating or zooming.
Default value is set to NO.
A Boolean value that determines whether gestures are anchored to the center coordinate of the map
while rotating or zooming. Default value is set to NO.
*/
@property(nonatomic) BOOL anchorRotateOrZoomGesturesToCenterCoordinate;
@property (nonatomic) BOOL anchorRotateOrZoomGesturesToCenterCoordinate;
/**
A Boolean value that determines whether the user will receive haptic feedback
@@ -726,7 +742,7 @@ MLN_EXPORT
This feature requires a device that supports haptic feedback, running iOS 10 or
newer.
*/
@property(nonatomic, getter=isHapticFeedbackEnabled) BOOL hapticFeedbackEnabled;
@property (nonatomic, getter=isHapticFeedbackEnabled) BOOL hapticFeedbackEnabled;
/**
A floating-point value that determines the rate of deceleration after the user
@@ -737,7 +753,7 @@ MLN_EXPORT
deceleration rates. `MLNMapViewDecelerationRateImmediate` can be used to
disable deceleration entirely.
*/
@property(nonatomic) CGFloat decelerationRate;
@property (nonatomic) CGFloat decelerationRate;
// MARK: Manipulating the Viewpoint
@@ -757,7 +773,7 @@ MLN_EXPORT
Changes the center coordinate of the map and optionally animates the change.
Changing the center coordinate centers the map on the new coordinate without
changing the current zoom level. For animated changes, wait until the map view has
changing the current zoom level. For animated changes, wait until the map view has
finished loading before calling this method.
@param coordinate The new center coordinate for the map.
@@ -772,7 +788,7 @@ MLN_EXPORT
/**
Changes the center coordinate and zoom level of the map and optionally animates
the change. For animated changes, wait until the map view has
the change. For animated changes, wait until the map view has
finished loading before calling this method.
@param centerCoordinate The new center coordinate for the map.
@@ -784,11 +800,13 @@ MLN_EXPORT
@note The behavior of this method is undefined if called in response to
`UIApplicationWillTerminateNotification`.
*/
- (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate zoomLevel:(double)zoomLevel animated:(BOOL)animated;
- (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate
zoomLevel:(double)zoomLevel
animated:(BOOL)animated;
/**
Changes the center coordinate, zoom level, and direction of the map and
optionally animates the change. For animated changes, wait until the map view has
optionally animates the change. For animated changes, wait until the map view has
finished loading before calling this method.
@param centerCoordinate The new center coordinate for the map.
@@ -802,11 +820,14 @@ MLN_EXPORT
@note The behavior of this method is undefined if called in response to
`UIApplicationWillTerminateNotification`.
*/
- (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate zoomLevel:(double)zoomLevel direction:(CLLocationDirection)direction animated:(BOOL)animated;
- (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate
zoomLevel:(double)zoomLevel
direction:(CLLocationDirection)direction
animated:(BOOL)animated;
/**
Changes the center coordinate, zoom level, and direction of the map, calling a
completion handler at the end of an optional animation. For animated changes,
completion handler at the end of an optional animation. For animated changes,
wait until the map view has finished loading before calling this method.
@param centerCoordinate The new center coordinate for the map.
@@ -821,7 +842,11 @@ MLN_EXPORT
@note The behavior of this method is undefined if called in response to
`UIApplicationWillTerminateNotification`.
*/
- (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate zoomLevel:(double)zoomLevel direction:(CLLocationDirection)direction animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion;
- (void)setCenterCoordinate:(CLLocationCoordinate2D)centerCoordinate
zoomLevel:(double)zoomLevel
direction:(CLLocationDirection)direction
animated:(BOOL)animated
completionHandler:(nullable void (^)(void))completion;
/** The zoom level of the receiver.
@@ -973,7 +998,7 @@ MLN_EXPORT
specify some longitudes less than −180 degrees or greater than 180 degrees. For
example, to show both Tokyo and San Francisco simultaneously, you could set the
visible bounds to extend from (35.68476, −220.24257) to (37.78428, −122.41310).
To specify a completion handler to execute after the animation finishes, use
the `-setVisibleCoordinateBounds:edgePadding:animated:completionHandler:` method.
@@ -983,7 +1008,11 @@ MLN_EXPORT
@param animated Specify `YES` to animate the change by smoothly scrolling and
zooming or `NO` to immediately display the given bounds.
*/
- (void)setVisibleCoordinateBounds:(MLNCoordinateBounds)bounds edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated __attribute__((deprecated("Use `-setVisibleCoordinateBounds:edgePadding:animated:completionHandler:` instead.")));
- (void)setVisibleCoordinateBounds:(MLNCoordinateBounds)bounds
edgePadding:(UIEdgeInsets)insets
animated:(BOOL)animated
__attribute__((deprecated(
"Use `-setVisibleCoordinateBounds:edgePadding:animated:completionHandler:` instead.")));
/**
Changes the receiver’s viewport to fit the given coordinate bounds with some
@@ -1001,7 +1030,10 @@ MLN_EXPORT
zooming or `NO` to immediately display the given bounds.
@param completion The block executed after the animation finishes.
*/
- (void)setVisibleCoordinateBounds:(MLNCoordinateBounds)bounds edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion;
- (void)setVisibleCoordinateBounds:(MLNCoordinateBounds)bounds
edgePadding:(UIEdgeInsets)insets
animated:(BOOL)animated
completionHandler:(nullable void (^)(void))completion;
/**
Changes the receiver’s viewport to fit all of the given coordinates with some
@@ -1020,7 +1052,10 @@ MLN_EXPORT
@param animated Specify `YES` to animate the change by smoothly scrolling and
zooming or `NO` to immediately display the given bounds.
*/
- (void)setVisibleCoordinates:(const CLLocationCoordinate2D *)coordinates count:(NSUInteger)count edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated;
- (void)setVisibleCoordinates:(const CLLocationCoordinate2D *)coordinates
count:(NSUInteger)count
edgePadding:(UIEdgeInsets)insets
animated:(BOOL)animated;
/**
Changes the receiver’s viewport to fit all of the given coordinates with some
@@ -1043,7 +1078,13 @@ MLN_EXPORT
@param function The timing function to animate the change.
@param completion The block executed after the animation finishes.
*/
- (void)setVisibleCoordinates:(const CLLocationCoordinate2D *)coordinates count:(NSUInteger)count edgePadding:(UIEdgeInsets)insets direction:(CLLocationDirection)direction duration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function completionHandler:(nullable void (^)(void))completion;
- (void)setVisibleCoordinates:(const CLLocationCoordinate2D *)coordinates
count:(NSUInteger)count
edgePadding:(UIEdgeInsets)insets
direction:(CLLocationDirection)direction
duration:(NSTimeInterval)duration
animationTimingFunction:(nullable CAMediaTimingFunction *)function
completionHandler:(nullable void (^)(void))completion;
/**
Sets the visible region so that the map displays the specified annotations.
@@ -1057,7 +1098,7 @@ MLN_EXPORT
@param animated `YES` if you want the map region change to be animated, or `NO`
if you want the map to display the new region immediately without animations.
*/
- (void)showAnnotations:(NSArray<id <MLNAnnotation>> *)annotations animated:(BOOL)animated;
- (void)showAnnotations:(NSArray<id<MLNAnnotation>> *)annotations animated:(BOOL)animated;
/**
Deprecated. Sets the visible region so that the map displays the specified
@@ -1065,7 +1106,7 @@ MLN_EXPORT
Calling this method updates the value in the `visibleCoordinateBounds` property
and potentially other properties to reflect the new map region.
To specify a completion handler to execute after the animation finishes, use
the `-showAnnotations:edgePadding:animated:completionHandler:` method.
@@ -1075,7 +1116,11 @@ MLN_EXPORT
@param animated `YES` if you want the map region change to be animated, or `NO`
if you want the map to display the new region immediately without animations.
*/
- (void)showAnnotations:(NSArray<id <MLNAnnotation>> *)annotations edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated __attribute__((deprecated("Use `-showAnnotations:edgePadding:animated:completionHandler:` instead.")));
- (void)showAnnotations:(NSArray<id<MLNAnnotation>> *)annotations
edgePadding:(UIEdgeInsets)insets
animated:(BOOL)animated
__attribute__((
deprecated("Use `-showAnnotations:edgePadding:animated:completionHandler:` instead.")));
/**
Sets the visible region so that the map displays the specified annotations with
@@ -1092,7 +1137,10 @@ MLN_EXPORT
if you want the map to display the new region immediately without animations.
@param completion The block executed after the animation finishes.
*/
- (void)showAnnotations:(NSArray<id <MLNAnnotation>> *)annotations edgePadding:(UIEdgeInsets)insets animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion;
- (void)showAnnotations:(NSArray<id<MLNAnnotation>> *)annotations
edgePadding:(UIEdgeInsets)insets
animated:(BOOL)animated
completionHandler:(nullable void (^)(void))completion;
/**
A camera representing the current viewpoint of the map.
@@ -1101,7 +1149,7 @@ MLN_EXPORT
/**
Moves the viewpoint to a different location with respect to the map with an
optional transition animation. For animated changes, wait until the map view has
optional transition animation. For animated changes, wait until the map view has
finished loading before calling this method.
@param camera The new viewpoint.
@@ -1116,7 +1164,7 @@ MLN_EXPORT
/**
Moves the viewpoint to a different location with respect to the map with an
optional transition duration and timing function. For animated changes, wait
optional transition duration and timing function. For animated changes, wait
until the map view has finished loading before calling this method.
@param camera The new viewpoint.
@@ -1131,11 +1179,13 @@ MLN_EXPORT
- TODO: Camera animation: learn how to create a timed animation that
rotates around a central point for a specific duration.
*/
- (void)setCamera:(MLNMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function;
- (void)setCamera:(MLNMapCamera *)camera
withDuration:(NSTimeInterval)duration
animationTimingFunction:(nullable CAMediaTimingFunction *)function;
/**
Moves the viewpoint to a different location with respect to the map with an
optional transition duration and timing function. For animated changes, wait
optional transition duration and timing function. For animated changes, wait
until the map view has finished loading before calling this method.
@param camera The new viewpoint.
@@ -1147,12 +1197,15 @@ MLN_EXPORT
is `0`, this parameter is ignored.
@param completion The block to execute after the animation finishes.
*/
- (void)setCamera:(MLNMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function completionHandler:(nullable void (^)(void))completion;
- (void)setCamera:(MLNMapCamera *)camera
withDuration:(NSTimeInterval)duration
animationTimingFunction:(nullable CAMediaTimingFunction *)function
completionHandler:(nullable void (^)(void))completion;
/**
Moves the viewpoint to a different location with respect to the map with an
optional transition duration and timing function, and optionally some additional
padding on each side. For animated changes, wait until the map view has
padding on each side. For animated changes, wait until the map view has
finished loading before calling this method.
@param camera The new viewpoint.
@@ -1166,7 +1219,11 @@ MLN_EXPORT
around the returned camera object if it were set as the receiver’s camera.
@param completion The block to execute after the animation finishes.
*/
- (void)setCamera:(MLNMapCamera *)camera withDuration:(NSTimeInterval)duration animationTimingFunction:(nullable CAMediaTimingFunction *)function edgePadding:(UIEdgeInsets)edgePadding completionHandler:(nullable void (^)(void))completion;
- (void)setCamera:(MLNMapCamera *)camera
withDuration:(NSTimeInterval)duration
animationTimingFunction:(nullable CAMediaTimingFunction *)function
edgePadding:(UIEdgeInsets)edgePadding
completionHandler:(nullable void (^)(void))completion;
/**
Moves the viewpoint to a different location using a transition animation that
@@ -1195,7 +1252,9 @@ MLN_EXPORT
is based on the length of the flight path.
@param completion The block to execute after the animation finishes.
*/
- (void)flyToCamera:(MLNMapCamera *)camera withDuration:(NSTimeInterval)duration completionHandler:(nullable void (^)(void))completion;
- (void)flyToCamera:(MLNMapCamera *)camera
withDuration:(NSTimeInterval)duration
completionHandler:(nullable void (^)(void))completion;
/**
Moves the viewpoint to a different location using a transition animation that
@@ -1215,8 +1274,10 @@ MLN_EXPORT
`-setCamera:animated:` would have a midpoint at a higher altitude.
@param completion The block to execute after the animation finishes.
*/
- (void)flyToCamera:(MLNMapCamera *)camera withDuration:(NSTimeInterval)duration peakAltitude:(CLLocationDistance)peakAltitude completionHandler:(nullable void (^)(void))completion;
- (void)flyToCamera:(MLNMapCamera *)camera
withDuration:(NSTimeInterval)duration
peakAltitude:(CLLocationDistance)peakAltitude
completionHandler:(nullable void (^)(void))completion;
/**
Moves the viewpoint to a different location using a transition animation that
@@ -1234,7 +1295,10 @@ MLN_EXPORT
around the returned camera object if it were set as the receiver’s camera.
@param completion The block to execute after the animation finishes.
*/
- (void)flyToCamera:(MLNMapCamera *)camera edgePadding:(UIEdgeInsets)insets withDuration:(NSTimeInterval)duration completionHandler:(nullable void (^)(void))completion;
- (void)flyToCamera:(MLNMapCamera *)camera
edgePadding:(UIEdgeInsets)insets
withDuration:(NSTimeInterval)duration
completionHandler:(nullable void (^)(void))completion;
/**
Returns the camera that best fits the given coordinate bounds.
@@ -1267,7 +1331,8 @@ MLN_EXPORT
`UIApplicationWillTerminateNotification`; you may receive a `nil` return value
depending on the order of notification delivery.
*/
- (MLNMapCamera *)cameraThatFitsCoordinateBounds:(MLNCoordinateBounds)bounds edgePadding:(UIEdgeInsets)insets;
- (MLNMapCamera *)cameraThatFitsCoordinateBounds:(MLNCoordinateBounds)bounds
edgePadding:(UIEdgeInsets)insets;
/**
Returns the camera that best fits the given coordinate bounds with some
@@ -1288,7 +1353,9 @@ MLN_EXPORT
`UIApplicationWillTerminateNotification`; you may receive a `nil` return value
depending on the order of notification delivery.
*/
- (MLNMapCamera *)camera:(MLNMapCamera *)camera fittingCoordinateBounds:(MLNCoordinateBounds)bounds edgePadding:(UIEdgeInsets)insets;
- (MLNMapCamera *)camera:(MLNMapCamera *)camera
fittingCoordinateBounds:(MLNCoordinateBounds)bounds
edgePadding:(UIEdgeInsets)insets;
/**
Returns the camera that best fits the given shape with some additional padding
@@ -1307,7 +1374,9 @@ MLN_EXPORT
`UIApplicationWillTerminateNotification`; you may receive a `nil` return value
depending on the order of notification delivery.
*/
- (MLNMapCamera *)camera:(MLNMapCamera *)camera fittingShape:(MLNShape *)shape edgePadding:(UIEdgeInsets)insets;
- (MLNMapCamera *)camera:(MLNMapCamera *)camera
fittingShape:(MLNShape *)shape
edgePadding:(UIEdgeInsets)insets;
/**
Returns the camera that best fits the given shape with some additional padding
@@ -1326,7 +1395,9 @@ MLN_EXPORT
`UIApplicationWillTerminateNotification`; you may receive a `nil` return value
depending on the order of notification delivery.
*/
- (MLNMapCamera *)cameraThatFitsShape:(MLNShape *)shape direction:(CLLocationDirection)direction edgePadding:(UIEdgeInsets)insets;
- (MLNMapCamera *)cameraThatFitsShape:(MLNShape *)shape
direction:(CLLocationDirection)direction
edgePadding:(UIEdgeInsets)insets;
/**
Returns the point in this view’s coordinate system on which to “anchor” in
@@ -1356,11 +1427,11 @@ MLN_EXPORT
view’s frame. Otherwise, those properties are inset, excluding part of the
frame from the viewport. For instance, if the only the top edge is inset, the
map center is effectively shifted downward.
When the map view’s superview is an instance of `UIViewController` whose
`automaticallyAdjustsScrollViewInsets` property is `YES`, the value of this
property may be overridden at any time.
The usage of `automaticallyAdjustsScrollViewInsets` has been deprecated
use the map view’s property `MLNMapView.automaticallyAdjustsContentInset`instead.
@@ -1396,10 +1467,10 @@ MLN_EXPORT
When the map view’s superview is an instance of `UIViewController` whose
`automaticallyAdjustsScrollViewInsets` property is `YES`, the value of this
property may be overridden at any time.
The usage of `automaticallyAdjustsScrollViewInsets` has been deprecated
use the map view’s property `MLNMapView.automaticallyAdjustsContentInset`instead.
To specify a completion handler to execute after the animation finishes, use
the `-setContentInset:animated:completionHandler:` method.
@@ -1408,7 +1479,9 @@ MLN_EXPORT
the content inset or `NO` if you want the map to inset the content
immediately.
*/
- (void)setContentInset:(UIEdgeInsets)contentInset animated:(BOOL)animated __attribute__((deprecated("Use `-setContentInset:animated:completionHandler:` instead.")));
- (void)setContentInset:(UIEdgeInsets)contentInset
animated:(BOOL)animated
__attribute__((deprecated("Use `-setContentInset:animated:completionHandler:` instead.")));
/**
Sets the distance from the edges of the map view’s frame to the edges of the
@@ -1424,7 +1497,7 @@ MLN_EXPORT
When the map view’s superview is an instance of `UIViewController` whose
`automaticallyAdjustsScrollViewInsets` property is `YES`, the value of this
property may be overridden at any time.
The usage of `automaticallyAdjustsScrollViewInsets` has been deprecated
use the map view’s property `MLNMapView.automaticallyAdjustsContentInset`instead.
@@ -1434,7 +1507,9 @@ MLN_EXPORT
immediately.
@param completion The block executed after the animation finishes.
*/
- (void)setContentInset:(UIEdgeInsets)contentInset animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion;
- (void)setContentInset:(UIEdgeInsets)contentInset
animated:(BOOL)animated
completionHandler:(nullable void (^)(void))completion;
// MARK: Converting Geographic Coordinates
@@ -1466,7 +1541,8 @@ MLN_EXPORT
#### Related examples
- TODO: Point conversion: learn how to convert a map coordinate to a `CGPoint` object.
*/
- (CGPoint)convertCoordinate:(CLLocationCoordinate2D)coordinate toPointToView:(nullable UIView *)view;
- (CGPoint)convertCoordinate:(CLLocationCoordinate2D)coordinate
toPointToView:(nullable UIView *)view;
/**
Converts a rectangle in the given view’s coordinate system to a geographic
@@ -1517,7 +1593,7 @@ MLN_EXPORT
Returns the new map projection instance initialized with the map view,
i.e. with the current camera state.
*/
- (MLNMapProjection*)mapProjection;
- (MLNMapProjection *)mapProjection;
// MARK: Annotating the Map
@@ -1528,7 +1604,7 @@ MLN_EXPORT
annotations are associated with the map view, the value of this property is
`nil`.
*/
@property (nonatomic, readonly, nullable) NSArray<id <MLNAnnotation>> *annotations;
@property (nonatomic, readonly, nullable) NSArray<id<MLNAnnotation>> *annotations;
/**
Adds an annotation to the map view.
@@ -1546,7 +1622,7 @@ MLN_EXPORT
- TODO: add a line annotation from GeoJSON.
- TODO: add an annotation to an `MLNMapView` object.
*/
- (void)addAnnotation:(id <MLNAnnotation>)annotation;
- (void)addAnnotation:(id<MLNAnnotation>)annotation;
/**
Adds an array of annotations to the map view.
@@ -1561,7 +1637,7 @@ MLN_EXPORT
must conform to the `MLNAnnotation` protocol. The map view retains each
individual annotation object.
*/
- (void)addAnnotations:(NSArray<id <MLNAnnotation>> *)annotations;
- (void)addAnnotations:(NSArray<id<MLNAnnotation>> *)annotations;
/**
Removes an annotation from the map view, deselecting it if it is selected.
@@ -1573,7 +1649,7 @@ MLN_EXPORT
@param annotation The annotation object to remove. This object must conform
to the `MLNAnnotation` protocol
*/
- (void)removeAnnotation:(id <MLNAnnotation>)annotation;
- (void)removeAnnotation:(id<MLNAnnotation>)annotation;
/**
Removes an array of annotations from the map view, deselecting any selected
@@ -1586,7 +1662,7 @@ MLN_EXPORT
@param annotations The array of annotation objects to remove. Objects in the
array must conform to the `MLNAnnotation` protocol.
*/
- (void)removeAnnotations:(NSArray<id <MLNAnnotation>> *)annotations;
- (void)removeAnnotations:(NSArray<id<MLNAnnotation>> *)annotations;
/**
Returns an `MLNAnnotationView` if the given annotation is currently associated
@@ -1595,7 +1671,7 @@ MLN_EXPORT
@param annotation The annotation associated with the view.
Annotation must conform to the `MLNAnnotation` protocol.
*/
- (nullable MLNAnnotationView *)viewForAnnotation:(id <MLNAnnotation>)annotation;
- (nullable MLNAnnotationView *)viewForAnnotation:(id<MLNAnnotation>)annotation;
/**
Returns a reusable annotation image object associated with its identifier.
@@ -1615,7 +1691,8 @@ MLN_EXPORT
- TODO: Add annotation views and images: learn how to most efficiently
reuse an `MLNAnnotationImage`.
*/
- (nullable __kindof MLNAnnotationImage *)dequeueReusableAnnotationImageWithIdentifier:(NSString *)identifier;
- (nullable __kindof MLNAnnotationImage *)dequeueReusableAnnotationImageWithIdentifier:
(NSString *)identifier;
/**
Returns a reusable annotation view object associated with its identifier.
@@ -1631,7 +1708,8 @@ MLN_EXPORT
@return An annotation view object with the given identifier, or `nil` if no
such object exists in the reuse queue.
*/
- (nullable __kindof MLNAnnotationView *)dequeueReusableAnnotationViewWithIdentifier:(NSString *)identifier;
- (nullable __kindof MLNAnnotationView *)dequeueReusableAnnotationViewWithIdentifier:
(NSString *)identifier;
/**
The complete list of annotations associated with the receiver that are
@@ -1641,7 +1719,7 @@ MLN_EXPORT
annotations are associated with the map view or if no annotations associated
with the map view are currently visible, the value of this property is `nil`.
*/
@property (nonatomic, readonly, nullable) NSArray<id <MLNAnnotation>> *visibleAnnotations;
@property (nonatomic, readonly, nullable) NSArray<id<MLNAnnotation>> *visibleAnnotations;
/**
Returns the list of annotations associated with the receiver that intersect with
@@ -1652,7 +1730,7 @@ MLN_EXPORT
no annotations associated with the map view are currently visible in the
rectangle.
*/
- (nullable NSArray<id <MLNAnnotation>> *)visibleAnnotationsInRect:(CGRect)rect;
- (nullable NSArray<id<MLNAnnotation>> *)visibleAnnotationsInRect:(CGRect)rect;
// MARK: Managing Annotation Selections
@@ -1669,7 +1747,7 @@ MLN_EXPORT
@note In versions prior to `4.0.0` if the annotation was offscreen it was not
selected.
*/
@property (nonatomic, copy) NSArray<id <MLNAnnotation>> *selectedAnnotations;
@property (nonatomic, copy) NSArray<id<MLNAnnotation>> *selectedAnnotations;
/**
Deprecated. Selects an annotation and displays its callout view.
@@ -1679,11 +1757,15 @@ MLN_EXPORT
| `animated` parameter | Effect |
|------------------|--------|
| `NO` | The annotation is selected, and the callout is presented. However the map is not panned to bring the annotation or callout into view. The presentation of the callout is NOT animated. |
| `YES` | The annotation is selected, and the callout is presented. If the annotation is not visible (or is partially visible) *and* is of type `MLNPointAnnotation`, the map is panned so that the annotation and its callout are brought into view. The annotation is *not* centered within the viewport. |
| `NO` | The annotation is selected, and the callout is presented. However the map is
not panned to bring the annotation or callout into view. The presentation of the callout is NOT
animated. | | `YES` | The annotation is selected, and the callout is presented. If the
annotation is not visible (or is partially visible) *and* is of type `MLNPointAnnotation`, the map
is panned so that the annotation and its callout are brought into view. The annotation is *not*
centered within the viewport. |
Note that a selection initiated by a single tap gesture is always animated.
To specify a completion handler to execute after the animation finishes, use
the `-selectAnnotation:animated:completionHandler:` method.
@@ -1693,7 +1775,9 @@ MLN_EXPORT
@note In versions prior to `4.0.0` selecting an offscreen annotation did not
change the camera.
*/
- (void)selectAnnotation:(id <MLNAnnotation>)annotation animated:(BOOL)animated __attribute__((deprecated("Use `-selectAnnotation:animated:completionHandler:` instead.")));
- (void)selectAnnotation:(id<MLNAnnotation>)annotation
animated:(BOOL)animated
__attribute__((deprecated("Use `-selectAnnotation:animated:completionHandler:` instead.")));
/**
Selects an annotation and displays its callout view with an optional completion
@@ -1704,8 +1788,12 @@ MLN_EXPORT
| `animated` parameter | Effect |
|------------------|--------|
| `NO` | The annotation is selected, and the callout is presented. However the map is not panned to bring the annotation or callout into view. The presentation of the callout is NOT animated. |
| `YES` | The annotation is selected, and the callout is presented. If the annotation is not visible (or is partially visible) *and* is of type `MLNPointAnnotation`, the map is panned so that the annotation and its callout are brought into view. The annotation is *not* centered within the viewport. |
| `NO` | The annotation is selected, and the callout is presented. However the map is
not panned to bring the annotation or callout into view. The presentation of the callout is NOT
animated. | | `YES` | The annotation is selected, and the callout is presented. If the
annotation is not visible (or is partially visible) *and* is of type `MLNPointAnnotation`, the map
is panned so that the annotation and its callout are brought into view. The annotation is *not*
centered within the viewport. |
Note that a selection initiated by a single tap gesture is always animated.
@@ -1716,7 +1804,9 @@ MLN_EXPORT
@note In versions prior to `4.0.0` selecting an offscreen annotation did not
change the camera.
*/
- (void)selectAnnotation:(id <MLNAnnotation>)annotation animated:(BOOL)animated completionHandler:(nullable void (^)(void))completion;
- (void)selectAnnotation:(id<MLNAnnotation>)annotation
animated:(BOOL)animated
completionHandler:(nullable void (^)(void))completion;
/**
:nodoc:
@@ -1725,11 +1815,17 @@ MLN_EXPORT
change.
@param annotation The annotation object to select.
@param moveIntoView If the annotation is not visible (or is partially visible) *and* is of type `MLNPointAnnotation`, the map is panned so that the annotation and its callout are brought into view. The annotation is *not* centered within the viewport.
@param animateSelection If `YES`, the annotation's selection state and callout view's presentation are animated.
@param moveIntoView If the annotation is not visible (or is partially visible) *and* is of type
`MLNPointAnnotation`, the map is panned so that the annotation and its callout are brought into
view. The annotation is *not* centered within the viewport.
@param animateSelection If `YES`, the annotation's selection state and callout view's presentation
are animated.
@param completion The block executed after the animation finishes.
*/
- (void)selectAnnotation:(id <MLNAnnotation>)annotation moveIntoView:(BOOL)moveIntoView animateSelection:(BOOL)animateSelection completionHandler:(nullable void (^)(void))completion;
- (void)selectAnnotation:(id<MLNAnnotation>)annotation
moveIntoView:(BOOL)moveIntoView
animateSelection:(BOOL)animateSelection
completionHandler:(nullable void (^)(void))completion;
/**
Deselects an annotation and hides its callout view.
@@ -1737,7 +1833,7 @@ MLN_EXPORT
@param annotation The annotation object to deselect.
@param animated If `YES`, the callout view is animated offscreen.
*/
- (void)deselectAnnotation:(nullable id <MLNAnnotation>)annotation animated:(BOOL)animated;
- (void)deselectAnnotation:(nullable id<MLNAnnotation>)annotation animated:(BOOL)animated;
// MARK: Overlaying the Map
@@ -1748,7 +1844,7 @@ MLN_EXPORT
overlays are associated with the map view, the value of this property is
empty array.
*/
@property (nonatomic, readonly, nonnull) NSArray<id <MLNOverlay>> *overlays;
@property (nonatomic, readonly, nonnull) NSArray<id<MLNOverlay>> *overlays;
/**
Adds a single overlay object to the map.
@@ -1757,7 +1853,7 @@ MLN_EXPORT
@param overlay The overlay object to add. This object must conform to the
`MLNOverlay` protocol. */
- (void)addOverlay:(id <MLNOverlay>)overlay;
- (void)addOverlay:(id<MLNOverlay>)overlay;
/**
Adds an array of overlay objects to the map.
@@ -1767,7 +1863,7 @@ MLN_EXPORT
@param overlays An array of objects, each of which must conform to the
`MLNOverlay` protocol.
*/
- (void)addOverlays:(NSArray<id <MLNOverlay>> *)overlays;
- (void)addOverlays:(NSArray<id<MLNOverlay>> *)overlays;
/**
Removes a single overlay object from the map.
@@ -1777,7 +1873,7 @@ MLN_EXPORT
@param overlay The overlay object to remove.
*/
- (void)removeOverlay:(id <MLNOverlay>)overlay;
- (void)removeOverlay:(id<MLNOverlay>)overlay;
/**
Removes one or more overlay objects from the map.
@@ -1787,7 +1883,7 @@ MLN_EXPORT
@param overlays An array of objects, each of which conforms to the `MLNOverlay`
protocol.
*/
- (void)removeOverlays:(NSArray<id <MLNOverlay>> *)overlays;
- (void)removeOverlays:(NSArray<id<MLNOverlay>> *)overlays;
// MARK: Accessing the Underlying Map Data
@@ -1807,7 +1903,8 @@ MLN_EXPORT
- TODO: Select a feature within a layer: to learn how to query an
`MLNMapView` object for visible `MLNFeature` objects.
*/
- (NSArray<id <MLNFeature>> *)visibleFeaturesAtPoint:(CGPoint)point NS_SWIFT_NAME(visibleFeatures(at:));
- (NSArray<id<MLNFeature>> *)visibleFeaturesAtPoint:(CGPoint)point
NS_SWIFT_NAME(visibleFeatures(at:));
/**
Returns an array of rendered map features that intersect with a given point,
@@ -1826,7 +1923,10 @@ MLN_EXPORT
@return An array of objects conforming to the `MLNFeature` protocol that
represent features in the sources used by the current style.
*/
- (NSArray<id <MLNFeature>> *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(nullable NSSet<NSString *> *)styleLayerIdentifiers NS_SWIFT_NAME(visibleFeatures(at:styleLayerIdentifiers:));
- (NSArray<id<MLNFeature>> *)visibleFeaturesAtPoint:(CGPoint)point
inStyleLayersWithIdentifiers:
(nullable NSSet<NSString *> *)styleLayerIdentifiers
NS_SWIFT_NAME(visibleFeatures(at:styleLayerIdentifiers:));
/**
Returns an array of rendered map features that intersect with a given point,
@@ -1893,7 +1993,11 @@ MLN_EXPORT
@return An array of objects conforming to the `MLNFeature` protocol that
represent features in the sources used by the current style.
*/
- (NSArray<id <MLNFeature>> *)visibleFeaturesAtPoint:(CGPoint)point inStyleLayersWithIdentifiers:(nullable NSSet<NSString *> *)styleLayerIdentifiers predicate:(nullable NSPredicate *)predicate NS_SWIFT_NAME(visibleFeatures(at:styleLayerIdentifiers:predicate:));
- (NSArray<id<MLNFeature>> *)visibleFeaturesAtPoint:(CGPoint)point
inStyleLayersWithIdentifiers:
(nullable NSSet<NSString *> *)styleLayerIdentifiers
predicate:(nullable NSPredicate *)predicate
NS_SWIFT_NAME(visibleFeatures(at:styleLayerIdentifiers:predicate:));
/**
Returns an array of rendered map features that intersect with the given
@@ -1908,7 +2012,7 @@ MLN_EXPORT
@return An array of objects conforming to the `MLNFeature` protocol that
represent features in the sources used by the current style.
*/
- (NSArray<id <MLNFeature>> *)visibleFeaturesInRect:(CGRect)rect NS_SWIFT_NAME(visibleFeatures(in:));
- (NSArray<id<MLNFeature>> *)visibleFeaturesInRect:(CGRect)rect NS_SWIFT_NAME(visibleFeatures(in:));
/**
Returns an array of rendered map features that intersect with the given
@@ -1927,7 +2031,10 @@ MLN_EXPORT
@return An array of objects conforming to the `MLNFeature` protocol that
represent features in the sources used by the current style.
*/
- (NSArray<id <MLNFeature>> *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(nullable NSSet<NSString *> *)styleLayerIdentifiers NS_SWIFT_NAME(visibleFeatures(in:styleLayerIdentifiers:));
- (NSArray<id<MLNFeature>> *)visibleFeaturesInRect:(CGRect)rect
inStyleLayersWithIdentifiers:
(nullable NSSet<NSString *> *)styleLayerIdentifiers
NS_SWIFT_NAME(visibleFeatures(in:styleLayerIdentifiers:));
/**
Returns an array of rendered map features that intersect with the given
@@ -1998,7 +2105,11 @@ MLN_EXPORT
@return An array of objects conforming to the `MLNFeature` protocol that
represent features in the sources used by the current style.
*/
- (NSArray<id <MLNFeature>> *)visibleFeaturesInRect:(CGRect)rect inStyleLayersWithIdentifiers:(nullable NSSet<NSString *> *)styleLayerIdentifiers predicate:(nullable NSPredicate *)predicate NS_SWIFT_NAME(visibleFeatures(in:styleLayerIdentifiers:predicate:));
- (NSArray<id<MLNFeature>> *)visibleFeaturesInRect:(CGRect)rect
inStyleLayersWithIdentifiers:
(nullable NSSet<NSString *> *)styleLayerIdentifiers
predicate:(nullable NSPredicate *)predicate
NS_SWIFT_NAME(visibleFeatures(in:styleLayerIdentifiers:predicate:));
// MARK: Debugging the Map
@@ -2010,7 +2121,6 @@ MLN_EXPORT
*/
@property (nonatomic) MLNMapDebugMaskOptions debugMask;
- (MLNBackendResource)backendResource;
@end

View File

@@ -1,7 +1,7 @@
#import <UIKit/UIKit.h>
#import "Mapbox.h"
#import "MLNCameraChangeReason.h"
#import "Mapbox.h"
NS_ASSUME_NONNULL_BEGIN
@@ -46,7 +46,9 @@ NS_ASSUME_NONNULL_BEGIN
#### Related examples
- <doc:BlockingGesturesExample>
*/
- (BOOL)mapView:(MLNMapView *)mapView shouldChangeFromCamera:(MLNMapCamera *)oldCamera toCamera:(MLNMapCamera *)newCamera;
- (BOOL)mapView:(MLNMapView *)mapView
shouldChangeFromCamera:(MLNMapCamera *)oldCamera
toCamera:(MLNMapCamera *)newCamera;
/**
:nodoc:
@@ -65,14 +67,18 @@ NS_ASSUME_NONNULL_BEGIN
gesture is recognized. If this method returns `NO`, the map view’s camera
continues to be this camera.
@param newCamera The expected camera after the gesture completes. If this
method returns `YES`, the viewport of the map will transition to the new camera. Note that the new camera cannot be modified.
method returns `YES`, the viewport of the map will transition to the new camera. Note that the new
camera cannot be modified.
@param reason The reason for the camera change.
@return A Boolean value indicating whether the map view should stay at
`oldCamera` or transition to `newCamera`.
@note If this method is implemented `-mapView:shouldChangeFromCamera:toCamera:` will not be called.
*/
- (BOOL)mapView:(MLNMapView *)mapView shouldChangeFromCamera:(MLNMapCamera *)oldCamera toCamera:(MLNMapCamera *)newCamera reason:(MLNCameraChangeReason)reason;
- (BOOL)mapView:(MLNMapView *)mapView
shouldChangeFromCamera:(MLNMapCamera *)oldCamera
toCamera:(MLNMapCamera *)newCamera
reason:(MLNCameraChangeReason)reason;
/**
Tells the delegate that the viewpoint depicted by the map view is about to change.
@@ -98,7 +104,9 @@ NS_ASSUME_NONNULL_BEGIN
@note If this method is implemented `-mapView:regionWillChangeAnimated:` will not be called.
*/
- (void)mapView:(MLNMapView *)mapView regionWillChangeWithReason:(MLNCameraChangeReason)reason animated:(BOOL)animated;
- (void)mapView:(MLNMapView *)mapView
regionWillChangeWithReason:(MLNCameraChangeReason)reason
animated:(BOOL)animated;
/**
Tells the delegate that the viewpoint depicted by the map view is changing.
@@ -168,7 +176,9 @@ NS_ASSUME_NONNULL_BEGIN
@note If this method is implemented `-mapView:regionDidChangeAnimated:` will not be called.
*/
- (void)mapView:(MLNMapView *)mapView regionDidChangeWithReason:(MLNCameraChangeReason)reason animated:(BOOL)animated;
- (void)mapView:(MLNMapView *)mapView
regionDidChangeWithReason:(MLNCameraChangeReason)reason
animated:(BOOL)animated;
// MARK: Loading the Map
@@ -258,11 +268,11 @@ NS_ASSUME_NONNULL_BEGIN
Tells the delegate that the map view is entering an idle state, and no more
drawing will be necessary until new data is loaded or there is some interaction
with the map.
- No camera transitions are in progress
- All currently requested tiles have loaded
- All fade/transition animations have completed
@param mapView The map view that has just entered the idle state.
*/
- (void)mapViewDidBecomeIdle:(MLNMapView *)mapView;
@@ -290,7 +300,9 @@ NS_ASSUME_NONNULL_BEGIN
- (void)mapView:(MLNMapView *)mapView didFinishLoadingStyle:(MLNStyle *)style;
/**
Tells the delegate that the `mapView` is missing an image. The image should be added synchronously with `-[MLNStyle setImage:forName:]` to be rendered on the current zoom level. When loading icons asynchronously, you can load a placeholder image and replace it when your image has loaded.
Tells the delegate that the `mapView` is missing an image. The image should be added synchronously
with `-[MLNStyle setImage:forName:]` to be rendered on the current zoom level. When loading icons
asynchronously, you can load a placeholder image and replace it when your image has loaded.
@param mapView The map view that is loading the image.
@param imageName The name of the image that is missing.
@@ -299,11 +311,11 @@ NS_ASSUME_NONNULL_BEGIN
/**
Asks the delegate whether the map view should evict cached images.
This method is called in two scenarios: when the cumulative size of unused images
exceeds the cache size or when the last tile that includes the image is removed from
memory.
@param mapView The map view that is evicting the image.
@param imageName The image name that is going to be removed.
@return A Boolean value indicating whether the map view should evict
@@ -335,13 +347,14 @@ NS_ASSUME_NONNULL_BEGIN
/**
Asks the delegate styling options for each default user location annotation view.
This method is called many times during gesturing, so you should avoid performing
complex or performance-intensive tasks in your implementation.
@param mapView The map view that is tracking the user’s location.
*/
- (MLNUserLocationAnnotationViewStyle *)mapViewStyleForDefaultUserLocationAnnotationView:(MLNMapView *)mapView NS_SWIFT_NAME(mapView(styleForDefaultUserLocationAnnotationView:));
- (MLNUserLocationAnnotationViewStyle *)mapViewStyleForDefaultUserLocationAnnotationView:
(MLNMapView *)mapView NS_SWIFT_NAME(mapView(styleForDefaultUserLocationAnnotationView:));
/**
Tells the delegate that the location of the user was updated.
@@ -360,7 +373,8 @@ NS_ASSUME_NONNULL_BEGIN
@param userLocation The location object representing the user’s latest
location. This property may be `nil`.
*/
- (void)mapView:(MLNMapView *)mapView didUpdateUserLocation:(nullable MLNUserLocation *)userLocation;
- (void)mapView:(MLNMapView *)mapView
didUpdateUserLocation:(nullable MLNUserLocation *)userLocation;
/**
Tells the delegate that an attempt to locate the user’s position failed.
@@ -381,7 +395,9 @@ NS_ASSUME_NONNULL_BEGIN
@param mode The new tracking mode.
@param animated Whether the change caused an animated effect on the map.
*/
- (void)mapView:(MLNMapView *)mapView didChangeUserTrackingMode:(MLNUserTrackingMode)mode animated:(BOOL)animated;
- (void)mapView:(MLNMapView *)mapView
didChangeUserTrackingMode:(MLNUserTrackingMode)mode
animated:(BOOL)animated;
/**
Returns a screen coordinate at which to position the user location annotation.
@@ -400,15 +416,16 @@ NS_ASSUME_NONNULL_BEGIN
/**
Tells the delegate that the map's location updates accuracy authorization has changed.
This method is called after the user changes location accuracy authorization when
requesting location permissions or in privacy settings.
@param mapView The map view that changed its location accuracy authorization.
@param manager The location manager reporting the update.
*/
- (void)mapView:(MLNMapView *)mapView didChangeLocationManagerAuthorization:(id<MLNLocationManager>)manager API_AVAILABLE(ios(14));
- (void)mapView:(MLNMapView *)mapView
didChangeLocationManagerAuthorization:(id<MLNLocationManager>)manager API_AVAILABLE(ios(14));
// MARK: Managing the Appearance of Annotations
@@ -438,7 +455,8 @@ NS_ASSUME_NONNULL_BEGIN
image should be used for `MLNAnnotation` objects that have been added to
your map
*/
- (nullable MLNAnnotationImage *)mapView:(MLNMapView *)mapView imageForAnnotation:(id <MLNAnnotation>)annotation;
- (nullable MLNAnnotationImage *)mapView:(MLNMapView *)mapView
imageForAnnotation:(id<MLNAnnotation>)annotation;
/**
Returns the alpha value to use when rendering a shape annotation.
@@ -541,7 +559,8 @@ NS_ASSUME_NONNULL_BEGIN
`MLNViewAnnotation` to use for a given `MLNPointAnnotation` object on your
map.
*/
- (nullable MLNAnnotationView *)mapView:(MLNMapView *)mapView viewForAnnotation:(id <MLNAnnotation>)annotation;
- (nullable MLNAnnotationView *)mapView:(MLNMapView *)mapView
viewForAnnotation:(id<MLNAnnotation>)annotation;
/**
Tells the delegate that one or more annotation views have been added and
@@ -554,7 +573,8 @@ NS_ASSUME_NONNULL_BEGIN
@param annotationViews An array of `MLNAnnotationView` objects representing the
views that were added.
*/
- (void)mapView:(MLNMapView *)mapView didAddAnnotationViews:(NSArray<MLNAnnotationView *> *)annotationViews;
- (void)mapView:(MLNMapView *)mapView
didAddAnnotationViews:(NSArray<MLNAnnotationView *> *)annotationViews;
// MARK: Selecting Annotations
@@ -586,7 +606,7 @@ NS_ASSUME_NONNULL_BEGIN
TODO: Dynamically style interactive points, learn how to remove an
annotation view if it has already been selected.
*/
- (void)mapView:(MLNMapView *)mapView didSelectAnnotation:(id <MLNAnnotation>)annotation;
- (void)mapView:(MLNMapView *)mapView didSelectAnnotation:(id<MLNAnnotation>)annotation;
/**
Tells the delegate that one of its annotations was deselected.
@@ -600,7 +620,7 @@ NS_ASSUME_NONNULL_BEGIN
@param mapView The map view containing the annotation.
@param annotation The annotation that was deselected.
*/
- (void)mapView:(MLNMapView *)mapView didDeselectAnnotation:(id <MLNAnnotation>)annotation;
- (void)mapView:(MLNMapView *)mapView didDeselectAnnotation:(id<MLNAnnotation>)annotation;
/**
Tells the delegate that one of its annotation views was selected.
@@ -666,7 +686,7 @@ NS_ASSUME_NONNULL_BEGIN
TODO: Default callout usage, learn how to show callouts for
`MLNAnnotation` objects.
*/
- (BOOL)mapView:(MLNMapView *)mapView annotationCanShowCallout:(id <MLNAnnotation>)annotation;
- (BOOL)mapView:(MLNMapView *)mapView annotationCanShowCallout:(id<MLNAnnotation>)annotation;
/**
Returns a callout view to display for the given annotation.
@@ -687,7 +707,8 @@ NS_ASSUME_NONNULL_BEGIN
TODO: Display custom views as callouts, learn how to customize an
`MLNAnnotation` object's `MLNCalloutView`.
*/
- (nullable id <MLNCalloutView>)mapView:(MLNMapView *)mapView calloutViewForAnnotation:(id <MLNAnnotation>)annotation;
- (nullable id<MLNCalloutView>)mapView:(MLNMapView *)mapView
calloutViewForAnnotation:(id<MLNAnnotation>)annotation;
/**
Returns the view to display on the left side of the standard callout bubble.
@@ -717,7 +738,8 @@ NS_ASSUME_NONNULL_BEGIN
TODO: Default callout usage, learn how to modify the view that is
displayed on the left side of the standard callout bubble.
*/
- (nullable UIView *)mapView:(MLNMapView *)mapView leftCalloutAccessoryViewForAnnotation:(id <MLNAnnotation>)annotation;
- (nullable UIView *)mapView:(MLNMapView *)mapView
leftCalloutAccessoryViewForAnnotation:(id<MLNAnnotation>)annotation;
/**
Returns the view to display on the right side of the standard callout bubble.
@@ -747,7 +769,8 @@ NS_ASSUME_NONNULL_BEGIN
TODO: Default callout usage, learn how to modify the view that is
displayed on the right side of the standard callout bubble.
*/
- (nullable UIView *)mapView:(MLNMapView *)mapView rightCalloutAccessoryViewForAnnotation:(id <MLNAnnotation>)annotation;
- (nullable UIView *)mapView:(MLNMapView *)mapView
rightCalloutAccessoryViewForAnnotation:(id<MLNAnnotation>)annotation;
/**
Tells the delegate that the user tapped one of the accessory controls in the
@@ -776,7 +799,9 @@ NS_ASSUME_NONNULL_BEGIN
TODO: Default callout usage, learn how to trigger an action when the
standard callout bubble's accessory control is tapped.
*/
- (void)mapView:(MLNMapView *)mapView annotation:(id <MLNAnnotation>)annotation calloutAccessoryControlTapped:(UIControl *)control;
- (void)mapView:(MLNMapView *)mapView
annotation:(id<MLNAnnotation>)annotation
calloutAccessoryControlTapped:(UIControl *)control;
/**
Tells the delegate that the user tapped on an annotation’s callout view.
@@ -798,7 +823,7 @@ NS_ASSUME_NONNULL_BEGIN
TODO: Display custom views as callouts, learn how to trigger an
action when an `MLNAnnotation`s `MLNCalloutView` is tapped.
*/
- (void)mapView:(MLNMapView *)mapView tapOnCalloutForAnnotation:(id <MLNAnnotation>)annotation;
- (void)mapView:(MLNMapView *)mapView tapOnCalloutForAnnotation:(id<MLNAnnotation>)annotation;
@end

View File

@@ -1,13 +1,13 @@
#import "MLNAnnotationContainerView.h"
#import "MLNMapView.h"
#import "MLNUserLocationAnnotationView.h"
#import "MLNAnnotationContainerView.h"
#include <mbgl/util/size.hpp>
namespace mbgl {
class Map;
class Renderer;
}
class Map;
class Renderer;
} // namespace mbgl
class MLNMapViewImpl;
@class MLNSource;
@@ -48,7 +48,8 @@ FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const _Nonnull MLNUnderlyingMapUna
- (void)didFailToLoadImage:(nonnull NSString *)imageName;
- (BOOL)shouldRemoveStyleImage:(nonnull NSString *)imageName;
- (CLLocationDistance)metersPerPointAtLatitude:(CLLocationDegrees)latitude zoomLevel:(double)zoomLevel;
- (CLLocationDistance)metersPerPointAtLatitude:(CLLocationDegrees)latitude
zoomLevel:(double)zoomLevel;
/** Triggers another render pass even when it is not necessary. */
- (void)setNeedsRerender;
@@ -59,14 +60,15 @@ FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const _Nonnull MLNUnderlyingMapUna
- (mbgl::Map &)mbglMap;
- (nonnull mbgl::Renderer *)renderer;
/** Returns whether the map view is currently loading or processing any assets required to render the map */
/** Returns whether the map view is currently loading or processing any assets required to render
* the map */
- (BOOL)isFullyLoaded;
/** Empties the in-memory tile cache. */
- (void)didReceiveMemoryWarning;
/** Returns an instance of MLNMapView implementation. Used for integration testing. */
- (nonnull MLNMapViewImpl *) viewImpl;
- (nonnull MLNMapViewImpl *)viewImpl;
- (void)pauseRendering:(nonnull NSNotification *)notification;
- (void)resumeRendering:(nonnull NSNotification *)notification;
@@ -77,6 +79,6 @@ FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const _Nonnull MLNUnderlyingMapUna
- (MLNMapCamera *_Nullable)cameraByTiltingToPitch:(CGFloat)pitch;
- (BOOL) _opaque;
- (BOOL)_opaque;
@end

View File

@@ -1,5 +1,5 @@
#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
#import <UIKit/UIKit.h>
@interface MLNScaleBar : UIView

View File

@@ -1,8 +1,8 @@
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
#import <Foundation/Foundation.h>
#import "MLNFoundation.h"
#import "MLNAnnotation.h"
#import "MLNFoundation.h"
NS_ASSUME_NONNULL_BEGIN
@@ -11,7 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
the user’s current location. You do not create instances of this class
directly. Instead, you retrieve an existing `MLNUserLocation` object from the
`userLocation` property of the map view displayed in your application.
#### Related examples
TODO: Customize the user location annotation,learn how to overide the
default user location annotation.

View File

@@ -1,8 +1,8 @@
#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
#import <UIKit/UIKit.h>
#import "MLNFoundation.h"
#import "MLNAnnotationView.h"
#import "MLNFoundation.h"
NS_ASSUME_NONNULL_BEGIN
@@ -25,7 +25,7 @@ MLN_EXPORT
The value of this property is nil during initialization and while user tracking
is inactive.
#### Related examples
TODO: Customize the user location annotation, learn how to customize
the default user location annotation object.

View File

@@ -1,5 +1,5 @@
#import "MLNUserLocationAnnotationView.h"
#import "MLNUserLocation.h"
#import "MLNUserLocationAnnotationView.h"
NS_ASSUME_NONNULL_BEGIN

View File

@@ -4,7 +4,8 @@
@interface MLNUserLocationHeadingArrowLayer : CAShapeLayer <MLNUserLocationHeadingIndicator>
- (instancetype)initWithUserLocationAnnotationView:(MLNUserLocationAnnotationView *)userLocationView;
- (instancetype)initWithUserLocationAnnotationView:
(MLNUserLocationAnnotationView *)userLocationView;
- (void)updateHeadingAccuracy:(CLLocationDirection)accuracy;
- (void)updateTintColor:(CGColorRef)color;

View File

@@ -4,7 +4,8 @@
@interface MLNUserLocationHeadingBeamLayer : CALayer <MLNUserLocationHeadingIndicator>
- (MLNUserLocationHeadingBeamLayer *)initWithUserLocationAnnotationView:(MLNUserLocationAnnotationView *)userLocationView;
- (MLNUserLocationHeadingBeamLayer *)initWithUserLocationAnnotationView:
(MLNUserLocationAnnotationView *)userLocationView;
- (void)updateHeadingAccuracy:(CLLocationDirection)accuracy;
- (void)updateTintColor:(CGColorRef)color;

View File

@@ -3,7 +3,8 @@
@protocol MLNUserLocationHeadingIndicator <NSObject>
- (instancetype)initWithUserLocationAnnotationView:(MLNUserLocationAnnotationView *)userLocationView;
- (instancetype)initWithUserLocationAnnotationView:
(MLNUserLocationAnnotationView *)userLocationView;
- (void)updateHeadingAccuracy:(CLLocationDirection)accuracy;
- (void)updateTintColor:(CGColorRef)color;

View File

@@ -7,7 +7,6 @@ FOUNDATION_EXPORT MLN_EXPORT double MapboxVersionNumber;
/// Project version string for Mapbox.
FOUNDATION_EXPORT MLN_EXPORT const unsigned char MapboxVersionString[];
#import "MLNSettings.h"
#import "MLNAnnotation.h"
#import "MLNAnnotationImage.h"
#import "MLNAnnotationView.h"
@@ -22,6 +21,8 @@ FOUNDATION_EXPORT MLN_EXPORT const unsigned char MapboxVersionString[];
#import "MLNCompassDirectionFormatter.h"
#import "MLNComputedShapeSource.h"
#import "MLNCoordinateFormatter.h"
#import "MLNCustomDrawableStyleLayer.h"
#import "MLNCustomStyleLayer.h"
#import "MLNDistanceFormatter.h"
#import "MLNFeature.h"
#import "MLNFillExtrusionStyleLayer.h"
@@ -38,15 +39,14 @@ FOUNDATION_EXPORT MLN_EXPORT const unsigned char MapboxVersionString[];
#import "MLNMapCamera.h"
#import "MLNMapProjection.h"
#import "MLNMapSnapshotter.h"
#import "MLNMapView+IBAdditions.h"
#import "MLNMapView.h"
#import "MLNMapViewDelegate.h"
#import "MLNMapView+IBAdditions.h"
#import "MLNMultiPoint.h"
#import "MLNNetworkConfiguration.h"
#import "MLNOfflinePack.h"
#import "MLNOfflineRegion.h"
#import "MLNOfflineStorage.h"
#import "MLNCustomStyleLayer.h"
#import "MLNOverlay.h"
#import "MLNPointAnnotation.h"
#import "MLNPointCollection.h"
@@ -55,6 +55,7 @@ FOUNDATION_EXPORT MLN_EXPORT const unsigned char MapboxVersionString[];
#import "MLNRasterDEMSource.h"
#import "MLNRasterStyleLayer.h"
#import "MLNRasterTileSource.h"
#import "MLNSettings.h"
#import "MLNShape.h"
#import "MLNShapeCollection.h"
#import "MLNShapeOfflineRegion.h"
@@ -69,10 +70,9 @@ FOUNDATION_EXPORT MLN_EXPORT const unsigned char MapboxVersionString[];
#import "MLNTypes.h"
#import "MLNUserLocation.h"
#import "MLNUserLocationAnnotationView.h"
#import "MLNUserLocationAnnotationViewStyle.h"
#import "MLNVectorStyleLayer.h"
#import "MLNVectorTileSource.h"
#import "NSExpression+MLNAdditions.h"
#import "NSPredicate+MLNAdditions.h"
#import "NSValue+MLNAdditions.h"
#import "MLNUserLocationAnnotationViewStyle.h"
#import "MLNCustomDrawableStyleLayer.h"

View File

@@ -1,7 +1,7 @@
#import <UIKit/UIKit.h>
#include <mbgl/util/color.hpp>
#include <mbgl/style/property_value.hpp>
#include <mbgl/util/color.hpp>
@interface UIColor (MLNAdditions)

View File

@@ -12,7 +12,8 @@ FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNResourceNotFoundException
- (nullable instancetype)initWithMLNStyleImage:(const mbgl::style::Image &)styleImage;
- (nullable instancetype)initWithMLNPremultipliedImage:(const mbgl::PremultipliedImage&&)mbglImage scale:(CGFloat)scale;
- (nullable instancetype)initWithMLNPremultipliedImage:(const mbgl::PremultipliedImage &&)mbglImage
scale:(CGFloat)scale;
- (std::unique_ptr<mbgl::style::Image>)mgl_styleImageWithIdentifier:(NSString *)identifier;
@@ -20,7 +21,7 @@ FOUNDATION_EXTERN MLN_EXPORT MLNExceptionName const MLNResourceNotFoundException
+ (UIImage *)mgl_resourceImageNamed:(NSString *)imageName;
- (BOOL)isDataEqualTo:(UIImage*)otherImage;
- (BOOL)isDataEqualTo:(UIImage *)otherImage;
@end