summaryrefslogtreecommitdiff
path: root/include/mbgl
diff options
context:
space:
mode:
authorPeter Liu <peterqliu@gmail.com>2015-04-01 17:05:22 -0700
committerPeter Liu <peterqliu@gmail.com>2015-04-01 17:05:22 -0700
commit440864063e916e92eed1b1fe15453e067cbf2781 (patch)
treeee3fbd7b775d79078d10fac4afab43944efe2f94 /include/mbgl
parent523295af7eb591b364fa721191cd96a031106914 (diff)
parent6d1f5aa68ca1dcef05678313404861178e92854a (diff)
downloadqtlocation-mapboxgl-440864063e916e92eed1b1fe15453e067cbf2781.tar.gz
Merge branch 'master' of https://github.com/mapbox/mapbox-gl-native
Diffstat (limited to 'include/mbgl')
-rw-r--r--include/mbgl/ios/MGLMapView.h139
-rw-r--r--include/mbgl/ios/MGLMapboxEvents.h60
-rw-r--r--include/mbgl/ios/MGLMetricsLocationManager.h21
-rw-r--r--include/mbgl/ios/MGLStyleFunctionValue.h23
-rw-r--r--include/mbgl/ios/MGLTypes.h22
-rw-r--r--include/mbgl/ios/MGLUserLocation.h26
-rw-r--r--include/mbgl/ios/MapboxGL.h5
-rw-r--r--include/mbgl/ios/NSArray+MGLAdditions.h7
-rw-r--r--include/mbgl/ios/NSDictionary+MGLAdditions.h7
-rw-r--r--include/mbgl/ios/UIColor+MGLAdditions.h11
-rw-r--r--include/mbgl/map/map.hpp18
-rw-r--r--include/mbgl/map/view.hpp17
-rw-r--r--include/mbgl/platform/darwin/settings_nsuserdefaults.hpp5
13 files changed, 247 insertions, 114 deletions
diff --git a/include/mbgl/ios/MGLMapView.h b/include/mbgl/ios/MGLMapView.h
index 3a6e622e12..bacef9d33d 100644
--- a/include/mbgl/ios/MGLMapView.h
+++ b/include/mbgl/ios/MGLMapView.h
@@ -1,6 +1,10 @@
+#import "MGLTypes.h"
+
#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
+@class MGLUserLocation;
+
@protocol MGLMapViewDelegate;
@protocol MGLAnnotation;
@@ -29,6 +33,13 @@
* @return An initialized map view, or `nil` if the map view was unable to be initialized. */
- (instancetype)initWithFrame:(CGRect)frame accessToken:(NSString *)accessToken bundledStyleNamed:(NSString *)styleName;
+/** Initialize a map view with a given frame, style URL, and access token.
+* @param frame The frame with which to initialize the map view.
+* @param accessToken A Mapbox API access token.
+* @param styleURL The map style URL to use. Can be either an HTTP/HTTPS URL or a Mapbox map ID style URL (`mapbox://<user.style>`).
+* @return An initialized map view, or `nil` if the map view was unable to be initialized. */
+- (instancetype)initWithFrame:(CGRect)frame accessToken:(NSString *)accessToken styleURL:(NSURL *)styleURL;
+
/** Initialize a map view with a given frame, the default style, and an access token.
* @param frame The frame with which to initialize the map view.
* @param accessToken A Mapbox API access token.
@@ -185,6 +196,10 @@
* @param styleName The map style name to use. */
- (void)useBundledStyleNamed:(NSString *)styleName;
+/** Sets the map style URL to use.
+* @param styleURL The map style URL to use. Can be either an HTTP/HTTPS URL or a Mapbox map ID style URL (`mapbox://<user.style>`). */
+- (void)setStyleURL:(NSURL *)styleURL;
+
#pragma mark - Annotating the Map
/** @name Annotating the Map */
@@ -234,6 +249,30 @@
* @param animated If `YES`, the callout view is animated offscreen. */
- (void)deselectAnnotation:(id <MGLAnnotation>)annotation animated:(BOOL)animated;
+#pragma mark - Displaying the User's Location
+
+/** A Boolean value indicating whether the map may display the user location.
+
+ This property does not indicate whether the user’s position is actually visible on the map, only whether the map view is allowed to display it. To determine whether the user’s position is visible, use the userLocationVisible property. The default value of this property is `NO`.
+
+ Setting this property to `YES` causes the map view to use the Core Location framework to find the current location. As long as this property is `YES`, the map view continues to track the user’s location and update it periodically.
+
+ On iOS 8 and above, your app must specify a value for `NSLocationWhenInUseUsageDescription` in its `Info.plist` to satisfy the requirements of the underlying Core Location framework when enabling this property.
+ */
+@property (nonatomic, assign) BOOL showsUserLocation;
+
+/// Returns a Boolean value indicating whether the user currently sees the user location annotation.
+@property (nonatomic, assign, readonly, getter=isUserLocationVisible) BOOL userLocationVisible;
+
+/// Returns the annotation object indicating the user’s current location.
+@property (nonatomic, readonly) MGLUserLocation *userLocation;
+
+/** The mode used to track the user location. */
+@property (nonatomic, assign) MGLUserTrackingMode userTrackingMode;
+
+/** Whether the map view should display a heading calibration alert when necessary. The default value is `YES`. */
+@property (nonatomic, assign) BOOL displayHeadingCalibration;
+
#pragma mark - Debugging
/** @name Debugging */
@@ -251,11 +290,15 @@
@end
+#pragma mark - MGLMapViewDelegate
+
/** The MGLMapViewDelegate protocol defines a set of optional methods that you can use to receive map-related update messages. Because many map operations require the MGLMapView class to load data asynchronously, the map view calls these methods to notify your application when specific operations complete. The map view also uses these methods to request annotation marker symbology and to manage interactions with those markers. */
@protocol MGLMapViewDelegate <NSObject>
@optional
+#pragma mark - Managing the Display of Annotations
+
/** @name Managing the Display of Annotations */
/** Returns the style's symbol name to use for the marker for the specified point annotation object.
@@ -264,14 +307,54 @@
* @return The marker symbol to display for the specified annotation or `nil` if you want to display the default symbol. */
- (NSString *)mapView:(MGLMapView *)mapView symbolNameForAnnotation:(id <MGLAnnotation>)annotation;
+/** Returns a Boolean value indicating whether the annotation is able to display extra information in a callout bubble.
+*
+* If the value returned is `YES`, a standard callout bubble is shown when the user taps a selected annotation. The callout uses the title and subtitle text from the associated annotation object. If there is no title text, though, the annotation will not show a callout. The callout also displays any custom callout views returned by the delegate for the left and right callout accessory views.
+*
+* If the value returned is `NO`, the value of the title and subtitle strings are ignored.
+*
+* @param mapView The map view that requested the annotation callout ability.
+* @param annotation The object representing the annotation.
+* @return A Boolean indicating whether the annotation should show a callout. */
+- (BOOL)mapView:(MGLMapView *)mapView annotationCanShowCallout:(id <MGLAnnotation>)annotation;
+
+/** Return the view to display on the left side of the standard callout bubble.
+*
+* The default value is treated as if `nil`. The left callout view is typically used to display information about the annotation or to link to custom information provided by your application.
+*
+* If the view you specify is also a descendant of the `UIControl` class, you can use the map view’s delegate to receive notifications when your control is tapped. If it does not descend from `UIControl`, your view is responsible for handling any touch events within its bounds.
+*
+* @param mapView The map view presenting the annotation callout.
+* @param annotation The object representing the annotation with the callout.
+* @return The accessory view to display. */
+- (UIView *)mapView:(MGLMapView *)mapView leftCalloutAccessoryViewForAnnotation:(id <MGLAnnotation>)annotation;
+
+/** Return the view to display on the right side of the standard callout bubble.
+*
+* The default value is treated is if `nil`. The right callout view is typically used to link to more detailed information about the annotation. A common view to specify for this property is `UIButton` object whose type is set to `UIButtonTypeDetailDisclosure`.
+*
+* If the view you specify is also a descendant of the `UIControl` class, you can use the map view’s delegate to receive notifications when your control is tapped. If it does not descend from `UIControl`, your view is responsible for handling any touch events within its bounds.
+*
+* @param mapView The map view presenting the annotation callout.
+* @param annotation The object representing the annotation with the callout.
+* @return The accessory view to display. */
+- (UIView *)mapView:(MGLMapView *)mapView rightCalloutAccessoryViewForAnnotation:(id <MGLAnnotation>)annotation;
+
+#pragma mark - Responding to Map Position Changes
+
// Responding to Map Position Changes
// TODO
- (void)mapView:(MGLMapView *)mapView regionWillChangeAnimated:(BOOL)animated;
// TODO
+- (void)mapViewRegionIsChanging:(MGLMapView *)mapView;
+
+// TODO
- (void)mapView:(MGLMapView *)mapView regionDidChangeAnimated:(BOOL)animated;
+#pragma mark - Loading the Map Data
+
// Loading the Map Data
// TODO
@@ -289,4 +372,60 @@
// TODO
- (void)mapViewDidFinishRenderingMap:(MGLMapView *)mapView fullyRendered:(BOOL)fullyRendered;
+#pragma mark - Tracking the User Location
+
+/// Tells the delegate that the map view will begin tracking the user’s location.
+- (void)mapViewWillStartLocatingUser:(MGLMapView *)mapView;
+
+/// Tells the delegate that the map view has stopped tracking the user’s location.
+- (void)mapViewDidStopLocatingUser:(MGLMapView *)mapView;
+
+/// Tells the delegate that the map view has updated the user’s location to the given location.
+- (void)mapView:(MGLMapView *)mapView didUpdateUserLocation:(MGLUserLocation *)userLocation;
+
+/// Tells the delegate that the map view has failed to locate the user.
+- (void)mapView:(MGLMapView *)mapView didFailToLocateUserWithError:(NSError *)error;
+
+/**
+ Tells the delegate that the map view’s user tracking mode has changed.
+
+ This method is called after the map view asynchronously changes to reflect the new user tracking mode, for example by beginning to zoom or rotate.
+ */
+- (void)mapView:(MGLMapView *)mapView didChangeUserTrackingMode:(MGLUserTrackingMode)mode animated:(BOOL)animated;
+
+#pragma mark - Managing Annotations
+
+/** @name Managing Annotations */
+
+/* Tells the delegate that the user tapped one of the annotation's accessory buttons.
+*
+* Accessory views contain custom content and are positioned on either side of the annotation title text. If a view you specify is a descendant of the `UIControl` class, the map view calls this method as a convenience whenever the user taps your view. You can use this method to respond to taps and perform any actions associated with that control. For example, if your control displayed additional information about the annotation, you could use this method to present a modal panel with that information.
+*
+* If your custom accessory views are not descendants of the `UIControl` class, the map view does not call this method.
+*
+* @param mapView The map view containing the specified annotation.
+* @param annotation The annotation whose button was tapped.
+* @param control The control that was tapped. */
+- (void)mapView:(MGLMapView *)mapView annotation:(id <MGLAnnotation>)annotation calloutAccessoryControlTapped:(UIControl *)control;
+
+#pragma mark - Selecting Annotations
+
+/** @name Selecting Annotations */
+
+/* Tells the delegate that one of its annotations was selected.
+*
+* You can use this method to track changes in the selection state of annotations.
+*
+* @param mapView The map view containing the annotation.
+* @param annotation The annotation that was selected. */
+- (void)mapView:(MGLMapView *)mapView didSelectAnnotation:(id <MGLAnnotation>)annotation;
+
+/* Tells the delegate that one of its annotations was deselected.
+*
+* You can use this method to track changes in the selection state of annotations.
+*
+* @param mapView The map view containing the annotation.
+* @param annotation The annotation that was deselected. */
+- (void)mapView:(MGLMapView *)mapView didDeselectAnnotation:(id <MGLAnnotation>)annotation;
+
@end
diff --git a/include/mbgl/ios/MGLMapboxEvents.h b/include/mbgl/ios/MGLMapboxEvents.h
index bb28ec26c5..ea37edbb8e 100644
--- a/include/mbgl/ios/MGLMapboxEvents.h
+++ b/include/mbgl/ios/MGLMapboxEvents.h
@@ -1,26 +1,50 @@
-//
-// MapboxEvents.h
-// MapboxEvents
-//
-// Created by Brad Leege on 3/5/15.
-// Copyright (c) 2015 Mapbox. All rights reserved.
-//
-
#import <Foundation/Foundation.h>
+extern NSString *const MGLEventTypeMapLoad;
+extern NSString *const MGLEventTypeMapTap;
+extern NSString *const MGLEventTypeMapDragEnd;
+extern NSString *const MGLEventTypeLocation;
+
+extern NSString *const MGLEventKeyLatitude;
+extern NSString *const MGLEventKeyLongitude;
+extern NSString *const MGLEventKeyZoomLevel;
+extern NSString *const MGLEventKeyPushEnabled;
+extern NSString *const MGLEventKeyEmailEnabled;
+extern NSString *const MGLEventKeyGestureID;
+
+extern NSString *const MGLEventGestureSingleTap;
+extern NSString *const MGLEventGestureDoubleTap;
+extern NSString *const MGLEventGestureTwoFingerSingleTap;
+extern NSString *const MGLEventGestureQuickZoom;
+extern NSString *const MGLEventGesturePanStart;
+extern NSString *const MGLEventGesturePinchStart;
+extern NSString *const MGLEventGestureRotateStart;
+
@interface MGLMapboxEvents : NSObject
-@property (atomic) NSInteger flushAt;
-@property (atomic) NSInteger flushAfter;
-@property (atomic) NSString *api;
-@property (atomic) NSString *token;
-@property (atomic) NSString *appName;
-@property (atomic) NSString *appVersion;
+// You must call these methods from the main thread.
+//
++ (void) setToken:(NSString *)token;
++ (void) setAppName:(NSString *)appName;
++ (void) setAppVersion:(NSString *)appVersion;
-+ (id)sharedManager;
+// You can call this method from any thread. Significant work will
+// be dispatched to a low-priority background queue and all
+// resulting calls are guaranteed threadsafe.
+//
+// Events or attributes passed could be accessed on non-main threads,
+// so you must not reference UI elements from within any arguments.
+// Copy any values needed first or create dedicated methods in this
+// class for threadsafe access to UIKit classes.
+//
++ (void) pushEvent:(NSString *)event withAttributes:(NSDictionary *)attributeDictionary;
-- (void) pushEvent:(NSString *)event withAttributes:(NSDictionary *)attributeDictionary;
+// You can call these methods from any thread.
+//
++ (BOOL) checkPushEnabled;
-- (void) flush;
+// You can call this method from any thread.
+//
++ (void) flush;
-@end \ No newline at end of file
+@end
diff --git a/include/mbgl/ios/MGLMetricsLocationManager.h b/include/mbgl/ios/MGLMetricsLocationManager.h
index ce04ae9ef6..7281d05010 100644
--- a/include/mbgl/ios/MGLMetricsLocationManager.h
+++ b/include/mbgl/ios/MGLMetricsLocationManager.h
@@ -1,22 +1,9 @@
-//
-// MBLocationManager.h
-// Hermes
-//
-// Created by Brad Leege on 3/8/15.
-// Copyright (c) 2015 Mapbox. All rights reserved.
-//
-
#import <Foundation/Foundation.h>
-#import "CoreLocation/CoreLocation.h"
-@interface MGLMetricsLocationManager : NSObject <CLLocationManagerDelegate>
+@interface MGLMetricsLocationManager : NSObject
-+ (id)sharedManager;
-
-- (BOOL) isAuthorizedStatusDetermined;
-- (void) requestAlwaysAuthorization;
-
-- (void) startUpdatingLocation;
-- (void) stopUpdatingLocation;
+// This method can be called from any thread.
+//
++ (instancetype)sharedManager;
@end
diff --git a/include/mbgl/ios/MGLStyleFunctionValue.h b/include/mbgl/ios/MGLStyleFunctionValue.h
deleted file mode 100644
index 27a867548b..0000000000
--- a/include/mbgl/ios/MGLStyleFunctionValue.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#import <UIKit/UIKit.h>
-
-@interface MGLStyleFunctionValue : NSObject
-
-+ (instancetype)linearFunctionWithBaseZoomLevel:(CGFloat)zBase
- initialValue:(CGFloat)val
- slope:(CGFloat)slope
- minimumValue:(CGFloat)min
- maximumValue:(CGFloat)max;
-
-+ (instancetype)exponentialFunctionWithBaseZoomLevel:(CGFloat)zBase
- initialValue:(CGFloat)val
- slope:(CGFloat)slope
- minimumValue:(CGFloat)min
- maximumValue:(CGFloat)max;
-
-+ (instancetype)minimumZoomLevelFunction:(CGFloat)minimumZoom;
-
-+ (instancetype)maximumZoomLevelFunction:(CGFloat)maximumZoom;
-
-+ (instancetype)stopsFunctionWithZoomLevelsAndValues:(NSNumber *)firstZoom, ... NS_REQUIRES_NIL_TERMINATION;
-
-@end
diff --git a/include/mbgl/ios/MGLTypes.h b/include/mbgl/ios/MGLTypes.h
index 7a17445770..4c2e58b24b 100644
--- a/include/mbgl/ios/MGLTypes.h
+++ b/include/mbgl/ios/MGLTypes.h
@@ -1,17 +1,9 @@
#import <Foundation/Foundation.h>
-// style property value types
-//
-extern NSString *const MGLStyleValueTypeBoolean;
-extern NSString *const MGLStyleValueTypeNumber;
-extern NSString *const MGLStyleValueTypeNumberPair;
-extern NSString *const MGLStyleValueTypeColor;
-extern NSString *const MGLStyleValueTypeString;
-
-// style property function types
-//
-extern NSString *const MGLStyleValueTypeFunctionMinimumZoom;
-extern NSString *const MGLStyleValueTypeFunctionMaximumZoom;
-extern NSString *const MGLStyleValueTypeFunctionLinear;
-extern NSString *const MGLStyleValueTypeFunctionExponential;
-extern NSString *const MGLStyleValueTypeFunctionStops;
+/// The degree to which the map view tracks the user’s location.
+typedef NS_ENUM(NSUInteger, MGLUserTrackingMode)
+{
+ MGLUserTrackingModeNone = 0, ///< does not track the user’s location or heading
+ MGLUserTrackingModeFollow = 1, ///< tracks the user’s location
+ MGLUserTrackingModeFollowWithHeading = 2, ///< tracks the user’s location and heading
+};
diff --git a/include/mbgl/ios/MGLUserLocation.h b/include/mbgl/ios/MGLUserLocation.h
new file mode 100644
index 0000000000..fee3368889
--- /dev/null
+++ b/include/mbgl/ios/MGLUserLocation.h
@@ -0,0 +1,26 @@
+#import "MGLAnnotation.h"
+
+@interface MGLUserLocation : NSObject <MGLAnnotation>
+
+@property (nonatomic, readonly) CLLocationCoordinate2D coordinate;
+
+/** @name Determining the User’s Position */
+
+/** The current location of the device. (read-only)
+*
+* This property contains `nil` if the map view is not currently showing the user location or if the user’s location has not yet been determined. */
+@property (nonatomic, readonly) CLLocation *location;
+
+/** A Boolean value indicating whether the user’s location is currently being updated. (read-only) */
+@property (nonatomic, readonly, getter=isUpdating) BOOL updating; // FIXME
+
+/** The heading of the user location. (read-only)
+*
+* This property is `nil` if the user location tracking mode is not `RMUserTrackingModeFollowWithHeading`. */
+@property (nonatomic, readonly) CLHeading *heading;
+
+@property (nonatomic, copy) NSString *title;
+
+@property (nonatomic, copy) NSString *subtitle;
+
+@end
diff --git a/include/mbgl/ios/MapboxGL.h b/include/mbgl/ios/MapboxGL.h
index 237d493f31..c32915bc76 100644
--- a/include/mbgl/ios/MapboxGL.h
+++ b/include/mbgl/ios/MapboxGL.h
@@ -1,7 +1,4 @@
#import "MGLAnnotation.h"
#import "MGLMapView.h"
-#import "MGLStyleFunctionValue.h"
#import "MGLTypes.h"
-#import "NSArray+MGLAdditions.h"
-#import "NSDictionary+MGLAdditions.h"
-#import "UIColor+MGLAdditions.h"
+#import "MGLUserLocation.h"
diff --git a/include/mbgl/ios/NSArray+MGLAdditions.h b/include/mbgl/ios/NSArray+MGLAdditions.h
deleted file mode 100644
index 4b87614330..0000000000
--- a/include/mbgl/ios/NSArray+MGLAdditions.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#import <Foundation/Foundation.h>
-
-@interface NSArray (MGLAdditions)
-
-- (NSMutableArray *)deepMutableCopy;
-
-@end
diff --git a/include/mbgl/ios/NSDictionary+MGLAdditions.h b/include/mbgl/ios/NSDictionary+MGLAdditions.h
deleted file mode 100644
index 04c3396d41..0000000000
--- a/include/mbgl/ios/NSDictionary+MGLAdditions.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#import <Foundation/Foundation.h>
-
-@interface NSDictionary (MGLAdditions)
-
-- (NSMutableDictionary *)deepMutableCopy;
-
-@end
diff --git a/include/mbgl/ios/UIColor+MGLAdditions.h b/include/mbgl/ios/UIColor+MGLAdditions.h
deleted file mode 100644
index 3758c04eef..0000000000
--- a/include/mbgl/ios/UIColor+MGLAdditions.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#import <UIKit/UIKit.h>
-
-@interface UIColor (MGLAdditions)
-
-+ (UIColor *)colorWithRGBAString:(NSString *)rgbaString;
-- (NSString *)rgbaStringFromColor;
-
-+ (UIColor *)colorWithHexString:(NSString *)hexString;
-- (NSString *)hexStringFromColor;
-
-@end
diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp
index 0fb2065cca..cd280d0247 100644
--- a/include/mbgl/map/map.hpp
+++ b/include/mbgl/map/map.hpp
@@ -15,6 +15,7 @@
#include <iosfwd>
#include <set>
#include <vector>
+#include <queue>
#include <mutex>
#include <condition_variable>
#include <functional>
@@ -28,7 +29,6 @@ class LayerDescription;
class Sprite;
class Style;
class StyleLayer;
-class StyleLayerGroup;
class StyleSource;
class TexturePool;
class FileSource;
@@ -153,13 +153,14 @@ public:
// Annotations
void setDefaultPointAnnotationSymbol(const std::string&);
+ double getTopOffsetPixelsForAnnotationSymbol(const std::string&);
uint32_t addPointAnnotation(const LatLng&, const std::string& symbol);
std::vector<uint32_t> addPointAnnotations(const std::vector<LatLng>&,
const std::vector<std::string>& symbols);
void removeAnnotation(uint32_t);
void removeAnnotations(const std::vector<uint32_t>&);
- std::vector<uint32_t> getAnnotationsInBounds(const LatLngBounds&) const;
- LatLngBounds getBoundsForAnnotations(const std::vector<uint32_t>&) const;
+ std::vector<uint32_t> getAnnotationsInBounds(const LatLngBounds&);
+ LatLngBounds getBoundsForAnnotations(const std::vector<uint32_t>&);
// Debug
void setDebug(bool value);
@@ -186,7 +187,6 @@ private:
void updateTiles();
void updateSources();
- void updateSources(const util::ptr<StyleLayerGroup> &group);
// Triggered by triggerUpdate();
void update();
@@ -199,6 +199,12 @@ private:
// the stylesheet.
void prepare();
+ // Runs the function in the map thread.
+ void invokeTask(std::function<void()>&&);
+ template <typename Fn> auto invokeSyncTask(const Fn& fn) -> decltype(fn());
+
+ void processTasks();
+
void updateAnnotationTiles(const std::vector<Tile::ID>&);
enum class Mode : uint8_t {
@@ -218,6 +224,7 @@ private:
std::thread thread;
std::unique_ptr<uv::async> asyncTerminate;
std::unique_ptr<uv::async> asyncUpdate;
+ std::unique_ptr<uv::async> asyncInvoke;
std::unique_ptr<uv::async> asyncRender;
bool terminating = false;
@@ -256,6 +263,9 @@ private:
std::set<util::ptr<StyleSource>> activeSources;
std::atomic<UpdateType> updated;
+
+ std::mutex mutexTask;
+ std::queue<std::function<void()>> tasks;
};
}
diff --git a/include/mbgl/map/view.hpp b/include/mbgl/map/view.hpp
index 1ee9d300c5..bcfeb62cfc 100644
--- a/include/mbgl/map/view.hpp
+++ b/include/mbgl/map/view.hpp
@@ -10,14 +10,15 @@ class Map;
enum MapChange : uint8_t {
MapChangeRegionWillChange = 0,
MapChangeRegionWillChangeAnimated = 1,
- MapChangeRegionDidChange = 2,
- MapChangeRegionDidChangeAnimated = 3,
- MapChangeWillStartLoadingMap = 4,
- MapChangeDidFinishLoadingMap = 5,
- MapChangeDidFailLoadingMap = 6,
- MapChangeWillStartRenderingMap = 7,
- MapChangeDidFinishRenderingMap = 8,
- MapChangeDidFinishRenderingMapFullyRendered = 9
+ MapChangeRegionIsChanging = 2,
+ MapChangeRegionDidChange = 3,
+ MapChangeRegionDidChangeAnimated = 4,
+ MapChangeWillStartLoadingMap = 5,
+ MapChangeDidFinishLoadingMap = 6,
+ MapChangeDidFailLoadingMap = 7,
+ MapChangeWillStartRenderingMap = 8,
+ MapChangeDidFinishRenderingMap = 9,
+ MapChangeDidFinishRenderingMapFullyRendered = 10
};
class View {
diff --git a/include/mbgl/platform/darwin/settings_nsuserdefaults.hpp b/include/mbgl/platform/darwin/settings_nsuserdefaults.hpp
index 3533e3da35..6c91fd3029 100644
--- a/include/mbgl/platform/darwin/settings_nsuserdefaults.hpp
+++ b/include/mbgl/platform/darwin/settings_nsuserdefaults.hpp
@@ -1,6 +1,8 @@
#ifndef MBGL_COMMON_SETTINGS_NSUSERDEFAULTS
#define MBGL_COMMON_SETTINGS_NSUSERDEFAULTS
+#import <mbgl/ios/MGLTypes.h>
+
namespace mbgl {
class Settings_NSUserDefaults {
@@ -16,6 +18,9 @@ public:
double zoom = 0;
double bearing = 0;
+ MGLUserTrackingMode userTrackingMode = MGLUserTrackingModeNone;
+ bool showsUserLocation = false;
+
bool debug = false;
};