Skip to content

Commit 0d0b3f4

Browse files
evil159pjleonard37
andauthored
Re-generate code according to the latest style spec (#599)
* Re-generate code according to the latest style spec and style gen * Handle location puck slot propety on the iOS side * Add changelog entries * Update CHANGELOG.md Co-authored-by: Patrick Leonard <pjleonard37@users.noreply.github.com> --------- Co-authored-by: Patrick Leonard <pjleonard37@users.noreply.github.com>
1 parent 56f35ff commit 0d0b3f4

File tree

56 files changed

+3448
-509
lines changed

Some content is hidden

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

56 files changed

+3448
-509
lines changed

CHANGELOG.md

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

33
* Bump Maps SDK to 11.5.0-rc.1
4+
* Expose `text-occlusion-opacity`, `icon-occlusion-opacity`, `line-occlusion-opacity`, `model-front-cutoff`, `lineZOffset` as experimental.
5+
* Add min/max/default values for most of the style properties.
6+
* Expose `clusterMinPoints` property for `GeoJSONSource`.
7+
* Expose `SlotLayer` and `RasterParticleLayer`.
8+
* Expose `LocationComponentSettings.slot`.
9+
* Add `@experimental` annotation to relevant APIs.
410

511
### 2.1.0-beta.1
612

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

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,28 @@ class PointAnnotationController(private val delegate: ControllerDelegate) : _Poi
733733
}
734734
}
735735

736+
override fun setIconOcclusionOpacity(
737+
managerId: String,
738+
iconOcclusionOpacity: Double,
739+
callback: (Result<Unit>) -> Unit
740+
) {
741+
val manager = delegate.getManager(managerId) as PointAnnotationManager
742+
manager.iconOcclusionOpacity = iconOcclusionOpacity
743+
callback(Result.success(Unit))
744+
}
745+
746+
override fun getIconOcclusionOpacity(
747+
managerId: String,
748+
callback: (Result<Double?>) -> Unit
749+
) {
750+
val manager = delegate.getManager(managerId) as PointAnnotationManager
751+
if (manager.iconOcclusionOpacity != null) {
752+
callback(Result.success(manager.iconOcclusionOpacity!!))
753+
} else {
754+
callback(Result.success(null))
755+
}
756+
}
757+
736758
override fun setIconTranslate(
737759
managerId: String,
738760
iconTranslate: List<Double?>,
@@ -777,6 +799,28 @@ class PointAnnotationController(private val delegate: ControllerDelegate) : _Poi
777799
}
778800
}
779801

802+
override fun setTextOcclusionOpacity(
803+
managerId: String,
804+
textOcclusionOpacity: Double,
805+
callback: (Result<Unit>) -> Unit
806+
) {
807+
val manager = delegate.getManager(managerId) as PointAnnotationManager
808+
manager.textOcclusionOpacity = textOcclusionOpacity
809+
callback(Result.success(Unit))
810+
}
811+
812+
override fun getTextOcclusionOpacity(
813+
managerId: String,
814+
callback: (Result<Double?>) -> Unit
815+
) {
816+
val manager = delegate.getManager(managerId) as PointAnnotationManager
817+
if (manager.textOcclusionOpacity != null) {
818+
callback(Result.success(manager.textOcclusionOpacity!!))
819+
} else {
820+
callback(Result.success(null))
821+
}
822+
}
823+
780824
override fun setTextTranslate(
781825
managerId: String,
782826
textTranslate: List<Double?>,

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@ class PolylineAnnotationController(private val delegate: ControllerDelegate) : _
130130
annotation.lineSortKey?.let {
131131
originalAnnotation.lineSortKey = it
132132
}
133+
annotation.lineZOffset?.let {
134+
originalAnnotation.lineZOffset = it
135+
}
133136
annotation.lineBlur?.let {
134137
originalAnnotation.lineBlur = it
135138
}
@@ -292,6 +295,28 @@ class PolylineAnnotationController(private val delegate: ControllerDelegate) : _
292295
}
293296
}
294297

