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

Adapt core library v4.0.0 breaking changes. #548

Merged
merged 3 commits into from
Sep 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

Mapbox welcomes participation and contributions from everyone. Please read [`Contributing Guide`](https://github.com/mapbox/mapbox-gl-native/blob/master/CONTRIBUTING.md) to get started.

## 9.5.0-alpha.1 - September 3, 2020
tarigo marked this conversation as resolved.
Show resolved Hide resolved
[Changes](https://github.com/mapbox/mapbox-gl-native-android/compare/android-v9.4.0...android-v9.5.0-alpha.1) since [Mapbox Maps SDK for Android v9.4.0](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v9.4.0)
### Changes made to match core library v4.0.0 updates
- Remove `LocalGlyphRasterizer`, now it's a part of core as pure C++ implementation. ([#548](https://github.com/mapbox/mapbox-gl-native-android/pull/548))
- `LocationIndicatorLayer`: deprecate getImageTiltDisplacement method, introduce it's replacement - getImagePitchDisplacement. ([#548](https://github.com/mapbox/mapbox-gl-native-android/pull/548))
- `LocationPropertyFactory`: `imageTiltDisplacement` methods are deprecated, `imagePitchDisplacement` are introduced for replacement. ([#548](https://github.com/mapbox/mapbox-gl-native-android/pull/548))
### Dependencies
- Update core library to 4.0.0

## 9.4.0 - August 26, 2020
[Changes](https://github.com/mapbox/mapbox-gl-native-android/compare/android-v9.3.0...android-v9.4.0) since [Mapbox Maps SDK for Android v9.3.0](https://github.com/mapbox/mapbox-gl-native-android/releases/tag/android-v9.3.0)
### Features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,15 +111,30 @@ public PropertyValue<Float> getPerspectiveCompensation() {
}

/**
* @deprecated Use {@link LocationIndicatorLayer#getImagePitchDisplacement} instead.
*
* Get the ImageTiltDisplacement property
*
* @return property wrapper value around Float
*/
@NonNull
@SuppressWarnings("unchecked")
@Deprecated
public PropertyValue<Float> getImageTiltDisplacement() {
checkThread();
return (PropertyValue<Float>) new PropertyValue("image-tilt-displacement", nativeGetImageTiltDisplacement());
return (PropertyValue<Float>) new PropertyValue("image-pitch-displacement", nativeGetImageTiltDisplacement());
}

/**
* Get the ImagePitchDisplacement property
*
* @return property wrapper value around Float
*/
@NonNull
@SuppressWarnings("unchecked")
public PropertyValue<Float> getImagePitchDisplacement() {
checkThread();
return (PropertyValue<Float>) new PropertyValue("image-pitch-displacement", nativeGetImagePitchDisplacement());
}

/**
Expand Down Expand Up @@ -419,6 +434,10 @@ public void setAccuracyRadiusBorderColorTransition(@NonNull TransitionOptions op
@Keep
private native Object nativeGetImageTiltDisplacement();

@NonNull
@Keep
private native Object nativeGetImagePitchDisplacement();

@NonNull
@Keep
private native Object nativeGetBearing();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,50 @@ public static PropertyValue<Expression> perspectiveCompensation(Expression expre
}

/**
* @deprecated Use {@link LocationPropertyFactory#imagePitchDisplacement} instead.
*
* 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.
*
* @param value a Float value
* @return property wrapper around Float
*/
public static PropertyValue<Float> imageTiltDisplacement(Float value) {
return new PaintPropertyValue<>("image-tilt-displacement", value);
return new PaintPropertyValue<>("image-pitch-displacement", value);
}

/**
* @deprecated Use {@link LocationPropertyFactory#imagePitchDisplacement} instead.
*
* 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.
*
* @param expression an expression statement
* @return property wrapper around an expression statement
*/
public static PropertyValue<Expression> imageTiltDisplacement(Expression expression) {
return new PaintPropertyValue<>("image-tilt-displacement", expression);
return new PaintPropertyValue<>("image-pitch-displacement", expression);
}

/**
* 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.
*
* @param value a Float value
* @return property wrapper around Float
*/
public static PropertyValue<Float> imagePitchDisplacement(Float value) {
return new PaintPropertyValue<>("image-pitch-displacement", value);
}

/**
* 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.
*
* @param expression an expression statement
* @return property wrapper around an expression statement
*/
public static PropertyValue<Expression> imagePitchDisplacement(Expression expression) {
return new PaintPropertyValue<>("image-pitch-displacement", expression);
}


/**
* The bearing of the location indicator.
*
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,19 @@ public void testImageTiltDisplacementAsConstant() {
assertEquals(layer.getImageTiltDisplacement().getValue(), propertyValue);
}

@Test
@UiThreadTest
public void testImagePitchDisplacementAsConstant() {
Timber.i("image-tilt-displacement");
assertNotNull(layer);
assertNull(layer.getImagePitchDisplacement().getValue());

// Set and Get
Float propertyValue = 0.3f;
layer.setProperties(imageTiltDisplacement(propertyValue));
assertEquals(layer.getImagePitchDisplacement().getValue(), propertyValue);
tarigo marked this conversation as resolved.
Show resolved Hide resolved
}

@Test
@UiThreadTest
public void testBearingAsConstant() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public void testHeatmapRadiusAsConstant() {
assertNull(layer.getHeatmapRadius().getValue());

// Set and Get
Float propertyValue = 0.3f;
Float propertyValue = 1.0f;
layer.setProperties(heatmapRadius(propertyValue));
assertEquals(layer.getHeatmapRadius().getValue(), propertyValue);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ public void testSymbolSpacingAsConstant() {
assertNull(layer.getSymbolSpacing().getValue());

// Set and Get
Float propertyValue = 0.3f;
Float propertyValue = 1.0f;
layer.setProperties(symbolSpacing(propertyValue));
assertEquals(layer.getSymbolSpacing().getValue(), propertyValue);
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/dependencies.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ ext {
ktlint : '0.34.0',
commonsIO : '2.6',
mapboxSdkVersions: '1.1.0',
mapboxSdkCore : '3.1.0',
mapboxSdkCore : '4.0.0',
mapboxSdkRegistryPlugin: '0.2.1'
]

Expand Down