summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2018-07-04 23:12:58 +0300
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2018-07-05 15:11:14 +0300
commit514485502db8ecacf2b11abad4599d7af09b0cf8 (patch)
tree21a76d2fda8b5ec5e19624f5eedf609a545b59b4 /platform
parent32dce870d756063167e000302afb553714f1f0cb (diff)
downloadqtlocation-mapboxgl-514485502db8ecacf2b11abad4599d7af09b0cf8.tar.gz
Rename `HeatmapColorPropertyValue` to `ColorRampPropertyValue`
Based on patch from @lbud (Lauren Budorick). Give `HeatmapColorPropertyValue` a more generic name, since the same value type will be used for both `heatmap-color` and `line-gradient` properties.
Diffstat (limited to 'platform')
-rw-r--r--platform/android/src/style/conversion/property_value.hpp10
-rw-r--r--platform/darwin/src/MGLHeatmapStyleLayer.mm2
-rw-r--r--platform/darwin/src/MGLStyleLayer.mm.ejs2
-rw-r--r--platform/darwin/src/MGLStyleValue_Private.h10
4 files changed, 12 insertions, 12 deletions
diff --git a/platform/android/src/style/conversion/property_value.hpp b/platform/android/src/style/conversion/property_value.hpp
index 902d1e80b2..e6fbe42179 100644
--- a/platform/android/src/style/conversion/property_value.hpp
+++ b/platform/android/src/style/conversion/property_value.hpp
@@ -1,8 +1,8 @@
#pragma once
-#include <mbgl/style/property_value.hpp>
+#include <mbgl/style/color_ramp_property_value.hpp>
#include <mbgl/style/data_driven_property_value.hpp>
-#include <mbgl/style/heatmap_color_property_value.hpp>
+#include <mbgl/style/property_value.hpp>
#include "../../conversion/conversion.hpp"
#include "../../conversion/constant.hpp"
#include "types.hpp"
@@ -75,10 +75,10 @@ struct Converter<jni::jobject*, mbgl::style::DataDrivenPropertyValue<T>> {
* Convert core heat map color property value to java
*/
template <>
-struct Converter<jni::jobject*, mbgl::style::HeatmapColorPropertyValue> {
+struct Converter<jni::jobject*, mbgl::style::ColorRampPropertyValue> {
- Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::HeatmapColorPropertyValue value) const {
- PropertyValueEvaluator<mbgl::style::HeatmapColorPropertyValue> evaluator(env);
+ Result<jni::jobject*> operator()(jni::JNIEnv& env, const mbgl::style::ColorRampPropertyValue value) const {
+ PropertyValueEvaluator<mbgl::style::ColorRampPropertyValue> evaluator(env);
return *convert<jni::jobject*>(env, value.evaluate(evaluator));
}
};
diff --git a/platform/darwin/src/MGLHeatmapStyleLayer.mm b/platform/darwin/src/MGLHeatmapStyleLayer.mm
index 925b3ac750..5e6b5df319 100644
--- a/platform/darwin/src/MGLHeatmapStyleLayer.mm
+++ b/platform/darwin/src/MGLHeatmapStyleLayer.mm
@@ -71,7 +71,7 @@
- (void)setHeatmapColor:(NSExpression *)heatmapColor {
MGLAssertStyleLayerIsValid();
- auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::HeatmapColorPropertyValue>(heatmapColor);
+ auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::ColorRampPropertyValue>(heatmapColor);
self.rawLayer->setHeatmapColor(mbglValue);
}
diff --git a/platform/darwin/src/MGLStyleLayer.mm.ejs b/platform/darwin/src/MGLStyleLayer.mm.ejs
index f3e75b492c..1e760749e9 100644
--- a/platform/darwin/src/MGLStyleLayer.mm.ejs
+++ b/platform/darwin/src/MGLStyleLayer.mm.ejs
@@ -164,7 +164,7 @@ namespace mbgl {
<% switch (property['property-type']) {
case 'color-ramp': -%>
- auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::HeatmapColorPropertyValue>(heatmapColor);
+ auto mbglValue = MGLStyleValueTransformer<mbgl::Color, MGLColor *>().toPropertyValue<mbgl::style::ColorRampPropertyValue>(heatmapColor);
<% break
case 'data-driven':
case 'cross-faded-data-driven': -%>
diff --git a/platform/darwin/src/MGLStyleValue_Private.h b/platform/darwin/src/MGLStyleValue_Private.h
index cc63793d0d..27f9e76632 100644
--- a/platform/darwin/src/MGLStyleValue_Private.h
+++ b/platform/darwin/src/MGLStyleValue_Private.h
@@ -8,9 +8,9 @@
#import "MGLTypes.h"
#import "MGLConversion.h"
+#include <mbgl/style/conversion/color_ramp_property_value.hpp>
#include <mbgl/style/conversion/property_value.hpp>
#include <mbgl/style/conversion/data_driven_property_value.hpp>
-#include <mbgl/style/conversion/heatmap_color_property_value.hpp>
#include <mbgl/style/conversion/position.hpp>
#import <mbgl/style/types.hpp>
@@ -54,7 +54,7 @@ public:
}
// Convert an mbgl heatmap color property value into an mgl style value
- NSExpression *toExpression(const mbgl::style::HeatmapColorPropertyValue &mbglValue) {
+ NSExpression *toExpression(const mbgl::style::ColorRampPropertyValue &mbglValue) {
if (mbglValue.isUndefined()) {
return nil;
}
@@ -65,7 +65,7 @@ public:
Converts an NSExpression to an mbgl property value.
*/
template <typename MBGLValue>
- typename std::enable_if_t<!std::is_same<MBGLValue, mbgl::style::HeatmapColorPropertyValue>::value,
+ typename std::enable_if_t<!std::is_same<MBGLValue, mbgl::style::ColorRampPropertyValue>::value,
MBGLValue> toPropertyValue(NSExpression *expression) {
if (!expression) {
return {};
@@ -100,7 +100,7 @@ public:
Converts an NSExpression to an mbgl property value.
*/
template <typename MBGLValue>
- typename std::enable_if_t<std::is_same<MBGLValue, mbgl::style::HeatmapColorPropertyValue>::value,
+ typename std::enable_if_t<std::is_same<MBGLValue, mbgl::style::ColorRampPropertyValue>::value,
MBGLValue> toPropertyValue(NSExpression *expression) {
if (!expression) {
return {};
@@ -109,7 +109,7 @@ public:
NSArray *jsonExpression = expression.mgl_jsonExpressionObject;
mbgl::style::conversion::Error valueError;
- auto value = mbgl::style::conversion::convert<mbgl::style::HeatmapColorPropertyValue>(
+ auto value = mbgl::style::conversion::convert<mbgl::style::ColorRampPropertyValue>(
mbgl::style::conversion::makeConvertible(jsonExpression), valueError);
if (!value) {
[NSException raise:NSInvalidArgumentException