298+
override fun setLineOcclusionOpacity(
299+
managerId: String,
300+
lineOcclusionOpacity: Double,
301+
callback: (Result<Unit>) -> Unit
302+
) {
303+
val manager = delegate.getManager(managerId) as PolylineAnnotationManager
304+
manager.lineOcclusionOpacity = lineOcclusionOpacity
305+
callback(Result.success(Unit))
306+
}
307+
308+
override fun getLineOcclusionOpacity(
309+
managerId: String,
310+
callback: (Result<Double?>) -> Unit
311+
) {
312+
val manager = delegate.getManager(managerId) as PolylineAnnotationManager
313+
if (manager.lineOcclusionOpacity != null) {
314+
callback(Result.success(manager.lineOcclusionOpacity!!))
315+
} else {
316+
callback(Result.success(null))
317+
}
318+
}
319+
295320
override fun setLineTranslate(
296321
managerId: String,
297322
lineTranslate: List<Double?>,
@@ -365,6 +390,7 @@ fun com.mapbox.maps.plugin.annotation.generated.PolylineAnnotation.toFLTPolyline
365390
geometry = geometry,
366391
lineJoin = lineJoin?.toFLTLineJoin(),
367392
lineSortKey = lineSortKey,
393+
lineZOffset = lineZOffset,
368394
lineBlur = lineBlur,
369395
// colorInt is 32 bit and may be bigger than MAX_INT, so transfer to UInt firstly and then to Long.
370396
lineBorderColor = lineBorderColorInt?.toUInt()?.toLong(),
@@ -390,6 +416,9 @@ fun PolylineAnnotationOptions.toPolylineAnnotationOptions(): com.mapbox.maps.plu
390416
this.lineSortKey?.let {
391417
options.withLineSortKey(it)
392418
}
419+
this.lineZOffset?.let {
420+
options.withLineZOffset(it)
421+
}
393422
this.lineBlur?.let {
394423
options.withLineBlur(it)
395424
}

android/src/main/kotlin/com/mapbox/maps/mapbox_maps/mapping/LocationComponentMappings.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ fun LocationComponentSettingsInterface.applyFromFLT(settings: LocationComponentS
2727
settings.puckBearing?.let {
2828
this.puckBearing = com.mapbox.maps.plugin.PuckBearing.values()[it.ordinal]
2929
}
30+
settings.slot?.let { this.slot = it }
3031
settings.locationPuck?.let {
3132
val puck2D = it.locationPuck2D
3233
val puck3D = it.locationPuck3D
@@ -73,6 +74,7 @@ fun LocationComponentSettingsInterface.toFLT(context: Context) = LocationCompone
7374
layerBelow = layerBelow,
7475
puckBearingEnabled = puckBearingEnabled,
7576
puckBearing = PuckBearing.values()[puckBearing.ordinal],
77+
slot = slot,
7678
locationPuck = LocationPuck(
7779
locationPuck2D = (locationPuck as? com.mapbox.maps.plugin.LocationPuck2D)?.let { puck2D ->
7880
LocationPuck2D(

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

Lines changed: 68 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ private fun createConnectionError(channelName: String): FlutterError {
3737
return FlutterError("channel-error", "Unable to establish connection on channel: '$channelName'.", "")
3838
}
3939

40-
/** Orientation of circle when map is pitched. */
40+
/**
41+
* Orientation of circle when map is pitched.
42+
* Default value: "viewport".
43+
*/
4144
enum class CirclePitchAlignment(val raw: Int) {
4245
/** The circle is aligned to the plane of the map. */
4346
MAP(0),
@@ -51,7 +54,10 @@ enum class CirclePitchAlignment(val raw: Int) {
5154
}
5255
}
5356

54-
/** Controls the scaling behavior of the circle when the map is pitched. */
57+
/**
58+
* Controls the scaling behavior of the circle when the map is pitched.
59+
* Default value: "map".
60+
*/
5561
enum class CirclePitchScale(val raw: Int) {
5662
/** Circles are scaled according to their apparent distance to the camera. */
5763
MAP(0),
@@ -65,7 +71,10 @@ enum class CirclePitchScale(val raw: Int) {
6571
}
6672
}
6773

68-
/** Controls the frame of reference for `circle-translate`. */
74+
/**
75+
* Controls the frame of reference for `circle-translate`.
76+
* Default value: "map".
77+
*/
6978
enum class CircleTranslateAnchor(val raw: Int) {
7079
/** The circle is translated relative to the map. */
7180
MAP(0),
@@ -87,19 +96,40 @@ data class CircleAnnotation(
8796
val geometry: Point,
8897
/** Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key. */
8998
val circleSortKey: Double? = null,
90-
/** Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity. */
99+
/**
100+
* Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.
101+
* Default value: 0.
102+
*/
91103
val circleBlur: Double? = null,
92-
/** The fill color of the circle. */
104+
/**
105+
* The fill color of the circle.
106+
* Default value: "#000000".
107+
*/
93108
val circleColor: Long? = null,
94-
/** The opacity at which the circle will be drawn. */
109+
/**
110+
* The opacity at which the circle will be drawn.
111+
* Default value: 1. Value range: [0, 1]
112+
*/
95113
val circleOpacity: Double? = null,
96-
/** Circle radius. */
114+
/**
115+
* Circle radius.
116+
* Default value: 5. Minimum value: 0.
117+
*/
97118
val circleRadius: Double? = null,
98-
/** The stroke color of the circle. */
119+
/**
120+
* The stroke color of the circle.
121+
* Default value: "#000000".
122+
*/
99123
val circleStrokeColor: Long? = null,
100-
/** The opacity of the circle's stroke. */
124+
/**
125+
* The opacity of the circle's stroke.
126+
* Default value: 1. Value range: [0, 1]
127+
*/
101128
val circleStrokeOpacity: Double? = null,
102-
/** The width of the circle's stroke. Strokes are placed outside of the `circle-radius`. */
129+
/**
130+
* The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.
131+
* Default value: 0. Minimum value: 0.
132+
*/
103133
val circleStrokeWidth: Double? = null
104134

105135
) {
@@ -141,19 +171,40 @@ data class CircleAnnotationOptions(
141171
val geometry: Point,
142172
/** Sorts features in ascending order based on this value. Features with a higher sort key will appear above features with a lower sort key. */
143173
val circleSortKey: Double? = null,
144-
/** Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity. */
174+
/**
175+
* Amount to blur the circle. 1 blurs the circle such that only the centerpoint is full opacity.
176+
* Default value: 0.
177+
*/
145178
val circleBlur: Double? = null,
146-
/** The fill color of the circle. */
179+
/**
180+
* The fill color of the circle.
181+
* Default value: "#000000".
182+
*/
147183
val circleColor: Long? = null,
148-
/** The opacity at which the circle will be drawn. */
184+
/**
185+
* The opacity at which the circle will be drawn.
186+
* Default value: 1. Value range: [0, 1]
187+
*/
149188
val circleOpacity: Double? = null,
150-
/** Circle radius. */
189+
/**
190+
* Circle radius.
191+
* Default value: 5. Minimum value: 0.
192+
*/
151193
val circleRadius: Double? = null,
152-
/** The stroke color of the circle. */
194+
/**
195+
* The stroke color of the circle.
196+
* Default value: "#000000".
197+
*/
153198
val circleStrokeColor: Long? = null,
154-
/** The opacity of the circle's stroke. */
199+
/**
200+
* The opacity of the circle's stroke.
201+
* Default value: 1. Value range: [0, 1]
202+
*/
155203
val circleStrokeOpacity: Double? = null,
156-
/** The width of the circle's stroke. Strokes are placed outside of the `circle-radius`. */
204+
/**
205+
* The width of the circle's stroke. Strokes are placed outside of the `circle-radius`.
206+
* Default value: 0. Minimum value: 0.
207+
*/
157208
val circleStrokeWidth: Double? = null
158209

159210
) {

0 commit comments

Comments
 (0)