Skip to content

Commit a4fbf97

Browse files
evil159github-actions[bot]
authored andcommitted
port changes from release/2.19 branch (#10522)
+ add padding to follow puck viewport state options. cc @mapbox/maps-flutter GitOrigin-RevId: b952ac7ee6c6414bb24e1e087ab707fc551af3d0
1 parent e92090c commit a4fbf97

17 files changed

Lines changed: 57 additions & 13 deletions

File tree

CHANGELOG.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,16 @@
44
* Introduce new `LineLayer.lineElevationGroundScale` property to scale elevated lines with terrain exaggeration.
55
* Promote elevated lines properties to stable: `LineLayer.lineZOffset` and `LineLayer.lineElevationReference`.
66
* Add experimental `ModelLayer.modelAllowDensityReduction` property to disable density reduction in model layers.
7+
* Add `FollowPuckViewportState.padding` to control camera padding when following the user's location puck, allowing the puck to be offset from the viewport center (e.g. for navigation UIs where the puck should appear near the bottom of the screen).
8+
9+
### 2.19.1
10+
11+
* [Android] Fix Gradle build failure when `SDK_REGISTRY_TOKEN` is not set in the environment or `gradle.properties`.
12+
* [Android] Fix `customData` not being applied when updating Circle, Point, Polygon, and Polyline annotations.
13+
14+
### 2.19.0
15+
16+
* Update Maps SDK to v11.19.0
717

818
### 2.19.0-rc.1
919

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## License
22

3-
Mapbox Maps for Flutter version 2.19.0-rc.1
3+
Mapbox Maps for Flutter version 2.19.1
44
Mapbox Maps Flutter SDK
55

66
Copyright © 2022 - 2026 Mapbox, Inc. All rights reserved.

android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ rootProject.allprojects {
2828
}
2929
credentials {
3030
username = "mapbox"
31-
password = System.getenv("SDK_REGISTRY_TOKEN") ?: project.property("SDK_REGISTRY_TOKEN") as String
31+
password = System.getenv("SDK_REGISTRY_TOKEN") ?: project.findProperty("SDK_REGISTRY_TOKEN") as String
3232
}
3333
}
3434
}

android/src/main/kotlin/com/mapbox/maps/mapbox_maps/ViewportController.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ fun ViewportPlugin.viewportStateFromFLTState(
160160
return when (stateStorage.type) {
161161
_ViewportStateType.IDLE -> idle().let { null }
162162
_ViewportStateType.FOLLOW_PUCK ->
163-
makeFollowPuckViewportState((stateStorage.options as _FollowPuckViewportStateOptions).toOptions())
163+
makeFollowPuckViewportState((stateStorage.options as _FollowPuckViewportStateOptions).toOptions(context))
164164

165165
_ViewportStateType.OVERVIEW ->
166166
makeOverviewViewportState(
@@ -179,7 +179,7 @@ fun ViewportPlugin.viewportStateFromFLTState(
179179
}
180180
}
181181

182-
fun _FollowPuckViewportStateOptions.toOptions(): FollowPuckViewportStateOptions {
182+
fun _FollowPuckViewportStateOptions.toOptions(context: Context): FollowPuckViewportStateOptions {
183183
val bearing: FollowPuckViewportStateBearing? = when (this.bearing) {
184184
_FollowPuckViewportStateBearing.HEADING -> FollowPuckViewportStateBearing.SyncWithLocationPuck
185185
_FollowPuckViewportStateBearing.COURSE -> FollowPuckViewportStateBearing.SyncWithLocationPuck
@@ -201,6 +201,7 @@ fun _FollowPuckViewportStateOptions.toOptions(): FollowPuckViewportStateOptions
201201
.zoom(zoom)
202202
.bearing(bearing)
203203
.pitch(pitch)
204+
.padding(padding?.toEdgeInsets(context))
204205
.build()
205206
}
206207

android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/CircleAnnotationController.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,9 @@ class CircleAnnotationController(private val delegate: ControllerDelegate) : _Ci
191191
annotation.circleStrokeWidth?.let {
192192
originalAnnotation.circleStrokeWidth = it
193193
}
194+
annotation.customData?.let {
195+
originalAnnotation.setData(Gson().toJsonTree(it))
196+
}
194197
return originalAnnotation
195198
}
196199

android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PointAnnotationController.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,9 @@ class PointAnnotationController(private val delegate: ControllerDelegate) : _Poi
300300
annotation.textOpacity?.let {
301301
originalAnnotation.textOpacity = it
302302
}
303+
annotation.customData?.let {
304+
originalAnnotation.setData(Gson().toJsonTree(it))
305+
}
303306
return originalAnnotation
304307
}
305308

android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PolygonAnnotationController.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ class PolygonAnnotationController(private val delegate: ControllerDelegate) : _P
190190
annotation.fillZOffset?.let {
191191
originalAnnotation.fillZOffset = it
192192
}
193+
annotation.customData?.let {
194+
originalAnnotation.setData(Gson().toJsonTree(it))
195+
}
193196
return originalAnnotation
194197
}
195198

android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PolylineAnnotationController.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,9 @@ class PolylineAnnotationController(private val delegate: ControllerDelegate) : _
212212
annotation.lineWidth?.let {
213213
originalAnnotation.lineWidth = it
214214
}
215+
annotation.customData?.let {
216+
originalAnnotation.setData(Gson().toJsonTree(it))
217+
}
215218
return originalAnnotation
216219
}
217220

