From ab4807d1c578731d7a0ff4c2b4a00c2f6a1e4d99 Mon Sep 17 00:00:00 2001 From: Nick Kurochkin Date: Fri, 19 May 2023 18:40:08 +0400 Subject: [PATCH 1/2] Implement getAnnotations functionality Implemented getAnnotations functionality in: - PointAnnotationManager - CircleAnnotationManager - PolygonAnnotationManager - PolylineAnnotationManager --- .../pigeons/FLTCircleAnnotationMessager.java | 35 +++++++++++++++++++ .../pigeons/FLTPointAnnotationMessager.java | 35 +++++++++++++++++++ .../pigeons/FLTPolygonAnnotationMessager.java | 35 +++++++++++++++++++ .../FLTPolylineAnnotationMessager.java | 35 +++++++++++++++++++ .../annotation/CircleAnnotationController.kt | 14 ++++++++ .../annotation/PointAnnotationController.kt | 13 +++++++ .../annotation/PolygonAnnotationController.kt | 13 +++++++ .../PolylineAnnotationController.kt | 13 +++++++ example/lib/circle_annotations.dart | 26 +++++++++++++- example/lib/point_annotations.dart | 26 +++++++++++++- example/lib/polygon_annotations.dart | 26 +++++++++++++- example/lib/polyline_annotations.dart | 26 +++++++++++++- ios/Classes/CircleAnnotationController.swift | 15 ++++++++ ios/Classes/CircleAnnotationMessager.h | 1 + ios/Classes/CircleAnnotationMessager.m | 20 +++++++++++ ios/Classes/PointAnnotationController.swift | 15 ++++++++ ios/Classes/PointAnnotationMessager.h | 1 + ios/Classes/PointAnnotationMessager.m | 20 +++++++++++ ios/Classes/PolygonAnnotationController.swift | 15 ++++++++ ios/Classes/PolygonAnnotationMessager.h | 1 + ios/Classes/PolygonAnnotationMessager.m | 20 +++++++++++ .../PolylineAnnotationController.swift | 15 ++++++++ ios/Classes/PolylineAnnotationMessager.h | 1 + ios/Classes/PolylineAnnotationMessager.m | 20 +++++++++++ .../annotation/circle_annotation_manager.dart | 4 +++ .../annotation/point_annotation_manager.dart | 3 ++ .../polygon_annotation_manager.dart | 4 +++ .../polyline_annotation_manager.dart | 4 +++ .../pigeons/circle_annotation_messager.dart | 24 +++++++++++++ .../circle_annotation_messager.dart.orig | 24 +++++++++++++ .../pigeons/point_annotation_messager.dart | 24 +++++++++++++ .../point_annotation_messager.dart.orig | 24 +++++++++++++ .../pigeons/polygon_annotation_messager.dart | 24 +++++++++++++ .../polygon_annotation_messager.dart.orig | 24 +++++++++++++ .../pigeons/polyline_annotation_messager.dart | 24 +++++++++++++ .../polyline_annotation_messager.dart.orig | 24 +++++++++++++ 36 files changed, 644 insertions(+), 4 deletions(-) diff --git a/android/src/main/java/com/mapbox/maps/pigeons/FLTCircleAnnotationMessager.java b/android/src/main/java/com/mapbox/maps/pigeons/FLTCircleAnnotationMessager.java index 14f1beeb..3fc1e242 100644 --- a/android/src/main/java/com/mapbox/maps/pigeons/FLTCircleAnnotationMessager.java +++ b/android/src/main/java/com/mapbox/maps/pigeons/FLTCircleAnnotationMessager.java @@ -469,6 +469,7 @@ public interface _CircleAnnotationMessager { void update(@NonNull String managerId, @NonNull CircleAnnotation annotation, Result result); void delete(@NonNull String managerId, @NonNull CircleAnnotation annotation, Result result); void deleteAll(@NonNull String managerId, Result result); + void getAnnotations(@NonNull String managerId, Result> result); void setCirclePitchAlignment(@NonNull String managerId, @NonNull CirclePitchAlignment circlePitchAlignment, Result result); void getCirclePitchAlignment(@NonNull String managerId, Result result); void setCirclePitchScale(@NonNull String managerId, @NonNull CirclePitchScale circlePitchScale, Result result); @@ -671,6 +672,40 @@ public void error(Throwable error) { channel.setMessageHandler(null); } } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon._CircleAnnotationMessager.getAnnotations", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + String managerIdArg = (String)args.get(0); + if (managerIdArg == null) { + throw new NullPointerException("managerIdArg unexpectedly null."); + } + Result> resultCallback = new Result>() { + public void success(List result) { + wrapped.put("result", result); + reply.reply(wrapped); + } + public void error(Throwable error) { + wrapped.put("error", wrapError(error)); + reply.reply(wrapped); + } + }; + + api.getAnnotations(managerIdArg, resultCallback); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + reply.reply(wrapped); + } + }); + } else { + channel.setMessageHandler(null); + } + } { BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon._CircleAnnotationMessager.setCirclePitchAlignment", getCodec()); diff --git a/android/src/main/java/com/mapbox/maps/pigeons/FLTPointAnnotationMessager.java b/android/src/main/java/com/mapbox/maps/pigeons/FLTPointAnnotationMessager.java index b6d628fc..a8d888b5 100644 --- a/android/src/main/java/com/mapbox/maps/pigeons/FLTPointAnnotationMessager.java +++ b/android/src/main/java/com/mapbox/maps/pigeons/FLTPointAnnotationMessager.java @@ -1191,6 +1191,7 @@ public interface _PointAnnotationMessager { void update(@NonNull String managerId, @NonNull PointAnnotation annotation, Result result); void delete(@NonNull String managerId, @NonNull PointAnnotation annotation, Result result); void deleteAll(@NonNull String managerId, Result result); + void getAnnotations(@NonNull String managerId, Result> result); void setIconAllowOverlap(@NonNull String managerId, @NonNull Boolean iconAllowOverlap, Result result); void getIconAllowOverlap(@NonNull String managerId, Result result); void setIconIgnorePlacement(@NonNull String managerId, @NonNull Boolean iconIgnorePlacement, Result result); @@ -1439,6 +1440,40 @@ public void error(Throwable error) { channel.setMessageHandler(null); } } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon._PointAnnotationMessager.getAnnotations", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + String managerIdArg = (String)args.get(0); + if (managerIdArg == null) { + throw new NullPointerException("managerIdArg unexpectedly null."); + } + Result> resultCallback = new Result>() { + public void success(List result) { + wrapped.put("result", result); + reply.reply(wrapped); + } + public void error(Throwable error) { + wrapped.put("error", wrapError(error)); + reply.reply(wrapped); + } + }; + + api.getAnnotations(managerIdArg, resultCallback); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + reply.reply(wrapped); + } + }); + } else { + channel.setMessageHandler(null); + } + } { BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon._PointAnnotationMessager.setIconAllowOverlap", getCodec()); diff --git a/android/src/main/java/com/mapbox/maps/pigeons/FLTPolygonAnnotationMessager.java b/android/src/main/java/com/mapbox/maps/pigeons/FLTPolygonAnnotationMessager.java index 00784700..c0348055 100644 --- a/android/src/main/java/com/mapbox/maps/pigeons/FLTPolygonAnnotationMessager.java +++ b/android/src/main/java/com/mapbox/maps/pigeons/FLTPolygonAnnotationMessager.java @@ -359,6 +359,7 @@ public interface _PolygonAnnotationMessager { void update(@NonNull String managerId, @NonNull PolygonAnnotation annotation, Result result); void delete(@NonNull String managerId, @NonNull PolygonAnnotation annotation, Result result); void deleteAll(@NonNull String managerId, Result result); + void getAnnotations(@NonNull String managerId, Result> result); void setFillAntialias(@NonNull String managerId, @NonNull Boolean fillAntialias, Result result); void getFillAntialias(@NonNull String managerId, Result result); void setFillTranslate(@NonNull String managerId, @NonNull List fillTranslate, Result result); @@ -559,6 +560,40 @@ public void error(Throwable error) { channel.setMessageHandler(null); } } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon._PolygonAnnotationMessager.getAnnotations", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + String managerIdArg = (String)args.get(0); + if (managerIdArg == null) { + throw new NullPointerException("managerIdArg unexpectedly null."); + } + Result> resultCallback = new Result>() { + public void success(List result) { + wrapped.put("result", result); + reply.reply(wrapped); + } + public void error(Throwable error) { + wrapped.put("error", wrapError(error)); + reply.reply(wrapped); + } + }; + + api.getAnnotations(managerIdArg, resultCallback); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + reply.reply(wrapped); + } + }); + } else { + channel.setMessageHandler(null); + } + } { BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon._PolygonAnnotationMessager.setFillAntialias", getCodec()); diff --git a/android/src/main/java/com/mapbox/maps/pigeons/FLTPolylineAnnotationMessager.java b/android/src/main/java/com/mapbox/maps/pigeons/FLTPolylineAnnotationMessager.java index a3bc3cda..f0cf2628 100644 --- a/android/src/main/java/com/mapbox/maps/pigeons/FLTPolylineAnnotationMessager.java +++ b/android/src/main/java/com/mapbox/maps/pigeons/FLTPolylineAnnotationMessager.java @@ -501,6 +501,7 @@ public interface _PolylineAnnotationMessager { void update(@NonNull String managerId, @NonNull PolylineAnnotation annotation, Result result); void delete(@NonNull String managerId, @NonNull PolylineAnnotation annotation, Result result); void deleteAll(@NonNull String managerId, Result result); + void getAnnotations(@NonNull String managerId, Result> result); void setLineCap(@NonNull String managerId, @NonNull LineCap lineCap, Result result); void getLineCap(@NonNull String managerId, Result result); void setLineMiterLimit(@NonNull String managerId, @NonNull Double lineMiterLimit, Result result); @@ -709,6 +710,40 @@ public void error(Throwable error) { channel.setMessageHandler(null); } } + { + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon._PolylineAnnotationMessager.getAnnotations", getCodec()); + if (api != null) { + channel.setMessageHandler((message, reply) -> { + Map wrapped = new HashMap<>(); + try { + ArrayList args = (ArrayList)message; + String managerIdArg = (String)args.get(0); + if (managerIdArg == null) { + throw new NullPointerException("managerIdArg unexpectedly null."); + } + Result> resultCallback = new Result>() { + public void success(List result) { + wrapped.put("result", result); + reply.reply(wrapped); + } + public void error(Throwable error) { + wrapped.put("error", wrapError(error)); + reply.reply(wrapped); + } + }; + + api.getAnnotations(managerIdArg, resultCallback); + } + catch (Error | RuntimeException exception) { + wrapped.put("error", wrapError(exception)); + reply.reply(wrapped); + } + }); + } else { + channel.setMessageHandler(null); + } + } { BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon._PolylineAnnotationMessager.setLineCap", getCodec()); diff --git a/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/CircleAnnotationController.kt b/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/CircleAnnotationController.kt index 7a970501..b2b7c694 100644 --- a/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/CircleAnnotationController.kt +++ b/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/CircleAnnotationController.kt @@ -119,6 +119,20 @@ class CircleAnnotationController(private val delegate: ControllerDelegate) : } } + override fun getAnnotations( + managerId: String, + result: FLTCircleAnnotationMessager.Result>? + ) { + try { + val manager = delegate.getManager(managerId) as CircleAnnotationManager + val annotations = annotationMap.values.map { it.toFLTCircleAnnotation() }.toMutableList() + result?.success(annotations) + } catch (e: Exception) { + result?.error(e) + } + } + + private fun updateAnnotation(annotation: FLTCircleAnnotationMessager.CircleAnnotation): CircleAnnotation { val originalAnnotation = annotationMap[annotation.id]!! annotation.geometry?.let { diff --git a/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PointAnnotationController.kt b/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PointAnnotationController.kt index f35618b2..c66a86e1 100644 --- a/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PointAnnotationController.kt +++ b/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PointAnnotationController.kt @@ -121,6 +121,19 @@ class PointAnnotationController(private val delegate: ControllerDelegate) : } } + override fun getAnnotations( + managerId: String, + result: FLTPointAnnotationMessager.Result>? + ) { + try { + val manager = delegate.getManager(managerId) as PointAnnotationManager + val annotations = annotationMap.values.map { it.toFLTPointAnnotation() }.toMutableList() + result?.success(annotations) + } catch (e: Exception) { + result?.error(e) + } + } + private fun updateAnnotation(annotation: FLTPointAnnotationMessager.PointAnnotation): PointAnnotation { val originalAnnotation = annotationMap[annotation.id]!! annotation.geometry?.let { diff --git a/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PolygonAnnotationController.kt b/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PolygonAnnotationController.kt index 47bdcbce..7a9f70f8 100644 --- a/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PolygonAnnotationController.kt +++ b/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PolygonAnnotationController.kt @@ -120,6 +120,19 @@ class PolygonAnnotationController(private val delegate: ControllerDelegate) : } } + override fun getAnnotations( + managerId: String, + result: FLTPolygonAnnotationMessager.Result>? + ) { + try { + val manager = delegate.getManager(managerId) as PolygonAnnotationManager + val annotations = annotationMap.values.map { it.toFLTPolygonAnnotation() }.toMutableList() + result?.success(annotations) + } catch (e: Exception) { + result?.error(e) + } + } + private fun updateAnnotation(annotation: FLTPolygonAnnotationMessager.PolygonAnnotation): PolygonAnnotation { val originalAnnotation = annotationMap[annotation.id]!! annotation.geometry?.let { diff --git a/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PolylineAnnotationController.kt b/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PolylineAnnotationController.kt index dde3996a..a4f78af7 100644 --- a/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PolylineAnnotationController.kt +++ b/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PolylineAnnotationController.kt @@ -120,6 +120,19 @@ class PolylineAnnotationController(private val delegate: ControllerDelegate) : } } + override fun getAnnotations( + managerId: String, + result: FLTPolylineAnnotationMessager.Result>? + ) { + try { + val manager = delegate.getManager(managerId) as PolylineAnnotationManager + val annotations = annotationMap.values.map { it.toFLTPolylineAnnotation() }.toMutableList() + result?.success(annotations) + } catch (e: Exception) { + result?.error(e) + } + } + private fun updateAnnotation(annotation: FLTPolylineAnnotationMessager.PolylineAnnotation): PolylineAnnotation { val originalAnnotation = annotationMap[annotation.id]!! annotation.geometry?.let { diff --git a/example/lib/circle_annotations.dart b/example/lib/circle_annotations.dart index d9045ece..e820ca15 100644 --- a/example/lib/circle_annotations.dart +++ b/example/lib/circle_annotations.dart @@ -122,6 +122,24 @@ class CircleAnnotationPageBodyState extends State { ); } + Widget _getAnnotations() { + return TextButton( + child: Text('get all annotations'), + onPressed: () { + circleAnnotationManager?.getAnnotations().then((value) { + final ids = value.map((e) => e.id).join(", "); + ScaffoldMessenger.of(context).showSnackBar(SnackBar( + content: Text( + "Current annotations ids:\n[$ids]", + ), + backgroundColor: Theme.of(context).primaryColor, + duration: Duration(seconds: 2), + )); + }); + }, + ); + } + @override Widget build(BuildContext context) { final MapWidget mapWidget = MapWidget( @@ -132,7 +150,13 @@ class CircleAnnotationPageBodyState extends State { final List listViewChildren = []; listViewChildren.addAll( - [_create(), _update(), _delete(), _deleteAll()], + [ + _create(), + _update(), + _delete(), + _deleteAll(), + _getAnnotations(), + ], ); final colmn = Column( diff --git a/example/lib/point_annotations.dart b/example/lib/point_annotations.dart index 6f604085..85c3eda7 100644 --- a/example/lib/point_annotations.dart +++ b/example/lib/point_annotations.dart @@ -138,6 +138,24 @@ class PointAnnotationPageBodyState extends State { ); } + Widget _getAnnotations() { + return TextButton( + child: Text('get all annotations'), + onPressed: () { + pointAnnotationManager?.getAnnotations().then((value) { + final ids = value.map((e) => e.id).join(", "); + ScaffoldMessenger.of(context).showSnackBar(SnackBar( + content: Text( + "Current annotations ids:\n[$ids]", + ), + backgroundColor: Theme.of(context).primaryColor, + duration: Duration(seconds: 2), + )); + }); + }, + ); + } + @override Widget build(BuildContext context) { final MapWidget mapWidget = MapWidget( @@ -148,7 +166,13 @@ class PointAnnotationPageBodyState extends State { final List listViewChildren = []; listViewChildren.addAll( - [_create(), _update(), _delete(), _deleteAll()], + [ + _create(), + _update(), + _delete(), + _deleteAll(), + _getAnnotations(), + ], ); final colmn = Column( diff --git a/example/lib/polygon_annotations.dart b/example/lib/polygon_annotations.dart index d4210d1b..ad541da8 100644 --- a/example/lib/polygon_annotations.dart +++ b/example/lib/polygon_annotations.dart @@ -128,6 +128,24 @@ class PolygonAnnotationPageBodyState extends State { ); } + Widget _getAnnotations() { + return TextButton( + child: Text('get all annotations'), + onPressed: () { + polygonAnnotationManager?.getAnnotations().then((value) { + final ids = value.map((e) => e.id).join(", "); + ScaffoldMessenger.of(context).showSnackBar(SnackBar( + content: Text( + "Current annotations ids:\n[$ids]", + ), + backgroundColor: Theme.of(context).primaryColor, + duration: Duration(seconds: 2), + )); + }); + }, + ); + } + @override Widget build(BuildContext context) { final MapWidget mapWidget = MapWidget( @@ -138,7 +156,13 @@ class PolygonAnnotationPageBodyState extends State { final List listViewChildren = []; listViewChildren.addAll( - [_create(), _update(), _delete(), _deleteAll()], + [ + _create(), + _update(), + _delete(), + _deleteAll(), + _getAnnotations(), + ], ); final colmn = Column( diff --git a/example/lib/polyline_annotations.dart b/example/lib/polyline_annotations.dart index d8a73efb..21e83b51 100644 --- a/example/lib/polyline_annotations.dart +++ b/example/lib/polyline_annotations.dart @@ -134,6 +134,24 @@ class PolylineAnnotationPageBodyState ); } + Widget _getAnnotations() { + return TextButton( + child: Text('get all annotations'), + onPressed: () { + polylineAnnotationManager?.getAnnotations().then((value) { + final ids = value.map((e) => e.id).join(", "); + ScaffoldMessenger.of(context).showSnackBar(SnackBar( + content: Text( + "Current annotations ids:\n[$ids]", + ), + backgroundColor: Theme.of(context).primaryColor, + duration: Duration(seconds: 2), + )); + }); + }, + ); + } + @override Widget build(BuildContext context) { final MapWidget mapWidget = MapWidget( @@ -144,7 +162,13 @@ class PolylineAnnotationPageBodyState final List listViewChildren = []; listViewChildren.addAll( - [_create(), _update(), _delete(), _deleteAll()], + [ + _create(), + _update(), + _delete(), + _deleteAll(), + _getAnnotations(), + ], ); final colmn = Column( diff --git a/ios/Classes/CircleAnnotationController.swift b/ios/Classes/CircleAnnotationController.swift index c78a2332..80fe13c6 100644 --- a/ios/Classes/CircleAnnotationController.swift +++ b/ios/Classes/CircleAnnotationController.swift @@ -99,6 +99,21 @@ class CircleAnnotationController: NSObject, FLT_CircleAnnotationMessager { } completion(nil) } + + func getAnnotationsManagerId(_ managerId: String, completion: @escaping ([FLTCircleAnnotation]?, FlutterError?) -> Void) { + do { + if let manager = try delegate?.getManager(managerId: managerId) as? CircleAnnotationManager { + let annotations = manager.annotations.map { annotation in + annotation.toFLTCircleAnnotation() + } + completion(annotations, nil) + } else { + completion(nil, FlutterError(code: CircleAnnotationController.errorCode, message: "No manager found with id: \(managerId)", details: nil)) + } + } catch { + completion(nil, FlutterError(code: CircleAnnotationController.errorCode, message: "No manager found with id: \(managerId)", details: nil)) + } + } func setCirclePitchAlignmentManagerId(_ managerId: String, circlePitchAlignment: FLTCirclePitchAlignment, completion: @escaping (FlutterError?) -> Void) { do { diff --git a/ios/Classes/CircleAnnotationMessager.h b/ios/Classes/CircleAnnotationMessager.h index a88027a8..ffc22f74 100644 --- a/ios/Classes/CircleAnnotationMessager.h +++ b/ios/Classes/CircleAnnotationMessager.h @@ -88,6 +88,7 @@ NSObject *FLT_CircleAnnotationMessagerGetCodec(void); - (void)updateManagerId:(NSString *)managerId annotation:(FLTCircleAnnotation *)annotation completion:(void(^)(FlutterError *_Nullable))completion; - (void)deleteManagerId:(NSString *)managerId annotation:(FLTCircleAnnotation *)annotation completion:(void(^)(FlutterError *_Nullable))completion; - (void)deleteAllManagerId:(NSString *)managerId completion:(void(^)(FlutterError *_Nullable))completion; +- (void)getAnnotationsManagerId:(NSString *)managerId completion:(void(^)(NSArray *_Nullable, FlutterError *_Nullable))completion; - (void)setCirclePitchAlignmentManagerId:(NSString *)managerId circlePitchAlignment:(FLTCirclePitchAlignment)circlePitchAlignment completion:(void(^)(FlutterError *_Nullable))completion; - (void)getCirclePitchAlignmentManagerId:(NSString *)managerId completion:(void(^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; - (void)setCirclePitchScaleManagerId:(NSString *)managerId circlePitchScale:(FLTCirclePitchScale)circlePitchScale completion:(void(^)(FlutterError *_Nullable))completion; diff --git a/ios/Classes/CircleAnnotationMessager.m b/ios/Classes/CircleAnnotationMessager.m index b15b8c29..bab64657 100644 --- a/ios/Classes/CircleAnnotationMessager.m +++ b/ios/Classes/CircleAnnotationMessager.m @@ -391,6 +391,26 @@ void FLT_CircleAnnotationMessagerSetup(id binaryMessenge [channel setMessageHandler:nil]; } } + { + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon._CircleAnnotationMessager.getAnnotations" + binaryMessenger:binaryMessenger + codec:FLT_CircleAnnotationMessagerGetCodec() ]; + if (api) { + NSCAssert([api respondsToSelector:@selector(getAnnotationsManagerId:completion:)], @"FLT_CircleAnnotationMessager api (%@) doesn't respond to @selector(getAnnotationsManagerId:completion:)", api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSString *arg_managerId = GetNullableObjectAtIndex(args, 0); + [api getAnnotationsManagerId:arg_managerId completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } + else { + [channel setMessageHandler:nil]; + } + } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] diff --git a/ios/Classes/PointAnnotationController.swift b/ios/Classes/PointAnnotationController.swift index 1d0c9d46..4cb56e0c 100644 --- a/ios/Classes/PointAnnotationController.swift +++ b/ios/Classes/PointAnnotationController.swift @@ -99,6 +99,21 @@ class PointAnnotationController: NSObject, FLT_PointAnnotationMessager { } completion(nil) } + + func getAnnotationsManagerId(_ managerId: String, completion: @escaping ([FLTPointAnnotation]?, FlutterError?) -> Void) { + do { + if let manager = try delegate?.getManager(managerId: managerId) as? PointAnnotationManager { + let annotations = manager.annotations.map { annotation in + annotation.toFLTPointAnnotation() + } + completion(annotations, nil) + } else { + completion(nil, FlutterError(code: PointAnnotationController.errorCode, message: "No manager found with id: \(managerId)", details: nil)) + } + } catch { + completion(nil, FlutterError(code: PointAnnotationController.errorCode, message: "No manager found with id: \(managerId)", details: nil)) + } + } func setIconAllowOverlapManagerId(_ managerId: String, iconAllowOverlap: NSNumber, completion: @escaping (FlutterError?) -> Void) { do { diff --git a/ios/Classes/PointAnnotationMessager.h b/ios/Classes/PointAnnotationMessager.h index b7f5be66..dce1d675 100644 --- a/ios/Classes/PointAnnotationMessager.h +++ b/ios/Classes/PointAnnotationMessager.h @@ -256,6 +256,7 @@ NSObject *FLT_PointAnnotationMessagerGetCodec(void); - (void)updateManagerId:(NSString *)managerId annotation:(FLTPointAnnotation *)annotation completion:(void(^)(FlutterError *_Nullable))completion; - (void)deleteManagerId:(NSString *)managerId annotation:(FLTPointAnnotation *)annotation completion:(void(^)(FlutterError *_Nullable))completion; - (void)deleteAllManagerId:(NSString *)managerId completion:(void(^)(FlutterError *_Nullable))completion; +- (void)getAnnotationsManagerId:(NSString *)managerId completion:(void(^)(NSArray *_Nullable, FlutterError *_Nullable))completion; - (void)setIconAllowOverlapManagerId:(NSString *)managerId iconAllowOverlap:(NSNumber *)iconAllowOverlap completion:(void(^)(FlutterError *_Nullable))completion; - (void)getIconAllowOverlapManagerId:(NSString *)managerId completion:(void(^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; - (void)setIconIgnorePlacementManagerId:(NSString *)managerId iconIgnorePlacement:(NSNumber *)iconIgnorePlacement completion:(void(^)(FlutterError *_Nullable))completion; diff --git a/ios/Classes/PointAnnotationMessager.m b/ios/Classes/PointAnnotationMessager.m index ad8ab03d..7814c384 100644 --- a/ios/Classes/PointAnnotationMessager.m +++ b/ios/Classes/PointAnnotationMessager.m @@ -543,6 +543,26 @@ void FLT_PointAnnotationMessagerSetup(id binaryMessenger [channel setMessageHandler:nil]; } } + { + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon._PointAnnotationMessager.getAnnotations" + binaryMessenger:binaryMessenger + codec:FLT_PointAnnotationMessagerGetCodec() ]; + if (api) { + NSCAssert([api respondsToSelector:@selector(getAnnotationsManagerId:completion:)], @"FLT_PointAnnotationMessager api (%@) doesn't respond to @selector(getAnnotationsManagerId:completion:)", api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSString *arg_managerId = GetNullableObjectAtIndex(args, 0); + [api getAnnotationsManagerId:arg_managerId completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } + else { + [channel setMessageHandler:nil]; + } + } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] diff --git a/ios/Classes/PolygonAnnotationController.swift b/ios/Classes/PolygonAnnotationController.swift index c56823f3..8248a4b2 100644 --- a/ios/Classes/PolygonAnnotationController.swift +++ b/ios/Classes/PolygonAnnotationController.swift @@ -99,6 +99,21 @@ class PolygonAnnotationController: NSObject, FLT_PolygonAnnotationMessager { } completion(nil) } + + func getAnnotationsManagerId(_ managerId: String, completion: @escaping ([FLTPolygonAnnotation]?, FlutterError?) -> Void) { + do { + if let manager = try delegate?.getManager(managerId: managerId) as? PolygonAnnotationManager { + let annotations = manager.annotations.map { annotation in + annotation.toFLTPolygonAnnotation() + } + completion(annotations, nil) + } else { + completion(nil, FlutterError(code: PolygonAnnotationController.errorCode, message: "No manager found with id: \(managerId)", details: nil)) + } + } catch { + completion(nil, FlutterError(code: PolygonAnnotationController.errorCode, message: "No manager found with id: \(managerId)", details: nil)) + } + } func setFillAntialiasManagerId(_ managerId: String, fillAntialias: NSNumber, completion: @escaping (FlutterError?) -> Void) { do { diff --git a/ios/Classes/PolygonAnnotationMessager.h b/ios/Classes/PolygonAnnotationMessager.h index 0d516b1b..ef3e7929 100644 --- a/ios/Classes/PolygonAnnotationMessager.h +++ b/ios/Classes/PolygonAnnotationMessager.h @@ -66,6 +66,7 @@ NSObject *FLT_PolygonAnnotationMessagerGetCodec(void); - (void)updateManagerId:(NSString *)managerId annotation:(FLTPolygonAnnotation *)annotation completion:(void(^)(FlutterError *_Nullable))completion; - (void)deleteManagerId:(NSString *)managerId annotation:(FLTPolygonAnnotation *)annotation completion:(void(^)(FlutterError *_Nullable))completion; - (void)deleteAllManagerId:(NSString *)managerId completion:(void(^)(FlutterError *_Nullable))completion; +- (void)getAnnotationsManagerId:(NSString *)managerId completion:(void(^)(NSArray *_Nullable, FlutterError *_Nullable))completion; - (void)setFillAntialiasManagerId:(NSString *)managerId fillAntialias:(NSNumber *)fillAntialias completion:(void(^)(FlutterError *_Nullable))completion; - (void)getFillAntialiasManagerId:(NSString *)managerId completion:(void(^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; - (void)setFillTranslateManagerId:(NSString *)managerId fillTranslate:(NSArray *)fillTranslate completion:(void(^)(FlutterError *_Nullable))completion; diff --git a/ios/Classes/PolygonAnnotationMessager.m b/ios/Classes/PolygonAnnotationMessager.m index 864efbe9..908e1792 100644 --- a/ios/Classes/PolygonAnnotationMessager.m +++ b/ios/Classes/PolygonAnnotationMessager.m @@ -367,6 +367,26 @@ void FLT_PolygonAnnotationMessagerSetup(id binaryMesseng [channel setMessageHandler:nil]; } } + { + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon._PolygonAnnotationMessager.getAnnotations" + binaryMessenger:binaryMessenger + codec:FLT_PolygonAnnotationMessagerGetCodec() ]; + if (api) { + NSCAssert([api respondsToSelector:@selector(getAnnotationsManagerId:completion:)], @"FLT_PolygonAnnotationMessager api (%@) doesn't respond to @selector(getAnnotationsManagerId:completion:)", api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSString *arg_managerId = GetNullableObjectAtIndex(args, 0); + [api getAnnotationsManagerId:arg_managerId completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } + else { + [channel setMessageHandler:nil]; + } + } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] diff --git a/ios/Classes/PolylineAnnotationController.swift b/ios/Classes/PolylineAnnotationController.swift index e0b5a67b..226d5257 100644 --- a/ios/Classes/PolylineAnnotationController.swift +++ b/ios/Classes/PolylineAnnotationController.swift @@ -99,6 +99,21 @@ class PolylineAnnotationController: NSObject, FLT_PolylineAnnotationMessager { } completion(nil) } + + func getAnnotationsManagerId(_ managerId: String, completion: @escaping ([FLTPolylineAnnotation]?, FlutterError?) -> Void) { + do { + if let manager = try delegate?.getManager(managerId: managerId) as? PolylineAnnotationManager { + let annotations = manager.annotations.map { annotation in + annotation.toFLTPolylineAnnotation() + } + completion(annotations, nil) + } else { + completion(nil, FlutterError(code: PolylineAnnotationController.errorCode, message: "No manager found with id: \(managerId)", details: nil)) + } + } catch { + completion(nil, FlutterError(code: PolylineAnnotationController.errorCode, message: "No manager found with id: \(managerId)", details: nil)) + } + } func setLineCapManagerId(_ managerId: String, lineCap: FLTLineCap, completion: @escaping (FlutterError?) -> Void) { do { diff --git a/ios/Classes/PolylineAnnotationMessager.h b/ios/Classes/PolylineAnnotationMessager.h index 7b50d977..8fde50f7 100644 --- a/ios/Classes/PolylineAnnotationMessager.h +++ b/ios/Classes/PolylineAnnotationMessager.h @@ -94,6 +94,7 @@ NSObject *FLT_PolylineAnnotationMessagerGetCodec(void); - (void)updateManagerId:(NSString *)managerId annotation:(FLTPolylineAnnotation *)annotation completion:(void(^)(FlutterError *_Nullable))completion; - (void)deleteManagerId:(NSString *)managerId annotation:(FLTPolylineAnnotation *)annotation completion:(void(^)(FlutterError *_Nullable))completion; - (void)deleteAllManagerId:(NSString *)managerId completion:(void(^)(FlutterError *_Nullable))completion; +- (void)getAnnotationsManagerId:(NSString *)managerId completion:(void(^)(NSArray *_Nullable, FlutterError *_Nullable))completion; - (void)setLineCapManagerId:(NSString *)managerId lineCap:(FLTLineCap)lineCap completion:(void(^)(FlutterError *_Nullable))completion; - (void)getLineCapManagerId:(NSString *)managerId completion:(void(^)(NSNumber *_Nullable, FlutterError *_Nullable))completion; - (void)setLineMiterLimitManagerId:(NSString *)managerId lineMiterLimit:(NSNumber *)lineMiterLimit completion:(void(^)(FlutterError *_Nullable))completion; diff --git a/ios/Classes/PolylineAnnotationMessager.m b/ios/Classes/PolylineAnnotationMessager.m index 34369f31..eec9907c 100644 --- a/ios/Classes/PolylineAnnotationMessager.m +++ b/ios/Classes/PolylineAnnotationMessager.m @@ -399,6 +399,26 @@ void FLT_PolylineAnnotationMessagerSetup(id binaryMessen [channel setMessageHandler:nil]; } } + { + FlutterBasicMessageChannel *channel = + [[FlutterBasicMessageChannel alloc] + initWithName:@"dev.flutter.pigeon._PolylineAnnotationMessager.getAnnotations" + binaryMessenger:binaryMessenger + codec:FLT_PolylineAnnotationMessagerGetCodec() ]; + if (api) { + NSCAssert([api respondsToSelector:@selector(getAnnotationsManagerId:completion:)], @"FLT_PolylineAnnotationMessager api (%@) doesn't respond to @selector(getAnnotationsManagerId:completion:)", api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSString *arg_managerId = GetNullableObjectAtIndex(args, 0); + [api getAnnotationsManagerId:arg_managerId completion:^(NSArray *_Nullable output, FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } + else { + [channel setMessageHandler:nil]; + } + } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] diff --git a/lib/src/annotation/circle_annotation_manager.dart b/lib/src/annotation/circle_annotation_manager.dart index 6bc83256..a3723ad9 100644 --- a/lib/src/annotation/circle_annotation_manager.dart +++ b/lib/src/annotation/circle_annotation_manager.dart @@ -37,6 +37,10 @@ class CircleAnnotationManager extends BaseAnnotationManager { /// Delete all the annotation added by this manager. Future deleteAll() => messager.deleteAll(id); + /// Current annotations of manager. + Future> getAnnotations() => + messager.getAnnotations(id); + /// Orientation of circle when map is pitched. Future setCirclePitchAlignment( CirclePitchAlignment circlePitchAlignment) => diff --git a/lib/src/annotation/point_annotation_manager.dart b/lib/src/annotation/point_annotation_manager.dart index cbf60128..3211eca3 100644 --- a/lib/src/annotation/point_annotation_manager.dart +++ b/lib/src/annotation/point_annotation_manager.dart @@ -36,6 +36,9 @@ class PointAnnotationManager extends BaseAnnotationManager { /// Delete all the annotation added by this manager. Future deleteAll() => messager.deleteAll(id); + /// Current annotations of manager. + Future> getAnnotations() => messager.getAnnotations(id); + /// If true, the icon will be visible even if it collides with other previously drawn symbols. Future setIconAllowOverlap(bool iconAllowOverlap) => messager.setIconAllowOverlap(id, iconAllowOverlap); diff --git a/lib/src/annotation/polygon_annotation_manager.dart b/lib/src/annotation/polygon_annotation_manager.dart index 2bf05394..b4a812dc 100644 --- a/lib/src/annotation/polygon_annotation_manager.dart +++ b/lib/src/annotation/polygon_annotation_manager.dart @@ -37,6 +37,10 @@ class PolygonAnnotationManager extends BaseAnnotationManager { /// Delete all the annotation added by this manager. Future deleteAll() => messager.deleteAll(id); + /// Current annotations of manager. + Future> getAnnotations() => + messager.getAnnotations(id); + /// Whether or not the fill should be antialiased. Future setFillAntialias(bool fillAntialias) => messager.setFillAntialias(id, fillAntialias); diff --git a/lib/src/annotation/polyline_annotation_manager.dart b/lib/src/annotation/polyline_annotation_manager.dart index 74bcc68d..149e6688 100644 --- a/lib/src/annotation/polyline_annotation_manager.dart +++ b/lib/src/annotation/polyline_annotation_manager.dart @@ -37,6 +37,10 @@ class PolylineAnnotationManager extends BaseAnnotationManager { /// Delete all the annotation added by this manager. Future deleteAll() => messager.deleteAll(id); + /// Current annotations of manager. + Future> getAnnotations() => + messager.getAnnotations(id); + /// The display of line endings. Future setLineCap(LineCap lineCap) => messager.setLineCap(id, lineCap); diff --git a/lib/src/pigeons/circle_annotation_messager.dart b/lib/src/pigeons/circle_annotation_messager.dart index b87c754d..4d49d268 100644 --- a/lib/src/pigeons/circle_annotation_messager.dart +++ b/lib/src/pigeons/circle_annotation_messager.dart @@ -409,6 +409,30 @@ class _CircleAnnotationMessager { } } + Future> getAnnotations(String arg_managerId) async { + final BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon._CircleAnnotationMessager.getAnnotations', codec, + binaryMessenger: _binaryMessenger); + final Map? replyMap = + await channel.send([arg_managerId]) as Map?; + if (replyMap == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel.', + ); + } else if (replyMap['error'] != null) { + final Map error = + (replyMap['error'] as Map?)!; + throw PlatformException( + code: (error['code'] as String?)!, + message: error['message'] as String?, + details: error['details'], + ); + } else { + return (replyMap['result'] as List?)!.cast(); + } + } + Future setCirclePitchAlignment(String arg_managerId, CirclePitchAlignment arg_circlePitchAlignment) async { final BasicMessageChannel channel = BasicMessageChannel( diff --git a/lib/src/pigeons/circle_annotation_messager.dart.orig b/lib/src/pigeons/circle_annotation_messager.dart.orig index 4f654115..924723f7 100644 --- a/lib/src/pigeons/circle_annotation_messager.dart.orig +++ b/lib/src/pigeons/circle_annotation_messager.dart.orig @@ -361,6 +361,30 @@ class _CircleAnnotationMessager { } } + Future> getAnnotations(String arg_managerId) async { + final BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon._CircleAnnotationMessager.getAnnotations', codec, + binaryMessenger: _binaryMessenger); + final Map? replyMap = + await channel.send([arg_managerId]) as Map?; + if (replyMap == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel.', + ); + } else if (replyMap['error'] != null) { + final Map error = + (replyMap['error'] as Map?)!; + throw PlatformException( + code: (error['code'] as String?)!, + message: error['message'] as String?, + details: error['details'], + ); + } else { + return (replyMap['result'] as List?)!.cast(); + } + } + Future setCirclePitchAlignment(String arg_managerId, CirclePitchAlignment arg_circlePitchAlignment) async { final BasicMessageChannel channel = BasicMessageChannel( diff --git a/lib/src/pigeons/point_annotation_messager.dart b/lib/src/pigeons/point_annotation_messager.dart index 01cf0723..1108ec1d 100644 --- a/lib/src/pigeons/point_annotation_messager.dart +++ b/lib/src/pigeons/point_annotation_messager.dart @@ -858,6 +858,30 @@ class _PointAnnotationMessager { } } + Future> getAnnotations(String arg_managerId) async { + final BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon._PointAnnotationMessager.getAnnotations', codec, + binaryMessenger: _binaryMessenger); + final Map? replyMap = + await channel.send([arg_managerId]) as Map?; + if (replyMap == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel.', + ); + } else if (replyMap['error'] != null) { + final Map error = + (replyMap['error'] as Map?)!; + throw PlatformException( + code: (error['code'] as String?)!, + message: error['message'] as String?, + details: error['details'], + ); + } else { + return (replyMap['result'] as List?)!.cast(); + } + } + Future setIconAllowOverlap( String arg_managerId, bool arg_iconAllowOverlap) async { final BasicMessageChannel channel = BasicMessageChannel( diff --git a/lib/src/pigeons/point_annotation_messager.dart.orig b/lib/src/pigeons/point_annotation_messager.dart.orig index bbe558a5..305c1a01 100644 --- a/lib/src/pigeons/point_annotation_messager.dart.orig +++ b/lib/src/pigeons/point_annotation_messager.dart.orig @@ -620,6 +620,30 @@ class _PointAnnotationMessager { } } + Future> getAnnotations(String arg_managerId) async { + final BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon._PointAnnotationMessager.getAnnotations', codec, + binaryMessenger: _binaryMessenger); + final Map? replyMap = + await channel.send([arg_managerId]) as Map?; + if (replyMap == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel.', + ); + } else if (replyMap['error'] != null) { + final Map error = + (replyMap['error'] as Map?)!; + throw PlatformException( + code: (error['code'] as String?)!, + message: error['message'] as String?, + details: error['details'], + ); + } else { + return (replyMap['result'] as List?)!.cast(); + } + } + Future setIconAllowOverlap( String arg_managerId, bool arg_iconAllowOverlap) async { final BasicMessageChannel channel = BasicMessageChannel( diff --git a/lib/src/pigeons/polygon_annotation_messager.dart b/lib/src/pigeons/polygon_annotation_messager.dart index 7667c853..f605bfbe 100644 --- a/lib/src/pigeons/polygon_annotation_messager.dart +++ b/lib/src/pigeons/polygon_annotation_messager.dart @@ -355,6 +355,30 @@ class _PolygonAnnotationMessager { } } + Future> getAnnotations(String arg_managerId) async { + final BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon._PolygonAnnotationMessager.getAnnotations', codec, + binaryMessenger: _binaryMessenger); + final Map? replyMap = + await channel.send([arg_managerId]) as Map?; + if (replyMap == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel.', + ); + } else if (replyMap['error'] != null) { + final Map error = + (replyMap['error'] as Map?)!; + throw PlatformException( + code: (error['code'] as String?)!, + message: error['message'] as String?, + details: error['details'], + ); + } else { + return (replyMap['result'] as List?)!.cast(); + } + } + Future setFillAntialias( String arg_managerId, bool arg_fillAntialias) async { final BasicMessageChannel channel = BasicMessageChannel( diff --git a/lib/src/pigeons/polygon_annotation_messager.dart.orig b/lib/src/pigeons/polygon_annotation_messager.dart.orig index 35cd0e31..6e472565 100644 --- a/lib/src/pigeons/polygon_annotation_messager.dart.orig +++ b/lib/src/pigeons/polygon_annotation_messager.dart.orig @@ -327,6 +327,30 @@ class _PolygonAnnotationMessager { } } + Future> getAnnotations(String arg_managerId) async { + final BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon._PolygonAnnotationMessager.getAnnotations', codec, + binaryMessenger: _binaryMessenger); + final Map? replyMap = + await channel.send([arg_managerId]) as Map?; + if (replyMap == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel.', + ); + } else if (replyMap['error'] != null) { + final Map error = + (replyMap['error'] as Map?)!; + throw PlatformException( + code: (error['code'] as String?)!, + message: error['message'] as String?, + details: error['details'], + ); + } else { + return (replyMap['result'] as List?)!.cast(); + } + } + Future setFillAntialias( String arg_managerId, bool arg_fillAntialias) async { final BasicMessageChannel channel = BasicMessageChannel( diff --git a/lib/src/pigeons/polyline_annotation_messager.dart b/lib/src/pigeons/polyline_annotation_messager.dart index 59762a4f..4770df18 100644 --- a/lib/src/pigeons/polyline_annotation_messager.dart +++ b/lib/src/pigeons/polyline_annotation_messager.dart @@ -433,6 +433,30 @@ class _PolylineAnnotationMessager { } } + Future> getAnnotations(String arg_managerId) async { + final BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon._PolylineAnnotationMessager.getAnnotations', codec, + binaryMessenger: _binaryMessenger); + final Map? replyMap = + await channel.send([arg_managerId]) as Map?; + if (replyMap == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel.', + ); + } else if (replyMap['error'] != null) { + final Map error = + (replyMap['error'] as Map?)!; + throw PlatformException( + code: (error['code'] as String?)!, + message: error['message'] as String?, + details: error['details'], + ); + } else { + return (replyMap['result'] as List?)!.cast(); + } + } + Future setLineCap(String arg_managerId, LineCap arg_lineCap) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon._PolylineAnnotationMessager.setLineCap', codec, diff --git a/lib/src/pigeons/polyline_annotation_messager.dart.orig b/lib/src/pigeons/polyline_annotation_messager.dart.orig index 7ba8a5a5..e016344a 100644 --- a/lib/src/pigeons/polyline_annotation_messager.dart.orig +++ b/lib/src/pigeons/polyline_annotation_messager.dart.orig @@ -377,6 +377,30 @@ class _PolylineAnnotationMessager { } } + Future> getAnnotations(String arg_managerId) async { + final BasicMessageChannel channel = BasicMessageChannel( + 'dev.flutter.pigeon._PolylineAnnotationMessager.getAnnotations', codec, + binaryMessenger: _binaryMessenger); + final Map? replyMap = + await channel.send([arg_managerId]) as Map?; + if (replyMap == null) { + throw PlatformException( + code: 'channel-error', + message: 'Unable to establish connection on channel.', + ); + } else if (replyMap['error'] != null) { + final Map error = + (replyMap['error'] as Map?)!; + throw PlatformException( + code: (error['code'] as String?)!, + message: error['message'] as String?, + details: error['details'], + ); + } else { + return (replyMap['result'] as List?)!.cast(); + } + } + Future setLineCap(String arg_managerId, LineCap arg_lineCap) async { final BasicMessageChannel channel = BasicMessageChannel( 'dev.flutter.pigeon._PolylineAnnotationMessager.setLineCap', codec, From badc6ed8495462da63d6bd79b1d538e1b76925e8 Mon Sep 17 00:00:00 2001 From: Nick Kurochkin Date: Tue, 23 May 2023 13:26:30 +0400 Subject: [PATCH 2/2] Annotation UserInfo dictonary --- .../pigeons/FLTCircleAnnotationMessager.java | 33 ++++++++++ .../pigeons/FLTPointAnnotationMessager.java | 32 ++++++++++ .../pigeons/FLTPolygonAnnotationMessager.java | 32 ++++++++++ .../FLTPolylineAnnotationMessager.java | 32 ++++++++++ .../com/mapbox/maps/mapbox_maps/Extentions.kt | 29 ++++++++- .../annotation/CircleAnnotationController.kt | 11 +++- .../annotation/PointAnnotationController.kt | 10 ++++ .../annotation/PolygonAnnotationController.kt | 10 ++++ .../PolylineAnnotationController.kt | 10 ++++ example/lib/circle_annotations.dart | 3 +- example/lib/point_annotations.dart | 3 +- example/lib/polygon_annotations.dart | 3 +- example/lib/polyline_annotations.dart | 3 +- ios/Classes/CircleAnnotationController.swift | 60 ++++++++++--------- ios/Classes/CircleAnnotationMessager.h | 8 ++- ios/Classes/CircleAnnotationMessager.m | 12 +++- ios/Classes/PointAnnotationController.swift | 8 ++- ios/Classes/PointAnnotationMessager.h | 8 ++- ios/Classes/PointAnnotationMessager.m | 12 +++- ios/Classes/PolygonAnnotationController.swift | 8 ++- ios/Classes/PolygonAnnotationMessager.h | 8 ++- ios/Classes/PolygonAnnotationMessager.m | 12 +++- .../PolylineAnnotationController.swift | 8 ++- ios/Classes/PolylineAnnotationMessager.h | 8 ++- ios/Classes/PolylineAnnotationMessager.m | 12 +++- .../pigeons/circle_annotation_messager.dart | 14 +++++ .../circle_annotation_messager.dart.orig | 10 ++++ .../pigeons/point_annotation_messager.dart | 14 +++++ .../point_annotation_messager.dart.orig | 10 ++++ .../pigeons/polygon_annotation_messager.dart | 14 +++++ .../polygon_annotation_messager.dart.orig | 10 ++++ .../pigeons/polyline_annotation_messager.dart | 14 +++++ .../polyline_annotation_messager.dart.orig | 10 ++++ 33 files changed, 418 insertions(+), 53 deletions(-) diff --git a/android/src/main/java/com/mapbox/maps/pigeons/FLTCircleAnnotationMessager.java b/android/src/main/java/com/mapbox/maps/pigeons/FLTCircleAnnotationMessager.java index 3fc1e242..afe1d1fb 100644 --- a/android/src/main/java/com/mapbox/maps/pigeons/FLTCircleAnnotationMessager.java +++ b/android/src/main/java/com/mapbox/maps/pigeons/FLTCircleAnnotationMessager.java @@ -117,6 +117,12 @@ public void setCircleStrokeWidth(@Nullable Double setterArg) { this.circleStrokeWidth = setterArg; } + private @Nullable Map userInfo; + public @Nullable Map getUserInfo() { return userInfo; } + public void setUserInfo(@Nullable Map setterArg) { + this.userInfo = setterArg; + } + /** Constructor is private to enforce null safety; use Builder. */ private CircleAnnotation() {} public static final class Builder { @@ -170,6 +176,12 @@ public static final class Builder { this.circleStrokeWidth = setterArg; return this; } + private @Nullable Map userInfo; + public @Nullable Map getUserInfo() { return userInfo; } + public Builder setUserInfo(@Nullable Map setterArg) { + this.userInfo = setterArg; + return this; + } public @NonNull CircleAnnotation build() { CircleAnnotation pigeonReturn = new CircleAnnotation(); pigeonReturn.setId(id); @@ -182,6 +194,7 @@ public static final class Builder { pigeonReturn.setCircleStrokeColor(circleStrokeColor); pigeonReturn.setCircleStrokeOpacity(circleStrokeOpacity); pigeonReturn.setCircleStrokeWidth(circleStrokeWidth); + pigeonReturn.setUserInfo(userInfo); return pigeonReturn; } } @@ -197,6 +210,7 @@ public static final class Builder { toMapResult.put("circleStrokeColor", circleStrokeColor); toMapResult.put("circleStrokeOpacity", circleStrokeOpacity); toMapResult.put("circleStrokeWidth", circleStrokeWidth); + toMapResult.put("userInfo", userInfo); return toMapResult; } static @NonNull CircleAnnotation fromMap(@NonNull Map map) { @@ -221,6 +235,8 @@ public static final class Builder { pigeonResult.setCircleStrokeOpacity((Double)circleStrokeOpacity); Object circleStrokeWidth = map.get("circleStrokeWidth"); pigeonResult.setCircleStrokeWidth((Double)circleStrokeWidth); + Object userInfo = map.get("userInfo"); + pigeonResult.setUserInfo((Map)userInfo); return pigeonResult; } } @@ -281,6 +297,12 @@ public void setCircleStrokeWidth(@Nullable Double setterArg) { this.circleStrokeWidth = setterArg; } + private @Nullable Map userInfo; + public @Nullable Map getUserInfo() { return userInfo; } + public void setUserInfo(@Nullable Map setterArg) { + this.userInfo = setterArg; + } + public static final class Builder { private @Nullable Map geometry; public @NonNull Builder setGeometry(@Nullable Map setterArg) { @@ -327,6 +349,13 @@ public static final class Builder { this.circleStrokeWidth = setterArg; return this; } + private @Nullable Map userInfo; + public @Nullable Map getUserInfo() { return userInfo; } + public Builder setUserInfo(@Nullable Map setterArg) { + this.userInfo = setterArg; + return this; + } + public @NonNull CircleAnnotationOptions build() { CircleAnnotationOptions pigeonReturn = new CircleAnnotationOptions(); pigeonReturn.setGeometry(geometry); @@ -338,6 +367,7 @@ public static final class Builder { pigeonReturn.setCircleStrokeColor(circleStrokeColor); pigeonReturn.setCircleStrokeOpacity(circleStrokeOpacity); pigeonReturn.setCircleStrokeWidth(circleStrokeWidth); + pigeonReturn.setUserInfo(userInfo); return pigeonReturn; } } @@ -352,6 +382,7 @@ public static final class Builder { toMapResult.put("circleStrokeColor", circleStrokeColor); toMapResult.put("circleStrokeOpacity", circleStrokeOpacity); toMapResult.put("circleStrokeWidth", circleStrokeWidth); + toMapResult.put("userInfo", userInfo); return toMapResult; } static @NonNull CircleAnnotationOptions fromMap(@NonNull Map map) { @@ -374,6 +405,8 @@ public static final class Builder { pigeonResult.setCircleStrokeOpacity((Double)circleStrokeOpacity); Object circleStrokeWidth = map.get("circleStrokeWidth"); pigeonResult.setCircleStrokeWidth((Double)circleStrokeWidth); + Object userInfo = map.get("userInfo"); + pigeonResult.setUserInfo((Map)userInfo); return pigeonResult; } } diff --git a/android/src/main/java/com/mapbox/maps/pigeons/FLTPointAnnotationMessager.java b/android/src/main/java/com/mapbox/maps/pigeons/FLTPointAnnotationMessager.java index a8d888b5..8fbcbad4 100644 --- a/android/src/main/java/com/mapbox/maps/pigeons/FLTPointAnnotationMessager.java +++ b/android/src/main/java/com/mapbox/maps/pigeons/FLTPointAnnotationMessager.java @@ -383,6 +383,12 @@ public void setTextOpacity(@Nullable Double setterArg) { this.textOpacity = setterArg; } + private @Nullable Map userInfo; + public @Nullable Map getUserInfo() { return userInfo; } + public void setUserInfo(@Nullable Map setterArg) { + this.userInfo = setterArg; + } + /** Constructor is private to enforce null safety; use Builder. */ private PointAnnotation() {} public static final class Builder { @@ -531,6 +537,12 @@ public static final class Builder { this.textOpacity = setterArg; return this; } + private @Nullable Map userInfo; + public @Nullable Map getUserInfo() { return userInfo; } + public Builder setUserInfo(@Nullable Map setterArg) { + this.userInfo = setterArg; + return this; + } public @NonNull PointAnnotation build() { PointAnnotation pigeonReturn = new PointAnnotation(); pigeonReturn.setId(id); @@ -562,6 +574,7 @@ public static final class Builder { pigeonReturn.setTextHaloColor(textHaloColor); pigeonReturn.setTextHaloWidth(textHaloWidth); pigeonReturn.setTextOpacity(textOpacity); + pigeonReturn.setUserInfo(userInfo); return pigeonReturn; } } @@ -596,6 +609,7 @@ public static final class Builder { toMapResult.put("textHaloColor", textHaloColor); toMapResult.put("textHaloWidth", textHaloWidth); toMapResult.put("textOpacity", textOpacity); + toMapResult.put("userInfo", userInfo); return toMapResult; } static @NonNull PointAnnotation fromMap(@NonNull Map map) { @@ -658,6 +672,8 @@ public static final class Builder { pigeonResult.setTextHaloWidth((Double)textHaloWidth); Object textOpacity = map.get("textOpacity"); pigeonResult.setTextOpacity((Double)textOpacity); + Object userInfo = map.get("userInfo"); + pigeonResult.setUserInfo((Map)userInfo); return pigeonResult; } } @@ -832,6 +848,12 @@ public void setTextOpacity(@Nullable Double setterArg) { this.textOpacity = setterArg; } + private @Nullable Map userInfo; + public @Nullable Map getUserInfo() { return userInfo; } + public void setUserInfo(@Nullable Map setterArg) { + this.userInfo = setterArg; + } + public static final class Builder { private @Nullable Map geometry; public @NonNull Builder setGeometry(@Nullable Map setterArg) { @@ -973,6 +995,12 @@ public static final class Builder { this.textOpacity = setterArg; return this; } + private @Nullable Map userInfo; + public @Nullable Map getUserInfo() { return userInfo; } + public Builder setUserInfo(@Nullable Map setterArg) { + this.userInfo = setterArg; + return this; + } public @NonNull PointAnnotationOptions build() { PointAnnotationOptions pigeonReturn = new PointAnnotationOptions(); pigeonReturn.setGeometry(geometry); @@ -1003,6 +1031,7 @@ public static final class Builder { pigeonReturn.setTextHaloColor(textHaloColor); pigeonReturn.setTextHaloWidth(textHaloWidth); pigeonReturn.setTextOpacity(textOpacity); + pigeonReturn.setUserInfo(userInfo); return pigeonReturn; } } @@ -1036,6 +1065,7 @@ public static final class Builder { toMapResult.put("textHaloColor", textHaloColor); toMapResult.put("textHaloWidth", textHaloWidth); toMapResult.put("textOpacity", textOpacity); + toMapResult.put("userInfo", userInfo); return toMapResult; } static @NonNull PointAnnotationOptions fromMap(@NonNull Map map) { @@ -1096,6 +1126,8 @@ public static final class Builder { pigeonResult.setTextHaloWidth((Double)textHaloWidth); Object textOpacity = map.get("textOpacity"); pigeonResult.setTextOpacity((Double)textOpacity); + Object userInfo = map.get("userInfo"); + pigeonResult.setUserInfo((Map)userInfo); return pigeonResult; } } diff --git a/android/src/main/java/com/mapbox/maps/pigeons/FLTPolygonAnnotationMessager.java b/android/src/main/java/com/mapbox/maps/pigeons/FLTPolygonAnnotationMessager.java index c0348055..2e1c01f4 100644 --- a/android/src/main/java/com/mapbox/maps/pigeons/FLTPolygonAnnotationMessager.java +++ b/android/src/main/java/com/mapbox/maps/pigeons/FLTPolygonAnnotationMessager.java @@ -79,6 +79,12 @@ public void setFillPattern(@Nullable String setterArg) { this.fillPattern = setterArg; } + private @Nullable Map userInfo; + public @Nullable Map getUserInfo() { return userInfo; } + public void setUserInfo(@Nullable Map setterArg) { + this.userInfo = setterArg; + } + /** Constructor is private to enforce null safety; use Builder. */ private PolygonAnnotation() {} public static final class Builder { @@ -117,6 +123,12 @@ public static final class Builder { this.fillPattern = setterArg; return this; } + private @Nullable Map userInfo; + public @Nullable Map getUserInfo() { return userInfo; } + public Builder setUserInfo(@Nullable Map setterArg) { + this.userInfo = setterArg; + return this; + } public @NonNull PolygonAnnotation build() { PolygonAnnotation pigeonReturn = new PolygonAnnotation(); pigeonReturn.setId(id); @@ -126,6 +138,7 @@ public static final class Builder { pigeonReturn.setFillOpacity(fillOpacity); pigeonReturn.setFillOutlineColor(fillOutlineColor); pigeonReturn.setFillPattern(fillPattern); + pigeonReturn.setUserInfo(userInfo); return pigeonReturn; } } @@ -138,6 +151,7 @@ public static final class Builder { toMapResult.put("fillOpacity", fillOpacity); toMapResult.put("fillOutlineColor", fillOutlineColor); toMapResult.put("fillPattern", fillPattern); + toMapResult.put("userInfo", userInfo); return toMapResult; } static @NonNull PolygonAnnotation fromMap(@NonNull Map map) { @@ -156,6 +170,8 @@ public static final class Builder { pigeonResult.setFillOutlineColor((fillOutlineColor == null) ? null : ((fillOutlineColor instanceof Integer) ? (Integer)fillOutlineColor : (Long)fillOutlineColor)); Object fillPattern = map.get("fillPattern"); pigeonResult.setFillPattern((String)fillPattern); + Object userInfo = map.get("userInfo"); + pigeonResult.setUserInfo((Map)userInfo); return pigeonResult; } } @@ -198,6 +214,12 @@ public void setFillPattern(@Nullable String setterArg) { this.fillPattern = setterArg; } + private @Nullable Map userInfo; + public @Nullable Map getUserInfo() { return userInfo; } + public void setUserInfo(@Nullable Map setterArg) { + this.userInfo = setterArg; + } + public static final class Builder { private @Nullable Map geometry; public @NonNull Builder setGeometry(@Nullable Map setterArg) { @@ -229,6 +251,12 @@ public static final class Builder { this.fillPattern = setterArg; return this; } + private @Nullable Map userInfo; + public @Nullable Map getUserInfo() { return userInfo; } + public Builder setUserInfo(@Nullable Map setterArg) { + this.userInfo = setterArg; + return this; + } public @NonNull PolygonAnnotationOptions build() { PolygonAnnotationOptions pigeonReturn = new PolygonAnnotationOptions(); pigeonReturn.setGeometry(geometry); @@ -237,6 +265,7 @@ public static final class Builder { pigeonReturn.setFillOpacity(fillOpacity); pigeonReturn.setFillOutlineColor(fillOutlineColor); pigeonReturn.setFillPattern(fillPattern); + pigeonReturn.setUserInfo(userInfo); return pigeonReturn; } } @@ -248,6 +277,7 @@ public static final class Builder { toMapResult.put("fillOpacity", fillOpacity); toMapResult.put("fillOutlineColor", fillOutlineColor); toMapResult.put("fillPattern", fillPattern); + toMapResult.put("userInfo", userInfo); return toMapResult; } static @NonNull PolygonAnnotationOptions fromMap(@NonNull Map map) { @@ -264,6 +294,8 @@ public static final class Builder { pigeonResult.setFillOutlineColor((fillOutlineColor == null) ? null : ((fillOutlineColor instanceof Integer) ? (Integer)fillOutlineColor : (Long)fillOutlineColor)); Object fillPattern = map.get("fillPattern"); pigeonResult.setFillPattern((String)fillPattern); + Object userInfo = map.get("userInfo"); + pigeonResult.setUserInfo((Map)userInfo); return pigeonResult; } } diff --git a/android/src/main/java/com/mapbox/maps/pigeons/FLTPolylineAnnotationMessager.java b/android/src/main/java/com/mapbox/maps/pigeons/FLTPolylineAnnotationMessager.java index f0cf2628..6ccce515 100644 --- a/android/src/main/java/com/mapbox/maps/pigeons/FLTPolylineAnnotationMessager.java +++ b/android/src/main/java/com/mapbox/maps/pigeons/FLTPolylineAnnotationMessager.java @@ -125,6 +125,12 @@ public void setLineWidth(@Nullable Double setterArg) { this.lineWidth = setterArg; } + private @Nullable Map userInfo; + public @Nullable Map getUserInfo() { return userInfo; } + public void setUserInfo(@Nullable Map setterArg) { + this.userInfo = setterArg; + } + /** Constructor is private to enforce null safety; use Builder. */ private PolylineAnnotation() {} public static final class Builder { @@ -183,6 +189,12 @@ public static final class Builder { this.lineWidth = setterArg; return this; } + private @Nullable Map userInfo; + public @Nullable Map getUserInfo() { return userInfo; } + public Builder setUserInfo(@Nullable Map setterArg) { + this.userInfo = setterArg; + return this; + } public @NonNull PolylineAnnotation build() { PolylineAnnotation pigeonReturn = new PolylineAnnotation(); pigeonReturn.setId(id); @@ -196,6 +208,7 @@ public static final class Builder { pigeonReturn.setLineOpacity(lineOpacity); pigeonReturn.setLinePattern(linePattern); pigeonReturn.setLineWidth(lineWidth); + pigeonReturn.setUserInfo(userInfo); return pigeonReturn; } } @@ -212,6 +225,7 @@ public static final class Builder { toMapResult.put("lineOpacity", lineOpacity); toMapResult.put("linePattern", linePattern); toMapResult.put("lineWidth", lineWidth); + toMapResult.put("userInfo", userInfo); return toMapResult; } static @NonNull PolylineAnnotation fromMap(@NonNull Map map) { @@ -238,6 +252,8 @@ public static final class Builder { pigeonResult.setLinePattern((String)linePattern); Object lineWidth = map.get("lineWidth"); pigeonResult.setLineWidth((Double)lineWidth); + Object userInfo = map.get("userInfo"); + pigeonResult.setUserInfo((Map)userInfo); return pigeonResult; } } @@ -304,6 +320,12 @@ public void setLineWidth(@Nullable Double setterArg) { this.lineWidth = setterArg; } + private @Nullable Map userInfo; + public @Nullable Map getUserInfo() { return userInfo; } + public void setUserInfo(@Nullable Map setterArg) { + this.userInfo = setterArg; + } + public static final class Builder { private @Nullable Map geometry; public @NonNull Builder setGeometry(@Nullable Map setterArg) { @@ -355,6 +377,12 @@ public static final class Builder { this.lineWidth = setterArg; return this; } + private @Nullable Map userInfo; + public @Nullable Map getUserInfo() { return userInfo; } + public Builder setUserInfo(@Nullable Map setterArg) { + this.userInfo = setterArg; + return this; + } public @NonNull PolylineAnnotationOptions build() { PolylineAnnotationOptions pigeonReturn = new PolylineAnnotationOptions(); pigeonReturn.setGeometry(geometry); @@ -367,6 +395,7 @@ public static final class Builder { pigeonReturn.setLineOpacity(lineOpacity); pigeonReturn.setLinePattern(linePattern); pigeonReturn.setLineWidth(lineWidth); + pigeonReturn.setUserInfo(userInfo); return pigeonReturn; } } @@ -382,6 +411,7 @@ public static final class Builder { toMapResult.put("lineOpacity", lineOpacity); toMapResult.put("linePattern", linePattern); toMapResult.put("lineWidth", lineWidth); + toMapResult.put("userInfo", userInfo); return toMapResult; } static @NonNull PolylineAnnotationOptions fromMap(@NonNull Map map) { @@ -406,6 +436,8 @@ public static final class Builder { pigeonResult.setLinePattern((String)linePattern); Object lineWidth = map.get("lineWidth"); pigeonResult.setLineWidth((Double)lineWidth); + Object userInfo = map.get("userInfo"); + pigeonResult.setUserInfo((Map)userInfo); return pigeonResult; } } diff --git a/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/Extentions.kt b/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/Extentions.kt index 99156491..349b4b6d 100644 --- a/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/Extentions.kt +++ b/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/Extentions.kt @@ -1,12 +1,13 @@ package com.mapbox.maps.mapbox_maps -import com.google.gson.Gson +import com.google.gson.* import com.mapbox.geojson.* import com.mapbox.maps.* import com.mapbox.maps.pigeons.FLTMapInterfaces import com.mapbox.maps.plugin.animation.MapAnimationOptions import org.json.JSONArray import org.json.JSONObject +import java.lang.reflect.Type // FLT to Android fun FLTMapInterfaces.MapAnimationOptions.toMapAnimationOptions(): MapAnimationOptions { @@ -386,7 +387,7 @@ fun CameraOptions.toFLTCameraOptions(): FLTMapInterfaces.CameraOptions { fun JSONObject.toMap(): Map = keys().asSequence().associateWith { when (val value = this[it]) { - is JSONArray -> { + is JSONArray -> { val map = (0 until value.length()).associate { Pair(it.toString(), value[it]) } JSONObject(map).toMap().values.toList() } @@ -394,4 +395,28 @@ fun JSONObject.toMap(): Map = keys().asSequence().associateWith { JSONObject.NULL -> null else -> value } +} + +fun JsonElement.toMap(): Map { + if(this is JsonNull || + (this is JSONArray && (this as JsonArray).size() == 0) || + (this is JSONObject && (this as JSONObject).length() == 0) + ) { + return mapOf() + } + val gson = Gson() + val type: Type = object : com.google.gson.reflect.TypeToken>() {}.type + return gson.fromJson(this, type) +} + +fun Map.toJsonElement(): JsonElement { + val gson = Gson() + val jsonObject = JsonObject() + + for ((key, value) in this) { + val jsonElement = gson.toJsonTree(value) + jsonObject.add(key, jsonElement) + } + + return jsonObject } \ No newline at end of file diff --git a/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/CircleAnnotationController.kt b/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/CircleAnnotationController.kt index b2b7c694..c8cbbad5 100644 --- a/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/CircleAnnotationController.kt +++ b/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/CircleAnnotationController.kt @@ -2,6 +2,7 @@ package com.mapbox.maps.mapbox_maps.annotation import com.mapbox.maps.extension.style.layers.properties.generated.* +import com.mapbox.maps.mapbox_maps.toJsonElement import com.mapbox.maps.mapbox_maps.toMap import com.mapbox.maps.mapbox_maps.toPoint import com.mapbox.maps.pigeons.FLTCircleAnnotationMessager @@ -162,6 +163,9 @@ class CircleAnnotationController(private val delegate: ControllerDelegate) : annotation.circleStrokeWidth?.let { originalAnnotation.circleStrokeWidth = it } + annotation.userInfo?.let { + originalAnnotation.setData(it.toJsonElement()) + } return originalAnnotation } @@ -287,7 +291,9 @@ fun CircleAnnotation.toFLTCircleAnnotation(): FLTCircleAnnotationMessager.Circle this.circleStrokeWidth?.let { builder.setCircleStrokeWidth(it) } - + this.getData()?.let { + builder.setUserInfo(it.toMap()) + } return builder.build() } @@ -320,6 +326,9 @@ fun FLTCircleAnnotationMessager.CircleAnnotationOptions.toCircleAnnotationOption this.circleStrokeWidth?.let { options.withCircleStrokeWidth(it) } + this.userInfo?.let { + options.withData(it.toJsonElement()) + } return options } // End of generated file. \ No newline at end of file diff --git a/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PointAnnotationController.kt b/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PointAnnotationController.kt index c66a86e1..c91d5947 100644 --- a/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PointAnnotationController.kt +++ b/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PointAnnotationController.kt @@ -3,6 +3,7 @@ package com.mapbox.maps.mapbox_maps.annotation import android.graphics.BitmapFactory import com.mapbox.maps.extension.style.layers.properties.generated.* +import com.mapbox.maps.mapbox_maps.toJsonElement import com.mapbox.maps.mapbox_maps.toMap import com.mapbox.maps.mapbox_maps.toPoint import com.mapbox.maps.pigeons.FLTPointAnnotationMessager @@ -220,6 +221,9 @@ class PointAnnotationController(private val delegate: ControllerDelegate) : annotation.textOpacity?.let { originalAnnotation.textOpacity = it } + annotation.userInfo?.let { + originalAnnotation.setData(it.toJsonElement()) + } return originalAnnotation } @@ -907,6 +911,9 @@ fun PointAnnotation.toFLTPointAnnotation(): FLTPointAnnotationMessager.PointAnno this.textOpacity?.let { builder.setTextOpacity(it) } + this.getData()?.let { + builder.setUserInfo(it.toMap()) + } return builder.build() } @@ -997,6 +1004,9 @@ fun FLTPointAnnotationMessager.PointAnnotationOptions.toPointAnnotationOptions() this.textOpacity?.let { options.withTextOpacity(it) } + this.userInfo?.let { + options.withData(it.toJsonElement()) + } return options } // End of generated file. \ No newline at end of file diff --git a/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PolygonAnnotationController.kt b/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PolygonAnnotationController.kt index 7a9f70f8..9fad7c97 100644 --- a/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PolygonAnnotationController.kt +++ b/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PolygonAnnotationController.kt @@ -2,6 +2,7 @@ package com.mapbox.maps.mapbox_maps.annotation import com.mapbox.maps.extension.style.layers.properties.generated.* +import com.mapbox.maps.mapbox_maps.toJsonElement import com.mapbox.maps.mapbox_maps.toMap import com.mapbox.maps.mapbox_maps.toPointsList import com.mapbox.maps.mapbox_maps.toPolygon @@ -153,6 +154,9 @@ class PolygonAnnotationController(private val delegate: ControllerDelegate) : annotation.fillPattern?.let { originalAnnotation.fillPattern = it } + annotation.userInfo?.let { + originalAnnotation.setData(it.toJsonElement()) + } return originalAnnotation } @@ -247,6 +251,9 @@ fun PolygonAnnotation.toFLTPolygonAnnotation(): FLTPolygonAnnotationMessager.Pol this.fillPattern?.let { builder.setFillPattern(it) } + this.getData()?.let { + builder.setUserInfo(it.toMap()) + } return builder.build() } @@ -271,6 +278,9 @@ fun FLTPolygonAnnotationMessager.PolygonAnnotationOptions.toPolygonAnnotationOpt this.fillPattern?.let { options.withFillPattern(it) } + this.userInfo?.let { + options.withData(it.toJsonElement()) + } return options } // End of generated file. \ No newline at end of file diff --git a/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PolylineAnnotationController.kt b/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PolylineAnnotationController.kt index a4f78af7..d05fa09b 100644 --- a/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PolylineAnnotationController.kt +++ b/android/src/main/kotlin/com/mapbox/maps/mapbox_maps/annotation/PolylineAnnotationController.kt @@ -2,6 +2,7 @@ package com.mapbox.maps.mapbox_maps.annotation import com.mapbox.maps.extension.style.layers.properties.generated.* +import com.mapbox.maps.mapbox_maps.toJsonElement import com.mapbox.maps.mapbox_maps.toLineString import com.mapbox.maps.mapbox_maps.toMap import com.mapbox.maps.mapbox_maps.toPoints @@ -165,6 +166,9 @@ class PolylineAnnotationController(private val delegate: ControllerDelegate) : annotation.lineWidth?.let { originalAnnotation.lineWidth = it } + annotation.userInfo?.let { + originalAnnotation.setData(it.toJsonElement()) + } return originalAnnotation } @@ -358,6 +362,9 @@ fun PolylineAnnotation.toFLTPolylineAnnotation(): FLTPolylineAnnotationMessager. this.lineWidth?.let { builder.setLineWidth(it) } + this.getData()?.let { + builder.setUserInfo(it.toMap()) + } return builder.build() } @@ -394,6 +401,9 @@ fun FLTPolylineAnnotationMessager.PolylineAnnotationOptions.toPolylineAnnotation this.lineWidth?.let { options.withLineWidth(it) } + this.userInfo?.let { + options.withData(it.toJsonElement()) + } return options } // End of generated file. \ No newline at end of file diff --git a/example/lib/circle_annotations.dart b/example/lib/circle_annotations.dart index e820ca15..04f50e63 100644 --- a/example/lib/circle_annotations.dart +++ b/example/lib/circle_annotations.dart @@ -48,7 +48,8 @@ class CircleAnnotationPageBodyState extends State { options.add(CircleAnnotationOptions( geometry: createRandomPoint().toJson(), circleColor: createRandomColor(), - circleRadius: 8.0)); + circleRadius: 8.0, + userInfo: {"test key": "data value"})); } circleAnnotationManager?.createMulti(options); circleAnnotationManager diff --git a/example/lib/point_annotations.dart b/example/lib/point_annotations.dart index 85c3eda7..465bbbfa 100644 --- a/example/lib/point_annotations.dart +++ b/example/lib/point_annotations.dart @@ -77,7 +77,8 @@ class PointAnnotationPageBodyState extends State { iconSize: 1.3, iconOffset: [0.0, -5.0], symbolSortKey: 10, - image: list)) + image: list, + userInfo: {"test key": "data value"})) .then((value) => pointAnnotation = value); } diff --git a/example/lib/polygon_annotations.dart b/example/lib/polygon_annotations.dart index ad541da8..f87f567e 100644 --- a/example/lib/polygon_annotations.dart +++ b/example/lib/polygon_annotations.dart @@ -47,7 +47,8 @@ class PolygonAnnotationPageBodyState extends State { options.add(PolygonAnnotationOptions( geometry: Polygon(coordinates: createRandomPositionsList()).toJson(), - fillColor: createRandomColor())); + fillColor: createRandomColor(), + userInfo: {"test key": "data value"})); } polygonAnnotationManager?.createMulti(options); polygonAnnotationManager diff --git a/example/lib/polyline_annotations.dart b/example/lib/polyline_annotations.dart index 21e83b51..a43aa432 100644 --- a/example/lib/polyline_annotations.dart +++ b/example/lib/polyline_annotations.dart @@ -52,7 +52,8 @@ class PolylineAnnotationPageBodyState polylineAnnotationManager?.createMulti(positions .map((e) => PolylineAnnotationOptions( geometry: LineString(coordinates: e).toJson(), - lineColor: createRandomColor())) + lineColor: createRandomColor(), + userInfo: {"test key": "data value"})) .toList()); polylineAnnotationManager ?.addOnPolylineAnnotationClickListener(AnnotationClickListener()); diff --git a/ios/Classes/CircleAnnotationController.swift b/ios/Classes/CircleAnnotationController.swift index 80fe13c6..c87da7dc 100644 --- a/ios/Classes/CircleAnnotationController.swift +++ b/ios/Classes/CircleAnnotationController.swift @@ -265,37 +265,43 @@ extension FLTCircleAnnotationOptions { if let circleStrokeWidth = self.circleStrokeWidth { annotation.circleStrokeWidth = circleStrokeWidth.doubleValue } + if let userInfo = self.userInfo { + annotation.userInfo = userInfo + } return annotation } } extension FLTCircleAnnotation { func toCircleAnnotation() -> CircleAnnotation { - var annotation = CircleAnnotation(id: self.id, centerCoordinate: convertDictionaryToCLLocationCoordinate2D(dict: self.geometry)!) - if let circleSortKey = self.circleSortKey { - annotation.circleSortKey = circleSortKey.doubleValue - } - if let circleBlur = self.circleBlur { - annotation.circleBlur = circleBlur.doubleValue - } - if let circleColor = self.circleColor { - annotation.circleColor = StyleColor.init(uiColorFromHex(rgbValue: circleColor.intValue)) - } - if let circleOpacity = self.circleOpacity { - annotation.circleOpacity = circleOpacity.doubleValue - } - if let circleRadius = self.circleRadius { - annotation.circleRadius = circleRadius.doubleValue - } - if let circleStrokeColor = self.circleStrokeColor { - annotation.circleStrokeColor = StyleColor.init(uiColorFromHex(rgbValue: circleStrokeColor.intValue)) - } - if let circleStrokeOpacity = self.circleStrokeOpacity { - annotation.circleStrokeOpacity = circleStrokeOpacity.doubleValue - } - if let circleStrokeWidth = self.circleStrokeWidth { - annotation.circleStrokeWidth = circleStrokeWidth.doubleValue - } + var annotation = CircleAnnotation(id: self.id, centerCoordinate: convertDictionaryToCLLocationCoordinate2D(dict: self.geometry)!) + if let circleSortKey = self.circleSortKey { + annotation.circleSortKey = circleSortKey.doubleValue + } + if let circleBlur = self.circleBlur { + annotation.circleBlur = circleBlur.doubleValue + } + if let circleColor = self.circleColor { + annotation.circleColor = StyleColor.init(uiColorFromHex(rgbValue: circleColor.intValue)) + } + if let circleOpacity = self.circleOpacity { + annotation.circleOpacity = circleOpacity.doubleValue + } + if let circleRadius = self.circleRadius { + annotation.circleRadius = circleRadius.doubleValue + } + if let circleStrokeColor = self.circleStrokeColor { + annotation.circleStrokeColor = StyleColor.init(uiColorFromHex(rgbValue: circleStrokeColor.intValue)) + } + if let circleStrokeOpacity = self.circleStrokeOpacity { + annotation.circleStrokeOpacity = circleStrokeOpacity.doubleValue + } + if let circleStrokeWidth = self.circleStrokeWidth { + annotation.circleStrokeWidth = circleStrokeWidth.doubleValue + } + if let userInfo = self.userInfo { + annotation.userInfo = userInfo + } return annotation } } @@ -333,8 +339,8 @@ extension CircleAnnotation { if self.circleStrokeWidth != nil { circleStrokeWidth = NSNumber(value: self.circleStrokeWidth!) } - - return FLTCircleAnnotation.make(withId: self.id, geometry: self.point.toMap(), circleSortKey: circleSortKey, circleBlur: circleBlur, circleColor: circleColor, circleOpacity: circleOpacity, circleRadius: circleRadius, circleStrokeColor: circleStrokeColor, circleStrokeOpacity: circleStrokeOpacity, circleStrokeWidth: circleStrokeWidth) + + return FLTCircleAnnotation.make(withId: self.id, geometry: self.point.toMap(), circleSortKey: circleSortKey, circleBlur: circleBlur, circleColor: circleColor, circleOpacity: circleOpacity, circleRadius: circleRadius, circleStrokeColor: circleStrokeColor, circleStrokeOpacity: circleStrokeOpacity, circleStrokeWidth: circleStrokeWidth, userInfo: self.userInfo) } } // End of generated file. diff --git a/ios/Classes/CircleAnnotationMessager.h b/ios/Classes/CircleAnnotationMessager.h index ffc22f74..ed044282 100644 --- a/ios/Classes/CircleAnnotationMessager.h +++ b/ios/Classes/CircleAnnotationMessager.h @@ -38,7 +38,8 @@ typedef NS_ENUM(NSUInteger, FLTCircleTranslateAnchor) { circleRadius:(nullable NSNumber *)circleRadius circleStrokeColor:(nullable NSNumber *)circleStrokeColor circleStrokeOpacity:(nullable NSNumber *)circleStrokeOpacity - circleStrokeWidth:(nullable NSNumber *)circleStrokeWidth; + circleStrokeWidth:(nullable NSNumber *)circleStrokeWidth + userInfo:(nullable NSDictionary *)userInfo; @property(nonatomic, copy) NSString * id; @property(nonatomic, strong, nullable) NSDictionary * geometry; @property(nonatomic, strong, nullable) NSNumber * circleSortKey; @@ -49,6 +50,7 @@ typedef NS_ENUM(NSUInteger, FLTCircleTranslateAnchor) { @property(nonatomic, strong, nullable) NSNumber * circleStrokeColor; @property(nonatomic, strong, nullable) NSNumber * circleStrokeOpacity; @property(nonatomic, strong, nullable) NSNumber * circleStrokeWidth; +@property(nonatomic, strong, nullable) NSDictionary * userInfo; @end @interface FLTCircleAnnotationOptions : NSObject @@ -60,7 +62,8 @@ typedef NS_ENUM(NSUInteger, FLTCircleTranslateAnchor) { circleRadius:(nullable NSNumber *)circleRadius circleStrokeColor:(nullable NSNumber *)circleStrokeColor circleStrokeOpacity:(nullable NSNumber *)circleStrokeOpacity - circleStrokeWidth:(nullable NSNumber *)circleStrokeWidth; + circleStrokeWidth:(nullable NSNumber *)circleStrokeWidth + userInfo:(nullable NSDictionary *)userInfo; @property(nonatomic, strong, nullable) NSDictionary * geometry; @property(nonatomic, strong, nullable) NSNumber * circleSortKey; @property(nonatomic, strong, nullable) NSNumber * circleBlur; @@ -70,6 +73,7 @@ typedef NS_ENUM(NSUInteger, FLTCircleTranslateAnchor) { @property(nonatomic, strong, nullable) NSNumber * circleStrokeColor; @property(nonatomic, strong, nullable) NSNumber * circleStrokeOpacity; @property(nonatomic, strong, nullable) NSNumber * circleStrokeWidth; +@property(nonatomic, strong, nullable) NSDictionary * userInfo; @end /// The codec used by FLTOnCircleAnnotationClickListener. diff --git a/ios/Classes/CircleAnnotationMessager.m b/ios/Classes/CircleAnnotationMessager.m index bab64657..c6fb5542 100644 --- a/ios/Classes/CircleAnnotationMessager.m +++ b/ios/Classes/CircleAnnotationMessager.m @@ -52,7 +52,8 @@ + (instancetype)makeWithId:(NSString *)id circleRadius:(nullable NSNumber *)circleRadius circleStrokeColor:(nullable NSNumber *)circleStrokeColor circleStrokeOpacity:(nullable NSNumber *)circleStrokeOpacity - circleStrokeWidth:(nullable NSNumber *)circleStrokeWidth { + circleStrokeWidth:(nullable NSNumber *)circleStrokeWidth + userInfo:(nullable NSDictionary *)userInfo { FLTCircleAnnotation* pigeonResult = [[FLTCircleAnnotation alloc] init]; pigeonResult.id = id; pigeonResult.geometry = geometry; @@ -64,6 +65,7 @@ + (instancetype)makeWithId:(NSString *)id pigeonResult.circleStrokeColor = circleStrokeColor; pigeonResult.circleStrokeOpacity = circleStrokeOpacity; pigeonResult.circleStrokeWidth = circleStrokeWidth; + pigeonResult.userInfo = userInfo; return pigeonResult; } + (FLTCircleAnnotation *)fromMap:(NSDictionary *)dict { @@ -79,6 +81,7 @@ + (FLTCircleAnnotation *)fromMap:(NSDictionary *)dict { pigeonResult.circleStrokeColor = GetNullableObject(dict, @"circleStrokeColor"); pigeonResult.circleStrokeOpacity = GetNullableObject(dict, @"circleStrokeOpacity"); pigeonResult.circleStrokeWidth = GetNullableObject(dict, @"circleStrokeWidth"); + pigeonResult.userInfo = GetNullableObject(dict, @"userInfo"); return pigeonResult; } + (nullable FLTCircleAnnotation *)nullableFromMap:(NSDictionary *)dict { return (dict) ? [FLTCircleAnnotation fromMap:dict] : nil; } @@ -94,6 +97,7 @@ - (NSDictionary *)toMap { @"circleStrokeColor" : (self.circleStrokeColor ?: [NSNull null]), @"circleStrokeOpacity" : (self.circleStrokeOpacity ?: [NSNull null]), @"circleStrokeWidth" : (self.circleStrokeWidth ?: [NSNull null]), + @"userInfo" : (self.userInfo ?: [NSNull null]), }; } @end @@ -107,7 +111,8 @@ + (instancetype)makeWithGeometry:(nullable NSDictionary *)geomet circleRadius:(nullable NSNumber *)circleRadius circleStrokeColor:(nullable NSNumber *)circleStrokeColor circleStrokeOpacity:(nullable NSNumber *)circleStrokeOpacity - circleStrokeWidth:(nullable NSNumber *)circleStrokeWidth { + circleStrokeWidth:(nullable NSNumber *)circleStrokeWidth + userInfo:(nullable NSDictionary *)userInfo { FLTCircleAnnotationOptions* pigeonResult = [[FLTCircleAnnotationOptions alloc] init]; pigeonResult.geometry = geometry; pigeonResult.circleSortKey = circleSortKey; @@ -118,6 +123,7 @@ + (instancetype)makeWithGeometry:(nullable NSDictionary *)geomet pigeonResult.circleStrokeColor = circleStrokeColor; pigeonResult.circleStrokeOpacity = circleStrokeOpacity; pigeonResult.circleStrokeWidth = circleStrokeWidth; + pigeonResult.userInfo = userInfo; return pigeonResult; } + (FLTCircleAnnotationOptions *)fromMap:(NSDictionary *)dict { @@ -131,6 +137,7 @@ + (FLTCircleAnnotationOptions *)fromMap:(NSDictionary *)dict { pigeonResult.circleStrokeColor = GetNullableObject(dict, @"circleStrokeColor"); pigeonResult.circleStrokeOpacity = GetNullableObject(dict, @"circleStrokeOpacity"); pigeonResult.circleStrokeWidth = GetNullableObject(dict, @"circleStrokeWidth"); + pigeonResult.userInfo = GetNullableObject(dict, @"userInfo"); return pigeonResult; } + (nullable FLTCircleAnnotationOptions *)nullableFromMap:(NSDictionary *)dict { return (dict) ? [FLTCircleAnnotationOptions fromMap:dict] : nil; } @@ -145,6 +152,7 @@ - (NSDictionary *)toMap { @"circleStrokeColor" : (self.circleStrokeColor ?: [NSNull null]), @"circleStrokeOpacity" : (self.circleStrokeOpacity ?: [NSNull null]), @"circleStrokeWidth" : (self.circleStrokeWidth ?: [NSNull null]), + @"userInfo" : (self.userInfo ?: [NSNull null]), }; } @end diff --git a/ios/Classes/PointAnnotationController.swift b/ios/Classes/PointAnnotationController.swift index 4cb56e0c..e46b87bb 100644 --- a/ios/Classes/PointAnnotationController.swift +++ b/ios/Classes/PointAnnotationController.swift @@ -993,6 +993,9 @@ extension FLTPointAnnotationOptions { if let textOpacity = self.textOpacity { annotation.textOpacity = textOpacity.doubleValue } + if let userInfo = self.userInfo { + annotation.userInfo = userInfo + } return annotation } } @@ -1073,6 +1076,9 @@ extension FLTPointAnnotation { if let textOpacity = self.textOpacity { annotation.textOpacity = textOpacity.doubleValue } + if let userInfo = self.userInfo { + annotation.userInfo = userInfo + } return annotation } } @@ -1183,7 +1189,7 @@ extension PointAnnotation { textOpacity = NSNumber(value: self.textOpacity!) } - return FLTPointAnnotation.make(withId: self.id, geometry: self.point.toMap(), image: nil, iconAnchor: iconAnchor!, iconImage: iconImage, iconOffset: iconOffset, iconRotate: iconRotate, iconSize: iconSize, symbolSortKey: symbolSortKey, textAnchor: textAnchor!, textField: textField, textJustify: textJustify!, textLetterSpacing: textLetterSpacing, textMaxWidth: textMaxWidth, textOffset: textOffset, textRadialOffset: textRadialOffset, textRotate: textRotate, textSize: textSize, textTransform: textTransform!, iconColor: iconColor, iconHaloBlur: iconHaloBlur, iconHaloColor: iconHaloColor, iconHaloWidth: iconHaloWidth, iconOpacity: iconOpacity, textColor: textColor, textHaloBlur: textHaloBlur, textHaloColor: textHaloColor, textHaloWidth: textHaloWidth, textOpacity: textOpacity) + return FLTPointAnnotation.make(withId: self.id, geometry: self.point.toMap(), image: nil, iconAnchor: iconAnchor!, iconImage: iconImage, iconOffset: iconOffset, iconRotate: iconRotate, iconSize: iconSize, symbolSortKey: symbolSortKey, textAnchor: textAnchor!, textField: textField, textJustify: textJustify!, textLetterSpacing: textLetterSpacing, textMaxWidth: textMaxWidth, textOffset: textOffset, textRadialOffset: textRadialOffset, textRotate: textRotate, textSize: textSize, textTransform: textTransform!, iconColor: iconColor, iconHaloBlur: iconHaloBlur, iconHaloColor: iconHaloColor, iconHaloWidth: iconHaloWidth, iconOpacity: iconOpacity, textColor: textColor, textHaloBlur: textHaloBlur, textHaloColor: textHaloColor, textHaloWidth: textHaloWidth, textOpacity: textOpacity, userInfo: self.userInfo) } } // End of generated file. diff --git a/ios/Classes/PointAnnotationMessager.h b/ios/Classes/PointAnnotationMessager.h index dce1d675..fc7a589f 100644 --- a/ios/Classes/PointAnnotationMessager.h +++ b/ios/Classes/PointAnnotationMessager.h @@ -149,7 +149,8 @@ typedef NS_ENUM(NSUInteger, FLTTextTranslateAnchor) { textHaloBlur:(nullable NSNumber *)textHaloBlur textHaloColor:(nullable NSNumber *)textHaloColor textHaloWidth:(nullable NSNumber *)textHaloWidth - textOpacity:(nullable NSNumber *)textOpacity; + textOpacity:(nullable NSNumber *)textOpacity + userInfo:(nullable NSDictionary *)userInfo; @property(nonatomic, copy) NSString * id; @property(nonatomic, strong, nullable) NSDictionary * geometry; @property(nonatomic, strong, nullable) FlutterStandardTypedData * image; @@ -179,6 +180,7 @@ typedef NS_ENUM(NSUInteger, FLTTextTranslateAnchor) { @property(nonatomic, strong, nullable) NSNumber * textHaloColor; @property(nonatomic, strong, nullable) NSNumber * textHaloWidth; @property(nonatomic, strong, nullable) NSNumber * textOpacity; +@property(nonatomic, strong, nullable) NSDictionary * userInfo; @end @interface FLTPointAnnotationOptions : NSObject @@ -209,7 +211,8 @@ typedef NS_ENUM(NSUInteger, FLTTextTranslateAnchor) { textHaloBlur:(nullable NSNumber *)textHaloBlur textHaloColor:(nullable NSNumber *)textHaloColor textHaloWidth:(nullable NSNumber *)textHaloWidth - textOpacity:(nullable NSNumber *)textOpacity; + textOpacity:(nullable NSNumber *)textOpacity + userInfo:(nullable NSDictionary *)userInfo; @property(nonatomic, strong, nullable) NSDictionary * geometry; @property(nonatomic, strong, nullable) FlutterStandardTypedData * image; @property(nonatomic, assign) FLTIconAnchor iconAnchor; @@ -238,6 +241,7 @@ typedef NS_ENUM(NSUInteger, FLTTextTranslateAnchor) { @property(nonatomic, strong, nullable) NSNumber * textHaloColor; @property(nonatomic, strong, nullable) NSNumber * textHaloWidth; @property(nonatomic, strong, nullable) NSNumber * textOpacity; +@property(nonatomic, strong, nullable) NSDictionary * userInfo; @end /// The codec used by FLTOnPointAnnotationClickListener. diff --git a/ios/Classes/PointAnnotationMessager.m b/ios/Classes/PointAnnotationMessager.m index 7814c384..efaae1c8 100644 --- a/ios/Classes/PointAnnotationMessager.m +++ b/ios/Classes/PointAnnotationMessager.m @@ -71,7 +71,8 @@ + (instancetype)makeWithId:(NSString *)id textHaloBlur:(nullable NSNumber *)textHaloBlur textHaloColor:(nullable NSNumber *)textHaloColor textHaloWidth:(nullable NSNumber *)textHaloWidth - textOpacity:(nullable NSNumber *)textOpacity { + textOpacity:(nullable NSNumber *)textOpacity + userInfo:(nullable NSDictionary *)userInfo { FLTPointAnnotation* pigeonResult = [[FLTPointAnnotation alloc] init]; pigeonResult.id = id; pigeonResult.geometry = geometry; @@ -102,6 +103,7 @@ + (instancetype)makeWithId:(NSString *)id pigeonResult.textHaloColor = textHaloColor; pigeonResult.textHaloWidth = textHaloWidth; pigeonResult.textOpacity = textOpacity; + pigeonResult.userInfo = userInfo; return pigeonResult; } + (FLTPointAnnotation *)fromMap:(NSDictionary *)dict { @@ -136,6 +138,7 @@ + (FLTPointAnnotation *)fromMap:(NSDictionary *)dict { pigeonResult.textHaloColor = GetNullableObject(dict, @"textHaloColor"); pigeonResult.textHaloWidth = GetNullableObject(dict, @"textHaloWidth"); pigeonResult.textOpacity = GetNullableObject(dict, @"textOpacity"); + pigeonResult.userInfo = GetNullableObject(dict, @"userInfo"); return pigeonResult; } + (nullable FLTPointAnnotation *)nullableFromMap:(NSDictionary *)dict { return (dict) ? [FLTPointAnnotation fromMap:dict] : nil; } @@ -170,6 +173,7 @@ - (NSDictionary *)toMap { @"textHaloColor" : (self.textHaloColor ?: [NSNull null]), @"textHaloWidth" : (self.textHaloWidth ?: [NSNull null]), @"textOpacity" : (self.textOpacity ?: [NSNull null]), + @"userInfo" : (self.userInfo ?: [NSNull null]), }; } @end @@ -202,7 +206,8 @@ + (instancetype)makeWithGeometry:(nullable NSDictionary *)geomet textHaloBlur:(nullable NSNumber *)textHaloBlur textHaloColor:(nullable NSNumber *)textHaloColor textHaloWidth:(nullable NSNumber *)textHaloWidth - textOpacity:(nullable NSNumber *)textOpacity { + textOpacity:(nullable NSNumber *)textOpacity + userInfo:(nullable NSDictionary *)userInfo { FLTPointAnnotationOptions* pigeonResult = [[FLTPointAnnotationOptions alloc] init]; pigeonResult.geometry = geometry; pigeonResult.image = image; @@ -232,6 +237,7 @@ + (instancetype)makeWithGeometry:(nullable NSDictionary *)geomet pigeonResult.textHaloColor = textHaloColor; pigeonResult.textHaloWidth = textHaloWidth; pigeonResult.textOpacity = textOpacity; + pigeonResult.userInfo = userInfo; return pigeonResult; } + (FLTPointAnnotationOptions *)fromMap:(NSDictionary *)dict { @@ -264,6 +270,7 @@ + (FLTPointAnnotationOptions *)fromMap:(NSDictionary *)dict { pigeonResult.textHaloColor = GetNullableObject(dict, @"textHaloColor"); pigeonResult.textHaloWidth = GetNullableObject(dict, @"textHaloWidth"); pigeonResult.textOpacity = GetNullableObject(dict, @"textOpacity"); + pigeonResult.userInfo = GetNullableObject(dict, @"userInfo"); return pigeonResult; } + (nullable FLTPointAnnotationOptions *)nullableFromMap:(NSDictionary *)dict { return (dict) ? [FLTPointAnnotationOptions fromMap:dict] : nil; } @@ -297,6 +304,7 @@ - (NSDictionary *)toMap { @"textHaloColor" : (self.textHaloColor ?: [NSNull null]), @"textHaloWidth" : (self.textHaloWidth ?: [NSNull null]), @"textOpacity" : (self.textOpacity ?: [NSNull null]), + @"userInfo" : (self.userInfo ?: [NSNull null]), }; } @end diff --git a/ios/Classes/PolygonAnnotationController.swift b/ios/Classes/PolygonAnnotationController.swift index 8248a4b2..b707c129 100644 --- a/ios/Classes/PolygonAnnotationController.swift +++ b/ios/Classes/PolygonAnnotationController.swift @@ -223,6 +223,9 @@ extension FLTPolygonAnnotationOptions { if let fillPattern = self.fillPattern { annotation.fillPattern = fillPattern } + if let userInfo = self.userInfo { + annotation.userInfo = userInfo + } return annotation } } @@ -244,6 +247,9 @@ extension FLTPolygonAnnotation { } if let fillPattern = self.fillPattern { annotation.fillPattern = fillPattern + } + if let userInfo = self.userInfo { + annotation.userInfo = userInfo } return annotation } @@ -271,7 +277,7 @@ extension PolygonAnnotation { fillPattern = self.fillPattern! } - return FLTPolygonAnnotation.make(withId: self.id, geometry: self.polygon.toMap(), fillSortKey: fillSortKey, fillColor: fillColor, fillOpacity: fillOpacity, fillOutlineColor: fillOutlineColor, fillPattern: fillPattern) + return FLTPolygonAnnotation.make(withId: self.id, geometry: self.polygon.toMap(), fillSortKey: fillSortKey, fillColor: fillColor, fillOpacity: fillOpacity, fillOutlineColor: fillOutlineColor, fillPattern: fillPattern, userInfo: self.userInfo) } } // End of generated file. diff --git a/ios/Classes/PolygonAnnotationMessager.h b/ios/Classes/PolygonAnnotationMessager.h index ef3e7929..eed6406c 100644 --- a/ios/Classes/PolygonAnnotationMessager.h +++ b/ios/Classes/PolygonAnnotationMessager.h @@ -25,7 +25,8 @@ typedef NS_ENUM(NSUInteger, FLTFillTranslateAnchor) { fillColor:(nullable NSNumber *)fillColor fillOpacity:(nullable NSNumber *)fillOpacity fillOutlineColor:(nullable NSNumber *)fillOutlineColor - fillPattern:(nullable NSString *)fillPattern; + fillPattern:(nullable NSString *)fillPattern + userInfo:(nullable NSDictionary *)userInfo; @property(nonatomic, copy) NSString * id; @property(nonatomic, strong, nullable) NSDictionary * geometry; @property(nonatomic, strong, nullable) NSNumber * fillSortKey; @@ -33,6 +34,7 @@ typedef NS_ENUM(NSUInteger, FLTFillTranslateAnchor) { @property(nonatomic, strong, nullable) NSNumber * fillOpacity; @property(nonatomic, strong, nullable) NSNumber * fillOutlineColor; @property(nonatomic, copy, nullable) NSString * fillPattern; +@property(nonatomic, strong, nullable) NSDictionary * userInfo; @end @interface FLTPolygonAnnotationOptions : NSObject @@ -41,13 +43,15 @@ typedef NS_ENUM(NSUInteger, FLTFillTranslateAnchor) { fillColor:(nullable NSNumber *)fillColor fillOpacity:(nullable NSNumber *)fillOpacity fillOutlineColor:(nullable NSNumber *)fillOutlineColor - fillPattern:(nullable NSString *)fillPattern; + fillPattern:(nullable NSString *)fillPattern + userInfo:(nullable NSDictionary *)userInfo; @property(nonatomic, strong, nullable) NSDictionary * geometry; @property(nonatomic, strong, nullable) NSNumber * fillSortKey; @property(nonatomic, strong, nullable) NSNumber * fillColor; @property(nonatomic, strong, nullable) NSNumber * fillOpacity; @property(nonatomic, strong, nullable) NSNumber * fillOutlineColor; @property(nonatomic, copy, nullable) NSString * fillPattern; +@property(nonatomic, strong, nullable) NSDictionary * userInfo; @end /// The codec used by FLTOnPolygonAnnotationClickListener. diff --git a/ios/Classes/PolygonAnnotationMessager.m b/ios/Classes/PolygonAnnotationMessager.m index 908e1792..d41e1fe3 100644 --- a/ios/Classes/PolygonAnnotationMessager.m +++ b/ios/Classes/PolygonAnnotationMessager.m @@ -49,7 +49,8 @@ + (instancetype)makeWithId:(NSString *)id fillColor:(nullable NSNumber *)fillColor fillOpacity:(nullable NSNumber *)fillOpacity fillOutlineColor:(nullable NSNumber *)fillOutlineColor - fillPattern:(nullable NSString *)fillPattern { + fillPattern:(nullable NSString *)fillPattern + userInfo:(nullable NSDictionary *)userInfo { FLTPolygonAnnotation* pigeonResult = [[FLTPolygonAnnotation alloc] init]; pigeonResult.id = id; pigeonResult.geometry = geometry; @@ -58,6 +59,7 @@ + (instancetype)makeWithId:(NSString *)id pigeonResult.fillOpacity = fillOpacity; pigeonResult.fillOutlineColor = fillOutlineColor; pigeonResult.fillPattern = fillPattern; + pigeonResult.userInfo = userInfo; return pigeonResult; } + (FLTPolygonAnnotation *)fromMap:(NSDictionary *)dict { @@ -70,6 +72,7 @@ + (FLTPolygonAnnotation *)fromMap:(NSDictionary *)dict { pigeonResult.fillOpacity = GetNullableObject(dict, @"fillOpacity"); pigeonResult.fillOutlineColor = GetNullableObject(dict, @"fillOutlineColor"); pigeonResult.fillPattern = GetNullableObject(dict, @"fillPattern"); + pigeonResult.userInfo = GetNullableObject(dict, @"userInfo"); return pigeonResult; } + (nullable FLTPolygonAnnotation *)nullableFromMap:(NSDictionary *)dict { return (dict) ? [FLTPolygonAnnotation fromMap:dict] : nil; } @@ -82,6 +85,7 @@ - (NSDictionary *)toMap { @"fillOpacity" : (self.fillOpacity ?: [NSNull null]), @"fillOutlineColor" : (self.fillOutlineColor ?: [NSNull null]), @"fillPattern" : (self.fillPattern ?: [NSNull null]), + @"userInfo" : (self.userInfo ?: [NSNull null]), }; } @end @@ -92,7 +96,8 @@ + (instancetype)makeWithGeometry:(nullable NSDictionary *)geomet fillColor:(nullable NSNumber *)fillColor fillOpacity:(nullable NSNumber *)fillOpacity fillOutlineColor:(nullable NSNumber *)fillOutlineColor - fillPattern:(nullable NSString *)fillPattern { + fillPattern:(nullable NSString *)fillPattern + userInfo:(nullable NSDictionary *)userInfo { FLTPolygonAnnotationOptions* pigeonResult = [[FLTPolygonAnnotationOptions alloc] init]; pigeonResult.geometry = geometry; pigeonResult.fillSortKey = fillSortKey; @@ -100,6 +105,7 @@ + (instancetype)makeWithGeometry:(nullable NSDictionary *)geomet pigeonResult.fillOpacity = fillOpacity; pigeonResult.fillOutlineColor = fillOutlineColor; pigeonResult.fillPattern = fillPattern; + pigeonResult.userInfo = userInfo; return pigeonResult; } + (FLTPolygonAnnotationOptions *)fromMap:(NSDictionary *)dict { @@ -110,6 +116,7 @@ + (FLTPolygonAnnotationOptions *)fromMap:(NSDictionary *)dict { pigeonResult.fillOpacity = GetNullableObject(dict, @"fillOpacity"); pigeonResult.fillOutlineColor = GetNullableObject(dict, @"fillOutlineColor"); pigeonResult.fillPattern = GetNullableObject(dict, @"fillPattern"); + pigeonResult.userInfo = GetNullableObject(dict, @"userInfo"); return pigeonResult; } + (nullable FLTPolygonAnnotationOptions *)nullableFromMap:(NSDictionary *)dict { return (dict) ? [FLTPolygonAnnotationOptions fromMap:dict] : nil; } @@ -121,6 +128,7 @@ - (NSDictionary *)toMap { @"fillOpacity" : (self.fillOpacity ?: [NSNull null]), @"fillOutlineColor" : (self.fillOutlineColor ?: [NSNull null]), @"fillPattern" : (self.fillPattern ?: [NSNull null]), + @"userInfo" : (self.userInfo ?: [NSNull null]), }; } @end diff --git a/ios/Classes/PolylineAnnotationController.swift b/ios/Classes/PolylineAnnotationController.swift index 226d5257..c7a05e99 100644 --- a/ios/Classes/PolylineAnnotationController.swift +++ b/ios/Classes/PolylineAnnotationController.swift @@ -351,6 +351,9 @@ extension FLTPolylineAnnotationOptions { if let lineWidth = self.lineWidth { annotation.lineWidth = lineWidth.doubleValue } + if let userInfo = self.userInfo { + annotation.userInfo = userInfo + } return annotation } } @@ -382,6 +385,9 @@ extension FLTPolylineAnnotation { } if let lineWidth = self.lineWidth { annotation.lineWidth = lineWidth.doubleValue + } + if let userInfo = self.userInfo { + annotation.userInfo = userInfo } return annotation } @@ -425,7 +431,7 @@ extension PolylineAnnotation { lineWidth = NSNumber(value: self.lineWidth!) } - return FLTPolylineAnnotation.make(withId: self.id, geometry: self.lineString.toMap(), lineJoin: lineJoin!, lineSortKey: lineSortKey, lineBlur: lineBlur, lineColor: lineColor, lineGapWidth: lineGapWidth, lineOffset: lineOffset, lineOpacity: lineOpacity, linePattern: linePattern, lineWidth: lineWidth) + return FLTPolylineAnnotation.make(withId: self.id, geometry: self.lineString.toMap(), lineJoin: lineJoin!, lineSortKey: lineSortKey, lineBlur: lineBlur, lineColor: lineColor, lineGapWidth: lineGapWidth, lineOffset: lineOffset, lineOpacity: lineOpacity, linePattern: linePattern, lineWidth: lineWidth, userInfo: self.userInfo) } } // End of generated file. diff --git a/ios/Classes/PolylineAnnotationMessager.h b/ios/Classes/PolylineAnnotationMessager.h index 8fde50f7..50fe23c9 100644 --- a/ios/Classes/PolylineAnnotationMessager.h +++ b/ios/Classes/PolylineAnnotationMessager.h @@ -41,7 +41,8 @@ typedef NS_ENUM(NSUInteger, FLTLineTranslateAnchor) { lineOffset:(nullable NSNumber *)lineOffset lineOpacity:(nullable NSNumber *)lineOpacity linePattern:(nullable NSString *)linePattern - lineWidth:(nullable NSNumber *)lineWidth; + lineWidth:(nullable NSNumber *)lineWidth + userInfo:(nullable NSDictionary *)userInfo; @property(nonatomic, copy) NSString * id; @property(nonatomic, strong, nullable) NSDictionary * geometry; @property(nonatomic, assign) FLTLineJoin lineJoin; @@ -53,6 +54,7 @@ typedef NS_ENUM(NSUInteger, FLTLineTranslateAnchor) { @property(nonatomic, strong, nullable) NSNumber * lineOpacity; @property(nonatomic, copy, nullable) NSString * linePattern; @property(nonatomic, strong, nullable) NSNumber * lineWidth; +@property(nonatomic, strong, nullable) NSDictionary * userInfo; @end @interface FLTPolylineAnnotationOptions : NSObject @@ -65,7 +67,8 @@ typedef NS_ENUM(NSUInteger, FLTLineTranslateAnchor) { lineOffset:(nullable NSNumber *)lineOffset lineOpacity:(nullable NSNumber *)lineOpacity linePattern:(nullable NSString *)linePattern - lineWidth:(nullable NSNumber *)lineWidth; + lineWidth:(nullable NSNumber *)lineWidth + userInfo:(nullable NSDictionary *)userInfo; @property(nonatomic, strong, nullable) NSDictionary * geometry; @property(nonatomic, assign) FLTLineJoin lineJoin; @property(nonatomic, strong, nullable) NSNumber * lineSortKey; @@ -76,6 +79,7 @@ typedef NS_ENUM(NSUInteger, FLTLineTranslateAnchor) { @property(nonatomic, strong, nullable) NSNumber * lineOpacity; @property(nonatomic, copy, nullable) NSString * linePattern; @property(nonatomic, strong, nullable) NSNumber * lineWidth; +@property(nonatomic, strong, nullable) NSDictionary * userInfo; @end /// The codec used by FLTOnPolylineAnnotationClickListener. diff --git a/ios/Classes/PolylineAnnotationMessager.m b/ios/Classes/PolylineAnnotationMessager.m index eec9907c..752449aa 100644 --- a/ios/Classes/PolylineAnnotationMessager.m +++ b/ios/Classes/PolylineAnnotationMessager.m @@ -53,7 +53,8 @@ + (instancetype)makeWithId:(NSString *)id lineOffset:(nullable NSNumber *)lineOffset lineOpacity:(nullable NSNumber *)lineOpacity linePattern:(nullable NSString *)linePattern - lineWidth:(nullable NSNumber *)lineWidth { + lineWidth:(nullable NSNumber *)lineWidth + userInfo:(nullable NSDictionary *)userInfo { FLTPolylineAnnotation* pigeonResult = [[FLTPolylineAnnotation alloc] init]; pigeonResult.id = id; pigeonResult.geometry = geometry; @@ -66,6 +67,7 @@ + (instancetype)makeWithId:(NSString *)id pigeonResult.lineOpacity = lineOpacity; pigeonResult.linePattern = linePattern; pigeonResult.lineWidth = lineWidth; + pigeonResult.userInfo = userInfo; return pigeonResult; } + (FLTPolylineAnnotation *)fromMap:(NSDictionary *)dict { @@ -82,6 +84,7 @@ + (FLTPolylineAnnotation *)fromMap:(NSDictionary *)dict { pigeonResult.lineOpacity = GetNullableObject(dict, @"lineOpacity"); pigeonResult.linePattern = GetNullableObject(dict, @"linePattern"); pigeonResult.lineWidth = GetNullableObject(dict, @"lineWidth"); + pigeonResult.userInfo = GetNullableObject(dict, @"userInfo"); return pigeonResult; } + (nullable FLTPolylineAnnotation *)nullableFromMap:(NSDictionary *)dict { return (dict) ? [FLTPolylineAnnotation fromMap:dict] : nil; } @@ -98,6 +101,7 @@ - (NSDictionary *)toMap { @"lineOpacity" : (self.lineOpacity ?: [NSNull null]), @"linePattern" : (self.linePattern ?: [NSNull null]), @"lineWidth" : (self.lineWidth ?: [NSNull null]), + @"userInfo" : (self.userInfo ?: [NSNull null]), }; } @end @@ -112,7 +116,8 @@ + (instancetype)makeWithGeometry:(nullable NSDictionary *)geomet lineOffset:(nullable NSNumber *)lineOffset lineOpacity:(nullable NSNumber *)lineOpacity linePattern:(nullable NSString *)linePattern - lineWidth:(nullable NSNumber *)lineWidth { + lineWidth:(nullable NSNumber *)lineWidth + userInfo:(nullable NSDictionary *)userInfo { FLTPolylineAnnotationOptions* pigeonResult = [[FLTPolylineAnnotationOptions alloc] init]; pigeonResult.geometry = geometry; pigeonResult.lineJoin = lineJoin; @@ -124,6 +129,7 @@ + (instancetype)makeWithGeometry:(nullable NSDictionary *)geomet pigeonResult.lineOpacity = lineOpacity; pigeonResult.linePattern = linePattern; pigeonResult.lineWidth = lineWidth; + pigeonResult.userInfo = userInfo; return pigeonResult; } + (FLTPolylineAnnotationOptions *)fromMap:(NSDictionary *)dict { @@ -138,6 +144,7 @@ + (FLTPolylineAnnotationOptions *)fromMap:(NSDictionary *)dict { pigeonResult.lineOpacity = GetNullableObject(dict, @"lineOpacity"); pigeonResult.linePattern = GetNullableObject(dict, @"linePattern"); pigeonResult.lineWidth = GetNullableObject(dict, @"lineWidth"); + pigeonResult.userInfo = GetNullableObject(dict, @"userInfo"); return pigeonResult; } + (nullable FLTPolylineAnnotationOptions *)nullableFromMap:(NSDictionary *)dict { return (dict) ? [FLTPolylineAnnotationOptions fromMap:dict] : nil; } @@ -153,6 +160,7 @@ - (NSDictionary *)toMap { @"lineOpacity" : (self.lineOpacity ?: [NSNull null]), @"linePattern" : (self.linePattern ?: [NSNull null]), @"lineWidth" : (self.lineWidth ?: [NSNull null]), + @"userInfo" : (self.userInfo ?: [NSNull null]), }; } @end diff --git a/lib/src/pigeons/circle_annotation_messager.dart b/lib/src/pigeons/circle_annotation_messager.dart index 4d49d268..48b47f1a 100644 --- a/lib/src/pigeons/circle_annotation_messager.dart +++ b/lib/src/pigeons/circle_annotation_messager.dart @@ -39,6 +39,7 @@ class CircleAnnotation { this.circleStrokeColor, this.circleStrokeOpacity, this.circleStrokeWidth, + this.userInfo, }); /// The id for annotation @@ -71,6 +72,9 @@ class CircleAnnotation { /// The width of the circle's stroke. Strokes are placed outside of the `circle-radius`. double? circleStrokeWidth; + /// Properties associated with the annotation. + Map? userInfo; + Object encode() { final Map pigeonMap = {}; pigeonMap['id'] = id; @@ -83,6 +87,7 @@ class CircleAnnotation { pigeonMap['circleStrokeColor'] = circleStrokeColor; pigeonMap['circleStrokeOpacity'] = circleStrokeOpacity; pigeonMap['circleStrokeWidth'] = circleStrokeWidth; + pigeonMap['userInfo'] = userInfo; return pigeonMap; } @@ -100,6 +105,8 @@ class CircleAnnotation { circleStrokeColor: pigeonMap['circleStrokeColor'] as int?, circleStrokeOpacity: pigeonMap['circleStrokeOpacity'] as double?, circleStrokeWidth: pigeonMap['circleStrokeWidth'] as double?, + userInfo: (pigeonMap['userInfo'] as Map?) + ?.cast(), ); } } @@ -115,6 +122,7 @@ class CircleAnnotationOptions { this.circleStrokeColor, this.circleStrokeOpacity, this.circleStrokeWidth, + this.userInfo, }); /// The geometry that determines the location/shape of this annotation @@ -144,6 +152,9 @@ class CircleAnnotationOptions { /// The width of the circle's stroke. Strokes are placed outside of the `circle-radius`. double? circleStrokeWidth; + /// Properties associated with the annotation. + Map? userInfo; + Object encode() { final Map pigeonMap = {}; pigeonMap['geometry'] = geometry; @@ -155,6 +166,7 @@ class CircleAnnotationOptions { pigeonMap['circleStrokeColor'] = circleStrokeColor; pigeonMap['circleStrokeOpacity'] = circleStrokeOpacity; pigeonMap['circleStrokeWidth'] = circleStrokeWidth; + pigeonMap['userInfo'] = userInfo; return pigeonMap; } @@ -171,6 +183,8 @@ class CircleAnnotationOptions { circleStrokeColor: pigeonMap['circleStrokeColor'] as int?, circleStrokeOpacity: pigeonMap['circleStrokeOpacity'] as double?, circleStrokeWidth: pigeonMap['circleStrokeWidth'] as double?, + userInfo: (pigeonMap['userInfo'] as Map?) + ?.cast(), ); } } diff --git a/lib/src/pigeons/circle_annotation_messager.dart.orig b/lib/src/pigeons/circle_annotation_messager.dart.orig index 924723f7..a74a8a20 100644 --- a/lib/src/pigeons/circle_annotation_messager.dart.orig +++ b/lib/src/pigeons/circle_annotation_messager.dart.orig @@ -27,6 +27,7 @@ class CircleAnnotation { this.circleStrokeColor, this.circleStrokeOpacity, this.circleStrokeWidth, + this.userInfo, }); String id; @@ -39,6 +40,7 @@ class CircleAnnotation { int? circleStrokeColor; double? circleStrokeOpacity; double? circleStrokeWidth; + Map? userInfo; Object encode() { final Map pigeonMap = {}; @@ -52,6 +54,7 @@ class CircleAnnotation { pigeonMap['circleStrokeColor'] = circleStrokeColor; pigeonMap['circleStrokeOpacity'] = circleStrokeOpacity; pigeonMap['circleStrokeWidth'] = circleStrokeWidth; + pigeonMap['userInfo'] = userInfo; return pigeonMap; } @@ -69,6 +72,8 @@ class CircleAnnotation { circleStrokeColor: pigeonMap['circleStrokeColor'] as int?, circleStrokeOpacity: pigeonMap['circleStrokeOpacity'] as double?, circleStrokeWidth: pigeonMap['circleStrokeWidth'] as double?, + userInfo: (pigeonMap['userInfo'] as Map?) + ?.cast(), ); } } @@ -84,6 +89,7 @@ class CircleAnnotationOptions { this.circleStrokeColor, this.circleStrokeOpacity, this.circleStrokeWidth, + this.userInfo, }); Map? geometry; @@ -95,6 +101,7 @@ class CircleAnnotationOptions { int? circleStrokeColor; double? circleStrokeOpacity; double? circleStrokeWidth; + Map? userInfo; Object encode() { final Map pigeonMap = {}; @@ -107,6 +114,7 @@ class CircleAnnotationOptions { pigeonMap['circleStrokeColor'] = circleStrokeColor; pigeonMap['circleStrokeOpacity'] = circleStrokeOpacity; pigeonMap['circleStrokeWidth'] = circleStrokeWidth; + pigeonMap['userInfo'] = userInfo; return pigeonMap; } @@ -123,6 +131,8 @@ class CircleAnnotationOptions { circleStrokeColor: pigeonMap['circleStrokeColor'] as int?, circleStrokeOpacity: pigeonMap['circleStrokeOpacity'] as double?, circleStrokeWidth: pigeonMap['circleStrokeWidth'] as double?, + userInfo: (pigeonMap['userInfo'] as Map?) + ?.cast(), ); } } diff --git a/lib/src/pigeons/point_annotation_messager.dart b/lib/src/pigeons/point_annotation_messager.dart index 1108ec1d..b58801fd 100644 --- a/lib/src/pigeons/point_annotation_messager.dart +++ b/lib/src/pigeons/point_annotation_messager.dart @@ -262,6 +262,7 @@ class PointAnnotation { this.textHaloColor, this.textHaloWidth, this.textOpacity, + this.userInfo, }); /// The id for annotation @@ -352,6 +353,9 @@ class PointAnnotation { /// The opacity at which the text will be drawn. double? textOpacity; + /// Properties associated with the annotation. + Map? userInfo; + Object encode() { final Map pigeonMap = {}; pigeonMap['id'] = id; @@ -383,6 +387,7 @@ class PointAnnotation { pigeonMap['textHaloColor'] = textHaloColor; pigeonMap['textHaloWidth'] = textHaloWidth; pigeonMap['textOpacity'] = textOpacity; + pigeonMap['userInfo'] = userInfo; return pigeonMap; } @@ -427,6 +432,8 @@ class PointAnnotation { textHaloColor: pigeonMap['textHaloColor'] as int?, textHaloWidth: pigeonMap['textHaloWidth'] as double?, textOpacity: pigeonMap['textOpacity'] as double?, + userInfo: (pigeonMap['userInfo'] as Map?) + ?.cast(), ); } } @@ -461,6 +468,7 @@ class PointAnnotationOptions { this.textHaloColor, this.textHaloWidth, this.textOpacity, + this.userInfo, }); /// The geometry that determines the location/shape of this annotation @@ -548,6 +556,9 @@ class PointAnnotationOptions { /// The opacity at which the text will be drawn. double? textOpacity; + /// Properties associated with the annotation. + Map? userInfo; + Object encode() { final Map pigeonMap = {}; pigeonMap['geometry'] = geometry; @@ -578,6 +589,7 @@ class PointAnnotationOptions { pigeonMap['textHaloColor'] = textHaloColor; pigeonMap['textHaloWidth'] = textHaloWidth; pigeonMap['textOpacity'] = textOpacity; + pigeonMap['userInfo'] = userInfo; return pigeonMap; } @@ -621,6 +633,8 @@ class PointAnnotationOptions { textHaloColor: pigeonMap['textHaloColor'] as int?, textHaloWidth: pigeonMap['textHaloWidth'] as double?, textOpacity: pigeonMap['textOpacity'] as double?, + userInfo: (pigeonMap['userInfo'] as Map?) + ?.cast(), ); } } diff --git a/lib/src/pigeons/point_annotation_messager.dart.orig b/lib/src/pigeons/point_annotation_messager.dart.orig index 305c1a01..fe17e4f1 100644 --- a/lib/src/pigeons/point_annotation_messager.dart.orig +++ b/lib/src/pigeons/point_annotation_messager.dart.orig @@ -138,6 +138,7 @@ class PointAnnotation { this.textHaloColor, this.textHaloWidth, this.textOpacity, + this.userInfo, }); String id; @@ -169,6 +170,7 @@ class PointAnnotation { int? textHaloColor; double? textHaloWidth; double? textOpacity; + Map? userInfo; Object encode() { final Map pigeonMap = {}; @@ -201,6 +203,7 @@ class PointAnnotation { pigeonMap['textHaloColor'] = textHaloColor; pigeonMap['textHaloWidth'] = textHaloWidth; pigeonMap['textOpacity'] = textOpacity; + pigeonMap['userInfo'] = userInfo; return pigeonMap; } @@ -245,6 +248,8 @@ class PointAnnotation { textHaloColor: pigeonMap['textHaloColor'] as int?, textHaloWidth: pigeonMap['textHaloWidth'] as double?, textOpacity: pigeonMap['textOpacity'] as double?, + userInfo: (pigeonMap['userInfo'] as Map?) + ?.cast(), ); } } @@ -279,6 +284,7 @@ class PointAnnotationOptions { this.textHaloColor, this.textHaloWidth, this.textOpacity, + this.userInfo, }); Map? geometry; @@ -309,6 +315,7 @@ class PointAnnotationOptions { int? textHaloColor; double? textHaloWidth; double? textOpacity; + Map? userInfo; Object encode() { final Map pigeonMap = {}; @@ -340,6 +347,7 @@ class PointAnnotationOptions { pigeonMap['textHaloColor'] = textHaloColor; pigeonMap['textHaloWidth'] = textHaloWidth; pigeonMap['textOpacity'] = textOpacity; + pigeonMap['userInfo'] = userInfo; return pigeonMap; } @@ -383,6 +391,8 @@ class PointAnnotationOptions { textHaloColor: pigeonMap['textHaloColor'] as int?, textHaloWidth: pigeonMap['textHaloWidth'] as double?, textOpacity: pigeonMap['textOpacity'] as double?, + userInfo: (pigeonMap['userInfo'] as Map?) + ?.cast(), ); } } diff --git a/lib/src/pigeons/polygon_annotation_messager.dart b/lib/src/pigeons/polygon_annotation_messager.dart index f605bfbe..a685d1f4 100644 --- a/lib/src/pigeons/polygon_annotation_messager.dart +++ b/lib/src/pigeons/polygon_annotation_messager.dart @@ -18,6 +18,7 @@ class PolygonAnnotation { this.fillOpacity, this.fillOutlineColor, this.fillPattern, + this.userInfo, }); /// The id for annotation @@ -41,6 +42,9 @@ class PolygonAnnotation { /// Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels. String? fillPattern; + /// Properties associated with the annotation. + Map? userInfo; + Object encode() { final Map pigeonMap = {}; pigeonMap['id'] = id; @@ -50,6 +54,7 @@ class PolygonAnnotation { pigeonMap['fillOpacity'] = fillOpacity; pigeonMap['fillOutlineColor'] = fillOutlineColor; pigeonMap['fillPattern'] = fillPattern; + pigeonMap['userInfo'] = userInfo; return pigeonMap; } @@ -64,6 +69,8 @@ class PolygonAnnotation { fillOpacity: pigeonMap['fillOpacity'] as double?, fillOutlineColor: pigeonMap['fillOutlineColor'] as int?, fillPattern: pigeonMap['fillPattern'] as String?, + userInfo: (pigeonMap['userInfo'] as Map?) + ?.cast(), ); } } @@ -76,6 +83,7 @@ class PolygonAnnotationOptions { this.fillOpacity, this.fillOutlineColor, this.fillPattern, + this.userInfo, }); /// The geometry that determines the location/shape of this annotation @@ -96,6 +104,9 @@ class PolygonAnnotationOptions { /// Name of image in sprite to use for drawing image fills. For seamless patterns, image width and height must be a factor of two (2, 4, 8, ..., 512). Note that zoom-dependent expressions will be evaluated only at integer zoom levels. String? fillPattern; + /// Properties associated with the annotation. + Map? userInfo; + Object encode() { final Map pigeonMap = {}; pigeonMap['geometry'] = geometry; @@ -104,6 +115,7 @@ class PolygonAnnotationOptions { pigeonMap['fillOpacity'] = fillOpacity; pigeonMap['fillOutlineColor'] = fillOutlineColor; pigeonMap['fillPattern'] = fillPattern; + pigeonMap['userInfo'] = userInfo; return pigeonMap; } @@ -117,6 +129,8 @@ class PolygonAnnotationOptions { fillOpacity: pigeonMap['fillOpacity'] as double?, fillOutlineColor: pigeonMap['fillOutlineColor'] as int?, fillPattern: pigeonMap['fillPattern'] as String?, + userInfo: (pigeonMap['userInfo'] as Map?) + ?.cast(), ); } } diff --git a/lib/src/pigeons/polygon_annotation_messager.dart.orig b/lib/src/pigeons/polygon_annotation_messager.dart.orig index 6e472565..bdb1f53d 100644 --- a/lib/src/pigeons/polygon_annotation_messager.dart.orig +++ b/lib/src/pigeons/polygon_annotation_messager.dart.orig @@ -14,6 +14,7 @@ class PolygonAnnotation { this.fillOpacity, this.fillOutlineColor, this.fillPattern, + this.userInfo, }); String id; @@ -23,6 +24,7 @@ class PolygonAnnotation { double? fillOpacity; int? fillOutlineColor; String? fillPattern; + Map? userInfo; Object encode() { final Map pigeonMap = {}; @@ -33,6 +35,7 @@ class PolygonAnnotation { pigeonMap['fillOpacity'] = fillOpacity; pigeonMap['fillOutlineColor'] = fillOutlineColor; pigeonMap['fillPattern'] = fillPattern; + pigeonMap['userInfo'] = userInfo; return pigeonMap; } @@ -47,6 +50,8 @@ class PolygonAnnotation { fillOpacity: pigeonMap['fillOpacity'] as double?, fillOutlineColor: pigeonMap['fillOutlineColor'] as int?, fillPattern: pigeonMap['fillPattern'] as String?, + userInfo: (pigeonMap['userInfo'] as Map?) + ?.cast(), ); } } @@ -59,6 +64,7 @@ class PolygonAnnotationOptions { this.fillOpacity, this.fillOutlineColor, this.fillPattern, + this.userInfo, }); Map? geometry; @@ -67,6 +73,7 @@ class PolygonAnnotationOptions { double? fillOpacity; int? fillOutlineColor; String? fillPattern; + Map? userInfo; Object encode() { final Map pigeonMap = {}; @@ -76,6 +83,7 @@ class PolygonAnnotationOptions { pigeonMap['fillOpacity'] = fillOpacity; pigeonMap['fillOutlineColor'] = fillOutlineColor; pigeonMap['fillPattern'] = fillPattern; + pigeonMap['userInfo'] = userInfo; return pigeonMap; } @@ -89,6 +97,8 @@ class PolygonAnnotationOptions { fillOpacity: pigeonMap['fillOpacity'] as double?, fillOutlineColor: pigeonMap['fillOutlineColor'] as int?, fillPattern: pigeonMap['fillPattern'] as String?, + userInfo: (pigeonMap['userInfo'] as Map?) + ?.cast(), ); } } diff --git a/lib/src/pigeons/polyline_annotation_messager.dart b/lib/src/pigeons/polyline_annotation_messager.dart index 4770df18..9b8a235e 100644 --- a/lib/src/pigeons/polyline_annotation_messager.dart +++ b/lib/src/pigeons/polyline_annotation_messager.dart @@ -46,6 +46,7 @@ class PolylineAnnotation { this.lineOpacity, this.linePattern, this.lineWidth, + this.userInfo, }); /// The id for annotation @@ -81,6 +82,9 @@ class PolylineAnnotation { /// Stroke thickness. double? lineWidth; + /// Properties associated with the annotation. + Map? userInfo; + Object encode() { final Map pigeonMap = {}; pigeonMap['id'] = id; @@ -94,6 +98,7 @@ class PolylineAnnotation { pigeonMap['lineOpacity'] = lineOpacity; pigeonMap['linePattern'] = linePattern; pigeonMap['lineWidth'] = lineWidth; + pigeonMap['userInfo'] = userInfo; return pigeonMap; } @@ -114,6 +119,8 @@ class PolylineAnnotation { lineOpacity: pigeonMap['lineOpacity'] as double?, linePattern: pigeonMap['linePattern'] as String?, lineWidth: pigeonMap['lineWidth'] as double?, + userInfo: (pigeonMap['userInfo'] as Map?) + ?.cast(), ); } } @@ -130,6 +137,7 @@ class PolylineAnnotationOptions { this.lineOpacity, this.linePattern, this.lineWidth, + this.userInfo, }); /// The geometry that determines the location/shape of this annotation @@ -162,6 +170,9 @@ class PolylineAnnotationOptions { /// Stroke thickness. double? lineWidth; + /// Properties associated with the annotation. + Map? userInfo; + Object encode() { final Map pigeonMap = {}; pigeonMap['geometry'] = geometry; @@ -174,6 +185,7 @@ class PolylineAnnotationOptions { pigeonMap['lineOpacity'] = lineOpacity; pigeonMap['linePattern'] = linePattern; pigeonMap['lineWidth'] = lineWidth; + pigeonMap['userInfo'] = userInfo; return pigeonMap; } @@ -193,6 +205,8 @@ class PolylineAnnotationOptions { lineOpacity: pigeonMap['lineOpacity'] as double?, linePattern: pigeonMap['linePattern'] as String?, lineWidth: pigeonMap['lineWidth'] as double?, + userInfo: (pigeonMap['userInfo'] as Map?) + ?.cast(), ); } } diff --git a/lib/src/pigeons/polyline_annotation_messager.dart.orig b/lib/src/pigeons/polyline_annotation_messager.dart.orig index e016344a..a8b78434 100644 --- a/lib/src/pigeons/polyline_annotation_messager.dart.orig +++ b/lib/src/pigeons/polyline_annotation_messager.dart.orig @@ -30,6 +30,7 @@ class PolylineAnnotation { this.lineOpacity, this.linePattern, this.lineWidth, + this.userInfo, }); String id; @@ -43,6 +44,7 @@ class PolylineAnnotation { double? lineOpacity; String? linePattern; double? lineWidth; + Map? userInfo; Object encode() { final Map pigeonMap = {}; @@ -57,6 +59,7 @@ class PolylineAnnotation { pigeonMap['lineOpacity'] = lineOpacity; pigeonMap['linePattern'] = linePattern; pigeonMap['lineWidth'] = lineWidth; + pigeonMap['userInfo'] = userInfo; return pigeonMap; } @@ -77,6 +80,8 @@ class PolylineAnnotation { lineOpacity: pigeonMap['lineOpacity'] as double?, linePattern: pigeonMap['linePattern'] as String?, lineWidth: pigeonMap['lineWidth'] as double?, + userInfo: (pigeonMap['userInfo'] as Map?) + ?.cast(), ); } } @@ -93,6 +98,7 @@ class PolylineAnnotationOptions { this.lineOpacity, this.linePattern, this.lineWidth, + this.userInfo, }); Map? geometry; @@ -105,6 +111,7 @@ class PolylineAnnotationOptions { double? lineOpacity; String? linePattern; double? lineWidth; + Map? userInfo; Object encode() { final Map pigeonMap = {}; @@ -118,6 +125,7 @@ class PolylineAnnotationOptions { pigeonMap['lineOpacity'] = lineOpacity; pigeonMap['linePattern'] = linePattern; pigeonMap['lineWidth'] = lineWidth; + pigeonMap['userInfo'] = userInfo; return pigeonMap; } @@ -137,6 +145,8 @@ class PolylineAnnotationOptions { lineOpacity: pigeonMap['lineOpacity'] as double?, linePattern: pigeonMap['linePattern'] as String?, lineWidth: pigeonMap['lineWidth'] as double?, + userInfo: (pigeonMap['userInfo'] as Map?) + ?.cast(), ); } }