Skip to content

Commit 99a3b9f

Browse files
pjleonard37Release SDK bot for Maps SDK team
andauthored
Add new properties and methods (#880)
Co-authored-by: Release SDK bot for Maps SDK team <[email protected]>
1 parent 27e5975 commit 99a3b9f

File tree

54 files changed

+2628
-843
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+2628
-843
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
### main
22

33
* Experimental `StandardBuildingState` has been removed. Use `StandardBuildingsState` instead.
4+
* Expose `SymbolLayer.iconSizeScaleRange`, `SymbolLayer.iconSizeScaleRangeExpression`, `SymbolLayer.textSizeScaleRange`, `SymbolLayer.textSizeScaleRangeExpression`, `LineLayer.lineCrossSlope`, `LineLayer.lineElevationReference`, `LineLayer.lineWidthUnit`, `FillLayer.fillElevationReference`.
5+
* Expose `PointAnnotationManager.setIconSizeScaleRange()`, `PointAnnotationManager.getIconSizeScaleRange()`, `PointAnnotationManager.setTextSizeScaleRange()`, `PointAnnotationManager.getTextSizeScaleRange()` , `PolygonAnnotationManager.setFillElevationReference()`, `PolygonAnnotationManager.getFillElevationReference()`, `PolylineAnnotationManager.setLineCrossSlope()`, `PolylineAnnotationManager.getLineCrossSlope()`, `PolylineAnnotationManager.setLineElevationReference()`, `PolylineAnnotationManager.getLineElevationReference()`, `PolylineAnnotationManager.setLineWidthUnit()`, `PolylineAnnotationManager.getLineWidthUnit()` as experimental.
6+
* Mark `ClipLayer.clipLayerScope` and `ClipLayer.clipLayerTypes` as stable
7+
* Mark `BackgroundLayer.backgroundPitchAlignment` as experimental
8+
* `top-image`, `bearing-image`, and `shadow-image` properties on `LocationIndicatorLayer` are now paint properties instead of layout properties.
49
* Introduce `onZoomListener` to `MapWidget` to allowing listening to zoom events resulting from user gestures: pinching, double-tapping, or quick zooming. The event returns `MapContentGestureContext`, which includes `touchPosition` (the location of the gesture on the screen), `point` (the geographical coordinates of the gesture), and `gestureState` (the state of the gesture). See `gestures_example.dart` for implementation guidance.
510

611
### 2.6.0

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

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,29 @@ class PointAnnotationController(private val delegate: ControllerDelegate) : _Poi
536536
}
537537
}
538538

539+
override fun setIconSizeScaleRange(
540+
managerId: String,
541+
iconSizeScaleRange: List<Double?>,
542+
callback: (Result<Unit>) -> Unit
543+
) {
544+
val manager = delegate.getManager(managerId) as PointAnnotationManager
545+
manager.iconSizeScaleRange = iconSizeScaleRange.mapNotNull { it }
546+
callback(Result.success(Unit))
547+
}
548+
549+
override fun getIconSizeScaleRange(
550+
managerId: String,
551+
callback: (Result<List<Double?>?>) -> Unit
552+
) {
553+
val manager = delegate.getManager(managerId) as PointAnnotationManager
554+
val value = manager.iconSizeScaleRange
555+
if (value != null) {
556+
callback(Result.success(value))
557+
} else {
558+
callback(Result.success(null))
559+
}
560+
}
561+
539562
override fun setIconTextFit(
540563
managerId: String,
541564
iconTextFit: IconTextFit,
@@ -1180,6 +1203,29 @@ class PointAnnotationController(private val delegate: ControllerDelegate) : _Poi
11801203
}
11811204
}
11821205

