diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2015-08-31 16:45:21 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2015-08-31 16:45:21 -0700 |
commit | abc1c84fb817a8e31dd1226a633dc895fdae602e (patch) | |
tree | 0eef59c9f60a19b722b413f9deef20982cb77b45 /include | |
parent | 119a9fbf776fc488b19668f54cc68998ebdfb12a (diff) | |
parent | 831df11ec47cb44f6664490a361ff42ef288ce9b (diff) | |
download | qtlocation-mapboxgl-abc1c84fb817a8e31dd1226a633dc895fdae602e.tar.gz |
Merge branch 'master' into node
Diffstat (limited to 'include')
-rw-r--r-- | include/mbgl/android/jni.hpp | 7 | ||||
-rw-r--r-- | include/mbgl/ios/MGLMapView.h | 21 | ||||
-rw-r--r-- | include/mbgl/map/map.hpp | 4 | ||||
-rw-r--r-- | include/mbgl/platform/darwin/settings_nsuserdefaults.hpp | 1 | ||||
-rw-r--r-- | include/mbgl/util/mat4.hpp | 13 |
5 files changed, 41 insertions, 5 deletions
diff --git a/include/mbgl/android/jni.hpp b/include/mbgl/android/jni.hpp index 62cb399d3f..07c44fc7ad 100644 --- a/include/mbgl/android/jni.hpp +++ b/include/mbgl/android/jni.hpp @@ -43,6 +43,13 @@ extern jfieldID latLngZoomLatitudeId; extern jfieldID latLngZoomLongitudeId; extern jfieldID latLngZoomZoomId; +extern jclass bboxClass; +extern jmethodID bboxConstructorId; +extern jfieldID bboxLatNorthId; +extern jfieldID bboxLatSouthId; +extern jfieldID bboxLonEastId; +extern jfieldID bboxLonWestId; + extern jclass markerClass; extern jmethodID markerConstructorId; extern jfieldID markerPositionId; diff --git a/include/mbgl/ios/MGLMapView.h b/include/mbgl/ios/MGLMapView.h index 2b9a3d2913..fc70f3d904 100644 --- a/include/mbgl/ios/MGLMapView.h +++ b/include/mbgl/ios/MGLMapView.h @@ -74,6 +74,13 @@ IB_DESIGNABLE * The default value of this property is `YES`. */ @property(nonatomic, getter=isRotateEnabled) BOOL rotateEnabled; +/** A Boolean value that determines whether the user may change the pitch (tilt) of the map. + * + * This property controls only user interactions with the map. If you set the value of this property to `NO`, you may still change the pitch of the map programmatically. + * + * The default value of this property is `YES`. */ +@property(nonatomic, getter=isPitchEnabled) BOOL pitchEnabled; + /** The compass image view shown in the upper-right when the map is rotated. */ @property (nonatomic, readonly) UIImageView *compassView; @@ -173,6 +180,20 @@ IB_DESIGNABLE /** Resets the map rotation to a northern heading. */ - (IBAction)resetNorth; +/** The pitch of the map (measured in degrees). + * + * The default value `0` shows a completely flat map. Maximum value is `60`. */ +@property (nonatomic) double pitch; + +/** Changes the pitch of the map. + * @param pitch The pitch of the map (measured in degrees) relative to top-down. + * + * Changing the pitch tilts the map without changing the current center coordinate or zoom level. */ +- (void)setPitch:(double)pitch; + +/** Resets the map pitch to head-on. */ +- (IBAction)resetPitch; + #pragma mark - Converting Map Coordinates /** @name Converting Map Coordinates */ diff --git a/include/mbgl/map/map.hpp b/include/mbgl/map/map.hpp index ebd79620d6..bd8847d420 100644 --- a/include/mbgl/map/map.hpp +++ b/include/mbgl/map/map.hpp @@ -123,6 +123,10 @@ public: double getBearing() const; void resetNorth(); + // Pitch + void setPitch(double pitch); + double getPitch() const; + // Size uint16_t getWidth() const; uint16_t getHeight() const; diff --git a/include/mbgl/platform/darwin/settings_nsuserdefaults.hpp b/include/mbgl/platform/darwin/settings_nsuserdefaults.hpp index 6c91fd3029..615320ee55 100644 --- a/include/mbgl/platform/darwin/settings_nsuserdefaults.hpp +++ b/include/mbgl/platform/darwin/settings_nsuserdefaults.hpp @@ -17,6 +17,7 @@ public: double latitude = 0; double zoom = 0; double bearing = 0; + double pitch = 0; MGLUserTrackingMode userTrackingMode = MGLUserTrackingModeNone; bool showsUserLocation = false; diff --git a/include/mbgl/util/mat4.hpp b/include/mbgl/util/mat4.hpp index 4279113d21..9c34332400 100644 --- a/include/mbgl/util/mat4.hpp +++ b/include/mbgl/util/mat4.hpp @@ -27,16 +27,19 @@ namespace mbgl { -typedef std::array<float, 16> mat4; +typedef std::array<double, 16> mat4; namespace matrix { void identity(mat4& out); -void ortho(mat4& out, float left, float right, float bottom, float top, float near, float far); +bool invert(mat4& out, mat4& a); +void ortho(mat4& out, double left, double right, double bottom, double top, double near, double far); +void perspective(mat4& out, double fovy, double aspect, double near, double far); void copy(mat4& out, const mat4& a); -void translate(mat4& out, const mat4& a, float x, float y, float z); -void rotate_z(mat4& out, const mat4& a, float rad); -void scale(mat4& out, const mat4& a, float x, float y, float z); +void translate(mat4& out, const mat4& a, double x, double y, double z); +void rotate_x(mat4& out, const mat4& a, double rad); +void rotate_z(mat4& out, const mat4& a, double rad); +void scale(mat4& out, const mat4& a, double x, double y, double z); void multiply(mat4& out, const mat4& a, const mat4& b); } |