summaryrefslogtreecommitdiff
path: root/platform/darwin/src/MGLLight.h
diff options
context:
space:
mode:
authorTobrun <tobrun.van.nuland@gmail.com>2017-07-05 08:37:27 +0200
committerTobrun <tobrun.van.nuland@gmail.com>2017-07-05 08:37:27 +0200
commit14c221fce77ce5041e16db8a40081cbcc54a1902 (patch)
treee887d5d690893f7fcb5001a926e6f41a9fb06c41 /platform/darwin/src/MGLLight.h
parent60eae41549cec18dfeed5175fe1d6c327060a8de (diff)
parentd2d8a575be2d4f28894c0c1f845cbb464869d97c (diff)
downloadqtlocation-mapboxgl-14c221fce77ce5041e16db8a40081cbcc54a1902.tar.gz
Merge branch 'release-ios-v3.6.0-android-v5.1.0'
# Conflicts: # .travis.yml # circle.yml # cmake/core-files.cmake # include/mbgl/style/function/composite_function.hpp # platform/android/CHANGELOG.md # platform/android/MapboxGLAndroidSDK/build.gradle # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/Mapbox.java # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MyBearingTracking.java # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/constants/MyLocationTracking.java # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationSource.java # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/CameraChangeDispatcher.java # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapGestureDetector.java # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapView.java # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMap.java # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/TrackingSettings.java # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/Transform.java # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/widgets/MyLocationView.java # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Light.java # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/Position.java # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/light/light.java.ejs # platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/BitmapUtils.java # platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/LightTest.java # platform/android/MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/light.junit.ejs # platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/camera/CameraPositionActivity.java # platform/android/MapboxGLAndroidSDKTestApp/src/main/java/com/mapbox/mapboxsdk/testapp/activity/userlocation/MockLocationEngine.java # platform/android/dependencies.gradle # platform/android/src/native_map_view.cpp # platform/darwin/scripts/generate-style-code.js # platform/darwin/src/MGLGeometry_Private.h # platform/darwin/src/MGLLight.h # platform/darwin/src/MGLLight.mm # platform/darwin/src/MGLSource.h # platform/darwin/src/MGLStyle.h # platform/darwin/src/MGLStyle.mm # platform/darwin/test/MGLLightTest.mm # platform/default/default_file_source.cpp # platform/ios/CHANGELOG.md # platform/ios/Mapbox-iOS-SDK-symbols.podspec # platform/ios/Mapbox-iOS-SDK.podspec # platform/ios/resources/Images.xcassets/default_marker.imageset/default_marker.pdf # platform/macos/CHANGELOG.md # scripts/generate-shaders.js # src/mbgl/layout/symbol_layout.cpp # src/mbgl/programs/program.hpp # src/mbgl/programs/symbol_program.hpp # src/mbgl/programs/uniforms.hpp # src/mbgl/renderer/frame_history.cpp # src/mbgl/renderer/paint_property_binder.hpp # src/mbgl/shaders/line.cpp # src/mbgl/shaders/line_pattern.cpp # src/mbgl/shaders/line_sdf.cpp # src/mbgl/sprite/sprite_atlas.hpp # src/mbgl/style/layers/line_layer_properties.hpp # src/mbgl/style/sources/geojson_source.cpp # src/mbgl/style/style.cpp # src/mbgl/text/glyph_atlas.hpp # src/mbgl/tile/geometry_tile.cpp # src/mbgl/tile/geometry_tile.hpp # test/style/style.test.cpp
Diffstat (limited to 'platform/darwin/src/MGLLight.h')
-rw-r--r--platform/darwin/src/MGLLight.h120
1 files changed, 94 insertions, 26 deletions
diff --git a/platform/darwin/src/MGLLight.h b/platform/darwin/src/MGLLight.h
index ef9811bd33..55b789f043 100644
--- a/platform/darwin/src/MGLLight.h
+++ b/platform/darwin/src/MGLLight.h
@@ -1,3 +1,6 @@
+// This file is generated.
+// Edit platform/darwin/scripts/generate-style-code.js, then run `make darwin-style-code`.
+
#import <CoreLocation/CoreLocation.h>
#import "MGLFoundation.h"
@@ -5,13 +8,19 @@
NS_ASSUME_NONNULL_BEGIN
-
-/** Options to specify extruded geometries are lit relative to the map or viewport. */
+/**
+ Whether extruded geometries are lit relative to the map or viewport.
+ */
typedef NS_ENUM(NSUInteger, MGLLightAnchor) {
- /** The position of the light source is aligned to the rotation of the map. */
+ /**
+ The position of the light source is aligned to the rotation of the map.
+ */
MGLLightAnchorMap,
- /** The position of the light source is aligned to the rotation of the viewport. */
- MGLLightAnchorViewport
+ /**
+ The position of the light source is aligned to the rotation of the
+ viewport.
+ */
+ MGLLightAnchorViewport,
};
/**
@@ -20,7 +29,7 @@ typedef NS_ENUM(NSUInteger, MGLLightAnchor) {
*/
typedef struct MGLSphericalPosition {
/** Distance from the center of the base of an object to its light. */
- CLLocationDistance radial;
+ CGFloat radial;
/** Position of the light relative to 0° (0° when `MGLLight.anchor` is set to viewport corresponds
to the top of the viewport, or 0° when `MGLLight.anchor` is set to map corresponds to due north,
and degrees proceed clockwise). */
@@ -38,7 +47,7 @@ typedef struct MGLSphericalPosition {
@return Returns a `MGLSphericalPosition` struct containing the position attributes.
*/
-NS_INLINE MGLSphericalPosition MGLSphericalPositionMake(CLLocationDistance radial, CLLocationDirection azimuthal, CLLocationDirection polar) {
+NS_INLINE MGLSphericalPosition MGLSphericalPositionMake(CGFloat radial, CLLocationDirection azimuthal, CLLocationDirection polar) {
MGLSphericalPosition position;
position.radial = radial;
position.azimuthal = azimuthal;
@@ -54,8 +63,17 @@ MGL_EXPORT
@interface MGLLight : NSObject
/**
- `anchor` Whether extruded geometries are lit relative to the map or viewport.
+ Whether extruded geometries are lit relative to the map or viewport.
+
+ The default value of this property is an `MGLStyleValue` object containing an
+ `NSValue` object containing `MGLLightAnchorViewport`.
+ You can set this property to an instance of:
+
+ * `MGLConstantStyleValue`
+ * `MGLCameraStyleFunction` with an interpolation mode of
+ `MGLInterpolationModeInterval`
+
This property corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-js/style-spec/#light-anchor"><code>anchor</code></a>
light property in the Mapbox Style Specification.
@@ -63,14 +81,25 @@ MGL_EXPORT
@property (nonatomic) MGLStyleValue<NSValue *> *anchor;
/**
- Values describing animated transitions to `anchor` property.
- */
-@property (nonatomic) MGLTransition anchorTransition;
-
-
-/**
- Position of the light source relative to lit (extruded) geometries.
+ Position of the `MGLLight` source relative to lit (extruded) geometries, in a
+ `MGLSphericalPosition` struct [radial coordinate, azimuthal angle, polar angle]
+ where radial indicates the distance from the center of the base of an object to
+ its light, azimuthal indicates the position of the light relative to 0° (0°
+ when `MGLLight.anchor` is set to `MGLLightAnchorViewport` corresponds to the
+ top of the viewport, or 0° when `MGLLight.anchor` is set to `MGLLightAnchorMap`
+ corresponds to due north, and degrees proceed clockwise), and polar indicates
+ the height of the light (from 0°, directly above, to 180°, directly below).
+
+ The default value of this property is an `MGLStyleValue` object containing an
+ `MGLSphericalPosition` struct set to 1.15 radial, 210 azimuthal and 30 polar.
+
+ You can set this property to an instance of:
+ * `MGLConstantStyleValue`
+ * `MGLCameraStyleFunction` with an interpolation mode of:
+ * `MGLInterpolationModeExponential`
+ * `MGLInterpolationModeInterval`
+
This property corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-js/style-spec/#light-position"><code>position</code></a>
light property in the Mapbox Style Specification.
@@ -78,48 +107,87 @@ MGL_EXPORT
@property (nonatomic) MGLStyleValue<NSValue *> *position;
/**
- Values describing animated transitions to `position` property.
- */
-@property (nonatomic) MGLTransition positionTransiton;
+ The transition affecting any changes to this layer’s `position` property.
+ This property corresponds to the `position-transition` property in the style JSON file format.
+*/
+@property (nonatomic) MGLTransition positionTransition;
#if TARGET_OS_IPHONE
/**
Color tint for lighting extruded geometries.
+ The default value of this property is an `MGLStyleValue` object containing
+ `UIColor.whiteColor`.
+
+ You can set this property to an instance of:
+
+ * `MGLConstantStyleValue`
+ * `MGLCameraStyleFunction` with an interpolation mode of:
+ * `MGLInterpolationModeExponential`
+ * `MGLInterpolationModeInterval`
+
This property corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-js/style-spec/#light-color"><code>color</code></a>
light property in the Mapbox Style Specification.
*/
@property (nonatomic) MGLStyleValue<UIColor *> *color;
#else
-
/**
Color tint for lighting extruded geometries.
+
+ The default value of this property is an `MGLStyleValue` object containing
+ `NSColor.whiteColor`.
+
+ You can set this property to an instance of:
+
+ * `MGLConstantStyleValue`
+ * `MGLCameraStyleFunction` with an interpolation mode of:
+ * `MGLInterpolationModeExponential`
+ * `MGLInterpolationModeInterval`
+
+ This property corresponds to the <a
+ href="https://www.mapbox.com/mapbox-gl-js/style-spec/#light-color"><code>color</code></a>
+ light property in the Mapbox Style Specification.
*/
@property (nonatomic) MGLStyleValue<NSColor *> *color;
#endif
/**
- Values describing animated transitions to `color` property.
- */
-@property (nonatomic) MGLTransition colorTransiton;
+ The transition affecting any changes to this layer’s `color` property.
+ This property corresponds to the `color-transition` property in the style JSON file format.
+*/
+@property (nonatomic) MGLTransition colorTransition;
/**
- Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as more extreme contrast.
+ Intensity of lighting (on a scale from 0 to 1). Higher numbers will present as
+ more extreme contrast.
+
+ The default value of this property is an `MGLStyleValue` object containing an
+ `NSNumber` object containing the float `0.5`.
+
+ You can set this property to an instance of:
+ * `MGLConstantStyleValue`
+ * `MGLCameraStyleFunction` with an interpolation mode of:
+ * `MGLInterpolationModeExponential`
+ * `MGLInterpolationModeInterval`
+
This property corresponds to the <a
href="https://www.mapbox.com/mapbox-gl-js/style-spec/#light-intensity"><code>intensity</code></a>
light property in the Mapbox Style Specification.
*/
-@property(nonatomic) MGLStyleValue<NSNumber *> *intensity;
+@property (nonatomic) MGLStyleValue<NSNumber *> *intensity;
/**
- Values describing animated transitions to `intensity` property.
- */
+ The transition affecting any changes to this layer’s `intensity` property.
+
+ This property corresponds to the `intensity-transition` property in the style JSON file format.
+*/
@property (nonatomic) MGLTransition intensityTransition;
+
@end
NS_ASSUME_NONNULL_END