1206+
override fun setTextSizeScaleRange(
1207+
managerId: String,
1208+
textSizeScaleRange: List<Double?>,
1209+
callback: (Result<Unit>) -> Unit
1210+
) {
1211+
val manager = delegate.getManager(managerId) as PointAnnotationManager
1212+
manager.textSizeScaleRange = textSizeScaleRange.mapNotNull { it }
1213+
callback(Result.success(Unit))
1214+
}
1215+
1216+
override fun getTextSizeScaleRange(
1217+
managerId: String,
1218+
callback: (Result<List<Double?>?>) -> Unit
1219+
) {
1220+
val manager = delegate.getManager(managerId) as PointAnnotationManager
1221+
val value = manager.textSizeScaleRange
1222+
if (value != null) {
1223+
callback(Result.success(value))
1224+
} else {
1225+
callback(Result.success(null))
1226+
}
1227+
}
1228+
11831229
override fun setTextTransform(
11841230
managerId: String,
11851231
textTransform: TextTransform,

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ fun SymbolElevationReference.toSymbolElevationReference(): com.mapbox.maps.exten
4747
return when (this) {
4848
SymbolElevationReference.SEA -> com.mapbox.maps.extension.style.layers.properties.generated.SymbolElevationReference.SEA
4949
SymbolElevationReference.GROUND -> com.mapbox.maps.extension.style.layers.properties.generated.SymbolElevationReference.GROUND
50+
SymbolElevationReference.HD_ROAD_MARKUP -> com.mapbox.maps.extension.style.layers.properties.generated.SymbolElevationReference.HD_ROAD_MARKUP
5051
else -> throw(RuntimeException("Unsupported SymbolElevationReference: $this"))
5152
}
5253
}
@@ -173,6 +174,7 @@ fun com.mapbox.maps.extension.style.layers.properties.generated.SymbolElevationR
173174
return when (this) {
174175
com.mapbox.maps.extension.style.layers.properties.generated.SymbolElevationReference.SEA -> SymbolElevationReference.SEA
175176
com.mapbox.maps.extension.style.layers.properties.generated.SymbolElevationReference.GROUND -> SymbolElevationReference.GROUND
177+
com.mapbox.maps.extension.style.layers.properties.generated.SymbolElevationReference.HD_ROAD_MARKUP -> SymbolElevationReference.HD_ROAD_MARKUP
176178
else -> throw(RuntimeException("Unsupported SymbolElevationReference: $this"))
177179
}
178180
}

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

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ package com.mapbox.maps.mapbox_maps.annotation
33

44
import com.mapbox.maps.mapbox_maps.pigeons.*
55
import com.mapbox.maps.plugin.annotation.generated.PolygonAnnotationManager
6+
import toFLTFillElevationReference
67
import toFLTFillTranslateAnchor
8+
import toFillElevationReference
79
import toFillTranslateAnchor
810

911
class PolygonAnnotationController(private val delegate: ControllerDelegate) : _PolygonAnnotationMessenger {
@@ -141,6 +143,29 @@ class PolygonAnnotationController(private val delegate: ControllerDelegate) : _P
141143
return originalAnnotation
142144
}
143145