android/src/main/kotlin/com/mapbox/maps/mapbox_maps/pigeons/ViewportInternal.kt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -265,15 +265,17 @@ data class _FollowPuckViewportStateOptions(
265265
val zoom: Double? = null,
266266
val bearingValue: Double? = null,
267267
val bearing: _FollowPuckViewportStateBearing? = null,
268-
val pitch: Double? = null
268+
val pitch: Double? = null,
269+
val padding: MbxEdgeInsets? = null
269270
) {
270271
companion object {
271272
fun fromList(pigeonVar_list: List<Any?>): _FollowPuckViewportStateOptions {
272273
val zoom = pigeonVar_list[0] as Double?
273274
val bearingValue = pigeonVar_list[1] as Double?
274275
val bearing = pigeonVar_list[2] as _FollowPuckViewportStateBearing?
275276
val pitch = pigeonVar_list[3] as Double?
276-
return _FollowPuckViewportStateOptions(zoom, bearingValue, bearing, pitch)
277+
val padding = pigeonVar_list[4] as MbxEdgeInsets?
278+
return _FollowPuckViewportStateOptions(zoom, bearingValue, bearing, pitch, padding)
277279
}
278280
}
279281
fun toList(): List<Any?> {
@@ -282,6 +284,7 @@ data class _FollowPuckViewportStateOptions(
282284
bearingValue,
283285
bearing,
284286
pitch,
287+
padding,
285288
)
286289
}
287290
override fun equals(other: Any?): Boolean {
@@ -294,7 +297,8 @@ data class _FollowPuckViewportStateOptions(
294297
return zoom == other.zoom &&
295298
bearingValue == other.bearingValue &&
296299
bearing == other.bearing &&
297-
pitch == other.pitch
300+
pitch == other.pitch &&
301+
padding == other.padding
298302
}
299303

300304
override fun hashCode(): Int = toList().hashCode()

ios/mapbox_maps_flutter.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
Pod::Spec.new do |s|
66
s.name = 'mapbox_maps_flutter'
7-
s.version = '2.19.0-rc.1'
7+
s.version = '2.19.1'
88

99
s.summary = 'Mapbox Maps SDK Flutter Plugin.'
1010
s.description = 'An officially developed solution from Mapbox that enables use of our latest Maps SDK product.'

0 commit comments

Comments
 (0)