@@ -33,6 +33,31 @@ private fun wrapError(exception: Throwable): List<Any?> {
3333 )
3434 }
3535}
36+ private fun deepEqualsCircleAnnotationMessenger (a : Any? , b : Any? ): Boolean {
37+ if (a is ByteArray && b is ByteArray ) {
38+ return a.contentEquals(b)
39+ }
40+ if (a is IntArray && b is IntArray ) {
41+ return a.contentEquals(b)
42+ }
43+ if (a is LongArray && b is LongArray ) {
44+ return a.contentEquals(b)
45+ }
46+ if (a is DoubleArray && b is DoubleArray ) {
47+ return a.contentEquals(b)
48+ }
49+ if (a is Array <* > && b is Array <* >) {
50+ return a.size == b.size &&
51+ a.indices.all { deepEqualsCircleAnnotationMessenger(a[it], b[it]) }
52+ }
53+ if (a is Map <* , * > && b is Map <* , * >) {
54+ return a.size == b.size && a.keys.all {
55+ (b as Map <Any ?, Any ?>).containsKey(it) &&
56+ deepEqualsCircleAnnotationMessenger(a[it], b[it])
57+ }
58+ }
59+ return a == b
60+ }
3661
3762/* *
3863 * Selects the base of circle-elevation. Some modes might require precomputed elevation data in the tileset.
@@ -146,7 +171,9 @@ data class CircleAnnotation(
146171 */
147172 val circleStrokeWidth : Double? = null ,
148173 /* * Property to determine whether annotation can be manually moved around map. */
149- val isDraggable : Boolean? = null
174+ val isDraggable : Boolean? = null ,
175+ /* * JSON convertible properties associated with the annotation, used to enrich Feature GeoJSON `properties["custom_data"]` field. */
176+ val customData : Map <String , Any >? = null
150177) {
151178 companion object {
152179 fun fromList (pigeonVar_list : List <Any ?>): CircleAnnotation {
@@ -161,7 +188,8 @@ data class CircleAnnotation(
161188 val circleStrokeOpacity = pigeonVar_list[8 ] as Double?
162189 val circleStrokeWidth = pigeonVar_list[9 ] as Double?
163190 val isDraggable = pigeonVar_list[10 ] as Boolean?
164- return CircleAnnotation (id, geometry, circleSortKey, circleBlur, circleColor, circleOpacity, circleRadius, circleStrokeColor, circleStrokeOpacity, circleStrokeWidth, isDraggable)
191+ val customData = pigeonVar_list[11 ] as Map <String , Any >?
192+ return CircleAnnotation (id, geometry, circleSortKey, circleBlur, circleColor, circleOpacity, circleRadius, circleStrokeColor, circleStrokeOpacity, circleStrokeWidth, isDraggable, customData)
165193 }
166194 }
167195 fun toList (): List <Any ?> {
@@ -177,6 +205,7 @@ data class CircleAnnotation(
177205 circleStrokeOpacity,
178206 circleStrokeWidth,
179207 isDraggable,
208+ customData,
180209 )
181210 }
182211 override fun equals (other : Any? ): Boolean {
@@ -196,7 +225,8 @@ data class CircleAnnotation(
196225 circleStrokeColor == other.circleStrokeColor &&
197226 circleStrokeOpacity == other.circleStrokeOpacity &&
198227 circleStrokeWidth == other.circleStrokeWidth &&
199- isDraggable == other.isDraggable
228+ isDraggable == other.isDraggable &&
229+ deepEqualsCircleAnnotationMessenger(customData, other.customData)
200230 }
201231
202232 override fun hashCode (): Int = toList().hashCode()
@@ -244,7 +274,9 @@ data class CircleAnnotationOptions(
244274 */
245275 val circleStrokeWidth : Double? = null ,
246276 /* * Property to determine whether annotation can be manually moved around map. */
247- val isDraggable : Boolean? = null
277+ val isDraggable : Boolean? = null ,
278+ /* * JSON convertible properties associated with the annotation, used to enrich Feature GeoJSON `properties["custom_data"]` field. */
279+ val customData : Map <String , Any >? = null
248280) {
249281 companion object {
250282 fun fromList (pigeonVar_list : List <Any ?>): CircleAnnotationOptions {
@@ -258,7 +290,8 @@ data class CircleAnnotationOptions(
258290 val circleStrokeOpacity = pigeonVar_list[7 ] as Double?
259291 val circleStrokeWidth = pigeonVar_list[8 ] as Double?
260292 val isDraggable = pigeonVar_list[9 ] as Boolean?
261- return CircleAnnotationOptions (geometry, circleSortKey, circleBlur, circleColor, circleOpacity, circleRadius, circleStrokeColor, circleStrokeOpacity, circleStrokeWidth, isDraggable)
293+ val customData = pigeonVar_list[10 ] as Map <String , Any >?
294+ return CircleAnnotationOptions (geometry, circleSortKey, circleBlur, circleColor, circleOpacity, circleRadius, circleStrokeColor, circleStrokeOpacity, circleStrokeWidth, isDraggable, customData)
262295 }
263296 }
264297 fun toList (): List <Any ?> {
@@ -273,6 +306,7 @@ data class CircleAnnotationOptions(
273306 circleStrokeOpacity,
274307 circleStrokeWidth,
275308 isDraggable,
309+ customData,
276310 )
277311 }
278312 override fun equals (other : Any? ): Boolean {
@@ -291,7 +325,8 @@ data class CircleAnnotationOptions(
291325 circleStrokeColor == other.circleStrokeColor &&
292326 circleStrokeOpacity == other.circleStrokeOpacity &&
293327 circleStrokeWidth == other.circleStrokeWidth &&
294- isDraggable == other.isDraggable
328+ isDraggable == other.isDraggable &&
329+ deepEqualsCircleAnnotationMessenger(customData, other.customData)
295330 }
296331
297332 override fun hashCode (): Int = toList().hashCode()
@@ -374,6 +409,7 @@ private open class CircleAnnotationMessengerPigeonCodec : StandardMessageCodec()
374409
375410/* * Generated interface from Pigeon that represents a handler of messages from Flutter. */
376411interface _CircleAnnotationMessenger {
412+ fun getAnnotations (managerId : String , callback : (Result <List <CircleAnnotation >>) -> Unit )
377413 fun create (managerId : String , annotationOption : CircleAnnotationOptions , callback : (Result <CircleAnnotation >) -> Unit )
378414 fun createMulti (managerId : String , annotationOptions : List <CircleAnnotationOptions >, callback : (Result <List <CircleAnnotation >>) -> Unit )
379415 fun update (managerId : String , annotation : CircleAnnotation , callback : (Result <Unit >) -> Unit )
@@ -417,6 +453,26 @@ interface _CircleAnnotationMessenger {
417453 @JvmOverloads
418454 fun setUp (binaryMessenger : BinaryMessenger , api : _CircleAnnotationMessenger ? , messageChannelSuffix : String = "") {
419455 val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) " .$messageChannelSuffix " else " "
456+ run {
457+ val channel = BasicMessageChannel <Any ?>(binaryMessenger, " dev.flutter.pigeon.mapbox_maps_flutter._CircleAnnotationMessenger.getAnnotations$separatedMessageChannelSuffix " , codec)
458+ if (api != null ) {
459+ channel.setMessageHandler { message, reply ->
460+ val args = message as List <Any ?>
461+ val managerIdArg = args[0 ] as String
462+ api.getAnnotations(managerIdArg) { result: Result <List <CircleAnnotation >> ->
463+ val error = result.exceptionOrNull()
464+ if (error != null ) {
465+ reply.reply(wrapError(error))
466+ } else {
467+ val data = result.getOrNull()
468+ reply.reply(wrapResult(data))
469+ }
470+ }
471+ }
472+ } else {
473+ channel.setMessageHandler(null )
474+ }
475+ }
420476 run {
421477 val channel = BasicMessageChannel <Any ?>(binaryMessenger, " dev.flutter.pigeon.mapbox_maps_flutter._CircleAnnotationMessenger.create$separatedMessageChannelSuffix " , codec)
422478 if (api != null ) {
0 commit comments