Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 3a9c7ae

Browse files
author
Igor Tarasov
committed
Adapt core library v4.0.0 breaking changes.
Summary of changes: - remove `LocalGlyphRasterizer`, it's now a part of core, pure C++ implementation; - LocationIndicatorLayer: deprecate `getImageTiltDisplacement` method, introduce it's `getImagePitchDisplacement` replacement; - the same as above for LocationPropertyFactory's imageTiltDisplacement methods; - change values in HeatmapLayerTest.testHeatmapRadiusAsConstant and SymbolLayerTest.testSymbolSpacingAsConstant test to fit value limits for the style layer properties;
1 parent 58430f7 commit 3a9c7ae

File tree

7 files changed

+62
-104
lines changed

7 files changed

+62
-104
lines changed

MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationIndicatorLayer.java

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,30 @@ public PropertyValue<Float> getPerspectiveCompensation() {
111111
}
112112

113113
/**
114+
* @deprecated Use {@link LocationIndicatorLayer#getImagePitchDisplacement} instead.
115+
*
114116
* Get the ImageTiltDisplacement property
115117
*
116118
* @return property wrapper value around Float
117119
*/
118120
@NonNull
119121
@SuppressWarnings("unchecked")
122+
@Deprecated
120123
public PropertyValue<Float> getImageTiltDisplacement() {
121124
checkThread();
122-
return (PropertyValue<Float>) new PropertyValue("image-tilt-displacement", nativeGetImageTiltDisplacement());
125+
return (PropertyValue<Float>) new PropertyValue("image-pitch-displacement", nativeGetImageTiltDisplacement());
126+
}
127+
128+
/**
129+
* Get the ImagePitchDisplacement property
130+
*
131+
* @return property wrapper value around Float
132+
*/
133+
@NonNull
134+
@SuppressWarnings("unchecked")
135+
public PropertyValue<Float> getImagePitchDisplacement() {
136+
checkThread();
137+
return (PropertyValue<Float>) new PropertyValue("image-pitch-displacement", nativeGetImagePitchDisplacement());
123138
}
124139

125140
/**
@@ -419,6 +434,10 @@ public void setAccuracyRadiusBorderColorTransition(@NonNull TransitionOptions op
419434
@Keep
420435
private native Object nativeGetImageTiltDisplacement();
421436

437+
@NonNull
438+
@Keep
439+
private native Object nativeGetImagePitchDisplacement();
440+
422441
@NonNull
423442
@Keep
424443
private native Object nativeGetBearing();

MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/location/LocationPropertyFactory.java

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,25 +50,50 @@ public static PropertyValue<Expression> perspectiveCompensation(Expression expre
5050
}
5151

5252
/**
53+
* @deprecated Use {@link LocationPropertyFactory#imagePitchDisplacement} instead.
54+
*
5355
* The displacement off the center of the top image and the shadow image when the pitch of the map is greater than 0. This helps producing a three-dimensional appearence.
5456
*
5557
* @param value a Float value
5658
* @return property wrapper around Float
5759
*/
5860
public static PropertyValue<Float> imageTiltDisplacement(Float value) {
59-
return new PaintPropertyValue<>("image-tilt-displacement", value);
61+
return new PaintPropertyValue<>("image-pitch-displacement", value);
6062
}
6163

6264
/**
65+
* @deprecated Use {@link LocationPropertyFactory#imagePitchDisplacement} instead.
66+
*
6367
* The displacement off the center of the top image and the shadow image when the pitch of the map is greater than 0. This helps producing a three-dimensional appearence.
6468
*
6569
* @param expression an expression statement
6670
* @return property wrapper around an expression statement
6771
*/
6872
public static PropertyValue<Expression> imageTiltDisplacement(Expression expression) {
69-
return new PaintPropertyValue<>("image-tilt-displacement", expression);
73+
return new PaintPropertyValue<>("image-pitch-displacement", expression);
74+
}
75+
76+
/**
77+
* The displacement off the center of the top image and the shadow image when the pitch of the map is greater than 0. This helps producing a three-dimensional appearence.
78+
*
79+
* @param value a Float value
80+
* @return property wrapper around Float
81+
*/
82+
public static PropertyValue<Float> imagePitchDisplacement(Float value) {
83+
return new PaintPropertyValue<>("image-pitch-displacement", value);
7084
}
7185

86+
/**
87+
* The displacement off the center of the top image and the shadow image when the pitch of the map is greater than 0. This helps producing a three-dimensional appearence.
88+
*
89+
* @param expression an expression statement
90+
* @return property wrapper around an expression statement
91+
*/
92+
public static PropertyValue<Expression> imagePitchDisplacement(Expression expression) {
93+
return new PaintPropertyValue<>("image-pitch-displacement", expression);
94+
}
95+
96+
7297
/**
7398
* The bearing of the location indicator.
7499
*

MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/text/LocalGlyphRasterizer.java

Lines changed: 0 additions & 95 deletions
This file was deleted.

MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/text/package-info.java

Lines changed: 0 additions & 4 deletions
This file was deleted.

MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/location/LocationIndicatorLayerTest.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,19 @@ public void testImageTiltDisplacementAsConstant() {
114114
assertEquals(layer.getImageTiltDisplacement().getValue(), propertyValue);
115115
}
116116

117+
@Test
118+
@UiThreadTest
119+
public void testImagePitchDisplacementAsConstant() {
120+
Timber.i("image-tilt-displacement");
121+
assertNotNull(layer);
122+
assertNull(layer.getImagePitchDisplacement().getValue());
123+
124+
// Set and Get
125+
Float propertyValue = 0.3f;
126+
layer.setProperties(imageTiltDisplacement(propertyValue));
127+
assertEquals(layer.getImagePitchDisplacement().getValue(), propertyValue);
128+
}
129+
117130
@Test
118131
@UiThreadTest
119132
public void testBearingAsConstant() {

MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/HeatmapLayerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ public void testHeatmapRadiusAsConstant() {
195195
assertNull(layer.getHeatmapRadius().getValue());
196196

197197
// Set and Get
198-
Float propertyValue = 0.3f;
198+
Float propertyValue = 1.0f;
199199
layer.setProperties(heatmapRadius(propertyValue));
200200
assertEquals(layer.getHeatmapRadius().getValue(), propertyValue);
201201
}

MapboxGLAndroidSDKTestApp/src/androidTest/java/com/mapbox/mapboxsdk/testapp/style/SymbolLayerTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ public void testSymbolSpacingAsConstant() {
198198
assertNull(layer.getSymbolSpacing().getValue());
199199

200200
// Set and Get
201-
Float propertyValue = 0.3f;
201+
Float propertyValue = 1.0f;
202202
layer.setProperties(symbolSpacing(propertyValue));
203203
assertEquals(layer.getSymbolSpacing().getValue(), propertyValue);
204204
}

0 commit comments

Comments
 (0)