146+
override fun setFillElevationReference(
147+
managerId: String,
148+
fillElevationReference: FillElevationReference,
149+
callback: (Result<Unit>) -> Unit
150+
) {
151+
val manager = delegate.getManager(managerId) as PolygonAnnotationManager
152+
manager.fillElevationReference = fillElevationReference.toFillElevationReference()
153+
callback(Result.success(Unit))
154+
}
155+
156+
override fun getFillElevationReference(
157+
managerId: String,
158+
callback: (Result<FillElevationReference?>) -> Unit
159+
) {
160+
val manager = delegate.getManager(managerId) as PolygonAnnotationManager
161+
val value = manager.fillElevationReference
162+
if (value != null) {
163+
callback(Result.success(value.toFLTFillElevationReference()))
164+
} else {
165+
callback(Result.success(null))
166+
}
167+
}
168+
144169
override fun setFillSortKey(
145170
managerId: String,
146171
fillSortKey: Double,

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ import com.mapbox.maps.mapbox_maps.pigeons.*
44

55
// FLT to Android
66

7+
fun FillElevationReference.toFillElevationReference(): com.mapbox.maps.extension.style.layers.properties.generated.FillElevationReference {
8+
return when (this) {
9+
FillElevationReference.NONE -> com.mapbox.maps.extension.style.layers.properties.generated.FillElevationReference.NONE
10+
FillElevationReference.HD_ROAD_BASE -> com.mapbox.maps.extension.style.layers.properties.generated.FillElevationReference.HD_ROAD_BASE
11+
FillElevationReference.HD_ROAD_MARKUP -> com.mapbox.maps.extension.style.layers.properties.generated.FillElevationReference.HD_ROAD_MARKUP
12+
else -> throw(RuntimeException("Unsupported FillElevationReference: $this"))
13+
}
14+
}
715
fun FillTranslateAnchor.toFillTranslateAnchor(): com.mapbox.maps.extension.style.layers.properties.generated.FillTranslateAnchor {
816
return when (this) {
917
FillTranslateAnchor.MAP -> com.mapbox.maps.extension.style.layers.properties.generated.FillTranslateAnchor.MAP
@@ -14,6 +22,14 @@ fun FillTranslateAnchor.toFillTranslateAnchor(): com.mapbox.maps.extension.style
1422

1523
// Android to FLT
1624

25+
fun com.mapbox.maps.extension.style.layers.properties.generated.FillElevationReference.toFLTFillElevationReference(): FillElevationReference {
26+
return when (this) {
27+
com.mapbox.maps.extension.style.layers.properties.generated.FillElevationReference.NONE -> FillElevationReference.NONE
28+
com.mapbox.maps.extension.style.layers.properties.generated.FillElevationReference.HD_ROAD_BASE -> FillElevationReference.HD_ROAD_BASE
29+
com.mapbox.maps.extension.style.layers.properties.generated.FillElevationReference.HD_ROAD_MARKUP -> FillElevationReference.HD_ROAD_MARKUP
30+
else -> throw(RuntimeException("Unsupported FillElevationReference: $this"))
31+
}
32+
}
1733
fun com.mapbox.maps.extension.style.layers.properties.generated.FillTranslateAnchor.toFLTFillTranslateAnchor(): FillTranslateAnchor {
1834
return when (this) {
1935
com.mapbox.maps.extension.style.layers.properties.generated.FillTranslateAnchor.MAP -> FillTranslateAnchor.MAP

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

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ import com.mapbox.maps.extension.style.utils.ColorUtils
55
import com.mapbox.maps.mapbox_maps.pigeons.*
66
import com.mapbox.maps.plugin.annotation.generated.PolylineAnnotationManager
77
import toFLTLineCap
8+
import toFLTLineElevationReference
89
import toFLTLineJoin
910
import toFLTLineTranslateAnchor
11+
import toFLTLineWidthUnit
1012
import toLineCap
13+
import toLineElevationReference
1114
import toLineJoin
1215
import toLineTranslateAnchor
16+
import toLineWidthUnit
1317

1418
class PolylineAnnotationController(private val delegate: ControllerDelegate) : _PolylineAnnotationMessenger {
1519
private val annotationMap = mutableMapOf<String, com.mapbox.maps.plugin.annotation.generated.PolylineAnnotation>()
@@ -187,6 +191,52 @@ class PolylineAnnotationController(private val delegate: ControllerDelegate) : _
187191
}
188192
}
189193

194+
override fun setLineCrossSlope(
195+
managerId: String,
196+
lineCrossSlope: Double,
197+
callback: (Result<Unit>) -> Unit
198+
) {
199+
val manager = delegate.getManager(managerId) as PolylineAnnotationManager
200+
manager.lineCrossSlope = lineCrossSlope
201+
callback(Result.success(Unit))
202+
}
203+
204+
override fun getLineCrossSlope(
205+
managerId: String,
206+
callback: (Result<Double?>) -> Unit
207+
) {
208+
val manager = delegate.getManager(managerId) as PolylineAnnotationManager
209+
val value = manager.lineCrossSlope
210+
if (value != null) {
211+
callback(Result.success(value))
212+
} else {
213+
callback(Result.success(null))
214+
}
215+
}
216+
217+
override fun setLineElevationReference(
218+
managerId: String,
219+
lineElevationReference: LineElevationReference,
220+
callback: (Result<Unit>) -> Unit
221+
) {
222+
val manager = delegate.getManager(managerId) as PolylineAnnotationManager
223+
manager.lineElevationReference = lineElevationReference.toLineElevationReference()
224+
callback(Result.success(Unit))
225+
}
226+
227+
override fun getLineElevationReference(
228+
managerId: String,
229+
callback: (Result<LineElevationReference?>) -> Unit
230+
) {
231+
val manager = delegate.getManager(managerId) as PolylineAnnotationManager
232+
val value = manager.lineElevationReference
233+
if (value != null) {
234+
callback(Result.success(value.toFLTLineElevationReference()))
235+
} else {
236+
callback(Result.success(null))
237+
}
238+
}
239+
190240
override fun setLineJoin(
191241
managerId: String,
192242
lineJoin: LineJoin,
@@ -279,6 +329,29 @@ class PolylineAnnotationController(private val delegate: ControllerDelegate) : _
279329
}
280330
}
281331

332+
override fun setLineWidthUnit(
333+
managerId: String,
334+
lineWidthUnit: LineWidthUnit,
335+
callback: (Result<Unit>) -> Unit
336+
) {
337+
val manager = delegate.getManager(managerId) as PolylineAnnotationManager
338+
manager.lineWidthUnit = lineWidthUnit.toLineWidthUnit()
339+
callback(Result.success(Unit))
340+
}
341+
342+
override fun getLineWidthUnit(
343+
managerId: String,
344+
callback: (Result<LineWidthUnit?>) -> Unit
345+
) {
346+
val manager = delegate.getManager(managerId) as PolylineAnnotationManager
347+
val value = manager.lineWidthUnit
348+
if (value != null) {
349+
callback(Result.success(value.toFLTLineWidthUnit()))
350+
} else {
351+
callback(Result.success(null))
352+
}
353+
}
354+
282355
override fun setLineZOffset(
283356
managerId: String,
284357
lineZOffset: Double,

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

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@ fun LineCap.toLineCap(): com.mapbox.maps.extension.style.layers.properties.gener
1212
else -> throw(RuntimeException("Unsupported LineCap: $this"))
1313
}
1414
}
15+
fun LineElevationReference.toLineElevationReference(): com.mapbox.maps.extension.style.layers.properties.generated.LineElevationReference {
16+
return when (this) {
17+
LineElevationReference.NONE -> com.mapbox.maps.extension.style.layers.properties.generated.LineElevationReference.NONE
18+
LineElevationReference.SEA -> com.mapbox.maps.extension.style.layers.properties.generated.LineElevationReference.SEA
19+
LineElevationReference.GROUND -> com.mapbox.maps.extension.style.layers.properties.generated.LineElevationReference.GROUND
20+
LineElevationReference.HD_ROAD_MARKUP -> com.mapbox.maps.extension.style.layers.properties.generated.LineElevationReference.HD_ROAD_MARKUP
21+
else -> throw(RuntimeException("Unsupported LineElevationReference: $this"))
22+
}
23+
}
1524
fun LineJoin.toLineJoin(): com.mapbox.maps.extension.style.layers.properties.generated.LineJoin {
1625
return when (this) {
1726
LineJoin.BEVEL -> com.mapbox.maps.extension.style.layers.properties.generated.LineJoin.BEVEL
@@ -21,6 +30,13 @@ fun LineJoin.toLineJoin(): com.mapbox.maps.extension.style.layers.properties.gen
2130
else -> throw(RuntimeException("Unsupported LineJoin: $this"))
2231
}
2332
}
33+
fun LineWidthUnit.toLineWidthUnit(): com.mapbox.maps.extension.style.layers.properties.generated.LineWidthUnit {
34+
return when (this) {
35+
LineWidthUnit.PIXELS -> com.mapbox.maps.extension.style.layers.properties.generated.LineWidthUnit.PIXELS
36+
LineWidthUnit.METERS -> com.mapbox.maps.extension.style.layers.properties.generated.LineWidthUnit.METERS
37+
else -> throw(RuntimeException("Unsupported LineWidthUnit: $this"))
38+
}
39+
}
2440
fun LineTranslateAnchor.toLineTranslateAnchor(): com.mapbox.maps.extension.style.layers.properties.generated.LineTranslateAnchor {
2541
return when (this) {
2642
LineTranslateAnchor.MAP -> com.mapbox.maps.extension.style.layers.properties.generated.LineTranslateAnchor.MAP
@@ -39,6 +55,15 @@ fun com.mapbox.maps.extension.style.layers.properties.generated.LineCap.toFLTLin
3955
else -> throw(RuntimeException("Unsupported LineCap: $this"))
4056
}
4157
}
58+
fun com.mapbox.maps.extension.style.layers.properties.generated.LineElevationReference.toFLTLineElevationReference(): LineElevationReference {
59+
return when (this) {
60+
com.mapbox.maps.extension.style.layers.properties.generated.LineElevationReference.NONE -> LineElevationReference.NONE
61+
com.mapbox.maps.extension.style.layers.properties.generated.LineElevationReference.SEA -> LineElevationReference.SEA
62+
com.mapbox.maps.extension.style.layers.properties.generated.LineElevationReference.GROUND -> LineElevationReference.GROUND
63+
com.mapbox.maps.extension.style.layers.properties.generated.LineElevationReference.HD_ROAD_MARKUP -> LineElevationReference.HD_ROAD_MARKUP
64+
else -> throw(RuntimeException("Unsupported LineElevationReference: $this"))
65+
}
66+
}
4267
fun com.mapbox.maps.extension.style.layers.properties.generated.LineJoin.toFLTLineJoin(): LineJoin {
4368
return when (this) {
4469
com.mapbox.maps.extension.style.layers.properties.generated.LineJoin.BEVEL -> LineJoin.BEVEL
@@ -48,6 +73,13 @@ fun com.mapbox.maps.extension.style.layers.properties.generated.LineJoin.toFLTLi
4873
else -> throw(RuntimeException("Unsupported LineJoin: $this"))
4974
}
5075
}
76+
fun com.mapbox.maps.extension.style.layers.properties.generated.LineWidthUnit.toFLTLineWidthUnit(): LineWidthUnit {
77+
return when (this) {
78+
com.mapbox.maps.extension.style.layers.properties.generated.LineWidthUnit.PIXELS -> LineWidthUnit.PIXELS
79+
com.mapbox.maps.extension.style.layers.properties.generated.LineWidthUnit.METERS -> LineWidthUnit.METERS
80+
else -> throw(RuntimeException("Unsupported LineWidthUnit: $this"))
81+
}
82+
}
5183
fun com.mapbox.maps.extension.style.layers.properties.generated.LineTranslateAnchor.toFLTLineTranslateAnchor(): LineTranslateAnchor {
5284
return when (this) {
5385
com.mapbox.maps.extension.style.layers.properties.generated.LineTranslateAnchor.MAP -> LineTranslateAnchor.MAP

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ data class CircleAnnotation(
114114
val circleOpacity: Double? = null,
115115
/**
116116
* Circle radius.
117-
* Default value: 5. Minimum value: 0.
117+
* Default value: 5. Minimum value: 0. The unit of circleRadius is in pixels.
118118
*/
119119
val circleRadius: Double? = null,
120120
/**
@@ -129,7 +129,7 @@ data class CircleAnnotation(
129129
val circleStrokeOpacity: Double? = null,
130130
/**
131131
* The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.
132-
* Default value: 0. Minimum value: 0.
132+
* Default value: 0. Minimum value: 0. The unit of circleStrokeWidth is in pixels.
133133
*/
134134
val circleStrokeWidth: Double? = null
135135
) {
@@ -187,7 +187,7 @@ data class CircleAnnotationOptions(
187187
val circleOpacity: Double? = null,
188188
/**
189189
* Circle radius.
190-
* Default value: 5. Minimum value: 0.
190+
* Default value: 5. Minimum value: 0. The unit of circleRadius is in pixels.
191191
*/
192192
val circleRadius: Double? = null,
193193
/**
@@ -202,7 +202,7 @@ data class CircleAnnotationOptions(
202202
val circleStrokeOpacity: Double? = null,
203203
/**
204204
* The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.
205-
* Default value: 0. Minimum value: 0.
205+
* Default value: 0. Minimum value: 0. The unit of circleStrokeWidth is in pixels.
206206
*/
207207
val circleStrokeWidth: Double? = null
208208
) {

0 commit comments

Comments
 (0)