Skip to content

Commit 9022d91

Browse files
evil159github-actions[bot]
authored andcommitted
Fix multi-word enum value conversion in annotations (#4970)
Fixes annotation enum value conversion code is missing replacing dashes with underscores. Addresses: https://mapbox.atlassian.net/browse/MAPSAND-2246 cc @mapbox/maps-ios cc @mapbox/maps-android GitOrigin-RevId: 262e3a483883491b46c490790d72c4e9d5c2ea1d
1 parent dd31f57 commit 9022d91

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Mapbox welcomes participation and contributions from everyone.
66

77
## Dependencies
88
* Update license to reflect license changes in underlying modules.
9+
* Fix exception when accessing enum properties in annotations.
910

1011
# 11.14.0-rc.1
1112
## Features ✨ and improvements 🏁

extension-compose/src/androidTest/java/com/mapbox/maps/extension/compose/annotation/AnnotationTests.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ import com.mapbox.maps.extension.compose.annotation.generated.withCircleColor
4545
import com.mapbox.maps.extension.compose.annotation.generated.withLineColor
4646
import com.mapbox.maps.extension.compose.internal.utils.CityLocations.HELSINKI
4747
import com.mapbox.maps.extension.compose.style.MapStyle
48+
import com.mapbox.maps.extension.style.layers.properties.generated.IconAnchor
49+
import com.mapbox.maps.extension.style.layers.properties.generated.TextAnchor
4850
import com.mapbox.maps.plugin.annotation.AnnotationConfig
4951
import com.mapbox.maps.plugin.annotation.AnnotationSourceOptions
5052
import com.mapbox.maps.plugin.annotation.ClusterOptions
@@ -224,6 +226,7 @@ public class AnnotationTests {
224226
point = SINGLE_POINT
225227
) {
226228
iconImage = icon
229+
iconAnchor = IconAnchor.BOTTOM_LEFT
227230
interactionsState.onClicked {
228231
clickedAnnotation = it
229232
true
@@ -238,6 +241,7 @@ public class AnnotationTests {
238241
composeTestRule.onNodeWithTag(testTag).performClick()
239242
composeTestRule.waitUntil { clickedAnnotation != null }
240243
assertEquals(SINGLE_POINT, clickedAnnotation!!.point)
244+
assertEquals(IconAnchor.BOTTOM_LEFT, clickedAnnotation!!.iconAnchor)
241245

242246
composeTestRule.onNodeWithTag(testTag).performLongClick()
243247
composeTestRule.waitUntil(timeoutMillis = 5000L) { longClickedAnnotation != null }
@@ -259,6 +263,7 @@ public class AnnotationTests {
259263
annotations = CLUSTER_POINTS.map {
260264
PointAnnotationOptions()
261265
.withIconImage("bitmap")
266+
.withTextAnchor(TextAnchor.TOP_LEFT)
262267
.withPoint(it)
263268
},
264269
annotationConfig = AnnotationConfig(
@@ -297,6 +302,7 @@ public class AnnotationTests {
297302
composeTestRule.onNodeWithTag(testTag).performClick()
298303
composeTestRule.waitUntil { clickedAnnotation != null }
299304
assertEquals(CLUSTER_POINTS[2], clickedAnnotation!!.point)
305+
assertEquals(TextAnchor.TOP_LEFT, clickedAnnotation!!.textAnchor)
300306

301307
composeTestRule.onNodeWithTag(testTag).performLongClick()
302308
composeTestRule.waitUntil(5000L) { longClickedAnnotation != null }

plugin-annotation/src/main/java/com/mapbox/maps/plugin/annotation/generated/PointAnnotation.kt

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugin-annotation/src/main/java/com/mapbox/maps/plugin/annotation/generated/PolylineAnnotation.kt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)