From 307055526d2df9212d59c62a23586c59cc612ae5 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Tue, 1 Sep 2026 13:51:46 -0400 Subject: [PATCH 01/14] Convert protocols --- .../ios/RunnerTests/GoogleMapsTests.swift | 2 +- .../RunnerTests/MarkerControllerTests.swift | 2 +- .../TestUtils/TestAssetProvider.swift | 12 ++-- .../TestUtils/TestMapEventHandler.swift | 18 ++--- .../AssetProvider.swift | 36 ++++++++++ .../CircleController.swift | 4 +- .../ClusterManagersController.swift | 7 +- .../GoogleMapController.swift | 55 ++++++++++----- .../GroundOverlayController.swift | 11 +-- .../HeatmapController.swift | 1 + .../ImageUtils.swift | 2 +- .../MapEventDelegate.swift | 59 ++++++++++++++++ .../MarkerController.swift | 18 ++--- .../PolygonController.swift | 4 +- .../PolylineController.swift | 4 +- .../FGMCATransactionWrapper.m | 23 ------- .../FGMAssetProvider.h | 42 ------------ .../FGMCATransactionWrapper.h | 20 ------ .../FGMMapEventDelegate.h | 67 ------------------- .../ios/RunnerTests/GoogleMapsTests.swift | 2 +- .../RunnerTests/MarkerControllerTests.swift | 2 +- .../TestUtils/TestAssetProvider.swift | 12 ++-- .../TestUtils/TestMapEventHandler.swift | 18 ++--- .../AssetProvider.swift | 36 ++++++++++ .../CircleController.swift | 4 +- .../ClusterManagersController.swift | 7 +- .../GoogleMapController.swift | 55 ++++++++++----- .../GroundOverlayController.swift | 11 +-- .../HeatmapController.swift | 1 + .../ImageUtils.swift | 2 +- .../MapEventDelegate.swift | 59 ++++++++++++++++ .../MarkerController.swift | 18 ++--- .../PolygonController.swift | 4 +- .../PolylineController.swift | 4 +- .../FGMCATransactionWrapper.m | 23 ------- .../FGMAssetProvider.h | 42 ------------ .../FGMCATransactionWrapper.h | 20 ------ .../FGMMapEventDelegate.h | 67 ------------------- .../GoogleMapsUtilsTrampoline.h | 12 ---- .../ios/RunnerTests/GoogleMapsTests.swift | 2 +- .../RunnerTests/MarkerControllerTests.swift | 2 +- .../TestUtils/TestAssetProvider.swift | 12 ++-- .../TestUtils/TestMapEventHandler.swift | 18 ++--- .../AssetProvider.swift | 36 ++++++++++ .../CircleController.swift | 4 +- .../ClusterManagersController.swift | 7 +- .../GoogleMapController.swift | 55 ++++++++++----- .../GroundOverlayController.swift | 11 +-- .../HeatmapController.swift | 1 + .../google_maps_flutter_ios/ImageUtils.swift | 2 +- .../MapEventDelegate.swift | 59 ++++++++++++++++ .../MarkerController.swift | 18 ++--- .../PolygonController.swift | 4 +- .../PolylineController.swift | 4 +- .../FGMCATransactionWrapper.m | 23 ------- .../FGMAssetProvider.h | 42 ------------ .../FGMCATransactionWrapper.h | 20 ------ .../FGMMapEventDelegate.h | 67 ------------------- 58 files changed, 525 insertions(+), 648 deletions(-) create mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/AssetProvider.swift create mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/MapEventDelegate.swift delete mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/FGMCATransactionWrapper.m delete mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/google_maps_flutter_ios_sdk10_objc/FGMAssetProvider.h delete mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/google_maps_flutter_ios_sdk10_objc/FGMCATransactionWrapper.h delete mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/google_maps_flutter_ios_sdk10_objc/FGMMapEventDelegate.h create mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/AssetProvider.swift create mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MapEventDelegate.swift delete mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/FGMCATransactionWrapper.m delete mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/google_maps_flutter_ios_sdk9_objc/FGMAssetProvider.h delete mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/google_maps_flutter_ios_sdk9_objc/FGMCATransactionWrapper.h delete mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/google_maps_flutter_ios_sdk9_objc/FGMMapEventDelegate.h delete mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/google_maps_flutter_ios_sdk9_objc/GoogleMapsUtilsTrampoline.h create mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/AssetProvider.swift create mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/MapEventDelegate.swift delete mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/FGMCATransactionWrapper.m delete mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/include/google_maps_flutter_ios_objc/FGMAssetProvider.h delete mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/include/google_maps_flutter_ios_objc/FGMCATransactionWrapper.h delete mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/include/google_maps_flutter_ios_objc/FGMMapEventDelegate.h diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/GoogleMapsTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/GoogleMapsTests.swift index c0d68c649ff5..d1c4d90ec1fc 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/GoogleMapsTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/GoogleMapsTests.swift @@ -9,7 +9,7 @@ import google_maps_flutter_ios_sdk10_objc @testable import google_maps_flutter_ios_sdk10 -class MockCATransaction: NSObject, FGMCATransactionProtocol { +class MockCATransaction: NSObject, MapAnimationCATransactionProtocol { var beginCalled = false var commitCalled = false var animationDuration: CFTimeInterval = 0.0 diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/MarkerControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/MarkerControllerTests.swift index 5cc8c4fa6ae2..fe219f617d41 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/MarkerControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/MarkerControllerTests.swift @@ -23,7 +23,7 @@ import google_maps_flutter_ios_sdk10_objc /// The mapView should outlive the controller, as the controller keeps a weak reference to it. func markersController( withMapView mapView: GMSMapView, - eventDelegate: NSObject & FGMMapEventDelegate + eventDelegate: MapEventDelegate ) -> MarkersController { return MarkersController( mapView: mapView, diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/TestUtils/TestAssetProvider.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/TestUtils/TestAssetProvider.swift index 745075545d87..8903cd4e3f18 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/TestUtils/TestAssetProvider.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/TestUtils/TestAssetProvider.swift @@ -3,11 +3,11 @@ // found in the LICENSE file. import UIKit -import google_maps_flutter_ios_sdk10 -import google_maps_flutter_ios_sdk10_objc -/// Fake implementation of FGMAssetProvider for unit tests. -class TestAssetProvider: NSObject, FGMAssetProvider { +@testable import google_maps_flutter_ios_sdk10 + +/// Fake implementation of AssetProvider for unit tests. +class TestAssetProvider: AssetProvider { private let image: UIImage? private let assetName: String? private let package: String? @@ -25,14 +25,12 @@ class TestAssetProvider: NSObject, FGMAssetProvider { self.image = image self.assetName = assetName self.package = package - super.init() } - override init() { + init() { self.image = nil self.assetName = nil self.package = nil - super.init() } func lookupKey(forAsset asset: String) -> String? { diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift index f1ea77a9ecc5..7407eacef820 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift @@ -3,37 +3,37 @@ // found in the LICENSE file. import Foundation -import google_maps_flutter_ios_sdk10 import google_maps_flutter_ios_sdk10_objc +@testable import google_maps_flutter_ios_sdk10 + /// Fake implementation of FGMMapEventDelegate for unit tests. -class TestMapEventHandler: NSObject, FGMMapEventDelegate { +class TestMapEventHandler: MapEventDelegate { func didStartCameraMove() {} func didMoveCamera(to cameraPosition: FGMPlatformCameraPosition) {} func didIdleCamera() {} - func didTap(atPosition position: FGMPlatformLatLng) {} + func didTap(at position: FGMPlatformLatLng) {} - func didLongPress(atPosition position: FGMPlatformLatLng) {} + func didLongPress(at position: FGMPlatformLatLng) {} func didTapMarker(withIdentifier markerId: String) {} func didStartDragForMarker( - withIdentifier markerId: String, atPosition position: FGMPlatformLatLng + withIdentifier markerId: String, at position: FGMPlatformLatLng ) {} - func didDragMarker(withIdentifier markerId: String, atPosition position: FGMPlatformLatLng) {} + func didDragMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) {} - func didEndDragForMarker(withIdentifier markerId: String, atPosition position: FGMPlatformLatLng) - {} + func didEndDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) {} func didTapInfoWindowOfMarker(withIdentifier markerId: String) {} func didTapCircle(withIdentifier circleId: String) {} - func didTap(_ cluster: FGMPlatformCluster) {} + func didTapCluster(_ cluster: FGMPlatformCluster) {} func didTapPolygon(withIdentifier polygonId: String) {} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/AssetProvider.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/AssetProvider.swift new file mode 100644 index 000000000000..cf4a2a9ba75c --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/AssetProvider.swift @@ -0,0 +1,36 @@ +// Copyright 2013 The Flutter Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import UIKit + +/// Protocol for looking up Flutter assets and resolving them to images. +/// +/// This is used to allow testing with mock assets without mocking the entire +/// Flutter plugin registrar and UIImage class. +protocol AssetProvider { + /// Returns the key for the given asset. + /// + /// Wraps the FlutterPluginRegistrar method of the same name. + /// + /// @param asset The name of the asset. + /// @return The key for the asset, or nil if not found. + func lookupKey(forAsset asset: String) -> String? + + /// Returns the key for the given asset from the given package. + /// + /// Wraps the FlutterPluginRegistrar method of the same name. + /// + /// @param asset The name of the asset. + /// @param package The name of the package to load the asset from. + /// @return The key for the asset, or nil if not found. + func lookupKey(forAsset asset: String, fromPackage package: String) -> String? + + /// Returns the image for the given named asset. + /// + /// Wraps the UIImage method of the same name. + /// + /// @param name The name of the image asset or file. + /// @return The image, or nil if not found. + func imageNamed(_ name: String) -> UIImage? +} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/CircleController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/CircleController.swift index 12685084077c..91bcf7915191 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/CircleController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/CircleController.swift @@ -54,11 +54,11 @@ class CircleController: NSObject { } class CirclesController: NSObject { - private weak var eventDelegate: FGMMapEventDelegate? + private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? private var circleIdToController: [String: CircleController] = [:] - init(mapView: GMSMapView, eventDelegate: FGMMapEventDelegate) { + init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate super.init() diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/ClusterManagersController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/ClusterManagersController.swift index c1ed35fffa67..237c3f421f50 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/ClusterManagersController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/ClusterManagersController.swift @@ -4,6 +4,7 @@ import Flutter import GoogleMaps +import GoogleMapsUtils #if canImport(google_maps_flutter_ios_sdk10_objc) import google_maps_flutter_ios_sdk10_objc @@ -12,10 +13,10 @@ import GoogleMaps /// A controller that manages all of the cluster managers on a map. class ClusterManagersController: NSObject { private var clusterManagerIdentifierToManagers: [String: GMUClusterManager] = [:] - private weak var eventDelegate: FGMMapEventDelegate? + private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? - init(mapView: GMSMapView, eventDelegate: FGMMapEventDelegate) { + init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate super.init() @@ -81,7 +82,7 @@ class ClusterManagersController: NSObject { guard let clusterManagerId = clusterManagerIdentifier(for: cluster) else { return } let platformCluster = FGMPlatformCluster.make( from: cluster, clusterManagerIdentifier: clusterManagerId) - eventDelegate?.didTap(platformCluster) + eventDelegate?.didTapCluster(platformCluster) } /// Returns the cluster manager identifier for given cluster. diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/GoogleMapController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/GoogleMapController.swift index 1407ca72bab1..4ab341a8a7bc 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/GoogleMapController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/GoogleMapController.swift @@ -10,13 +10,34 @@ import GoogleMapsUtils import google_maps_flutter_ios_sdk10_objc #endif -/// Non-test implementation of FGMAssetProvider, wrapping a Flutter plugin registrar. -class DefaultAssetProvider: NSObject, FGMAssetProvider { +/// Protocol for CATransaction to allow mocking in tests. +protocol MapAnimationCATransactionProtocol { + func begin() + func commit() + func setAnimationDuration(_ duration: CFTimeInterval) +} + +/// Non-test implementation of MapAnimationCATransactionProtocol. +class DefaultMapAnimationCATransaction: MapAnimationCATransactionProtocol { + func begin() { + CATransaction.begin() + } + + func commit() { + CATransaction.commit() + } + + func setAnimationDuration(_ duration: CFTimeInterval) { + CATransaction.setAnimationDuration(duration) + } +} + +/// Non-test implementation of AssetProvider, wrapping a Flutter plugin registrar. +class DefaultAssetProvider: AssetProvider { weak var registrar: FlutterPluginRegistrar? init(registrar: FlutterPluginRegistrar) { self.registrar = registrar - super.init() } func lookupKey(forAsset asset: String) -> String? { @@ -32,13 +53,12 @@ class DefaultAssetProvider: NSObject, FGMAssetProvider { } } -/// Non-test implementation of FGMMapEventDelegate, wrapping a FGMMapsCallbackApi instance. -class DefaultMapEventHandler: NSObject, FGMMapEventDelegate { +/// Non-test implementation of MapEventDelegate, wrapping a FGMMapsCallbackApi instance. +class DefaultMapEventHandler: MapEventDelegate { let callbackHandler: FGMMapsCallbackApi init(callbackHandler: FGMMapsCallbackApi) { self.callbackHandler = callbackHandler - super.init() } func didStartCameraMove() { @@ -53,11 +73,11 @@ class DefaultMapEventHandler: NSObject, FGMMapEventDelegate { callbackHandler.didIdleCamera { _ in } } - func didTap(atPosition position: FGMPlatformLatLng) { + func didTap(at position: FGMPlatformLatLng) { callbackHandler.didTap(atPosition: position) { _ in } } - func didLongPress(atPosition position: FGMPlatformLatLng) { + func didLongPress(at position: FGMPlatformLatLng) { callbackHandler.didLongPress(atPosition: position) { _ in } } @@ -66,17 +86,16 @@ class DefaultMapEventHandler: NSObject, FGMMapEventDelegate { } func didStartDragForMarker( - withIdentifier markerId: String, atPosition position: FGMPlatformLatLng + withIdentifier markerId: String, at position: FGMPlatformLatLng ) { callbackHandler.didStartDragForMarker(withIdentifier: markerId, atPosition: position) { _ in } } - func didDragMarker(withIdentifier markerId: String, atPosition position: FGMPlatformLatLng) { + func didDragMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) { callbackHandler.didDragMarker(withIdentifier: markerId, atPosition: position) { _ in } } - func didEndDragForMarker(withIdentifier markerId: String, atPosition position: FGMPlatformLatLng) - { + func didEndDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) { callbackHandler.didEndDragForMarker(withIdentifier: markerId, atPosition: position) { _ in } } @@ -88,7 +107,7 @@ class DefaultMapEventHandler: NSObject, FGMMapEventDelegate { callbackHandler.didTapCircle(withIdentifier: circleId) { _ in } } - func didTap(_ cluster: FGMPlatformCluster) { + func didTapCluster(_ cluster: FGMPlatformCluster) { callbackHandler.didTap(cluster) { _ in } } @@ -168,7 +187,7 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV mapView: GMSMapView, viewIdentifier viewId: Int64, creationParameters: FGMPlatformMapViewCreationParams, - assetProvider: FGMAssetProvider, + assetProvider: AssetProvider, binaryMessenger: FlutterBinaryMessenger ) { self.mapView = mapView @@ -421,11 +440,11 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV } public func mapView(_ mapView: GMSMapView, didTapAt coordinate: CLLocationCoordinate2D) { - mapEventHandler.didTap(atPosition: FGMPlatformLatLng.make(from: coordinate)) + mapEventHandler.didTap(at: FGMPlatformLatLng.make(from: coordinate)) } public func mapView(_ mapView: GMSMapView, didLongPressAt coordinate: CLLocationCoordinate2D) { - mapEventHandler.didLongPress(atPosition: FGMPlatformLatLng.make(from: coordinate)) + mapEventHandler.didLongPress(at: FGMPlatformLatLng.make(from: coordinate)) } func interpretMapConfiguration(_ config: FGMPlatformMapConfiguration) { @@ -542,7 +561,7 @@ class MapCallHandler: NSObject, FGMMapsApi { weak var controller: GoogleMapController? let messenger: FlutterBinaryMessenger let pigeonSuffix: String - var transactionWrapper: FGMCATransactionProtocol + var transactionWrapper: MapAnimationCATransactionProtocol init( messenger: FlutterBinaryMessenger, @@ -550,7 +569,7 @@ class MapCallHandler: NSObject, FGMMapsApi { ) { self.messenger = messenger self.pigeonSuffix = suffix - self.transactionWrapper = FGMCATransactionWrapper() + self.transactionWrapper = DefaultMapAnimationCATransaction() super.init() } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/GroundOverlayController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/GroundOverlayController.swift index d3bd9ffc09f3..602f805ced06 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/GroundOverlayController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/GroundOverlayController.swift @@ -3,6 +3,7 @@ // found in the LICENSE file. import GoogleMaps +import GoogleMapsUtils import UIKit #if canImport(google_maps_flutter_ios_sdk10_objc) @@ -35,7 +36,7 @@ class GroundOverlayController: NSObject { /// /// Setting the ground overlay to visible will set its map to the controller's mapView. func update( - from platformGroundOverlay: FGMPlatformGroundOverlay, assetProvider: FGMAssetProvider, + from platformGroundOverlay: FGMPlatformGroundOverlay, assetProvider: AssetProvider, screenScale: CGFloat ) { if let mapView = mapView { @@ -57,7 +58,7 @@ class GroundOverlayController: NSObject { _ groundOverlay: GMSGroundOverlay, from platformGroundOverlay: FGMPlatformGroundOverlay, mapView: GMSMapView, - assetProvider: FGMAssetProvider, + assetProvider: AssetProvider, screenScale: CGFloat, usingBounds useBounds: Bool ) { @@ -102,11 +103,11 @@ class GroundOverlayController: NSObject { /// Controller of multiple ground overlays on the map. class GroundOverlaysController: NSObject { private var groundOverlayControllerByIdentifier: [String: GroundOverlayController] = [:] - private weak var eventDelegate: FGMMapEventDelegate? - private let assetProvider: FGMAssetProvider + private weak var eventDelegate: MapEventDelegate? + private let assetProvider: AssetProvider private weak var mapView: GMSMapView? - init(mapView: GMSMapView, eventDelegate: FGMMapEventDelegate, assetProvider: FGMAssetProvider) { + init(mapView: GMSMapView, eventDelegate: MapEventDelegate, assetProvider: AssetProvider) { self.mapView = mapView self.eventDelegate = eventDelegate self.assetProvider = assetProvider diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/HeatmapController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/HeatmapController.swift index f88aad2ed965..e28805d887b1 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/HeatmapController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/HeatmapController.swift @@ -3,6 +3,7 @@ // found in the LICENSE file. import GoogleMaps +import GoogleMapsUtils #if canImport(google_maps_flutter_ios_sdk10_objc) import google_maps_flutter_ios_sdk10_objc diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/ImageUtils.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/ImageUtils.swift index 8400fbaec479..9ed4b0c46307 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/ImageUtils.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/ImageUtils.swift @@ -13,7 +13,7 @@ import UIKit extension FGMPlatformBitmap { /// Creates a UIImage from the Pigeon bitmap representation, suitable for use as a marker icon. func createIcon( - assetProvider: FGMAssetProvider, + assetProvider: AssetProvider, screenScale: CGFloat ) -> UIImage? { assert(screenScale > 0, "Screen scale must be greater than 0") diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/MapEventDelegate.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/MapEventDelegate.swift new file mode 100644 index 000000000000..43c1e81a1168 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/MapEventDelegate.swift @@ -0,0 +1,59 @@ +// Copyright 2013 The Flutter Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#if canImport(google_maps_flutter_ios_sdk10_objc) + import google_maps_flutter_ios_sdk10_objc +#endif + +/// Delegate for map event notifications. +/// +/// This is abstraction of the map event portions of FGMMapsCallbackApi, to +/// avoid coupling all the individual controllers to the Pigeon implementation +/// of event handling, and to allow for mocks/fakes in unit tests. +protocol MapEventDelegate: AnyObject { + /// Called when the map camera starts moving. + func didStartCameraMove() + + /// Called when the map camera moves. + func didMoveCamera(to cameraPosition: FGMPlatformCameraPosition) + + /// Called when the map camera stops moving. + func didIdleCamera() + + /// Called when the map, not a specifc map object, is tapped. + func didTap(at position: FGMPlatformLatLng) + + /// Called when the map, not a specifc map object, is long pressed. + func didLongPress(at position: FGMPlatformLatLng) + + /// Called when a marker is tapped. + func didTapMarker(withIdentifier markerId: String) + + /// Called when a marker drag starts. + func didStartDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) + + /// Called when a marker drag updates. + func didDragMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) + + /// Called when a marker drag ends. + func didEndDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) + + /// Called when a marker's info window is tapped. + func didTapInfoWindowOfMarker(withIdentifier markerId: String) + + /// Called when a circle is tapped. + func didTapCircle(withIdentifier circleId: String) + + /// Called when a marker cluster is tapped. + func didTapCluster(_ cluster: FGMPlatformCluster) + + /// Called when a polygon is tapped. + func didTapPolygon(withIdentifier polygonId: String) + + /// Called when a polyline is tapped. + func didTapPolyline(withIdentifier polylineId: String) + + /// Called when a ground overlay is tapped. + func didTapGroundOverlay(withIdentifier groundOverlayId: String) +} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/MarkerController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/MarkerController.swift index 9200d0a4b171..45763017cfe3 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/MarkerController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/MarkerController.swift @@ -48,7 +48,7 @@ class MarkerController: NSObject { /// Setting the marker to visible will set its map to the controller's mapView. func update( from platformMarker: FGMPlatformMarker, - assetProvider: FGMAssetProvider, + assetProvider: AssetProvider, screenScale: CGFloat ) { clusterManagerIdentifier = platformMarker.clusterManagerId @@ -78,7 +78,7 @@ class MarkerController: NSObject { _ marker: GMSMarker, from platformMarker: FGMPlatformMarker, mapView: GMSMapView?, - assetProvider: FGMAssetProvider, + assetProvider: AssetProvider, screenScale: CGFloat, usingOpacityForVisibility useOpacityForVisibility: Bool ) { @@ -118,17 +118,17 @@ class MarkerController: NSObject { /// Controller of multiple markers on the map. class MarkersController: NSObject { private(set) var markerIdentifierToController: [String: MarkerController] = [:] - private weak var eventDelegate: FGMMapEventDelegate? + private weak var eventDelegate: MapEventDelegate? private weak var clusterManagersController: ClusterManagersController? - private let assetProvider: FGMAssetProvider + private let assetProvider: AssetProvider private weak var mapView: GMSMapView? private let markerType: FGMPlatformMarkerType init( mapView: GMSMapView, - eventDelegate: FGMMapEventDelegate, + eventDelegate: MapEventDelegate, clusterManagersController: ClusterManagersController?, - assetProvider: FGMAssetProvider, + assetProvider: AssetProvider, markerType: FGMPlatformMarkerType ) { self.mapView = mapView @@ -231,7 +231,7 @@ class MarkersController: NSObject { guard markerIdentifierToController[identifier] != nil else { return } eventDelegate?.didStartDragForMarker( withIdentifier: identifier, - atPosition: FGMPlatformLatLng.make(from: location) + at: FGMPlatformLatLng.make(from: location) ) } @@ -239,7 +239,7 @@ class MarkersController: NSObject { guard markerIdentifierToController[identifier] != nil else { return } eventDelegate?.didDragMarker( withIdentifier: identifier, - atPosition: FGMPlatformLatLng.make(from: location) + at: FGMPlatformLatLng.make(from: location) ) } @@ -247,7 +247,7 @@ class MarkersController: NSObject { guard markerIdentifierToController[identifier] != nil else { return } eventDelegate?.didEndDragForMarker( withIdentifier: identifier, - atPosition: FGMPlatformLatLng.make(from: location) + at: FGMPlatformLatLng.make(from: location) ) } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/PolygonController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/PolygonController.swift index ab5c16652ed1..afda2e016909 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/PolygonController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/PolygonController.swift @@ -56,10 +56,10 @@ class PolygonController: NSObject { class PolygonsController: NSObject { private var polygonIdentifierToController: [String: PolygonController] = [:] - private weak var eventDelegate: FGMMapEventDelegate? + private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? - init(mapView: GMSMapView, eventDelegate: FGMMapEventDelegate) { + init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate super.init() diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/PolylineController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/PolylineController.swift index 278c6a336ff4..4994c7526f39 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/PolylineController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/PolylineController.swift @@ -61,10 +61,10 @@ class PolylineController: NSObject { class PolylinesController: NSObject { private var polylineIdentifierToController: [String: PolylineController] = [:] - private weak var eventDelegate: FGMMapEventDelegate? + private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? - init(mapView: GMSMapView, eventDelegate: FGMMapEventDelegate) { + init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate super.init() diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/FGMCATransactionWrapper.m b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/FGMCATransactionWrapper.m deleted file mode 100644 index 5fb79de8b17a..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/FGMCATransactionWrapper.m +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2013 The Flutter Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FGMCATransactionWrapper.h" - -@import QuartzCore; - -@implementation FGMCATransactionWrapper - -- (void)begin { - [CATransaction begin]; -} - -- (void)commit { - [CATransaction commit]; -} - -- (void)setAnimationDuration:(CFTimeInterval)duration { - [CATransaction setAnimationDuration:duration]; -} - -@end diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/google_maps_flutter_ios_sdk10_objc/FGMAssetProvider.h b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/google_maps_flutter_ios_sdk10_objc/FGMAssetProvider.h deleted file mode 100644 index 2254ec7287b8..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/google_maps_flutter_ios_sdk10_objc/FGMAssetProvider.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2013 The Flutter Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -@import UIKit; - -NS_ASSUME_NONNULL_BEGIN - -/// Protocol for looking up Flutter assets and resolving them to images. -/// -/// This is used to allow testing with mock assets without mocking the entire -/// Flutter plugin registrar and UIImage class. -@protocol FGMAssetProvider - -/// Returns the key for the given asset. -/// -/// Wraps the FlutterPluginRegistrar method of the same name. -/// -/// @param asset The name of the asset. -/// @return The key for the asset, or nil if not found. -- (nullable NSString *)lookupKeyForAsset:(NSString *)asset; - -/// Returns the key for the given asset from the given package. -/// -/// Wraps the FlutterPluginRegistrar method of the same name. -/// -/// @param asset The name of the asset. -/// @param package The name of the package to load the asset from. -/// @return The key for the asset, or nil if not found. -- (nullable NSString *)lookupKeyForAsset:(NSString *)asset fromPackage:(NSString *)package; - -/// Returns the image for the given named asset. -/// -/// Wraps the UIImage method of the same name. -/// -/// @param name The name of the image asset or file. -/// @return The image, or nil if not found. -- (nullable UIImage *)imageNamed:(NSString *)name; - -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/google_maps_flutter_ios_sdk10_objc/FGMCATransactionWrapper.h b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/google_maps_flutter_ios_sdk10_objc/FGMCATransactionWrapper.h deleted file mode 100644 index 41df2dedd618..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/google_maps_flutter_ios_sdk10_objc/FGMCATransactionWrapper.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2013 The Flutter Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -@import Foundation; - -NS_ASSUME_NONNULL_BEGIN - -/// Protocol for CATransaction to allow mocking in tests. -@protocol FGMCATransactionProtocol -- (void)begin; -- (void)commit; -- (void)setAnimationDuration:(CFTimeInterval)duration; -@end - -/// Wrapper for CATransaction to allow mocking in tests. -@interface FGMCATransactionWrapper : NSObject -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/google_maps_flutter_ios_sdk10_objc/FGMMapEventDelegate.h b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/google_maps_flutter_ios_sdk10_objc/FGMMapEventDelegate.h deleted file mode 100644 index f93f1adef252..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/google_maps_flutter_ios_sdk10_objc/FGMMapEventDelegate.h +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2013 The Flutter Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -@import Foundation; - -#import "google_maps_flutter_pigeon_messages.g.h" - -NS_ASSUME_NONNULL_BEGIN - -/// Delegate for map event notifications. -/// -/// This is abstraction of the map event portions of FGMMapsCallbackApi, to -/// avoid coupling all the individual controllers to the Pigeon implementation -/// of event handling, and to allow for mocks/fakes in unit tests. -@protocol FGMMapEventDelegate - -/// Called when the map camera starts moving. -- (void)didStartCameraMove; - -/// Called when the map camera moves. -- (void)didMoveCameraToPosition:(FGMPlatformCameraPosition *)cameraPosition; - -/// Called when the map camera stops moving. -- (void)didIdleCamera; - -/// Called when the map, not a specifc map object, is tapped. -- (void)didTapAtPosition:(FGMPlatformLatLng *)position; - -/// Called when the map, not a specifc map object, is long pressed. -- (void)didLongPressAtPosition:(FGMPlatformLatLng *)position; - -/// Called when a marker is tapped. -- (void)didTapMarkerWithIdentifier:(NSString *)markerId; - -/// Called when a marker drag starts. -- (void)didStartDragForMarkerWithIdentifier:(NSString *)markerId - atPosition:(FGMPlatformLatLng *)position; - -/// Called when a marker drag updates. -- (void)didDragMarkerWithIdentifier:(NSString *)markerId atPosition:(FGMPlatformLatLng *)position; - -/// Called when a marker drag ends. -- (void)didEndDragForMarkerWithIdentifier:(NSString *)markerId - atPosition:(FGMPlatformLatLng *)position; - -/// Called when a marker's info window is tapped. -- (void)didTapInfoWindowOfMarkerWithIdentifier:(NSString *)markerId; - -/// Called when a circle is tapped. -- (void)didTapCircleWithIdentifier:(NSString *)circleId; - -/// Called when a marker cluster is tapped. -- (void)didTapCluster:(FGMPlatformCluster *)cluster; - -/// Called when a polygon is tapped. -- (void)didTapPolygonWithIdentifier:(NSString *)polygonId; - -/// Called when a polyline is tapped. -- (void)didTapPolylineWithIdentifier:(NSString *)polylineId; - -/// Called when a ground overlay is tapped. -- (void)didTapGroundOverlayWithIdentifier:(NSString *)groundOverlayId; - -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GoogleMapsTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GoogleMapsTests.swift index 5268b227e74e..3a83d60dbab3 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GoogleMapsTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GoogleMapsTests.swift @@ -9,7 +9,7 @@ import google_maps_flutter_ios_sdk9_objc @testable import google_maps_flutter_ios_sdk9 -class MockCATransaction: NSObject, FGMCATransactionProtocol { +class MockCATransaction: NSObject, MapAnimationCATransactionProtocol { var beginCalled = false var commitCalled = false var animationDuration: CFTimeInterval = 0.0 diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/MarkerControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/MarkerControllerTests.swift index 6cff56be74e0..48b11088a1d0 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/MarkerControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/MarkerControllerTests.swift @@ -23,7 +23,7 @@ import google_maps_flutter_ios_sdk9_objc /// The mapView should outlive the controller, as the controller keeps a weak reference to it. func markersController( withMapView mapView: GMSMapView, - eventDelegate: NSObject & FGMMapEventDelegate + eventDelegate: MapEventDelegate ) -> MarkersController { return MarkersController( mapView: mapView, diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TestUtils/TestAssetProvider.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TestUtils/TestAssetProvider.swift index 97720ed2b333..d2e530782afd 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TestUtils/TestAssetProvider.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TestUtils/TestAssetProvider.swift @@ -3,11 +3,11 @@ // found in the LICENSE file. import UIKit -import google_maps_flutter_ios_sdk9 -import google_maps_flutter_ios_sdk9_objc -/// Fake implementation of FGMAssetProvider for unit tests. -class TestAssetProvider: NSObject, FGMAssetProvider { +@testable import google_maps_flutter_ios_sdk9 + +/// Fake implementation of AssetProvider for unit tests. +class TestAssetProvider: AssetProvider { private let image: UIImage? private let assetName: String? private let package: String? @@ -25,14 +25,12 @@ class TestAssetProvider: NSObject, FGMAssetProvider { self.image = image self.assetName = assetName self.package = package - super.init() } - override init() { + init() { self.image = nil self.assetName = nil self.package = nil - super.init() } func lookupKey(forAsset asset: String) -> String? { diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift index 5dec204caf45..0c9f5b07d82f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift @@ -3,37 +3,37 @@ // found in the LICENSE file. import Foundation -import google_maps_flutter_ios_sdk9 import google_maps_flutter_ios_sdk9_objc +@testable import google_maps_flutter_ios_sdk9 + /// Fake implementation of FGMMapEventDelegate for unit tests. -class TestMapEventHandler: NSObject, FGMMapEventDelegate { +class TestMapEventHandler: MapEventDelegate { func didStartCameraMove() {} func didMoveCamera(to cameraPosition: FGMPlatformCameraPosition) {} func didIdleCamera() {} - func didTap(atPosition position: FGMPlatformLatLng) {} + func didTap(at position: FGMPlatformLatLng) {} - func didLongPress(atPosition position: FGMPlatformLatLng) {} + func didLongPress(at position: FGMPlatformLatLng) {} func didTapMarker(withIdentifier markerId: String) {} func didStartDragForMarker( - withIdentifier markerId: String, atPosition position: FGMPlatformLatLng + withIdentifier markerId: String, at position: FGMPlatformLatLng ) {} - func didDragMarker(withIdentifier markerId: String, atPosition position: FGMPlatformLatLng) {} + func didDragMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) {} - func didEndDragForMarker(withIdentifier markerId: String, atPosition position: FGMPlatformLatLng) - {} + func didEndDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) {} func didTapInfoWindowOfMarker(withIdentifier markerId: String) {} func didTapCircle(withIdentifier circleId: String) {} - func didTap(_ cluster: FGMPlatformCluster) {} + func didTapCluster(_ cluster: FGMPlatformCluster) {} func didTapPolygon(withIdentifier polygonId: String) {} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/AssetProvider.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/AssetProvider.swift new file mode 100644 index 000000000000..cf4a2a9ba75c --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/AssetProvider.swift @@ -0,0 +1,36 @@ +// Copyright 2013 The Flutter Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import UIKit + +/// Protocol for looking up Flutter assets and resolving them to images. +/// +/// This is used to allow testing with mock assets without mocking the entire +/// Flutter plugin registrar and UIImage class. +protocol AssetProvider { + /// Returns the key for the given asset. + /// + /// Wraps the FlutterPluginRegistrar method of the same name. + /// + /// @param asset The name of the asset. + /// @return The key for the asset, or nil if not found. + func lookupKey(forAsset asset: String) -> String? + + /// Returns the key for the given asset from the given package. + /// + /// Wraps the FlutterPluginRegistrar method of the same name. + /// + /// @param asset The name of the asset. + /// @param package The name of the package to load the asset from. + /// @return The key for the asset, or nil if not found. + func lookupKey(forAsset asset: String, fromPackage package: String) -> String? + + /// Returns the image for the given named asset. + /// + /// Wraps the UIImage method of the same name. + /// + /// @param name The name of the image asset or file. + /// @return The image, or nil if not found. + func imageNamed(_ name: String) -> UIImage? +} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/CircleController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/CircleController.swift index cec0abb3cbbe..0829d3055761 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/CircleController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/CircleController.swift @@ -54,11 +54,11 @@ class CircleController: NSObject { } class CirclesController: NSObject { - private weak var eventDelegate: FGMMapEventDelegate? + private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? private var circleIdToController: [String: CircleController] = [:] - init(mapView: GMSMapView, eventDelegate: FGMMapEventDelegate) { + init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate super.init() diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ClusterManagersController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ClusterManagersController.swift index 5c6fea53c631..9e057bff71fc 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ClusterManagersController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ClusterManagersController.swift @@ -4,6 +4,7 @@ import Flutter import GoogleMaps +import GoogleMapsUtils #if canImport(google_maps_flutter_ios_sdk9_objc) import google_maps_flutter_ios_sdk9_objc @@ -12,10 +13,10 @@ import GoogleMaps /// A controller that manages all of the cluster managers on a map. class ClusterManagersController: NSObject { private var clusterManagerIdentifierToManagers: [String: GMUClusterManager] = [:] - private weak var eventDelegate: FGMMapEventDelegate? + private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? - init(mapView: GMSMapView, eventDelegate: FGMMapEventDelegate) { + init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate super.init() @@ -81,7 +82,7 @@ class ClusterManagersController: NSObject { guard let clusterManagerId = clusterManagerIdentifier(for: cluster) else { return } let platformCluster = FGMPlatformCluster.make( from: cluster, clusterManagerIdentifier: clusterManagerId) - eventDelegate?.didTap(platformCluster) + eventDelegate?.didTapCluster(platformCluster) } /// Returns the cluster manager identifier for given cluster. diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapController.swift index 06949262ec87..48cefce1ac29 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapController.swift @@ -10,13 +10,34 @@ import GoogleMapsUtils import google_maps_flutter_ios_sdk9_objc #endif -/// Non-test implementation of FGMAssetProvider, wrapping a Flutter plugin registrar. -class DefaultAssetProvider: NSObject, FGMAssetProvider { +/// Protocol for CATransaction to allow mocking in tests. +protocol MapAnimationCATransactionProtocol { + func begin() + func commit() + func setAnimationDuration(_ duration: CFTimeInterval) +} + +/// Non-test implementation of MapAnimationCATransactionProtocol. +class DefaultMapAnimationCATransaction: MapAnimationCATransactionProtocol { + func begin() { + CATransaction.begin() + } + + func commit() { + CATransaction.commit() + } + + func setAnimationDuration(_ duration: CFTimeInterval) { + CATransaction.setAnimationDuration(duration) + } +} + +/// Non-test implementation of AssetProvider, wrapping a Flutter plugin registrar. +class DefaultAssetProvider: AssetProvider { weak var registrar: FlutterPluginRegistrar? init(registrar: FlutterPluginRegistrar) { self.registrar = registrar - super.init() } func lookupKey(forAsset asset: String) -> String? { @@ -32,13 +53,12 @@ class DefaultAssetProvider: NSObject, FGMAssetProvider { } } -/// Non-test implementation of FGMMapEventDelegate, wrapping a FGMMapsCallbackApi instance. -class DefaultMapEventHandler: NSObject, FGMMapEventDelegate { +/// Non-test implementation of MapEventDelegate, wrapping a FGMMapsCallbackApi instance. +class DefaultMapEventHandler: MapEventDelegate { let callbackHandler: FGMMapsCallbackApi init(callbackHandler: FGMMapsCallbackApi) { self.callbackHandler = callbackHandler - super.init() } func didStartCameraMove() { @@ -53,11 +73,11 @@ class DefaultMapEventHandler: NSObject, FGMMapEventDelegate { callbackHandler.didIdleCamera { _ in } } - func didTap(atPosition position: FGMPlatformLatLng) { + func didTap(at position: FGMPlatformLatLng) { callbackHandler.didTap(atPosition: position) { _ in } } - func didLongPress(atPosition position: FGMPlatformLatLng) { + func didLongPress(at position: FGMPlatformLatLng) { callbackHandler.didLongPress(atPosition: position) { _ in } } @@ -66,17 +86,16 @@ class DefaultMapEventHandler: NSObject, FGMMapEventDelegate { } func didStartDragForMarker( - withIdentifier markerId: String, atPosition position: FGMPlatformLatLng + withIdentifier markerId: String, at position: FGMPlatformLatLng ) { callbackHandler.didStartDragForMarker(withIdentifier: markerId, atPosition: position) { _ in } } - func didDragMarker(withIdentifier markerId: String, atPosition position: FGMPlatformLatLng) { + func didDragMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) { callbackHandler.didDragMarker(withIdentifier: markerId, atPosition: position) { _ in } } - func didEndDragForMarker(withIdentifier markerId: String, atPosition position: FGMPlatformLatLng) - { + func didEndDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) { callbackHandler.didEndDragForMarker(withIdentifier: markerId, atPosition: position) { _ in } } @@ -88,7 +107,7 @@ class DefaultMapEventHandler: NSObject, FGMMapEventDelegate { callbackHandler.didTapCircle(withIdentifier: circleId) { _ in } } - func didTap(_ cluster: FGMPlatformCluster) { + func didTapCluster(_ cluster: FGMPlatformCluster) { callbackHandler.didTap(cluster) { _ in } } @@ -168,7 +187,7 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV mapView: GMSMapView, viewIdentifier viewId: Int64, creationParameters: FGMPlatformMapViewCreationParams, - assetProvider: FGMAssetProvider, + assetProvider: AssetProvider, binaryMessenger: FlutterBinaryMessenger ) { self.mapView = mapView @@ -421,11 +440,11 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV } public func mapView(_ mapView: GMSMapView, didTapAt coordinate: CLLocationCoordinate2D) { - mapEventHandler.didTap(atPosition: FGMPlatformLatLng.make(from: coordinate)) + mapEventHandler.didTap(at: FGMPlatformLatLng.make(from: coordinate)) } public func mapView(_ mapView: GMSMapView, didLongPressAt coordinate: CLLocationCoordinate2D) { - mapEventHandler.didLongPress(atPosition: FGMPlatformLatLng.make(from: coordinate)) + mapEventHandler.didLongPress(at: FGMPlatformLatLng.make(from: coordinate)) } func interpretMapConfiguration(_ config: FGMPlatformMapConfiguration) { @@ -542,7 +561,7 @@ class MapCallHandler: NSObject, FGMMapsApi { weak var controller: GoogleMapController? let messenger: FlutterBinaryMessenger let pigeonSuffix: String - var transactionWrapper: FGMCATransactionProtocol + var transactionWrapper: MapAnimationCATransactionProtocol init( messenger: FlutterBinaryMessenger, @@ -550,7 +569,7 @@ class MapCallHandler: NSObject, FGMMapsApi { ) { self.messenger = messenger self.pigeonSuffix = suffix - self.transactionWrapper = FGMCATransactionWrapper() + self.transactionWrapper = DefaultMapAnimationCATransaction() super.init() } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GroundOverlayController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GroundOverlayController.swift index 32a7c165b554..e69037287f36 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GroundOverlayController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GroundOverlayController.swift @@ -3,6 +3,7 @@ // found in the LICENSE file. import GoogleMaps +import GoogleMapsUtils import UIKit #if canImport(google_maps_flutter_ios_sdk9_objc) @@ -35,7 +36,7 @@ class GroundOverlayController: NSObject { /// /// Setting the ground overlay to visible will set its map to the controller's mapView. func update( - from platformGroundOverlay: FGMPlatformGroundOverlay, assetProvider: FGMAssetProvider, + from platformGroundOverlay: FGMPlatformGroundOverlay, assetProvider: AssetProvider, screenScale: CGFloat ) { if let mapView = mapView { @@ -57,7 +58,7 @@ class GroundOverlayController: NSObject { _ groundOverlay: GMSGroundOverlay, from platformGroundOverlay: FGMPlatformGroundOverlay, mapView: GMSMapView, - assetProvider: FGMAssetProvider, + assetProvider: AssetProvider, screenScale: CGFloat, usingBounds useBounds: Bool ) { @@ -102,11 +103,11 @@ class GroundOverlayController: NSObject { /// Controller of multiple ground overlays on the map. class GroundOverlaysController: NSObject { private var groundOverlayControllerByIdentifier: [String: GroundOverlayController] = [:] - private weak var eventDelegate: FGMMapEventDelegate? - private let assetProvider: FGMAssetProvider + private weak var eventDelegate: MapEventDelegate? + private let assetProvider: AssetProvider private weak var mapView: GMSMapView? - init(mapView: GMSMapView, eventDelegate: FGMMapEventDelegate, assetProvider: FGMAssetProvider) { + init(mapView: GMSMapView, eventDelegate: MapEventDelegate, assetProvider: AssetProvider) { self.mapView = mapView self.eventDelegate = eventDelegate self.assetProvider = assetProvider diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/HeatmapController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/HeatmapController.swift index 10158847110a..e777b374e129 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/HeatmapController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/HeatmapController.swift @@ -3,6 +3,7 @@ // found in the LICENSE file. import GoogleMaps +import GoogleMapsUtils #if canImport(google_maps_flutter_ios_sdk9_objc) import google_maps_flutter_ios_sdk9_objc diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ImageUtils.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ImageUtils.swift index 25ad7c11d1fe..7d47237a6543 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ImageUtils.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ImageUtils.swift @@ -13,7 +13,7 @@ import UIKit extension FGMPlatformBitmap { /// Creates a UIImage from the Pigeon bitmap representation, suitable for use as a marker icon. func createIcon( - assetProvider: FGMAssetProvider, + assetProvider: AssetProvider, screenScale: CGFloat ) -> UIImage? { assert(screenScale > 0, "Screen scale must be greater than 0") diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MapEventDelegate.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MapEventDelegate.swift new file mode 100644 index 000000000000..f3125ba6199c --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MapEventDelegate.swift @@ -0,0 +1,59 @@ +// Copyright 2013 The Flutter Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#if canImport(google_maps_flutter_ios_sdk9_objc) + import google_maps_flutter_ios_sdk9_objc +#endif + +/// Delegate for map event notifications. +/// +/// This is abstraction of the map event portions of FGMMapsCallbackApi, to +/// avoid coupling all the individual controllers to the Pigeon implementation +/// of event handling, and to allow for mocks/fakes in unit tests. +protocol MapEventDelegate: AnyObject { + /// Called when the map camera starts moving. + func didStartCameraMove() + + /// Called when the map camera moves. + func didMoveCamera(to cameraPosition: FGMPlatformCameraPosition) + + /// Called when the map camera stops moving. + func didIdleCamera() + + /// Called when the map, not a specifc map object, is tapped. + func didTap(at position: FGMPlatformLatLng) + + /// Called when the map, not a specifc map object, is long pressed. + func didLongPress(at position: FGMPlatformLatLng) + + /// Called when a marker is tapped. + func didTapMarker(withIdentifier markerId: String) + + /// Called when a marker drag starts. + func didStartDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) + + /// Called when a marker drag updates. + func didDragMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) + + /// Called when a marker drag ends. + func didEndDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) + + /// Called when a marker's info window is tapped. + func didTapInfoWindowOfMarker(withIdentifier markerId: String) + + /// Called when a circle is tapped. + func didTapCircle(withIdentifier circleId: String) + + /// Called when a marker cluster is tapped. + func didTapCluster(_ cluster: FGMPlatformCluster) + + /// Called when a polygon is tapped. + func didTapPolygon(withIdentifier polygonId: String) + + /// Called when a polyline is tapped. + func didTapPolyline(withIdentifier polylineId: String) + + /// Called when a ground overlay is tapped. + func didTapGroundOverlay(withIdentifier groundOverlayId: String) +} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MarkerController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MarkerController.swift index c9c5a6f0712b..97cda598470d 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MarkerController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MarkerController.swift @@ -48,7 +48,7 @@ class MarkerController: NSObject { /// Setting the marker to visible will set its map to the controller's mapView. func update( from platformMarker: FGMPlatformMarker, - assetProvider: FGMAssetProvider, + assetProvider: AssetProvider, screenScale: CGFloat ) { clusterManagerIdentifier = platformMarker.clusterManagerId @@ -78,7 +78,7 @@ class MarkerController: NSObject { _ marker: GMSMarker, from platformMarker: FGMPlatformMarker, mapView: GMSMapView?, - assetProvider: FGMAssetProvider, + assetProvider: AssetProvider, screenScale: CGFloat, usingOpacityForVisibility useOpacityForVisibility: Bool ) { @@ -118,17 +118,17 @@ class MarkerController: NSObject { /// Controller of multiple markers on the map. class MarkersController: NSObject { private(set) var markerIdentifierToController: [String: MarkerController] = [:] - private weak var eventDelegate: FGMMapEventDelegate? + private weak var eventDelegate: MapEventDelegate? private weak var clusterManagersController: ClusterManagersController? - private let assetProvider: FGMAssetProvider + private let assetProvider: AssetProvider private weak var mapView: GMSMapView? private let markerType: FGMPlatformMarkerType init( mapView: GMSMapView, - eventDelegate: FGMMapEventDelegate, + eventDelegate: MapEventDelegate, clusterManagersController: ClusterManagersController?, - assetProvider: FGMAssetProvider, + assetProvider: AssetProvider, markerType: FGMPlatformMarkerType ) { self.mapView = mapView @@ -231,7 +231,7 @@ class MarkersController: NSObject { guard markerIdentifierToController[identifier] != nil else { return } eventDelegate?.didStartDragForMarker( withIdentifier: identifier, - atPosition: FGMPlatformLatLng.make(from: location) + at: FGMPlatformLatLng.make(from: location) ) } @@ -239,7 +239,7 @@ class MarkersController: NSObject { guard markerIdentifierToController[identifier] != nil else { return } eventDelegate?.didDragMarker( withIdentifier: identifier, - atPosition: FGMPlatformLatLng.make(from: location) + at: FGMPlatformLatLng.make(from: location) ) } @@ -247,7 +247,7 @@ class MarkersController: NSObject { guard markerIdentifierToController[identifier] != nil else { return } eventDelegate?.didEndDragForMarker( withIdentifier: identifier, - atPosition: FGMPlatformLatLng.make(from: location) + at: FGMPlatformLatLng.make(from: location) ) } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolygonController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolygonController.swift index a24da0fae3fb..e2d78a7c6c40 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolygonController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolygonController.swift @@ -56,10 +56,10 @@ class PolygonController: NSObject { class PolygonsController: NSObject { private var polygonIdentifierToController: [String: PolygonController] = [:] - private weak var eventDelegate: FGMMapEventDelegate? + private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? - init(mapView: GMSMapView, eventDelegate: FGMMapEventDelegate) { + init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate super.init() diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolylineController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolylineController.swift index 77116a5157e8..0ed24af32031 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolylineController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolylineController.swift @@ -61,10 +61,10 @@ class PolylineController: NSObject { class PolylinesController: NSObject { private var polylineIdentifierToController: [String: PolylineController] = [:] - private weak var eventDelegate: FGMMapEventDelegate? + private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? - init(mapView: GMSMapView, eventDelegate: FGMMapEventDelegate) { + init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate super.init() diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/FGMCATransactionWrapper.m b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/FGMCATransactionWrapper.m deleted file mode 100644 index 5fb79de8b17a..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/FGMCATransactionWrapper.m +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2013 The Flutter Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FGMCATransactionWrapper.h" - -@import QuartzCore; - -@implementation FGMCATransactionWrapper - -- (void)begin { - [CATransaction begin]; -} - -- (void)commit { - [CATransaction commit]; -} - -- (void)setAnimationDuration:(CFTimeInterval)duration { - [CATransaction setAnimationDuration:duration]; -} - -@end diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/google_maps_flutter_ios_sdk9_objc/FGMAssetProvider.h b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/google_maps_flutter_ios_sdk9_objc/FGMAssetProvider.h deleted file mode 100644 index 2254ec7287b8..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/google_maps_flutter_ios_sdk9_objc/FGMAssetProvider.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2013 The Flutter Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -@import UIKit; - -NS_ASSUME_NONNULL_BEGIN - -/// Protocol for looking up Flutter assets and resolving them to images. -/// -/// This is used to allow testing with mock assets without mocking the entire -/// Flutter plugin registrar and UIImage class. -@protocol FGMAssetProvider - -/// Returns the key for the given asset. -/// -/// Wraps the FlutterPluginRegistrar method of the same name. -/// -/// @param asset The name of the asset. -/// @return The key for the asset, or nil if not found. -- (nullable NSString *)lookupKeyForAsset:(NSString *)asset; - -/// Returns the key for the given asset from the given package. -/// -/// Wraps the FlutterPluginRegistrar method of the same name. -/// -/// @param asset The name of the asset. -/// @param package The name of the package to load the asset from. -/// @return The key for the asset, or nil if not found. -- (nullable NSString *)lookupKeyForAsset:(NSString *)asset fromPackage:(NSString *)package; - -/// Returns the image for the given named asset. -/// -/// Wraps the UIImage method of the same name. -/// -/// @param name The name of the image asset or file. -/// @return The image, or nil if not found. -- (nullable UIImage *)imageNamed:(NSString *)name; - -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/google_maps_flutter_ios_sdk9_objc/FGMCATransactionWrapper.h b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/google_maps_flutter_ios_sdk9_objc/FGMCATransactionWrapper.h deleted file mode 100644 index 41df2dedd618..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/google_maps_flutter_ios_sdk9_objc/FGMCATransactionWrapper.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2013 The Flutter Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -@import Foundation; - -NS_ASSUME_NONNULL_BEGIN - -/// Protocol for CATransaction to allow mocking in tests. -@protocol FGMCATransactionProtocol -- (void)begin; -- (void)commit; -- (void)setAnimationDuration:(CFTimeInterval)duration; -@end - -/// Wrapper for CATransaction to allow mocking in tests. -@interface FGMCATransactionWrapper : NSObject -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/google_maps_flutter_ios_sdk9_objc/FGMMapEventDelegate.h b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/google_maps_flutter_ios_sdk9_objc/FGMMapEventDelegate.h deleted file mode 100644 index f93f1adef252..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/google_maps_flutter_ios_sdk9_objc/FGMMapEventDelegate.h +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2013 The Flutter Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -@import Foundation; - -#import "google_maps_flutter_pigeon_messages.g.h" - -NS_ASSUME_NONNULL_BEGIN - -/// Delegate for map event notifications. -/// -/// This is abstraction of the map event portions of FGMMapsCallbackApi, to -/// avoid coupling all the individual controllers to the Pigeon implementation -/// of event handling, and to allow for mocks/fakes in unit tests. -@protocol FGMMapEventDelegate - -/// Called when the map camera starts moving. -- (void)didStartCameraMove; - -/// Called when the map camera moves. -- (void)didMoveCameraToPosition:(FGMPlatformCameraPosition *)cameraPosition; - -/// Called when the map camera stops moving. -- (void)didIdleCamera; - -/// Called when the map, not a specifc map object, is tapped. -- (void)didTapAtPosition:(FGMPlatformLatLng *)position; - -/// Called when the map, not a specifc map object, is long pressed. -- (void)didLongPressAtPosition:(FGMPlatformLatLng *)position; - -/// Called when a marker is tapped. -- (void)didTapMarkerWithIdentifier:(NSString *)markerId; - -/// Called when a marker drag starts. -- (void)didStartDragForMarkerWithIdentifier:(NSString *)markerId - atPosition:(FGMPlatformLatLng *)position; - -/// Called when a marker drag updates. -- (void)didDragMarkerWithIdentifier:(NSString *)markerId atPosition:(FGMPlatformLatLng *)position; - -/// Called when a marker drag ends. -- (void)didEndDragForMarkerWithIdentifier:(NSString *)markerId - atPosition:(FGMPlatformLatLng *)position; - -/// Called when a marker's info window is tapped. -- (void)didTapInfoWindowOfMarkerWithIdentifier:(NSString *)markerId; - -/// Called when a circle is tapped. -- (void)didTapCircleWithIdentifier:(NSString *)circleId; - -/// Called when a marker cluster is tapped. -- (void)didTapCluster:(FGMPlatformCluster *)cluster; - -/// Called when a polygon is tapped. -- (void)didTapPolygonWithIdentifier:(NSString *)polygonId; - -/// Called when a polyline is tapped. -- (void)didTapPolylineWithIdentifier:(NSString *)polylineId; - -/// Called when a ground overlay is tapped. -- (void)didTapGroundOverlayWithIdentifier:(NSString *)groundOverlayId; - -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/google_maps_flutter_ios_sdk9_objc/GoogleMapsUtilsTrampoline.h b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/google_maps_flutter_ios_sdk9_objc/GoogleMapsUtilsTrampoline.h deleted file mode 100644 index cf6399b5b39e..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/google_maps_flutter_ios_sdk9_objc/GoogleMapsUtilsTrampoline.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2013 The Flutter Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// If Swift Package Manager is in use, Objective-C headers are available under the -// GoogleMapsUtilsObjC package. When using CocoaPods, the headers are provided by the -// GoogleMapsUtils package. -#ifdef FGM_USING_COCOAPODS -@import GoogleMapsUtils; -#else -@import GoogleMapsUtilsObjC; -#endif diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/GoogleMapsTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/GoogleMapsTests.swift index 9178990a73ba..a474194e412f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/GoogleMapsTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/GoogleMapsTests.swift @@ -9,7 +9,7 @@ import google_maps_flutter_ios_objc @testable import google_maps_flutter_ios -class MockCATransaction: NSObject, FGMCATransactionProtocol { +class MockCATransaction: NSObject, MapAnimationCATransactionProtocol { var beginCalled = false var commitCalled = false var animationDuration: CFTimeInterval = 0.0 diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/MarkerControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/MarkerControllerTests.swift index 4c3d751062ac..9a6afe770ccc 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/MarkerControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/MarkerControllerTests.swift @@ -23,7 +23,7 @@ import google_maps_flutter_ios_objc /// The mapView should outlive the controller, as the controller keeps a weak reference to it. func markersController( withMapView mapView: GMSMapView, - eventDelegate: NSObject & FGMMapEventDelegate + eventDelegate: MapEventDelegate ) -> MarkersController { return MarkersController( mapView: mapView, diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/TestUtils/TestAssetProvider.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/TestUtils/TestAssetProvider.swift index e32bc617a111..e46183f791b0 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/TestUtils/TestAssetProvider.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/TestUtils/TestAssetProvider.swift @@ -3,11 +3,11 @@ // found in the LICENSE file. import UIKit -import google_maps_flutter_ios -import google_maps_flutter_ios_objc -/// Fake implementation of FGMAssetProvider for unit tests. -class TestAssetProvider: NSObject, FGMAssetProvider { +@testable import google_maps_flutter_ios + +/// Fake implementation of AssetProvider for unit tests. +class TestAssetProvider: AssetProvider { private let image: UIImage? private let assetName: String? private let package: String? @@ -25,14 +25,12 @@ class TestAssetProvider: NSObject, FGMAssetProvider { self.image = image self.assetName = assetName self.package = package - super.init() } - override init() { + init() { self.image = nil self.assetName = nil self.package = nil - super.init() } func lookupKey(forAsset asset: String) -> String? { diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift index e40d4244a163..decb94221c5b 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift @@ -3,37 +3,37 @@ // found in the LICENSE file. import Foundation -import google_maps_flutter_ios import google_maps_flutter_ios_objc +@testable import google_maps_flutter_ios + /// Fake implementation of FGMMapEventDelegate for unit tests. -class TestMapEventHandler: NSObject, FGMMapEventDelegate { +class TestMapEventHandler: MapEventDelegate { func didStartCameraMove() {} func didMoveCamera(to cameraPosition: FGMPlatformCameraPosition) {} func didIdleCamera() {} - func didTap(atPosition position: FGMPlatformLatLng) {} + func didTap(at position: FGMPlatformLatLng) {} - func didLongPress(atPosition position: FGMPlatformLatLng) {} + func didLongPress(at position: FGMPlatformLatLng) {} func didTapMarker(withIdentifier markerId: String) {} func didStartDragForMarker( - withIdentifier markerId: String, atPosition position: FGMPlatformLatLng + withIdentifier markerId: String, at position: FGMPlatformLatLng ) {} - func didDragMarker(withIdentifier markerId: String, atPosition position: FGMPlatformLatLng) {} + func didDragMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) {} - func didEndDragForMarker(withIdentifier markerId: String, atPosition position: FGMPlatformLatLng) - {} + func didEndDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) {} func didTapInfoWindowOfMarker(withIdentifier markerId: String) {} func didTapCircle(withIdentifier circleId: String) {} - func didTap(_ cluster: FGMPlatformCluster) {} + func didTapCluster(_ cluster: FGMPlatformCluster) {} func didTapPolygon(withIdentifier polygonId: String) {} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/AssetProvider.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/AssetProvider.swift new file mode 100644 index 000000000000..cf4a2a9ba75c --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/AssetProvider.swift @@ -0,0 +1,36 @@ +// Copyright 2013 The Flutter Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import UIKit + +/// Protocol for looking up Flutter assets and resolving them to images. +/// +/// This is used to allow testing with mock assets without mocking the entire +/// Flutter plugin registrar and UIImage class. +protocol AssetProvider { + /// Returns the key for the given asset. + /// + /// Wraps the FlutterPluginRegistrar method of the same name. + /// + /// @param asset The name of the asset. + /// @return The key for the asset, or nil if not found. + func lookupKey(forAsset asset: String) -> String? + + /// Returns the key for the given asset from the given package. + /// + /// Wraps the FlutterPluginRegistrar method of the same name. + /// + /// @param asset The name of the asset. + /// @param package The name of the package to load the asset from. + /// @return The key for the asset, or nil if not found. + func lookupKey(forAsset asset: String, fromPackage package: String) -> String? + + /// Returns the image for the given named asset. + /// + /// Wraps the UIImage method of the same name. + /// + /// @param name The name of the image asset or file. + /// @return The image, or nil if not found. + func imageNamed(_ name: String) -> UIImage? +} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/CircleController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/CircleController.swift index 4fdae6200fc6..2c9e9125ad95 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/CircleController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/CircleController.swift @@ -54,11 +54,11 @@ class CircleController: NSObject { } class CirclesController: NSObject { - private weak var eventDelegate: FGMMapEventDelegate? + private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? private var circleIdToController: [String: CircleController] = [:] - init(mapView: GMSMapView, eventDelegate: FGMMapEventDelegate) { + init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate super.init() diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/ClusterManagersController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/ClusterManagersController.swift index e4db55d05d34..50ffe6e99360 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/ClusterManagersController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/ClusterManagersController.swift @@ -4,6 +4,7 @@ import Flutter import GoogleMaps +import GoogleMapsUtils #if canImport(google_maps_flutter_ios_objc) import google_maps_flutter_ios_objc @@ -12,10 +13,10 @@ import GoogleMaps /// A controller that manages all of the cluster managers on a map. class ClusterManagersController: NSObject { private var clusterManagerIdentifierToManagers: [String: GMUClusterManager] = [:] - private weak var eventDelegate: FGMMapEventDelegate? + private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? - init(mapView: GMSMapView, eventDelegate: FGMMapEventDelegate) { + init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate super.init() @@ -81,7 +82,7 @@ class ClusterManagersController: NSObject { guard let clusterManagerId = clusterManagerIdentifier(for: cluster) else { return } let platformCluster = FGMPlatformCluster.make( from: cluster, clusterManagerIdentifier: clusterManagerId) - eventDelegate?.didTap(platformCluster) + eventDelegate?.didTapCluster(platformCluster) } /// Returns the cluster manager identifier for given cluster. diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/GoogleMapController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/GoogleMapController.swift index 3349fb89ca37..61795d6b6e16 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/GoogleMapController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/GoogleMapController.swift @@ -10,13 +10,34 @@ import GoogleMapsUtils import google_maps_flutter_ios_objc #endif -/// Non-test implementation of FGMAssetProvider, wrapping a Flutter plugin registrar. -class DefaultAssetProvider: NSObject, FGMAssetProvider { +/// Protocol for CATransaction to allow mocking in tests. +protocol MapAnimationCATransactionProtocol { + func begin() + func commit() + func setAnimationDuration(_ duration: CFTimeInterval) +} + +/// Non-test implementation of MapAnimationCATransactionProtocol. +class DefaultMapAnimationCATransaction: MapAnimationCATransactionProtocol { + func begin() { + CATransaction.begin() + } + + func commit() { + CATransaction.commit() + } + + func setAnimationDuration(_ duration: CFTimeInterval) { + CATransaction.setAnimationDuration(duration) + } +} + +/// Non-test implementation of AssetProvider, wrapping a Flutter plugin registrar. +class DefaultAssetProvider: AssetProvider { weak var registrar: FlutterPluginRegistrar? init(registrar: FlutterPluginRegistrar) { self.registrar = registrar - super.init() } func lookupKey(forAsset asset: String) -> String? { @@ -32,13 +53,12 @@ class DefaultAssetProvider: NSObject, FGMAssetProvider { } } -/// Non-test implementation of FGMMapEventDelegate, wrapping a FGMMapsCallbackApi instance. -class DefaultMapEventHandler: NSObject, FGMMapEventDelegate { +/// Non-test implementation of MapEventDelegate, wrapping a FGMMapsCallbackApi instance. +class DefaultMapEventHandler: MapEventDelegate { let callbackHandler: FGMMapsCallbackApi init(callbackHandler: FGMMapsCallbackApi) { self.callbackHandler = callbackHandler - super.init() } func didStartCameraMove() { @@ -53,11 +73,11 @@ class DefaultMapEventHandler: NSObject, FGMMapEventDelegate { callbackHandler.didIdleCamera { _ in } } - func didTap(atPosition position: FGMPlatformLatLng) { + func didTap(at position: FGMPlatformLatLng) { callbackHandler.didTap(atPosition: position) { _ in } } - func didLongPress(atPosition position: FGMPlatformLatLng) { + func didLongPress(at position: FGMPlatformLatLng) { callbackHandler.didLongPress(atPosition: position) { _ in } } @@ -66,17 +86,16 @@ class DefaultMapEventHandler: NSObject, FGMMapEventDelegate { } func didStartDragForMarker( - withIdentifier markerId: String, atPosition position: FGMPlatformLatLng + withIdentifier markerId: String, at position: FGMPlatformLatLng ) { callbackHandler.didStartDragForMarker(withIdentifier: markerId, atPosition: position) { _ in } } - func didDragMarker(withIdentifier markerId: String, atPosition position: FGMPlatformLatLng) { + func didDragMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) { callbackHandler.didDragMarker(withIdentifier: markerId, atPosition: position) { _ in } } - func didEndDragForMarker(withIdentifier markerId: String, atPosition position: FGMPlatformLatLng) - { + func didEndDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) { callbackHandler.didEndDragForMarker(withIdentifier: markerId, atPosition: position) { _ in } } @@ -88,7 +107,7 @@ class DefaultMapEventHandler: NSObject, FGMMapEventDelegate { callbackHandler.didTapCircle(withIdentifier: circleId) { _ in } } - func didTap(_ cluster: FGMPlatformCluster) { + func didTapCluster(_ cluster: FGMPlatformCluster) { callbackHandler.didTap(cluster) { _ in } } @@ -168,7 +187,7 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV mapView: GMSMapView, viewIdentifier viewId: Int64, creationParameters: FGMPlatformMapViewCreationParams, - assetProvider: FGMAssetProvider, + assetProvider: AssetProvider, binaryMessenger: FlutterBinaryMessenger ) { self.mapView = mapView @@ -421,11 +440,11 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV } public func mapView(_ mapView: GMSMapView, didTapAt coordinate: CLLocationCoordinate2D) { - mapEventHandler.didTap(atPosition: FGMPlatformLatLng.make(from: coordinate)) + mapEventHandler.didTap(at: FGMPlatformLatLng.make(from: coordinate)) } public func mapView(_ mapView: GMSMapView, didLongPressAt coordinate: CLLocationCoordinate2D) { - mapEventHandler.didLongPress(atPosition: FGMPlatformLatLng.make(from: coordinate)) + mapEventHandler.didLongPress(at: FGMPlatformLatLng.make(from: coordinate)) } func interpretMapConfiguration(_ config: FGMPlatformMapConfiguration) { @@ -542,7 +561,7 @@ class MapCallHandler: NSObject, FGMMapsApi { weak var controller: GoogleMapController? let messenger: FlutterBinaryMessenger let pigeonSuffix: String - var transactionWrapper: FGMCATransactionProtocol + var transactionWrapper: MapAnimationCATransactionProtocol init( messenger: FlutterBinaryMessenger, @@ -550,7 +569,7 @@ class MapCallHandler: NSObject, FGMMapsApi { ) { self.messenger = messenger self.pigeonSuffix = suffix - self.transactionWrapper = FGMCATransactionWrapper() + self.transactionWrapper = DefaultMapAnimationCATransaction() super.init() } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/GroundOverlayController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/GroundOverlayController.swift index e9c5778bbab0..6b3ccf9acdf5 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/GroundOverlayController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/GroundOverlayController.swift @@ -3,6 +3,7 @@ // found in the LICENSE file. import GoogleMaps +import GoogleMapsUtils import UIKit #if canImport(google_maps_flutter_ios_objc) @@ -35,7 +36,7 @@ class GroundOverlayController: NSObject { /// /// Setting the ground overlay to visible will set its map to the controller's mapView. func update( - from platformGroundOverlay: FGMPlatformGroundOverlay, assetProvider: FGMAssetProvider, + from platformGroundOverlay: FGMPlatformGroundOverlay, assetProvider: AssetProvider, screenScale: CGFloat ) { if let mapView = mapView { @@ -57,7 +58,7 @@ class GroundOverlayController: NSObject { _ groundOverlay: GMSGroundOverlay, from platformGroundOverlay: FGMPlatformGroundOverlay, mapView: GMSMapView, - assetProvider: FGMAssetProvider, + assetProvider: AssetProvider, screenScale: CGFloat, usingBounds useBounds: Bool ) { @@ -102,11 +103,11 @@ class GroundOverlayController: NSObject { /// Controller of multiple ground overlays on the map. class GroundOverlaysController: NSObject { private var groundOverlayControllerByIdentifier: [String: GroundOverlayController] = [:] - private weak var eventDelegate: FGMMapEventDelegate? - private let assetProvider: FGMAssetProvider + private weak var eventDelegate: MapEventDelegate? + private let assetProvider: AssetProvider private weak var mapView: GMSMapView? - init(mapView: GMSMapView, eventDelegate: FGMMapEventDelegate, assetProvider: FGMAssetProvider) { + init(mapView: GMSMapView, eventDelegate: MapEventDelegate, assetProvider: AssetProvider) { self.mapView = mapView self.eventDelegate = eventDelegate self.assetProvider = assetProvider diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/HeatmapController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/HeatmapController.swift index b8a3bc65c539..65cd5dc7a64f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/HeatmapController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/HeatmapController.swift @@ -3,6 +3,7 @@ // found in the LICENSE file. import GoogleMaps +import GoogleMapsUtils #if canImport(google_maps_flutter_ios_objc) import google_maps_flutter_ios_objc diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/ImageUtils.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/ImageUtils.swift index 75f0ea1731f3..636ab730ebc9 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/ImageUtils.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/ImageUtils.swift @@ -13,7 +13,7 @@ import UIKit extension FGMPlatformBitmap { /// Creates a UIImage from the Pigeon bitmap representation, suitable for use as a marker icon. func createIcon( - assetProvider: FGMAssetProvider, + assetProvider: AssetProvider, screenScale: CGFloat ) -> UIImage? { assert(screenScale > 0, "Screen scale must be greater than 0") diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/MapEventDelegate.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/MapEventDelegate.swift new file mode 100644 index 000000000000..3fdde6b712ef --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/MapEventDelegate.swift @@ -0,0 +1,59 @@ +// Copyright 2013 The Flutter Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#if canImport(google_maps_flutter_ios_objc) + import google_maps_flutter_ios_objc +#endif + +/// Delegate for map event notifications. +/// +/// This is abstraction of the map event portions of FGMMapsCallbackApi, to +/// avoid coupling all the individual controllers to the Pigeon implementation +/// of event handling, and to allow for mocks/fakes in unit tests. +protocol MapEventDelegate: AnyObject { + /// Called when the map camera starts moving. + func didStartCameraMove() + + /// Called when the map camera moves. + func didMoveCamera(to cameraPosition: FGMPlatformCameraPosition) + + /// Called when the map camera stops moving. + func didIdleCamera() + + /// Called when the map, not a specifc map object, is tapped. + func didTap(at position: FGMPlatformLatLng) + + /// Called when the map, not a specifc map object, is long pressed. + func didLongPress(at position: FGMPlatformLatLng) + + /// Called when a marker is tapped. + func didTapMarker(withIdentifier markerId: String) + + /// Called when a marker drag starts. + func didStartDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) + + /// Called when a marker drag updates. + func didDragMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) + + /// Called when a marker drag ends. + func didEndDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) + + /// Called when a marker's info window is tapped. + func didTapInfoWindowOfMarker(withIdentifier markerId: String) + + /// Called when a circle is tapped. + func didTapCircle(withIdentifier circleId: String) + + /// Called when a marker cluster is tapped. + func didTapCluster(_ cluster: FGMPlatformCluster) + + /// Called when a polygon is tapped. + func didTapPolygon(withIdentifier polygonId: String) + + /// Called when a polyline is tapped. + func didTapPolyline(withIdentifier polylineId: String) + + /// Called when a ground overlay is tapped. + func didTapGroundOverlay(withIdentifier groundOverlayId: String) +} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/MarkerController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/MarkerController.swift index c4880530e56a..28cb05d5e260 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/MarkerController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/MarkerController.swift @@ -48,7 +48,7 @@ class MarkerController: NSObject { /// Setting the marker to visible will set its map to the controller's mapView. func update( from platformMarker: FGMPlatformMarker, - assetProvider: FGMAssetProvider, + assetProvider: AssetProvider, screenScale: CGFloat ) { clusterManagerIdentifier = platformMarker.clusterManagerId @@ -78,7 +78,7 @@ class MarkerController: NSObject { _ marker: GMSMarker, from platformMarker: FGMPlatformMarker, mapView: GMSMapView?, - assetProvider: FGMAssetProvider, + assetProvider: AssetProvider, screenScale: CGFloat, usingOpacityForVisibility useOpacityForVisibility: Bool ) { @@ -118,17 +118,17 @@ class MarkerController: NSObject { /// Controller of multiple markers on the map. class MarkersController: NSObject { private(set) var markerIdentifierToController: [String: MarkerController] = [:] - private weak var eventDelegate: FGMMapEventDelegate? + private weak var eventDelegate: MapEventDelegate? private weak var clusterManagersController: ClusterManagersController? - private let assetProvider: FGMAssetProvider + private let assetProvider: AssetProvider private weak var mapView: GMSMapView? private let markerType: FGMPlatformMarkerType init( mapView: GMSMapView, - eventDelegate: FGMMapEventDelegate, + eventDelegate: MapEventDelegate, clusterManagersController: ClusterManagersController?, - assetProvider: FGMAssetProvider, + assetProvider: AssetProvider, markerType: FGMPlatformMarkerType ) { self.mapView = mapView @@ -231,7 +231,7 @@ class MarkersController: NSObject { guard markerIdentifierToController[identifier] != nil else { return } eventDelegate?.didStartDragForMarker( withIdentifier: identifier, - atPosition: FGMPlatformLatLng.make(from: location) + at: FGMPlatformLatLng.make(from: location) ) } @@ -239,7 +239,7 @@ class MarkersController: NSObject { guard markerIdentifierToController[identifier] != nil else { return } eventDelegate?.didDragMarker( withIdentifier: identifier, - atPosition: FGMPlatformLatLng.make(from: location) + at: FGMPlatformLatLng.make(from: location) ) } @@ -247,7 +247,7 @@ class MarkersController: NSObject { guard markerIdentifierToController[identifier] != nil else { return } eventDelegate?.didEndDragForMarker( withIdentifier: identifier, - atPosition: FGMPlatformLatLng.make(from: location) + at: FGMPlatformLatLng.make(from: location) ) } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/PolygonController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/PolygonController.swift index 9f2fcb58db72..8e643a904002 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/PolygonController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/PolygonController.swift @@ -56,10 +56,10 @@ class PolygonController: NSObject { class PolygonsController: NSObject { private var polygonIdentifierToController: [String: PolygonController] = [:] - private weak var eventDelegate: FGMMapEventDelegate? + private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? - init(mapView: GMSMapView, eventDelegate: FGMMapEventDelegate) { + init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate super.init() diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/PolylineController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/PolylineController.swift index 42d41cee189f..db7e3fc02715 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/PolylineController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/PolylineController.swift @@ -61,10 +61,10 @@ class PolylineController: NSObject { class PolylinesController: NSObject { private var polylineIdentifierToController: [String: PolylineController] = [:] - private weak var eventDelegate: FGMMapEventDelegate? + private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? - init(mapView: GMSMapView, eventDelegate: FGMMapEventDelegate) { + init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate super.init() diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/FGMCATransactionWrapper.m b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/FGMCATransactionWrapper.m deleted file mode 100644 index 5fb79de8b17a..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/FGMCATransactionWrapper.m +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright 2013 The Flutter Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "FGMCATransactionWrapper.h" - -@import QuartzCore; - -@implementation FGMCATransactionWrapper - -- (void)begin { - [CATransaction begin]; -} - -- (void)commit { - [CATransaction commit]; -} - -- (void)setAnimationDuration:(CFTimeInterval)duration { - [CATransaction setAnimationDuration:duration]; -} - -@end diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/include/google_maps_flutter_ios_objc/FGMAssetProvider.h b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/include/google_maps_flutter_ios_objc/FGMAssetProvider.h deleted file mode 100644 index 2254ec7287b8..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/include/google_maps_flutter_ios_objc/FGMAssetProvider.h +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright 2013 The Flutter Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -@import UIKit; - -NS_ASSUME_NONNULL_BEGIN - -/// Protocol for looking up Flutter assets and resolving them to images. -/// -/// This is used to allow testing with mock assets without mocking the entire -/// Flutter plugin registrar and UIImage class. -@protocol FGMAssetProvider - -/// Returns the key for the given asset. -/// -/// Wraps the FlutterPluginRegistrar method of the same name. -/// -/// @param asset The name of the asset. -/// @return The key for the asset, or nil if not found. -- (nullable NSString *)lookupKeyForAsset:(NSString *)asset; - -/// Returns the key for the given asset from the given package. -/// -/// Wraps the FlutterPluginRegistrar method of the same name. -/// -/// @param asset The name of the asset. -/// @param package The name of the package to load the asset from. -/// @return The key for the asset, or nil if not found. -- (nullable NSString *)lookupKeyForAsset:(NSString *)asset fromPackage:(NSString *)package; - -/// Returns the image for the given named asset. -/// -/// Wraps the UIImage method of the same name. -/// -/// @param name The name of the image asset or file. -/// @return The image, or nil if not found. -- (nullable UIImage *)imageNamed:(NSString *)name; - -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/include/google_maps_flutter_ios_objc/FGMCATransactionWrapper.h b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/include/google_maps_flutter_ios_objc/FGMCATransactionWrapper.h deleted file mode 100644 index 41df2dedd618..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/include/google_maps_flutter_ios_objc/FGMCATransactionWrapper.h +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright 2013 The Flutter Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -@import Foundation; - -NS_ASSUME_NONNULL_BEGIN - -/// Protocol for CATransaction to allow mocking in tests. -@protocol FGMCATransactionProtocol -- (void)begin; -- (void)commit; -- (void)setAnimationDuration:(CFTimeInterval)duration; -@end - -/// Wrapper for CATransaction to allow mocking in tests. -@interface FGMCATransactionWrapper : NSObject -@end - -NS_ASSUME_NONNULL_END diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/include/google_maps_flutter_ios_objc/FGMMapEventDelegate.h b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/include/google_maps_flutter_ios_objc/FGMMapEventDelegate.h deleted file mode 100644 index f93f1adef252..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/include/google_maps_flutter_ios_objc/FGMMapEventDelegate.h +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2013 The Flutter Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -@import Foundation; - -#import "google_maps_flutter_pigeon_messages.g.h" - -NS_ASSUME_NONNULL_BEGIN - -/// Delegate for map event notifications. -/// -/// This is abstraction of the map event portions of FGMMapsCallbackApi, to -/// avoid coupling all the individual controllers to the Pigeon implementation -/// of event handling, and to allow for mocks/fakes in unit tests. -@protocol FGMMapEventDelegate - -/// Called when the map camera starts moving. -- (void)didStartCameraMove; - -/// Called when the map camera moves. -- (void)didMoveCameraToPosition:(FGMPlatformCameraPosition *)cameraPosition; - -/// Called when the map camera stops moving. -- (void)didIdleCamera; - -/// Called when the map, not a specifc map object, is tapped. -- (void)didTapAtPosition:(FGMPlatformLatLng *)position; - -/// Called when the map, not a specifc map object, is long pressed. -- (void)didLongPressAtPosition:(FGMPlatformLatLng *)position; - -/// Called when a marker is tapped. -- (void)didTapMarkerWithIdentifier:(NSString *)markerId; - -/// Called when a marker drag starts. -- (void)didStartDragForMarkerWithIdentifier:(NSString *)markerId - atPosition:(FGMPlatformLatLng *)position; - -/// Called when a marker drag updates. -- (void)didDragMarkerWithIdentifier:(NSString *)markerId atPosition:(FGMPlatformLatLng *)position; - -/// Called when a marker drag ends. -- (void)didEndDragForMarkerWithIdentifier:(NSString *)markerId - atPosition:(FGMPlatformLatLng *)position; - -/// Called when a marker's info window is tapped. -- (void)didTapInfoWindowOfMarkerWithIdentifier:(NSString *)markerId; - -/// Called when a circle is tapped. -- (void)didTapCircleWithIdentifier:(NSString *)circleId; - -/// Called when a marker cluster is tapped. -- (void)didTapCluster:(FGMPlatformCluster *)cluster; - -/// Called when a polygon is tapped. -- (void)didTapPolygonWithIdentifier:(NSString *)polygonId; - -/// Called when a polyline is tapped. -- (void)didTapPolylineWithIdentifier:(NSString *)polylineId; - -/// Called when a ground overlay is tapped. -- (void)didTapGroundOverlayWithIdentifier:(NSString *)groundOverlayId; - -@end - -NS_ASSUME_NONNULL_END From ecdadaad795a475ea426bd3a23350c1845e30df8 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Wed, 2 Sep 2026 12:55:04 -0400 Subject: [PATCH 02/14] Initial Pigeon conversion --- .../RunnerTests/CircleControllerTests.swift | 11 +- .../ClusterManagersControllerTests.swift | 41 +- .../RunnerTests/ConversionsUtilsTests.swift | 142 +- .../ExtractIconFromDataTests.swift | 111 +- .../ios/RunnerTests/GoogleMapsTests.swift | 47 +- .../GroundOverlayControllerTests.swift | 53 +- .../RunnerTests/HeatmapControllerTests.swift | 23 +- .../RunnerTests/MarkerControllerTests.swift | 97 +- .../RunnerTests/PolygonControllerTests.swift | 9 +- .../RunnerTests/PolylineControllerTests.swift | 27 +- .../TestUtils/TestMapEventHandler.swift | 17 +- .../TileOverlayControllerTests.swift | 5 +- .../TileProviderControllerTests.swift | 7 +- .../ios/google_maps_flutter_ios_sdk9.podspec | 3 +- .../Package.swift | 19 +- .../CircleController.swift | 18 +- .../ClusterManagersController.swift | 18 +- .../ConversionUtils.swift | 136 +- .../GoogleMapController.swift | 409 +- .../GoogleMapFactory.swift | 8 +- .../GroundOverlayController.swift | 26 +- .../HeatmapController.swift | 30 +- .../ImageUtils.swift | 31 +- .../MapEventDelegate.swift | 16 +- .../MarkerController.swift | 69 +- .../Messages.g.swift | 4253 +++++++++++++++ .../PolygonController.swift | 18 +- .../PolylineController.swift | 18 +- .../TileOverlayController.swift | 45 +- .../google_maps_flutter_pigeon_messages.g.m | 4849 ----------------- .../google_maps_flutter_pigeon_messages.g.h | 991 ---- .../pigeons/messages.dart | 98 +- .../tool/unshared_source_files.dart | 2 - 33 files changed, 4934 insertions(+), 6713 deletions(-) create mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/Messages.g.swift delete mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/google_maps_flutter_pigeon_messages.g.m delete mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/google_maps_flutter_ios_sdk9_objc/google_maps_flutter_pigeon_messages.g.h diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/CircleControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/CircleControllerTests.swift index b65e95836cf5..cbf713343ee3 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/CircleControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/CircleControllerTests.swift @@ -4,7 +4,6 @@ import GoogleMaps import Testing -import google_maps_flutter_ios_sdk9_objc @testable import google_maps_flutter_ios_sdk9 @@ -14,14 +13,14 @@ import google_maps_flutter_ios_sdk9_objc let circle = PropertyOrderValidatingCircle() CircleController.update( circle, - from: FGMPlatformCircle.make( - withConsumeTapEvents: false, - fill: FGMPlatformColor.make(withRed: 0, green: 0, blue: 0, alpha: 0), - stroke: FGMPlatformColor.make(withRed: 0, green: 0, blue: 0, alpha: 0), + from: PlatformCircle( + consumeTapEvents: false, + fillColor: PlatformColor(red: 0, green: 0, blue: 0, alpha: 0), + strokeColor: PlatformColor(red: 0, green: 0, blue: 0, alpha: 0), visible: true, strokeWidth: 0, zIndex: 0, - center: FGMPlatformLatLng.make(withLatitude: 0, longitude: 0), + center: PlatformLatLng(latitude: 0, longitude: 0), radius: 10, circleId: "circle" ), diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ClusterManagersControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ClusterManagersControllerTests.swift index c28a6f1f74c8..f54527f823d1 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ClusterManagersControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ClusterManagersControllerTests.swift @@ -5,7 +5,6 @@ import Flutter import GoogleMaps import Testing -import google_maps_flutter_ios_sdk9_objc @testable import google_maps_flutter_ios_sdk9 @@ -36,7 +35,7 @@ import google_maps_flutter_ios_sdk9_objc // Add cluster managers. let clusterManagerId = "cm" - let clusterManagerToAdd = FGMPlatformClusterManager.make(withIdentifier: clusterManagerId) + let clusterManagerToAdd = PlatformClusterManager(identifier: clusterManagerId) clusterManagersController.add([clusterManagerToAdd]) // Verify that cluster managers are available @@ -47,18 +46,16 @@ import google_maps_flutter_ios_sdk9_objc let markerId1 = "m1" let markerId2 = "m2" - let zeroPoint = FGMPlatformPoint.makeWith(x: 0, y: 0) - let zeroLatLng = FGMPlatformLatLng.make(withLatitude: 0, longitude: 0) - let bitmap = FGMPlatformBitmap.make( - withBitmap: FGMPlatformBitmapDefaultMarker.make(withHue: 0) - ) - let infoWindow = FGMPlatformInfoWindow.make( - withTitle: "Info", + let zeroPoint = PlatformPoint(x: 0, y: 0) + let zeroLatLng = PlatformLatLng(latitude: 0, longitude: 0) + let bitmap = PlatformBitmap(bitmap: PlatformBitmapDefaultMarker(hue: 0)) + let infoWindow = PlatformInfoWindow( + title: "Info", snippet: nil, anchor: zeroPoint ) - let marker1 = FGMPlatformMarker.make( - withAlpha: 1, + let marker1 = PlatformMarker( + alpha: 1, anchor: zeroPoint, consumeTapEvents: false, draggable: false, @@ -73,8 +70,8 @@ import google_maps_flutter_ios_sdk9_objc clusterManagerId: clusterManagerId, collisionBehavior: nil ) - let marker2 = FGMPlatformMarker.make( - withAlpha: 1, + let marker2 = PlatformMarker( + alpha: 1, anchor: zeroPoint, consumeTapEvents: false, draggable: false, @@ -96,11 +93,7 @@ import google_maps_flutter_ios_sdk9_objc clusterManagersController.invokeClusteringForEachClusterManager() // Verify that the markers were added to the cluster manager - var error: FlutterError? = nil - let clusters1 = try #require( - clusterManagersController.clusters(withIdentifier: clusterManagerId, error: &error) - ) - #expect(error == nil) + let clusters1 = try clusterManagersController.clusters(withIdentifier: clusterManagerId) let targetCluster = try #require( clusters1.first(where: { $0.clusterManagerId == clusterManagerId }) ) @@ -111,11 +104,7 @@ import google_maps_flutter_ios_sdk9_objc markersController.removeMarkers(withIdentifiers: [markerId2]) // Verify that the marker2 is removed from the clusterManager - error = nil - let clusters2 = try #require( - clusterManagersController.clusters(withIdentifier: clusterManagerId, error: &error) - ) - #expect(error == nil) + let clusters2 = try clusterManagersController.clusters(withIdentifier: clusterManagerId) let targetCluster2 = try #require( clusters2.first(where: { $0.clusterManagerId == clusterManagerId }) ) @@ -125,11 +114,7 @@ import google_maps_flutter_ios_sdk9_objc markersController.removeMarkers(withIdentifiers: [markerId1]) // Verify that all markers are removed from clusterManager - error = nil - let clusters3 = try #require( - clusterManagersController.clusters(withIdentifier: clusterManagerId, error: &error) - ) - #expect(error == nil) + let clusters3 = try clusterManagersController.clusters(withIdentifier: clusterManagerId) #expect(clusters3.count == 0) // Remove cluster manager diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ConversionsUtilsTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ConversionsUtilsTests.swift index b6970b5597fb..35ab712077c7 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ConversionsUtilsTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ConversionsUtilsTests.swift @@ -4,7 +4,6 @@ import GoogleMaps import Testing -import google_maps_flutter_ios_sdk9_objc @testable import google_maps_flutter_ios_sdk9 @@ -15,8 +14,8 @@ import google_maps_flutter_ios_sdk9_objc let platformGreen: CGFloat = 2 / 255.0 let platformBlue: CGFloat = 3 / 255.0 let platformAlpha: CGFloat = 4 / 255.0 - let color = FGMPlatformColor.make( - withRed: platformRed, + let color = PlatformColor( + red: platformRed, green: platformGreen, blue: platformBlue, alpha: platformAlpha @@ -39,7 +38,7 @@ import google_maps_flutter_ios_sdk9_objc let blue: CGFloat = 3 / 255.0 let alpha: CGFloat = 4 / 255.0 let color = UIColor(red: red, green: green, blue: blue, alpha: alpha) - let platformColor = FGMPlatformColor.make(from: color) + let platformColor = PlatformColor.make(from: color) #expect(abs(red - platformColor.red) <= CGFloat.ulpOfOne) #expect(abs(green - platformColor.green) <= CGFloat.ulpOfOne) #expect(abs(blue - platformColor.blue) <= CGFloat.ulpOfOne) @@ -47,7 +46,7 @@ import google_maps_flutter_ios_sdk9_objc } @Test func pointFromLatLong() { - let latlong = FGMPlatformLatLng.make(withLatitude: 1, longitude: 2) + let latlong = PlatformLatLng(latitude: 1, longitude: 2) let location = latlong.toCLLocationCoordinate2D() #expect(location.latitude == 1) #expect(location.longitude == 2) @@ -60,7 +59,7 @@ import google_maps_flutter_ios_sdk9_objc bearing: 3.0, viewingAngle: 75.0 ) - let pigeonPosition = FGMPlatformCameraPosition.make(from: position) + let pigeonPosition = PlatformCameraPosition.make(from: position) #expect(abs(pigeonPosition.target.latitude - position.target.latitude) <= Double.ulpOfOne) #expect(abs(pigeonPosition.target.longitude - position.target.longitude) <= Double.ulpOfOne) #expect(abs(Float(pigeonPosition.zoom) - position.zoom) <= Float.ulpOfOne) @@ -70,7 +69,7 @@ import google_maps_flutter_ios_sdk9_objc @Test func pigeonPointForGCPoint() { let point = CGPoint(x: 10, y: 20) - let pigeonPoint = FGMPlatformPoint.make(from: point) + let pigeonPoint = PlatformPoint.make(from: point) #expect(abs(pigeonPoint.x - Double(point.x)) <= Double.ulpOfOne) #expect(abs(pigeonPoint.y - Double(point.y)) <= Double.ulpOfOne) } @@ -80,7 +79,7 @@ import google_maps_flutter_ios_sdk9_objc coordinate: CLLocationCoordinate2D(latitude: 10, longitude: 20), coordinate: CLLocationCoordinate2D(latitude: 30, longitude: 40) ) - let pigeonBounds = FGMPlatformLatLngBounds.make(from: bounds) + let pigeonBounds = PlatformLatLngBounds.make(from: bounds) #expect(abs(pigeonBounds.southwest.latitude - bounds.southWest.latitude) <= Double.ulpOfOne) #expect(abs(pigeonBounds.southwest.longitude - bounds.southWest.longitude) <= Double.ulpOfOne) #expect(abs(pigeonBounds.northeast.latitude - bounds.northEast.latitude) <= Double.ulpOfOne) @@ -88,9 +87,9 @@ import google_maps_flutter_ios_sdk9_objc } @Test func getCameraPostionForPigeonCameraPosition() { - let pigeonCameraPosition = FGMPlatformCameraPosition.make( - withBearing: 1.0, - target: FGMPlatformLatLng.make(withLatitude: 2.0, longitude: 3.0), + let pigeonCameraPosition = PlatformCameraPosition( + bearing: 1.0, + target: PlatformLatLng(latitude: 2.0, longitude: 3.0), tilt: 4.0, zoom: 5.0 ) @@ -108,7 +107,7 @@ import google_maps_flutter_ios_sdk9_objc } @Test func cgPointForPigeonPoint() { - let pigeonPoint = FGMPlatformPoint.makeWith(x: 1.0, y: 2.0) + let pigeonPoint = PlatformPoint(x: 1.0, y: 2.0) let point = pigeonPoint.toCGPoint() @@ -117,9 +116,9 @@ import google_maps_flutter_ios_sdk9_objc } @Test func coordinateBoundsFromLatLongs() { - let pigeonBounds = FGMPlatformLatLngBounds.make( - withNortheast: FGMPlatformLatLng.make(withLatitude: 3, longitude: 4), - southwest: FGMPlatformLatLng.make(withLatitude: 1, longitude: 2) + let pigeonBounds = PlatformLatLngBounds( + northeast: PlatformLatLng(latitude: 3, longitude: 4), + southwest: PlatformLatLng(latitude: 1, longitude: 2) ) let bounds = pigeonBounds.toGMSCoordinateBounds() @@ -132,25 +131,25 @@ import google_maps_flutter_ios_sdk9_objc } @Test func mapViewTypeFromPigeonType() { - #expect(GMSMapViewType.normal == FGMPlatformMapType.normal.gmsMapViewType) - #expect(GMSMapViewType.satellite == FGMPlatformMapType.satellite.gmsMapViewType) - #expect(GMSMapViewType.terrain == FGMPlatformMapType.terrain.gmsMapViewType) - #expect(GMSMapViewType.hybrid == FGMPlatformMapType.hybrid.gmsMapViewType) - #expect(GMSMapViewType.none == FGMPlatformMapType.none.gmsMapViewType) + #expect(GMSMapViewType.normal == PlatformMapType.normal.gmsMapViewType) + #expect(GMSMapViewType.satellite == PlatformMapType.satellite.gmsMapViewType) + #expect(GMSMapViewType.terrain == PlatformMapType.terrain.gmsMapViewType) + #expect(GMSMapViewType.hybrid == PlatformMapType.hybrid.gmsMapViewType) + #expect(GMSMapViewType.none == PlatformMapType.none.gmsMapViewType) } @Test func cameraUpdateFromNewCameraPosition() { - let newPositionUpdate = FGMPlatformCameraUpdateNewCameraPosition.make( - with: FGMPlatformCameraPosition.make( - withBearing: 4, - target: FGMPlatformLatLng.make(withLatitude: 1, longitude: 2), + let newPositionUpdate = PlatformCameraUpdateNewCameraPosition( + cameraPosition: PlatformCameraPosition( + bearing: 4, + target: PlatformLatLng(latitude: 1, longitude: 2), tilt: 5, zoom: 3 ) ) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: newPositionUpdate).toGMSCameraUpdate() + _ = PlatformCameraUpdate(cameraUpdate: newPositionUpdate).toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @@ -158,32 +157,32 @@ import google_maps_flutter_ios_sdk9_objc @Test func cameraUpdateFromNewLatLong() { let lat: Double = 1 let lng: Double = 2 - let platformUpdate = FGMPlatformCameraUpdateNewLatLng.make( - with: FGMPlatformLatLng.make(withLatitude: lat, longitude: lng) + let platformUpdate = PlatformCameraUpdateNewLatLng( + latLng: PlatformLatLng(latitude: lat, longitude: lng) ) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = PlatformCameraUpdate(cameraUpdate: platformUpdate).toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @Test func cameraUpdateFromNewLatLngBounds() { - let pigeonBounds = FGMPlatformLatLngBounds.make( - withNortheast: FGMPlatformLatLng.make(withLatitude: 1, longitude: 2), - southwest: FGMPlatformLatLng.make(withLatitude: 3, longitude: 4) + let pigeonBounds = PlatformLatLngBounds( + northeast: PlatformLatLng(latitude: 1, longitude: 2), + southwest: PlatformLatLng(latitude: 3, longitude: 4) ) let bounds = pigeonBounds.toGMSCoordinateBounds() let padding: Double = 20 - let platformUpdate = FGMPlatformCameraUpdateNewLatLngBounds.make( - with: FGMPlatformLatLngBounds.make(from: bounds), + let platformUpdate = PlatformCameraUpdateNewLatLngBounds( + bounds: PlatformLatLngBounds.make(from: bounds), padding: padding ) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = PlatformCameraUpdate(cameraUpdate: platformUpdate).toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @@ -192,14 +191,14 @@ import google_maps_flutter_ios_sdk9_objc let lat: Double = 1 let lng: Double = 2 let zoom: Double = 3 - let platformUpdate = FGMPlatformCameraUpdateNewLatLngZoom.make( - with: FGMPlatformLatLng.make(withLatitude: lat, longitude: lng), + let platformUpdate = PlatformCameraUpdateNewLatLngZoom( + latLng: PlatformLatLng(latitude: lat, longitude: lng), zoom: zoom ) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = PlatformCameraUpdate(cameraUpdate: platformUpdate).toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @@ -207,22 +206,22 @@ import google_maps_flutter_ios_sdk9_objc @Test func cameraUpdateFromScrollBy() { let x: Double = 1 let y: Double = 2 - let platformUpdate = FGMPlatformCameraUpdateScrollBy.make(withDx: x, dy: y) + let platformUpdate = PlatformCameraUpdateScrollBy(dx: x, dy: y) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = PlatformCameraUpdate(cameraUpdate: platformUpdate).toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @Test func cameraUpdateFromZoomBy() { let zoom: Double = 1 - let platformUpdateNoPoint = FGMPlatformCameraUpdateZoomBy.make(withAmount: zoom, focus: nil) + let platformUpdateNoPoint = PlatformCameraUpdateZoomBy(amount: zoom, focus: nil) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdateNoPoint).toGMSCameraUpdate() + _ = PlatformCameraUpdate(cameraUpdate: platformUpdateNoPoint).toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @@ -231,51 +230,48 @@ import google_maps_flutter_ios_sdk9_objc let zoom: Double = 1 let x: Double = 2 let y: Double = 3 - let platformUpdate = FGMPlatformCameraUpdateZoomBy.make( - withAmount: zoom, - focus: FGMPlatformPoint.makeWith(x: x, y: y) - ) + let platformUpdate = PlatformCameraUpdateZoomBy(amount: zoom, focus: PlatformPoint(x: x, y: y)) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = PlatformCameraUpdate(cameraUpdate: platformUpdate).toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @Test func cameraUpdateFromZoomIn() { - let platformUpdate = FGMPlatformCameraUpdateZoom.make(withOut: false) + let platformUpdate = PlatformCameraUpdateZoom(out: false) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = PlatformCameraUpdate(cameraUpdate: platformUpdate).toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @Test func cameraUpdateFromZoomOut() { - let platformUpdate = FGMPlatformCameraUpdateZoom.make(withOut: true) + let platformUpdate = PlatformCameraUpdateZoom(out: true) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = PlatformCameraUpdate(cameraUpdate: platformUpdate).toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @Test func cameraUpdateFromZoomTo() { let zoom: Double = 1 - let platformUpdate = FGMPlatformCameraUpdateZoomTo.make(withZoom: zoom) + let platformUpdate = PlatformCameraUpdateZoomTo(zoom: zoom) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = PlatformCameraUpdate(cameraUpdate: platformUpdate).toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @Test func strokeStyleFromPattern() { - let pattern = FGMPlatformPatternItem.make(with: .dash, length: 1) + let pattern = PlatformPatternItem(type: .dash, length: 1) let strokeColor = UIColor.red _ = pattern.gmsStrokeStyle(strokeColor: strokeColor) @@ -285,7 +281,7 @@ import google_maps_flutter_ios_sdk9_objc @Test func nonNullLengthFromPatternItem() { let length: Double = 6.4 - let pattern = FGMPlatformPatternItem.make(with: .gap, length: length as NSNumber) + let pattern = PlatformPatternItem(type: .gap, length: length) let spanLength = pattern.gmsStyleSpanLength() @@ -293,7 +289,7 @@ import google_maps_flutter_ios_sdk9_objc } @Test func nullLengthFromPatternItem() { - let pattern = FGMPlatformPatternItem.make(with: .dot, length: nil) + let pattern = PlatformPatternItem(type: .dot, length: nil) let spanLength = pattern.gmsStyleSpanLength() @@ -302,8 +298,8 @@ import google_maps_flutter_ios_sdk9_objc @Test func weightedLatLngFromPlatformWeightedLatLng() { let intensity: Double = 3.0 - let data = FGMPlatformWeightedLatLng.make( - withPoint: FGMPlatformLatLng.make(withLatitude: 10, longitude: 20), + let data = PlatformWeightedLatLng( + point: PlatformLatLng(latitude: 10, longitude: 20), weight: intensity ) @@ -318,17 +314,17 @@ import google_maps_flutter_ios_sdk9_objc let platformBlue: Double = 0.3 let platformAlpha: Double = 0.4 let colorMapSize: Int = 200 - let platformGradient = FGMPlatformHeatmapGradient.make( - with: [ - FGMPlatformColor.make( - withRed: platformRed, + let platformGradient = PlatformHeatmapGradient( + colors: [ + PlatformColor( + red: platformRed, green: platformGreen, blue: platformBlue, alpha: platformAlpha ) ], - startPoints: [startPoint as NSNumber], - colorMapSize: colorMapSize + startPoints: [startPoint], + colorMapSize: Int64(colorMapSize) ) let gradient = platformGradient.toGMUGradient() diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ExtractIconFromDataTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ExtractIconFromDataTests.swift index b9e05e9d51de..87b9dab3afc8 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ExtractIconFromDataTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ExtractIconFromDataTests.swift @@ -4,7 +4,6 @@ import Flutter import Testing -import google_maps_flutter_ios_sdk9_objc @testable import google_maps_flutter_ios_sdk9 @@ -15,8 +14,8 @@ import google_maps_flutter_ios_sdk9_objc let assetName = "fakeImageName" let assetProvider = TestAssetProvider(image: testImage, forAssetName: assetName, package: nil) - let bitmap = FGMPlatformBitmapAssetMap.make( - withAssetName: assetName, + let bitmap = PlatformBitmapAssetMap( + assetName: assetName, bitmapScaling: .auto, imagePixelRatio: 1, width: nil, @@ -25,7 +24,7 @@ import google_maps_flutter_ios_sdk9_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( + let resultImage = PlatformBitmap(bitmap: bitmap).createIcon( assetProvider: assetProvider, screenScale: screenScale ) @@ -42,8 +41,8 @@ import google_maps_flutter_ios_sdk9_objc let assetName = "fakeImageName" let assetProvider = TestAssetProvider(image: testImage, forAssetName: assetName, package: nil) - let bitmap = FGMPlatformBitmapAssetMap.make( - withAssetName: assetName, + let bitmap = PlatformBitmapAssetMap( + assetName: assetName, bitmapScaling: .auto, imagePixelRatio: 10, width: nil, @@ -52,7 +51,7 @@ import google_maps_flutter_ios_sdk9_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( + let resultImage = PlatformBitmap(bitmap: bitmap).createIcon( assetProvider: assetProvider, screenScale: screenScale ) @@ -71,17 +70,17 @@ import google_maps_flutter_ios_sdk9_objc let assetProvider = TestAssetProvider(image: testImage, forAssetName: assetName, package: nil) let width: CGFloat = 15.0 - let bitmap = FGMPlatformBitmapAssetMap.make( - withAssetName: assetName, + let bitmap = PlatformBitmapAssetMap( + assetName: assetName, bitmapScaling: .auto, imagePixelRatio: 1, - width: width as NSNumber, + width: width, height: nil ) let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( + let resultImage = PlatformBitmap(bitmap: bitmap).createIcon( assetProvider: assetProvider, screenScale: screenScale ) @@ -105,17 +104,17 @@ import google_maps_flutter_ios_sdk9_objc let width: CGFloat = 15.0 let height: CGFloat = 45.0 - let bitmap = FGMPlatformBitmapAssetMap.make( - withAssetName: assetName, + let bitmap = PlatformBitmapAssetMap( + assetName: assetName, bitmapScaling: .auto, imagePixelRatio: 1, - width: width as NSNumber, - height: height as NSNumber + width: width, + height: height ) let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( + let resultImage = PlatformBitmap(bitmap: bitmap).createIcon( assetProvider: assetProvider, screenScale: screenScale ) @@ -131,8 +130,8 @@ import google_maps_flutter_ios_sdk9_objc let assetName = "fakeImageName" let assetProvider = TestAssetProvider(image: testImage, forAssetName: assetName, package: nil) - let bitmap = FGMPlatformBitmapAssetMap.make( - withAssetName: assetName, + let bitmap = PlatformBitmapAssetMap( + assetName: assetName, bitmapScaling: .none, imagePixelRatio: 1, width: nil, @@ -141,7 +140,7 @@ import google_maps_flutter_ios_sdk9_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( + let resultImage = PlatformBitmap(bitmap: bitmap).createIcon( assetProvider: assetProvider, screenScale: screenScale ) @@ -157,8 +156,8 @@ import google_maps_flutter_ios_sdk9_objc let pngData = try #require(testImage.pngData()) let typedData = FlutterStandardTypedData(bytes: pngData) - let bitmap = FGMPlatformBitmapBytesMap.make( - withByteData: typedData, + let bitmap = PlatformBitmapBytesMap( + byteData: typedData, bitmapScaling: .auto, imagePixelRatio: 1, width: nil, @@ -167,7 +166,7 @@ import google_maps_flutter_ios_sdk9_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( + let resultImage = PlatformBitmap(bitmap: bitmap).createIcon( assetProvider: TestAssetProvider(), screenScale: screenScale ) @@ -183,8 +182,8 @@ import google_maps_flutter_ios_sdk9_objc let pngData = try #require(testImage.pngData()) let typedData = FlutterStandardTypedData(bytes: pngData) - let bitmap = FGMPlatformBitmapBytesMap.make( - withByteData: typedData, + let bitmap = PlatformBitmapBytesMap( + byteData: typedData, bitmapScaling: .auto, imagePixelRatio: 10, width: nil, @@ -193,7 +192,7 @@ import google_maps_flutter_ios_sdk9_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( + let resultImage = PlatformBitmap(bitmap: bitmap).createIcon( assetProvider: TestAssetProvider(), screenScale: screenScale ) @@ -210,17 +209,17 @@ import google_maps_flutter_ios_sdk9_objc let width: CGFloat = 15.0 let height: CGFloat = 15.0 let typedData = FlutterStandardTypedData(bytes: pngData) - let bitmap = FGMPlatformBitmapBytesMap.make( - withByteData: typedData, + let bitmap = PlatformBitmapBytesMap( + byteData: typedData, bitmapScaling: .auto, imagePixelRatio: 1, - width: width as NSNumber, - height: height as NSNumber + width: width, + height: height ) let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( + let resultImage = PlatformBitmap(bitmap: bitmap).createIcon( assetProvider: TestAssetProvider(), screenScale: screenScale ) @@ -244,17 +243,17 @@ import google_maps_flutter_ios_sdk9_objc let width: CGFloat = 15.0 let height: CGFloat = 45.0 let typedData = FlutterStandardTypedData(bytes: pngData) - let bitmap = FGMPlatformBitmapBytesMap.make( - withByteData: typedData, + let bitmap = PlatformBitmapBytesMap( + byteData: typedData, bitmapScaling: .auto, imagePixelRatio: 1, - width: width as NSNumber, - height: height as NSNumber + width: width, + height: height ) let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( + let resultImage = PlatformBitmap(bitmap: bitmap).createIcon( assetProvider: TestAssetProvider(), screenScale: screenScale ) @@ -269,8 +268,8 @@ import google_maps_flutter_ios_sdk9_objc let pngData = try #require(testImage.pngData()) let typedData = FlutterStandardTypedData(bytes: pngData) - let bitmap = FGMPlatformBitmapBytesMap.make( - withByteData: typedData, + let bitmap = PlatformBitmapBytesMap( + byteData: typedData, bitmapScaling: .none, imagePixelRatio: 1, width: nil, @@ -279,7 +278,7 @@ import google_maps_flutter_ios_sdk9_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( + let resultImage = PlatformBitmap(bitmap: bitmap).createIcon( assetProvider: TestAssetProvider(), screenScale: screenScale ) @@ -294,12 +293,12 @@ import google_maps_flutter_ios_sdk9_objc @Test func extractIconFromPinConfigWithGlyphColor() { let assetProvider = TestAssetProvider() - let backgroundColor = FGMPlatformColor.make(withRed: 0.0, green: 1.0, blue: 1.0, alpha: 1.0) - let borderColor = FGMPlatformColor.make(withRed: 1.0, green: 0.0, blue: 1.0, alpha: 1.0) - let glyphColor = FGMPlatformColor.make(withRed: 0.1, green: 0.2, blue: 0.3, alpha: 1.0) + let backgroundColor = PlatformColor(red: 0.0, green: 1.0, blue: 1.0, alpha: 1.0) + let borderColor = PlatformColor(red: 1.0, green: 0.0, blue: 1.0, alpha: 1.0) + let glyphColor = PlatformColor(red: 0.1, green: 0.2, blue: 0.3, alpha: 1.0) - let pinConfig = FGMPlatformBitmapPinConfig.make( - withBackgroundColor: backgroundColor, + let pinConfig = PlatformBitmapPinConfig( + backgroundColor: backgroundColor, borderColor: borderColor, glyphColor: glyphColor, glyphTextColor: nil, @@ -309,7 +308,7 @@ import google_maps_flutter_ios_sdk9_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: pinConfig).createIcon( + let resultImage = PlatformBitmap(bitmap: pinConfig).createIcon( assetProvider: assetProvider, screenScale: screenScale ) @@ -324,10 +323,10 @@ import google_maps_flutter_ios_sdk9_objc @Test func extractIconFromPinConfigWithGlyphText() { let assetProvider = TestAssetProvider() - let glyphTextColor = FGMPlatformColor.make(withRed: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) + let glyphTextColor = PlatformColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) - let pinConfig = FGMPlatformBitmapPinConfig.make( - withBackgroundColor: nil, + let pinConfig = PlatformBitmapPinConfig( + backgroundColor: nil, borderColor: nil, glyphColor: nil, glyphTextColor: glyphTextColor, @@ -337,7 +336,7 @@ import google_maps_flutter_ios_sdk9_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: pinConfig).createIcon( + let resultImage = PlatformBitmap(bitmap: pinConfig).createIcon( assetProvider: assetProvider, screenScale: screenScale ) @@ -355,20 +354,20 @@ import google_maps_flutter_ios_sdk9_objc let assetName = "fakeImageNameKey" let assetProvider = TestAssetProvider(image: testImage, forAssetName: assetName, package: nil) - let assetBitmap = FGMPlatformBitmapAssetMap.make( - withAssetName: assetName, + let assetBitmap = PlatformBitmapAssetMap( + assetName: assetName, bitmapScaling: .auto, imagePixelRatio: 1, width: nil, height: nil ) - let glyphBitmap = FGMPlatformBitmap.make(withBitmap: assetBitmap) + let glyphBitmap = PlatformBitmap(bitmap: assetBitmap) - let backgroundColor = FGMPlatformColor.make(withRed: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) - let borderColor = FGMPlatformColor.make(withRed: 0.0, green: 0.0, blue: 0.0, alpha: 1.0) + let backgroundColor = PlatformColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) + let borderColor = PlatformColor(red: 0.0, green: 0.0, blue: 0.0, alpha: 1.0) - let pinConfig = FGMPlatformBitmapPinConfig.make( - withBackgroundColor: backgroundColor, + let pinConfig = PlatformBitmapPinConfig( + backgroundColor: backgroundColor, borderColor: borderColor, glyphColor: nil, glyphTextColor: nil, @@ -378,7 +377,7 @@ import google_maps_flutter_ios_sdk9_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: pinConfig).createIcon( + let resultImage = PlatformBitmap(bitmap: pinConfig).createIcon( assetProvider: assetProvider, screenScale: screenScale ) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GoogleMapsTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GoogleMapsTests.swift index 3a83d60dbab3..42b4cf50ce58 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GoogleMapsTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GoogleMapsTests.swift @@ -5,7 +5,6 @@ import Flutter import GoogleMaps import Testing -import google_maps_flutter_ios_sdk9_objc @testable import google_maps_flutter_ios_sdk9 @@ -129,12 +128,10 @@ class StubPluginRegistrar: NSObject, FlutterPluginRegistrar { let mockTransactionWrapper = MockCATransaction() controller.callHandler.transactionWrapper = mockTransactionWrapper - let zoomTo = FGMPlatformCameraUpdateZoomTo.make(withZoom: 10.0) - let cameraUpdate = FGMPlatformCameraUpdate.make(withCameraUpdate: zoomTo) - var error: FlutterError? = nil + let zoomTo = PlatformCameraUpdateZoomTo(zoom: 10.0) + let cameraUpdate = PlatformCameraUpdate(cameraUpdate: zoomTo) - controller.callHandler.animateCamera(with: cameraUpdate, duration: nil, error: &error) - #expect(error == nil) + try controller.callHandler.animateCamera(cameraUpdate, duration: nil) #expect(mapView.didAnimateCamera) #expect(!mockTransactionWrapper.beginCalled) #expect(!mockTransactionWrapper.commitCalled) @@ -161,21 +158,15 @@ class StubPluginRegistrar: NSObject, FlutterPluginRegistrar { let mockTransactionWrapper = MockCATransaction() controller.callHandler.transactionWrapper = mockTransactionWrapper - let zoomTo = FGMPlatformCameraUpdateZoomTo.make(withZoom: 10.0) - let cameraUpdate = FGMPlatformCameraUpdate.make(withCameraUpdate: zoomTo) - var error: FlutterError? = nil + let zoomTo = PlatformCameraUpdateZoomTo(zoom: 10.0) + let cameraUpdate = PlatformCameraUpdate(cameraUpdate: zoomTo) - let durationMilliseconds: NSNumber = 100 - controller.callHandler.animateCamera( - with: cameraUpdate, - duration: durationMilliseconds, - error: &error - ) - #expect(error == nil) + let durationMilliseconds: Int64 = 100 + try controller.callHandler.animateCamera(cameraUpdate, duration: durationMilliseconds) #expect(mapView.didAnimateCamera) #expect(mockTransactionWrapper.beginCalled) #expect(mockTransactionWrapper.commitCalled) - #expect(mockTransactionWrapper.animationDuration == durationMilliseconds.doubleValue / 1000) + #expect(mockTransactionWrapper.animationDuration == Double(durationMilliseconds) / 1000) } @Test func inspectorAPICameraPosition() throws { @@ -201,9 +192,7 @@ class StubPluginRegistrar: NSObject, FlutterPluginRegistrar { let inspector = MapInspector(messenger: binaryMessenger, pigeonSuffix: "0") inspector.controller = controller - var error: FlutterError? = nil - let cameraPosition = try #require(inspector.cameraPosition(&error)) - #expect(error == nil) + let cameraPosition = try inspector.cameraPosition() #expect(cameraPosition.target.latitude == initialCameraPosition.target.latitude) #expect(cameraPosition.target.longitude == initialCameraPosition.target.longitude) @@ -212,16 +201,16 @@ class StubPluginRegistrar: NSObject, FlutterPluginRegistrar { /// Creates an empty creation parameters object for tests where the values don't matter, just that /// there's a valid object to pass in. - private func emptyCreationParameters() -> FGMPlatformMapViewCreationParams { - return FGMPlatformMapViewCreationParams.make( - withInitialCameraPosition: FGMPlatformCameraPosition.make( - withBearing: 0.0, - target: FGMPlatformLatLng.make(withLatitude: 0.0, longitude: 0.0), + private func emptyCreationParameters() -> PlatformMapViewCreationParams { + return PlatformMapViewCreationParams( + initialCameraPosition: PlatformCameraPosition( + bearing: 0.0, + target: PlatformLatLng(latitude: 0.0, longitude: 0.0), tilt: 0.0, zoom: 0.0 ), - mapConfiguration: FGMPlatformMapConfiguration.make( - withCompassEnabled: nil, + mapConfiguration: PlatformMapConfiguration( + compassEnabled: nil, cameraTargetBounds: nil, mapType: nil, minMaxZoomPreference: nil, @@ -288,8 +277,8 @@ class StubPluginRegistrar: NSObject, FlutterPluginRegistrar { #expect(controller.styleError != nil) // Update config without style - let config = FGMPlatformMapConfiguration.make( - withCompassEnabled: true, + let config = PlatformMapConfiguration( + compassEnabled: true, cameraTargetBounds: nil, mapType: nil, minMaxZoomPreference: nil, diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GroundOverlayControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GroundOverlayControllerTests.swift index 8223f32486b3..8b56f666de34 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GroundOverlayControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GroundOverlayControllerTests.swift @@ -4,7 +4,6 @@ import GoogleMaps import Testing -import google_maps_flutter_ios_sdk9_objc @testable import google_maps_flutter_ios_sdk9 @@ -76,18 +75,16 @@ import google_maps_flutter_ios_sdk9_objc let (groundOverlayController, mapView) = try GroundOverlayControllerTests.groundOverlayControllerWithPositionWithMockedMap() - let position = FGMPlatformLatLng.make(withLatitude: 52.4816, longitude: 3.1791) + let position = PlatformLatLng(latitude: 52.4816, longitude: 3.1791) - let bitmap = FGMPlatformBitmap.make( - withBitmap: FGMPlatformBitmapDefaultMarker.make(withHue: 0) - ) + let bitmap = PlatformBitmap(bitmap: PlatformBitmapDefaultMarker(hue: 0)) - let platformGroundOverlay = FGMPlatformGroundOverlay.make( - withGroundOverlayId: "id_1", + let platformGroundOverlay = PlatformGroundOverlay( + groundOverlayId: "id_1", image: bitmap, position: position, bounds: nil, - anchor: FGMPlatformPoint.makeWith(x: 0.5, y: 0.5), + anchor: PlatformPoint(x: 0.5, y: 0.5), transparency: 0.5, bearing: 65.0, zIndex: 2, @@ -116,7 +113,7 @@ import google_maps_flutter_ios_sdk9_objc #expect(abs(groundOverlayController.groundOverlay.anchor.y - 0.5) <= Double.ulpOfOne) #expect(groundOverlayController.groundOverlay.zIndex == Int32(platformGroundOverlay.zIndex)) - let convertedPlatformGroundOverlay = FGMPlatformGroundOverlay.make( + let convertedPlatformGroundOverlay = PlatformGroundOverlay.make( from: groundOverlayController.groundOverlay, overlayId: "id_1", isCreatedWithBounds: false, @@ -128,7 +125,7 @@ import google_maps_flutter_ios_sdk9_objc #expect( abs(convertedPlatformGroundOverlay.position!.longitude - position.longitude) <= Double.ulpOfOne) - #expect(convertedPlatformGroundOverlay.zoomLevel!.doubleValue == 14.0) + #expect(convertedPlatformGroundOverlay.zoomLevel == 14.0) #expect(convertedPlatformGroundOverlay.transparency == platformGroundOverlay.transparency) #expect(convertedPlatformGroundOverlay.bearing == platformGroundOverlay.bearing) #expect(abs(convertedPlatformGroundOverlay.anchor!.x - 0.5) <= Double.ulpOfOne) @@ -141,21 +138,19 @@ import google_maps_flutter_ios_sdk9_objc let (groundOverlayController, mapView) = try GroundOverlayControllerTests.groundOverlayControllerWithBoundsWithMockedMap() - let bounds = FGMPlatformLatLngBounds.make( - withNortheast: FGMPlatformLatLng.make(withLatitude: 54.4816, longitude: 5.1791), - southwest: FGMPlatformLatLng.make(withLatitude: 52.4816, longitude: 3.1791) + let bounds = PlatformLatLngBounds( + northeast: PlatformLatLng(latitude: 54.4816, longitude: 5.1791), + southwest: PlatformLatLng(latitude: 52.4816, longitude: 3.1791) ) - let bitmap = FGMPlatformBitmap.make( - withBitmap: FGMPlatformBitmapDefaultMarker.make(withHue: 0) - ) + let bitmap = PlatformBitmap(bitmap: PlatformBitmapDefaultMarker(hue: 0)) - let platformGroundOverlay = FGMPlatformGroundOverlay.make( - withGroundOverlayId: "id_1", + let platformGroundOverlay = PlatformGroundOverlay( + groundOverlayId: "id_1", image: bitmap, position: nil, bounds: bounds, - anchor: FGMPlatformPoint.makeWith(x: 0.5, y: 0.5), + anchor: PlatformPoint(x: 0.5, y: 0.5), transparency: 0.5, bearing: 65.0, zIndex: 2, @@ -183,7 +178,7 @@ import google_maps_flutter_ios_sdk9_objc #expect(abs(groundOverlayController.groundOverlay.anchor.y - 0.5) <= Double.ulpOfOne) #expect(groundOverlayController.groundOverlay.zIndex == Int32(platformGroundOverlay.zIndex)) - let convertedPlatformGroundOverlay = FGMPlatformGroundOverlay.make( + let convertedPlatformGroundOverlay = PlatformGroundOverlay.make( from: groundOverlayController.groundOverlay, overlayId: "id_1", isCreatedWithBounds: true, @@ -214,17 +209,15 @@ import google_maps_flutter_ios_sdk9_objc let groundOverlay = PropertyOrderValidatingGroundOverlay() GroundOverlayController.update( groundOverlay, - from: FGMPlatformGroundOverlay.make( - withGroundOverlayId: "groundOverlay", - image: FGMPlatformBitmap.make( - withBitmap: FGMPlatformBitmapDefaultMarker.make(withHue: 0) - ), - position: FGMPlatformLatLng.make(withLatitude: 0, longitude: 0), - bounds: FGMPlatformLatLngBounds.make( - withNortheast: FGMPlatformLatLng.make(withLatitude: 54.4816, longitude: 5.1791), - southwest: FGMPlatformLatLng.make(withLatitude: 52.4816, longitude: 3.1791) + from: PlatformGroundOverlay( + groundOverlayId: "groundOverlay", + image: PlatformBitmap(bitmap: PlatformBitmapDefaultMarker(hue: 0)), + position: PlatformLatLng(latitude: 0, longitude: 0), + bounds: PlatformLatLngBounds( + northeast: PlatformLatLng(latitude: 54.4816, longitude: 5.1791), + southwest: PlatformLatLng(latitude: 52.4816, longitude: 3.1791) ), - anchor: FGMPlatformPoint.makeWith(x: 0.5, y: 0.5), + anchor: PlatformPoint(x: 0.5, y: 0.5), transparency: 0.5, bearing: 65.0, zIndex: 2, diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/HeatmapControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/HeatmapControllerTests.swift index bbfe98e7857e..6fa4380fd25a 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/HeatmapControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/HeatmapControllerTests.swift @@ -5,7 +5,6 @@ import GoogleMaps import GoogleMapsUtils import Testing -import google_maps_flutter_ios_sdk9_objc @testable import google_maps_flutter_ios_sdk9 @@ -13,25 +12,25 @@ import google_maps_flutter_ios_sdk9_objc @Test func updateHeatmapSetsVisibilityLast() { let heatmap = PropertyOrderValidatingHeatmap() - let gradient = FGMPlatformHeatmapGradient.make( - with: [ - FGMPlatformColor.make(withRed: 0, green: 0, blue: 0, alpha: 0), - FGMPlatformColor.make(withRed: 1.0, green: 1.0, blue: 1.0, alpha: 1.0), + let gradient = PlatformHeatmapGradient( + colors: [ + PlatformColor(red: 0, green: 0, blue: 0, alpha: 0), + PlatformColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0), ], - startPoints: [0 as NSNumber, 1 as NSNumber], + startPoints: [0, 1], colorMapSize: 256 ) HeatmapController.update( heatmap, - from: FGMPlatformHeatmap.make( - withHeatmapId: "heatmap", + from: PlatformHeatmap( + heatmapId: "heatmap", data: [ - FGMPlatformWeightedLatLng.make( - withPoint: FGMPlatformLatLng.make(withLatitude: 5.0, longitude: 5.0), + PlatformWeightedLatLng( + point: PlatformLatLng(latitude: 5.0, longitude: 5.0), weight: 0.5 ), - FGMPlatformWeightedLatLng.make( - withPoint: FGMPlatformLatLng.make(withLatitude: 10.0, longitude: 10.0), + PlatformWeightedLatLng( + point: PlatformLatLng(latitude: 10.0, longitude: 10.0), weight: 0.75 ), ], diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/MarkerControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/MarkerControllerTests.swift index 48b11088a1d0..91b8e7304c8d 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/MarkerControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/MarkerControllerTests.swift @@ -4,7 +4,6 @@ import GoogleMaps import Testing -import google_maps_flutter_ios_sdk9_objc @testable import google_maps_flutter_ios_sdk9 @@ -18,7 +17,7 @@ import google_maps_flutter_ios_sdk9_objc return PartiallyMockedMapView(options: mapViewOptions) } - /// Returns a FGMMarkersController instance instantiated with the given map view. + /// Returns a MarkersController instance instantiated with the given map view. /// /// The mapView should outlive the controller, as the controller keeps a weak reference to it. func markersController( @@ -34,8 +33,8 @@ import google_maps_flutter_ios_sdk9_objc ) } - func placeholderBitmap() -> FGMPlatformBitmap { - return FGMPlatformBitmap.make(withBitmap: FGMPlatformBitmapDefaultMarker.make(withHue: 0)) + func placeholderBitmap() -> PlatformBitmap { + return PlatformBitmap(bitmap: PlatformBitmapDefaultMarker(hue: 0)) } @Test func setsMarkerNumericProperties() throws { @@ -48,23 +47,23 @@ import google_maps_flutter_ios_sdk9_objc let anchorY = 2.718 let alpha = 0.4 let rotation = 90.0 - let zIndex = 3 + let zIndex: Int64 = 3 let latitude = 10.0 let longitude = 20.0 controller.add([ - FGMPlatformMarker.make( - withAlpha: alpha, - anchor: FGMPlatformPoint.makeWith(x: anchorX, y: anchorY), + PlatformMarker( + alpha: alpha, + anchor: PlatformPoint(x: anchorX, y: anchorY), consumeTapEvents: true, draggable: true, flat: true, icon: placeholderBitmap(), - infoWindow: FGMPlatformInfoWindow.make( - withTitle: "info title", + infoWindow: PlatformInfoWindow( + title: "info title", snippet: "info snippet", - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0) + anchor: PlatformPoint(x: 0, y: 0) ), - position: FGMPlatformLatLng.make(withLatitude: latitude, longitude: longitude), + position: PlatformLatLng(latitude: latitude, longitude: longitude), rotation: rotation, visible: true, zIndex: zIndex, @@ -94,19 +93,19 @@ import google_maps_flutter_ios_sdk9_objc let markerIdentifier = "marker" controller.add([ - FGMPlatformMarker.make( - withAlpha: 1.0, - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0), + PlatformMarker( + alpha: 1.0, + anchor: PlatformPoint(x: 0, y: 0), consumeTapEvents: false, draggable: true, flat: false, icon: placeholderBitmap(), - infoWindow: FGMPlatformInfoWindow.make( - withTitle: "info title", + infoWindow: PlatformInfoWindow( + title: "info title", snippet: "info snippet", - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0) + anchor: PlatformPoint(x: 0, y: 0) ), - position: FGMPlatformLatLng.make(withLatitude: 0.0, longitude: 0.0), + position: PlatformLatLng(latitude: 0.0, longitude: 0.0), rotation: 0, visible: false, zIndex: 0, @@ -131,19 +130,19 @@ import google_maps_flutter_ios_sdk9_objc let markerIdentifier = "marker" controller.add([ - FGMPlatformMarker.make( - withAlpha: 1.0, - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0), + PlatformMarker( + alpha: 1.0, + anchor: PlatformPoint(x: 0, y: 0), consumeTapEvents: false, draggable: false, flat: true, icon: placeholderBitmap(), - infoWindow: FGMPlatformInfoWindow.make( - withTitle: "info title", + infoWindow: PlatformInfoWindow( + title: "info title", snippet: "info snippet", - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0) + anchor: PlatformPoint(x: 0, y: 0) ), - position: FGMPlatformLatLng.make(withLatitude: 0.0, longitude: 0.0), + position: PlatformLatLng(latitude: 0.0, longitude: 0.0), rotation: 0, visible: false, zIndex: 0, @@ -168,19 +167,19 @@ import google_maps_flutter_ios_sdk9_objc let markerIdentifier = "marker" controller.add([ - FGMPlatformMarker.make( - withAlpha: 1.0, - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0), + PlatformMarker( + alpha: 1.0, + anchor: PlatformPoint(x: 0, y: 0), consumeTapEvents: false, draggable: false, flat: false, icon: placeholderBitmap(), - infoWindow: FGMPlatformInfoWindow.make( - withTitle: "info title", + infoWindow: PlatformInfoWindow( + title: "info title", snippet: "info snippet", - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0) + anchor: PlatformPoint(x: 0, y: 0) ), - position: FGMPlatformLatLng.make(withLatitude: 0.0, longitude: 0.0), + position: PlatformLatLng(latitude: 0.0, longitude: 0.0), rotation: 0, visible: true, zIndex: 0, @@ -208,19 +207,19 @@ import google_maps_flutter_ios_sdk9_objc let anchorX = 3.14 let anchorY = 2.718 controller.add([ - FGMPlatformMarker.make( - withAlpha: 1.0, - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0), + PlatformMarker( + alpha: 1.0, + anchor: PlatformPoint(x: 0, y: 0), consumeTapEvents: true, draggable: true, flat: true, icon: placeholderBitmap(), - infoWindow: FGMPlatformInfoWindow.make( - withTitle: title, + infoWindow: PlatformInfoWindow( + title: title, snippet: snippet, - anchor: FGMPlatformPoint.makeWith(x: anchorX, y: anchorY) + anchor: PlatformPoint(x: anchorX, y: anchorY) ), - position: FGMPlatformLatLng.make(withLatitude: 0, longitude: 0), + position: PlatformLatLng(latitude: 0, longitude: 0), rotation: 0, visible: true, zIndex: 0, @@ -242,24 +241,22 @@ import google_maps_flutter_ios_sdk9_objc @Test func updateMarkerSetsVisibilityLast() { let marker = PropertyOrderValidatingAdvancedMarker() - let collisionBehavior = FGMPlatformMarkerCollisionBehaviorBox( - value: .requiredAndHidesOptional - ) + let collisionBehavior = PlatformMarkerCollisionBehavior.requiredAndHidesOptional MarkerController.update( marker, - from: FGMPlatformMarker.make( - withAlpha: 1.0, - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0), + from: PlatformMarker( + alpha: 1.0, + anchor: PlatformPoint(x: 0, y: 0), consumeTapEvents: true, draggable: true, flat: true, icon: placeholderBitmap(), - infoWindow: FGMPlatformInfoWindow.make( - withTitle: "info title", + infoWindow: PlatformInfoWindow( + title: "info title", snippet: "info snippet", - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0) + anchor: PlatformPoint(x: 0, y: 0) ), - position: FGMPlatformLatLng.make(withLatitude: 0, longitude: 0), + position: PlatformLatLng(latitude: 0, longitude: 0), rotation: 0, visible: true, zIndex: 0, diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/PolygonControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/PolygonControllerTests.swift index 4ce8f46fe6e2..fb14690c42c7 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/PolygonControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/PolygonControllerTests.swift @@ -4,7 +4,6 @@ import GoogleMaps import Testing -import google_maps_flutter_ios_sdk9_objc @testable import google_maps_flutter_ios_sdk9 @@ -14,15 +13,15 @@ import google_maps_flutter_ios_sdk9_objc let polygon = PropertyOrderValidatingPolygon() PolygonController.update( polygon, - from: FGMPlatformPolygon.make( - withPolygonId: "polygon", + from: PlatformPolygon( + polygonId: "polygon", consumesTapEvents: false, - fill: FGMPlatformColor.make(withRed: 0, green: 0, blue: 0, alpha: 0), + fillColor: PlatformColor(red: 0, green: 0, blue: 0, alpha: 0), geodesic: false, points: [], holes: [], visible: true, - stroke: FGMPlatformColor.make(withRed: 0, green: 0, blue: 0, alpha: 0), + strokeColor: PlatformColor(red: 0, green: 0, blue: 0, alpha: 0), strokeWidth: 0, zIndex: 0 ), diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/PolylineControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/PolylineControllerTests.swift index 6012e3d9d6e4..d0df052f4247 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/PolylineControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/PolylineControllerTests.swift @@ -4,7 +4,6 @@ import GoogleMaps import Testing -import google_maps_flutter_ios_sdk9_objc @testable import google_maps_flutter_ios_sdk9 @@ -13,15 +12,15 @@ import google_maps_flutter_ios_sdk9_objc @Test func patternsSetSpans() { let mapView = PolylineControllerTests.mapView() - let polyline = FGMPlatformPolyline.make( - withPolylineId: "polyline_id_0", + let polyline = PlatformPolyline( + polylineId: "polyline_id_0", consumesTapEvents: false, - color: FGMPlatformColor.make(withRed: 0, green: 0, blue: 0, alpha: 0), + color: PlatformColor(red: 0, green: 0, blue: 0, alpha: 0), geodesic: false, jointType: .round, patterns: [ - FGMPlatformPatternItem.make(with: .dot, length: 10), - FGMPlatformPatternItem.make(with: .dash, length: 10), + PlatformPatternItem(type: .dot, length: 10), + PlatformPatternItem(type: .dash, length: 10), ], points: PolylineControllerTests.polylinePoints(), visible: true, @@ -46,10 +45,10 @@ import google_maps_flutter_ios_sdk9_objc let polyline = PropertyOrderValidatingPolyline() PolylineController.update( polyline, - from: FGMPlatformPolyline.make( - withPolylineId: "polyline", + from: PlatformPolyline( + polylineId: "polyline", consumesTapEvents: false, - color: FGMPlatformColor.make(withRed: 0, green: 0, blue: 0, alpha: 0), + color: PlatformColor(red: 0, green: 0, blue: 0, alpha: 0), geodesic: false, jointType: .round, patterns: [], @@ -72,12 +71,12 @@ import google_maps_flutter_ios_sdk9_objc } /// Returns a set of points to use for tests that need a valid but arbitrary line. - static func polylinePoints() -> [FGMPlatformLatLng] { + static func polylinePoints() -> [PlatformLatLng] { return [ - FGMPlatformLatLng.make(withLatitude: 52.4816, longitude: -3.1791), - FGMPlatformLatLng.make(withLatitude: 54.043, longitude: -2.9925), - FGMPlatformLatLng.make(withLatitude: 54.1396, longitude: -4.2739), - FGMPlatformLatLng.make(withLatitude: 53.4153, longitude: -4.0829), + PlatformLatLng(latitude: 52.4816, longitude: -3.1791), + PlatformLatLng(latitude: 54.043, longitude: -2.9925), + PlatformLatLng(latitude: 54.1396, longitude: -4.2739), + PlatformLatLng(latitude: 53.4153, longitude: -4.0829), ] } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift index 0c9f5b07d82f..76576b6f45cf 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift @@ -3,37 +3,36 @@ // found in the LICENSE file. import Foundation -import google_maps_flutter_ios_sdk9_objc @testable import google_maps_flutter_ios_sdk9 -/// Fake implementation of FGMMapEventDelegate for unit tests. +/// Fake implementation of MapEventDelegate for unit tests. class TestMapEventHandler: MapEventDelegate { func didStartCameraMove() {} - func didMoveCamera(to cameraPosition: FGMPlatformCameraPosition) {} + func didMoveCamera(to cameraPosition: PlatformCameraPosition) {} func didIdleCamera() {} - func didTap(at position: FGMPlatformLatLng) {} + func didTap(at position: PlatformLatLng) {} - func didLongPress(at position: FGMPlatformLatLng) {} + func didLongPress(at position: PlatformLatLng) {} func didTapMarker(withIdentifier markerId: String) {} func didStartDragForMarker( - withIdentifier markerId: String, at position: FGMPlatformLatLng + withIdentifier markerId: String, at position: PlatformLatLng ) {} - func didDragMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) {} + func didDragMarker(withIdentifier markerId: String, at position: PlatformLatLng) {} - func didEndDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) {} + func didEndDragForMarker(withIdentifier markerId: String, at position: PlatformLatLng) {} func didTapInfoWindowOfMarker(withIdentifier markerId: String) {} func didTapCircle(withIdentifier circleId: String) {} - func didTapCluster(_ cluster: FGMPlatformCluster) {} + func didTapCluster(_ cluster: PlatformCluster) {} func didTapPolygon(withIdentifier polygonId: String) {} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TileOverlayControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TileOverlayControllerTests.swift index 2f44cbfb166e..37f49323add8 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TileOverlayControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TileOverlayControllerTests.swift @@ -4,7 +4,6 @@ import GoogleMaps import Testing -import google_maps_flutter_ios_sdk9_objc @testable import google_maps_flutter_ios_sdk9 @@ -14,8 +13,8 @@ import google_maps_flutter_ios_sdk9_objc let tileLayer = PropertyOrderValidatingTileLayer() TileOverlayController.update( tileLayer, - from: FGMPlatformTileOverlay.make( - withTileOverlayId: "overlay", + from: PlatformTileOverlay( + tileOverlayId: "overlay", fadeIn: false, transparency: 0.5, zIndex: 0, diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TileProviderControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TileProviderControllerTests.swift index d17866f837a9..bd5fcf4ccbc0 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TileProviderControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TileProviderControllerTests.swift @@ -5,7 +5,6 @@ import Flutter import GoogleMaps import Testing -import google_maps_flutter_ios_sdk9_objc @testable import google_maps_flutter_ios_sdk9 @@ -28,9 +27,9 @@ class TestTileProvider: NSObject, TileProviderDelegate { func tile( withOverlayIdentifier tileOverlayId: String, - location: FGMPlatformPoint, - zoom: Int, - completion: @escaping (FGMPlatformTile?, FlutterError?) -> Void + location: PlatformPoint, + zoom: Int64, + completion: @escaping (Result) -> Void ) { #expect(Thread.isMainThread) onTileCalled() diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9.podspec b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9.podspec index b4e7b8abe4e6..eb38d5648233 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9.podspec +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9.podspec @@ -14,8 +14,7 @@ Downloaded by pub (not CocoaPods). s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_ios_sdk9' } s.documentation_url = 'https://pub.dev/packages/google_maps_flutter_ios_sdk9' - s.source_files = 'google_maps_flutter_ios_sdk9/Sources/**/*.{h,m,swift}' - s.public_header_files = 'google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/**/*.h' + s.source_files = 'google_maps_flutter_ios_sdk9/Sources/**/*.{swift}' s.dependency 'Flutter' s.dependency 'GoogleMaps', '~> 9.2' # Google-Maps-iOS-Utils 6.0 and 6.1.0 support GoogleMaps 9.x. The next release diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Package.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Package.swift index 959d55efd801..555493f83122 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Package.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Package.swift @@ -24,7 +24,6 @@ let package = Package( .target( name: "google_maps_flutter_ios_sdk9", dependencies: [ - "google_maps_flutter_ios_sdk9_objc", .product( name: "GoogleMapsUtils", package: "google-maps-ios-utils" @@ -37,22 +36,6 @@ let package = Package( resources: [ .process("Resources") ] - ), - .target( - name: "google_maps_flutter_ios_sdk9_objc", - dependencies: [ - .product( - name: "GoogleMapsUtils", - package: "google-maps-ios-utils" - ), - .product( - name: "GoogleMaps", - package: "ios-maps-sdk" - ), - ], - cSettings: [ - .headerSearchPath("include/google_maps_flutter_ios_sdk9_objc") - ] - ), + ) ] ) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/CircleController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/CircleController.swift index 0829d3055761..956882a26bb8 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/CircleController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/CircleController.swift @@ -4,16 +4,12 @@ import GoogleMaps -#if canImport(google_maps_flutter_ios_sdk9_objc) - import google_maps_flutter_ios_sdk9_objc -#endif - /// Defines circle controllable by Flutter. class CircleController: NSObject { let circle: GMSCircle private weak var mapView: GMSMapView? - init(circle: FGMPlatformCircle, mapView: GMSMapView) { + init(circle: PlatformCircle, mapView: GMSMapView) { self.circle = GMSCircle() self.mapView = mapView self.circle.userData = [circle.circleId] @@ -25,20 +21,20 @@ class CircleController: NSObject { circle.map = nil } - /// Updates the controller's circle with the properties from a FGMPlatformCircle. + /// Updates the controller's circle with the properties from a PlatformCircle. /// /// Setting the circle to visible will set its map to the given mapView. - func update(from platformCircle: FGMPlatformCircle) { + func update(from platformCircle: PlatformCircle) { if let mapView = mapView { CircleController.update(circle, from: platformCircle, with: mapView) } } - /// Updates the given GMSCircle with the properties from a FGMPlatformCircle. + /// Updates the given GMSCircle with the properties from a PlatformCircle. /// /// Setting the circle to visible will set its map to the given mapView. static func update( - _ circle: GMSCircle, from platformCircle: FGMPlatformCircle, with mapView: GMSMapView + _ circle: GMSCircle, from platformCircle: PlatformCircle, with mapView: GMSMapView ) { circle.isTappable = platformCircle.consumeTapEvents circle.zIndex = Int32(platformCircle.zIndex) @@ -64,14 +60,14 @@ class CirclesController: NSObject { super.init() } - func add(_ circles: [FGMPlatformCircle]) { + func add(_ circles: [PlatformCircle]) { guard let mapView = mapView else { return } for circle in circles { circleIdToController[circle.circleId] = CircleController(circle: circle, mapView: mapView) } } - func change(_ circles: [FGMPlatformCircle]) { + func change(_ circles: [PlatformCircle]) { for circle in circles { circleIdToController[circle.circleId]?.update(from: circle) } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ClusterManagersController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ClusterManagersController.swift index 9e057bff71fc..0e33f2c4d9a3 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ClusterManagersController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ClusterManagersController.swift @@ -6,10 +6,6 @@ import Flutter import GoogleMaps import GoogleMapsUtils -#if canImport(google_maps_flutter_ios_sdk9_objc) - import google_maps_flutter_ios_sdk9_objc -#endif - /// A controller that manages all of the cluster managers on a map. class ClusterManagersController: NSObject { private var clusterManagerIdentifierToManagers: [String: GMUClusterManager] = [:] @@ -22,7 +18,7 @@ class ClusterManagersController: NSObject { super.init() } - func add(_ clusterManagersToAdd: [FGMPlatformClusterManager]) { + func add(_ clusterManagersToAdd: [PlatformClusterManager]) { for clusterManager in clusterManagersToAdd { addClusterManager(clusterManager.identifier) } @@ -57,17 +53,13 @@ class ClusterManagersController: NSObject { clusterManagerIdentifierToManagers.values.forEach({ $0.cluster() }) } - func clusters( - withIdentifier identifier: String, - error: AutoreleasingUnsafeMutablePointer - ) -> [FGMPlatformCluster]? { + func clusters(withIdentifier identifier: String) throws -> [PlatformCluster] { guard let clusterManager = clusterManagerIdentifierToManagers[identifier] else { - error.pointee = FlutterError( + throw PigeonError( code: "Invalid clusterManagerId", message: "getClusters called with invalid clusterManagerId", details: "clusterManagerId was: '\(identifier)'" ) - return nil } guard let mapView = mapView else { return [] } @@ -75,12 +67,12 @@ class ClusterManagersController: NSObject { // https://github.com/googlemaps/google-maps-ios-utils/blob/0e7ed81f1bbd9d29e4529c40ae39b0791b0a0eb8/src/Clustering/GMUClusterManager.m#L94. let integralZoom = floorf(Float(mapView.camera.zoom) + 0.5) let clusters = clusterManager.algorithm.clusters(atZoom: integralZoom) - return clusters.map { FGMPlatformCluster.make(from: $0, clusterManagerIdentifier: identifier) } + return clusters.map { PlatformCluster.make(from: $0, clusterManagerIdentifier: identifier) } } func didTap(_ cluster: GMUStaticCluster) { guard let clusterManagerId = clusterManagerIdentifier(for: cluster) else { return } - let platformCluster = FGMPlatformCluster.make( + let platformCluster = PlatformCluster.make( from: cluster, clusterManagerIdentifier: clusterManagerId) eventDelegate?.didTapCluster(platformCluster) } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ConversionUtils.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ConversionUtils.swift index 751cfee96d30..98bfccddd3c3 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ConversionUtils.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ConversionUtils.swift @@ -6,14 +6,10 @@ import Flutter import GoogleMaps import GoogleMapsUtils -#if canImport(google_maps_flutter_ios_sdk9_objc) - import google_maps_flutter_ios_sdk9_objc -#endif - -extension FGMPlatformPoint { +extension PlatformPoint { /// Converts a CGPoint to its Pigeon equivalent. - static func make(from point: CGPoint) -> FGMPlatformPoint { - return FGMPlatformPoint.makeWith(x: point.x, y: point.y) + static func make(from point: CGPoint) -> PlatformPoint { + return PlatformPoint(x: point.x, y: point.y) } /// Returns the equivalent CGPoint. @@ -22,11 +18,10 @@ extension FGMPlatformPoint { } } -extension FGMPlatformLatLng { +extension PlatformLatLng { /// Converts a CLLocationCoordinate2D to its Pigeon representation. - static func make(from coordinate: CLLocationCoordinate2D) -> FGMPlatformLatLng { - return FGMPlatformLatLng.make( - withLatitude: coordinate.latitude, longitude: coordinate.longitude) + static func make(from coordinate: CLLocationCoordinate2D) -> PlatformLatLng { + return PlatformLatLng(latitude: coordinate.latitude, longitude: coordinate.longitude) } /// Returns the equivalent CLLocationCoordinate2D. @@ -35,12 +30,12 @@ extension FGMPlatformLatLng { } } -extension FGMPlatformLatLngBounds { +extension PlatformLatLngBounds { /// Converts a GMSCoordinateBounds to its Pigeon representation. - static func make(from bounds: GMSCoordinateBounds) -> FGMPlatformLatLngBounds { - return FGMPlatformLatLngBounds.make( - withNortheast: FGMPlatformLatLng.make(from: bounds.northEast), - southwest: FGMPlatformLatLng.make(from: bounds.southWest) + static func make(from bounds: GMSCoordinateBounds) -> PlatformLatLngBounds { + return PlatformLatLngBounds( + northeast: PlatformLatLng.make(from: bounds.northEast), + southwest: PlatformLatLng.make(from: bounds.southWest) ) } @@ -53,12 +48,12 @@ extension FGMPlatformLatLngBounds { } } -extension FGMPlatformCameraPosition { +extension PlatformCameraPosition { /// Converts a GMSCameraPosition to its Pigeon representation. - static func make(from position: GMSCameraPosition) -> FGMPlatformCameraPosition { - return FGMPlatformCameraPosition.make( - withBearing: position.bearing, - target: FGMPlatformLatLng.make(from: position.target), + static func make(from position: GMSCameraPosition) -> PlatformCameraPosition { + return PlatformCameraPosition( + bearing: position.bearing, + target: PlatformLatLng.make(from: position.target), tilt: position.viewingAngle, zoom: Double(position.zoom) ) @@ -84,7 +79,7 @@ func makePath(from points: [CLLocationCoordinate2D]) -> GMSMutablePath { return path } -extension FGMPlatformMapType { +extension PlatformMapType { /// The corresponding GMSMapViewType. var gmsMapViewType: GMSMapViewType { switch self { @@ -98,7 +93,7 @@ extension FGMPlatformMapType { } } -extension FGMPlatformMarkerCollisionBehavior { +extension PlatformMarkerCollisionBehavior { /// The corresponding GMSCollisionBehavior. var gmsCollisionBehavior: GMSCollisionBehavior { switch self { @@ -114,40 +109,39 @@ extension FGMPlatformMarkerCollisionBehavior { } } -extension FGMPlatformGroundOverlay { +extension PlatformGroundOverlay { /// Converts a GMSGroundOverlay to its Pigeon representation. static func make( from groundOverlay: GMSGroundOverlay, overlayId: String, isCreatedWithBounds: Bool, - zoomLevel: NSNumber? - ) -> FGMPlatformGroundOverlay { - let placeholderImage = FGMPlatformBitmap.make( - withBitmap: FGMPlatformBitmapDefaultMarker.make(withHue: nil)) + zoomLevel: Double? + ) -> PlatformGroundOverlay { + let placeholderImage = PlatformBitmap(bitmap: PlatformBitmapDefaultMarker(hue: nil)) if isCreatedWithBounds, let bounds = groundOverlay.bounds { - return FGMPlatformGroundOverlay.make( - withGroundOverlayId: overlayId, + return PlatformGroundOverlay( + groundOverlayId: overlayId, image: placeholderImage, position: nil, - bounds: FGMPlatformLatLngBounds.make(from: bounds), - anchor: FGMPlatformPoint.make(from: groundOverlay.anchor), + bounds: PlatformLatLngBounds.make(from: bounds), + anchor: PlatformPoint.make(from: groundOverlay.anchor), transparency: 1.0 - Double(groundOverlay.opacity), bearing: groundOverlay.bearing, - zIndex: Int(groundOverlay.zIndex), + zIndex: Int64(groundOverlay.zIndex), visible: groundOverlay.map != nil, clickable: groundOverlay.isTappable, zoomLevel: zoomLevel ) } else { - return FGMPlatformGroundOverlay.make( - withGroundOverlayId: overlayId, + return PlatformGroundOverlay( + groundOverlayId: overlayId, image: placeholderImage, - position: FGMPlatformLatLng.make(from: groundOverlay.position), + position: PlatformLatLng.make(from: groundOverlay.position), bounds: nil, - anchor: FGMPlatformPoint.make(from: groundOverlay.anchor), + anchor: PlatformPoint.make(from: groundOverlay.anchor), transparency: 1.0 - Double(groundOverlay.opacity), bearing: groundOverlay.bearing, - zIndex: Int(groundOverlay.zIndex), + zIndex: Int64(groundOverlay.zIndex), visible: groundOverlay.map != nil, clickable: groundOverlay.isTappable, zoomLevel: zoomLevel @@ -156,14 +150,14 @@ extension FGMPlatformGroundOverlay { } } -extension FGMPlatformHeatmapGradient { +extension PlatformHeatmapGradient { /// Converts a GMUGradient to its Pigeon representation. - static func make(from gradient: GMUGradient) -> FGMPlatformHeatmapGradient { - let colors = gradient.colors.map { FGMPlatformColor.make(from: $0) } - return FGMPlatformHeatmapGradient.make( - with: colors, - startPoints: gradient.startPoints, - colorMapSize: Int(gradient.mapSize) + static func make(from gradient: GMUGradient) -> PlatformHeatmapGradient { + let colors = gradient.colors.map { PlatformColor.make(from: $0) } + return PlatformHeatmapGradient( + colors: colors, + startPoints: gradient.startPoints.map({ $0.doubleValue }), + colorMapSize: Int64(gradient.mapSize) ) } @@ -172,18 +166,18 @@ extension FGMPlatformHeatmapGradient { let colors = colors.map { $0.toUIColor() } return GMUGradient( colors: colors, - startPoints: startPoints, + startPoints: startPoints.map({ $0 as NSNumber }), colorMapSize: UInt(colorMapSize) ) } } -extension FGMPlatformWeightedLatLng { +extension PlatformWeightedLatLng { /// Converts a GMUWeightedLatLng to its Pigeon representation. - static func make(from weightedLatLng: GMUWeightedLatLng) -> FGMPlatformWeightedLatLng { + static func make(from weightedLatLng: GMUWeightedLatLng) -> PlatformWeightedLatLng { let point = GMSMapPoint(x: weightedLatLng.point().x, y: weightedLatLng.point().y) - return FGMPlatformWeightedLatLng.make( - withPoint: FGMPlatformLatLng.make(from: GMSUnproject(point)), + return PlatformWeightedLatLng( + point: PlatformLatLng.make(from: GMSUnproject(point)), weight: Double(weightedLatLng.intensity) ) } @@ -194,36 +188,36 @@ extension FGMPlatformWeightedLatLng { } } -extension FGMPlatformCameraUpdate { +extension PlatformCameraUpdate { /// Creates a GMSCameraUpdate from its Pigeon equivalent. func toGMSCameraUpdate() -> GMSCameraUpdate? { // See note in messages.dart for why this is so loosely typed. switch cameraUpdate { - case let newCameraPosition as FGMPlatformCameraUpdateNewCameraPosition: + case let newCameraPosition as PlatformCameraUpdateNewCameraPosition: return GMSCameraUpdate.setCamera(newCameraPosition.cameraPosition.toGMSCameraPosition()) - case let newLatLng as FGMPlatformCameraUpdateNewLatLng: + case let newLatLng as PlatformCameraUpdateNewLatLng: return GMSCameraUpdate.setTarget(newLatLng.latLng.toCLLocationCoordinate2D()) - case let newLatLngBounds as FGMPlatformCameraUpdateNewLatLngBounds: + case let newLatLngBounds as PlatformCameraUpdateNewLatLngBounds: return GMSCameraUpdate.fit( newLatLngBounds.bounds.toGMSCoordinateBounds(), withPadding: CGFloat(newLatLngBounds.padding) ) - case let newLatLngZoom as FGMPlatformCameraUpdateNewLatLngZoom: + case let newLatLngZoom as PlatformCameraUpdateNewLatLngZoom: return GMSCameraUpdate.setTarget( newLatLngZoom.latLng.toCLLocationCoordinate2D(), zoom: Float(newLatLngZoom.zoom) ) - case let scrollBy as FGMPlatformCameraUpdateScrollBy: + case let scrollBy as PlatformCameraUpdateScrollBy: return GMSCameraUpdate.scrollBy(x: scrollBy.dx, y: scrollBy.dy) - case let zoomBy as FGMPlatformCameraUpdateZoomBy: + case let zoomBy as PlatformCameraUpdateZoomBy: if let focus = zoomBy.focus { return GMSCameraUpdate.zoom(by: Float(zoomBy.amount), at: focus.toCGPoint()) } else { return GMSCameraUpdate.zoom(by: Float(zoomBy.amount)) } - case let zoom as FGMPlatformCameraUpdateZoom: + case let zoom as PlatformCameraUpdateZoom: return zoom.out ? GMSCameraUpdate.zoomOut() : GMSCameraUpdate.zoomIn() - case let zoomTo as FGMPlatformCameraUpdateZoomTo: + case let zoomTo as PlatformCameraUpdateZoomTo: return GMSCameraUpdate.zoom(to: Float(zoomTo.zoom)) default: return nil @@ -231,16 +225,16 @@ extension FGMPlatformCameraUpdate { } } -extension FGMPlatformColor { +extension PlatformColor { /// Converts a UIColor to its Pigeon representation. - static func make(from color: UIColor) -> FGMPlatformColor { + static func make(from color: UIColor) -> PlatformColor { var red: CGFloat = 0 var green: CGFloat = 0 var blue: CGFloat = 0 var alpha: CGFloat = 0 color.getRed(&red, green: &green, blue: &blue, alpha: &alpha) - return FGMPlatformColor.make( - withRed: Double(red), green: Double(green), blue: Double(blue), alpha: Double(alpha)) + return PlatformColor( + red: Double(red), green: Double(green), blue: Double(blue), alpha: Double(alpha)) } /// Returns the equivalent UIColor. @@ -249,7 +243,7 @@ extension FGMPlatformColor { } } -extension FGMPlatformPatternItem { +extension PlatformPatternItem { /// The GMSStrokeStyle expression of this pattern, using the given stroke color. func gmsStrokeStyle(strokeColor: UIColor) -> GMSStrokeStyle { let color = type == .gap ? UIColor.clear : strokeColor @@ -258,16 +252,16 @@ extension FGMPlatformPatternItem { /// The span length for this pattern, in the form expected by GMSStyleSpans. func gmsStyleSpanLength() -> NSNumber { - return length ?? 0 + return (length ?? 0) as NSNumber } } -extension FGMPlatformCluster { +extension PlatformCluster { /// Converts a GMUCluster to its Pigeon representation. static func make( from cluster: GMUCluster, clusterManagerIdentifier: String - ) -> FGMPlatformCluster { + ) -> PlatformCluster { var bounds = GMSCoordinateBounds() for item in cluster.items { bounds = bounds.includingCoordinate(item.position) @@ -277,10 +271,10 @@ extension FGMPlatformCluster { markerIdentifierFromMarker($0) } - return FGMPlatformCluster.make( - withClusterManagerId: clusterManagerIdentifier, - position: FGMPlatformLatLng.make(from: cluster.position), - bounds: FGMPlatformLatLngBounds.make(from: bounds), + return PlatformCluster( + clusterManagerId: clusterManagerIdentifier, + position: PlatformLatLng.make(from: cluster.position), + bounds: PlatformLatLngBounds.make(from: bounds), markerIds: markerIds ) } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapController.swift index 48cefce1ac29..fef962a73295 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapController.swift @@ -6,10 +6,6 @@ import Flutter import GoogleMaps import GoogleMapsUtils -#if canImport(google_maps_flutter_ios_sdk9_objc) - import google_maps_flutter_ios_sdk9_objc -#endif - /// Protocol for CATransaction to allow mocking in tests. protocol MapAnimationCATransactionProtocol { func begin() @@ -53,11 +49,11 @@ class DefaultAssetProvider: AssetProvider { } } -/// Non-test implementation of MapEventDelegate, wrapping a FGMMapsCallbackApi instance. +/// Non-test implementation of MapEventDelegate, wrapping a MapsCallbackApi instance. class DefaultMapEventHandler: MapEventDelegate { - let callbackHandler: FGMMapsCallbackApi + let callbackHandler: MapsCallbackApi - init(callbackHandler: FGMMapsCallbackApi) { + init(callbackHandler: MapsCallbackApi) { self.callbackHandler = callbackHandler } @@ -65,7 +61,7 @@ class DefaultMapEventHandler: MapEventDelegate { callbackHandler.didStartCameraMove { _ in } } - func didMoveCamera(to cameraPosition: FGMPlatformCameraPosition) { + func didMoveCamera(to cameraPosition: PlatformCameraPosition) { callbackHandler.didMoveCamera(to: cameraPosition) { _ in } } @@ -73,12 +69,12 @@ class DefaultMapEventHandler: MapEventDelegate { callbackHandler.didIdleCamera { _ in } } - func didTap(at position: FGMPlatformLatLng) { - callbackHandler.didTap(atPosition: position) { _ in } + func didTap(at position: PlatformLatLng) { + callbackHandler.didTap(at: position) { _ in } } - func didLongPress(at position: FGMPlatformLatLng) { - callbackHandler.didLongPress(atPosition: position) { _ in } + func didLongPress(at position: PlatformLatLng) { + callbackHandler.didLongPress(at: position) { _ in } } func didTapMarker(withIdentifier markerId: String) { @@ -86,17 +82,17 @@ class DefaultMapEventHandler: MapEventDelegate { } func didStartDragForMarker( - withIdentifier markerId: String, at position: FGMPlatformLatLng + withIdentifier markerId: String, at position: PlatformLatLng ) { - callbackHandler.didStartDragForMarker(withIdentifier: markerId, atPosition: position) { _ in } + callbackHandler.didStartDragForMarker(withIdentifier: markerId, at: position) { _ in } } - func didDragMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) { - callbackHandler.didDragMarker(withIdentifier: markerId, atPosition: position) { _ in } + func didDragMarker(withIdentifier markerId: String, at position: PlatformLatLng) { + callbackHandler.didDragMarker(withIdentifier: markerId, at: position) { _ in } } - func didEndDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) { - callbackHandler.didEndDragForMarker(withIdentifier: markerId, atPosition: position) { _ in } + func didEndDragForMarker(withIdentifier markerId: String, at position: PlatformLatLng) { + callbackHandler.didEndDragForMarker(withIdentifier: markerId, at: position) { _ in } } func didTapInfoWindowOfMarker(withIdentifier markerId: String) { @@ -107,8 +103,8 @@ class DefaultMapEventHandler: MapEventDelegate { callbackHandler.didTapCircle(withIdentifier: circleId) { _ in } } - func didTapCluster(_ cluster: FGMPlatformCluster) { - callbackHandler.didTap(cluster) { _ in } + func didTapCluster(_ cluster: PlatformCluster) { + callbackHandler.didTapCluster(cluster) { _ in } } func didTapPolygon(withIdentifier polygonId: String) { @@ -128,7 +124,7 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV /// The Google Maps SDK map view managed by this controller. let mapView: GMSMapView /// The Pigeon callback API implementation, used to send events to the Dart side. - let dartCallbackHandler: FGMMapsCallbackApi + let dartCallbackHandler: MapsCallbackApi /// The map SDK event handler, which routes events to the Dart callback handler. let mapEventHandler: DefaultMapEventHandler /// The main Pigeon API implementation, separate to avoid lifetime extension. @@ -159,10 +155,10 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV /// that the observer is removed before the controller is deallocated. private var isObservingFrame = false - public convenience init( + convenience init( frame: CGRect, viewIdentifier viewId: Int64, - creationParameters: FGMPlatformMapViewCreationParams, + creationParameters: PlatformMapViewCreationParams, registrar: FlutterPluginRegistrar ) { let camera = creationParameters.initialCameraPosition.toGMSCameraPosition() @@ -186,7 +182,7 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV init( mapView: GMSMapView, viewIdentifier viewId: Int64, - creationParameters: FGMPlatformMapViewCreationParams, + creationParameters: PlatformMapViewCreationParams, assetProvider: AssetProvider, binaryMessenger: FlutterBinaryMessenger ) { @@ -202,12 +198,12 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV styleError = errorString } if let trackCameraPosition = creationParameters.mapConfiguration.trackCameraPosition { - self.trackCameraPosition = trackCameraPosition.boolValue + self.trackCameraPosition = trackCameraPosition } // End duplicate code. let pigeonSuffix = String(format: "%lld", viewId) - dartCallbackHandler = FGMMapsCallbackApi( + dartCallbackHandler = MapsCallbackApi( binaryMessenger: binaryMessenger, messageChannelSuffix: pigeonSuffix ) @@ -272,9 +268,17 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV super.init() callHandler.controller = self - SetUpFGMMapsApiWithSuffix(binaryMessenger, callHandler, pigeonSuffix) + MapsApiSetup.setUp( + binaryMessenger: binaryMessenger, + api: callHandler, + messageChannelSuffix: pigeonSuffix + ) inspector.controller = self - SetUpFGMMapsInspectorApiWithSuffix(binaryMessenger, inspector, pigeonSuffix) + MapsInspectorApiSetup.setUp( + binaryMessenger: binaryMessenger, + api: inspector, + messageChannelSuffix: pigeonSuffix + ) mapView.delegate = self isObservingFrame = true @@ -288,8 +292,15 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV if isObservingFrame { mapView.removeObserver(self, forKeyPath: "frame") } - SetUpFGMMapsApiWithSuffix(callHandler.messenger, nil, callHandler.pigeonSuffix) - SetUpFGMMapsInspectorApiWithSuffix(inspector.messenger, nil, inspector.pigeonSuffix) + MapsApiSetup.setUp( + binaryMessenger: callHandler.messenger, + api: nil, + messageChannelSuffix: callHandler.pigeonSuffix + ) + MapsInspectorApiSetup.setUp( + binaryMessenger: inspector.messenger, + api: nil, + messageChannelSuffix: inspector.pigeonSuffix) } public func view() -> UIView { @@ -379,7 +390,7 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV public func mapView(_ mapView: GMSMapView, didChange position: GMSCameraPosition) { if trackCameraPosition { - mapEventHandler.didMoveCamera(to: FGMPlatformCameraPosition.make(from: position)) + mapEventHandler.didMoveCamera(to: PlatformCameraPosition.make(from: position)) } } @@ -440,14 +451,14 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV } public func mapView(_ mapView: GMSMapView, didTapAt coordinate: CLLocationCoordinate2D) { - mapEventHandler.didTap(at: FGMPlatformLatLng.make(from: coordinate)) + mapEventHandler.didTap(at: PlatformLatLng.make(from: coordinate)) } public func mapView(_ mapView: GMSMapView, didLongPressAt coordinate: CLLocationCoordinate2D) { - mapEventHandler.didLongPress(at: FGMPlatformLatLng.make(from: coordinate)) + mapEventHandler.didLongPress(at: PlatformLatLng.make(from: coordinate)) } - func interpretMapConfiguration(_ config: FGMPlatformMapConfiguration) { + func interpretMapConfiguration(_ config: PlatformMapConfiguration) { // Any changes here must also be made to the `init` method above. See the comment there for // details. let (styleUpdateAttempted, errorString) = GoogleMapController.updateMapView( @@ -456,7 +467,7 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV styleError = errorString } if let trackCameraPosition = config.trackCameraPosition { - self.trackCameraPosition = trackCameraPosition.boolValue + self.trackCameraPosition = trackCameraPosition } } @@ -466,7 +477,7 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV /// describing any error interpreting the style in `config`. If the boolean is true, the error /// string should be stored in `styleError` for later access. static func updateMapView( - _ mapView: GMSMapView, fromConfiguration config: FGMPlatformMapConfiguration + _ mapView: GMSMapView, fromConfiguration config: PlatformMapConfiguration ) -> (Bool, String?) { if let cameraTargetBounds = config.cameraTargetBounds { if let bounds = cameraTargetBounds.bounds { @@ -476,23 +487,23 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV } } if let compassEnabled = config.compassEnabled { - mapView.settings.compassButton = compassEnabled.boolValue + mapView.settings.compassButton = compassEnabled } if let indoorEnabled = config.indoorViewEnabled { - mapView.isIndoorEnabled = indoorEnabled.boolValue + mapView.isIndoorEnabled = indoorEnabled } if let trafficEnabled = config.trafficEnabled { - mapView.isTrafficEnabled = trafficEnabled.boolValue + mapView.isTrafficEnabled = trafficEnabled } if let buildingsEnabled = config.buildingsEnabled { - mapView.isBuildingsEnabled = buildingsEnabled.boolValue + mapView.isBuildingsEnabled = buildingsEnabled } if let mapType = config.mapType { - mapView.mapType = mapType.value.gmsMapViewType + mapView.mapType = mapType.gmsMapViewType } if let zoomData = config.minMaxZoomPreference { - let minZoom = zoomData.min?.floatValue ?? kGMSMinZoomLevel - let maxZoom = zoomData.max?.floatValue ?? kGMSMaxZoomLevel + let minZoom = zoomData.min.map({ Float($0) }) ?? kGMSMinZoomLevel + let maxZoom = zoomData.max.map({ Float($0) }) ?? kGMSMaxZoomLevel mapView.setMinZoom(minZoom, maxZoom: maxZoom) } if let padding = config.padding { @@ -504,22 +515,22 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV ) } if let rotateGesturesEnabled = config.rotateGesturesEnabled { - mapView.settings.rotateGestures = rotateGesturesEnabled.boolValue + mapView.settings.rotateGestures = rotateGesturesEnabled } if let scrollGesturesEnabled = config.scrollGesturesEnabled { - mapView.settings.scrollGestures = scrollGesturesEnabled.boolValue + mapView.settings.scrollGestures = scrollGesturesEnabled } if let tiltGesturesEnabled = config.tiltGesturesEnabled { - mapView.settings.tiltGestures = tiltGesturesEnabled.boolValue + mapView.settings.tiltGestures = tiltGesturesEnabled } if let zoomGesturesEnabled = config.zoomGesturesEnabled { - mapView.settings.zoomGestures = zoomGesturesEnabled.boolValue + mapView.settings.zoomGestures = zoomGesturesEnabled } if let myLocationEnabled = config.myLocationEnabled { - mapView.isMyLocationEnabled = myLocationEnabled.boolValue + mapView.isMyLocationEnabled = myLocationEnabled } if let myLocationButtonEnabled = config.myLocationButtonEnabled { - mapView.settings.myLocationButton = myLocationButtonEnabled.boolValue + mapView.settings.myLocationButton = myLocationButtonEnabled } if let mapStyle = config.style { let (style, errorString) = GoogleMapController.parseMapStyle(mapStyle) @@ -532,21 +543,21 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV } } -// TODO(stuartmorgan): Remove this in favor of an extension to add FGMTileProviderDelegate to +// TODO(stuartmorgan): Remove this in favor of an extension to add TileProviderDelegate to // the Pigeon Flutter API object once this plugin has switched to Swift Pigeon generation // (adjusting the protocol to match the Swift version of the signature). private class ConcreteTileProvider: NSObject, TileProviderDelegate { - let handler: FGMMapsCallbackApi + let handler: MapsCallbackApi - init(dartCallbackHandler: FGMMapsCallbackApi) { + init(dartCallbackHandler: MapsCallbackApi) { handler = dartCallbackHandler } public func tile( withOverlayIdentifier tileOverlayId: String, - location: FGMPlatformPoint, - zoom: Int, - completion: @escaping (FGMPlatformTile?, FlutterError?) -> Void + location: PlatformPoint, + zoom: Int64, + completion: @escaping (Result) -> Void ) { handler.tile( withOverlayIdentifier: tileOverlayId, @@ -557,7 +568,7 @@ private class ConcreteTileProvider: NSObject, TileProviderDelegate { } } -class MapCallHandler: NSObject, FGMMapsApi { +class MapCallHandler: NSObject, MapsApi { weak var controller: GoogleMapController? let messenger: FlutterBinaryMessenger let pigeonSuffix: String @@ -573,13 +584,14 @@ class MapCallHandler: NSObject, FGMMapsApi { super.init() } - func waitForMapWithError(_ error: AutoreleasingUnsafeMutablePointer) { + func waitForMap() { // No-op; this call just ensures synchronization with the platform thread. } func updateCircles( - byAdding toAdd: [FGMPlatformCircle], changing toChange: [FGMPlatformCircle], - removing idsToRemove: [String], error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformCircle], + changing toChange: [PlatformCircle], + removing idsToRemove: [String] ) { controller?.circlesController.add(toAdd) controller?.circlesController.change(toChange) @@ -587,24 +599,23 @@ class MapCallHandler: NSObject, FGMMapsApi { } func updateHeatmaps( - byAdding toAdd: [FGMPlatformHeatmap], changing toChange: [FGMPlatformHeatmap], - removing idsToRemove: [String], error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformHeatmap], + changing toChange: [PlatformHeatmap], + removing idsToRemove: [String] ) { controller?.heatmapsController.add(toAdd) controller?.heatmapsController.change(toChange) controller?.heatmapsController.removeHeatmaps(withIdentifiers: idsToRemove) } - func update( - with configuration: FGMPlatformMapConfiguration, - error: AutoreleasingUnsafeMutablePointer - ) { + func updateWithMapConfiguration(_ configuration: PlatformMapConfiguration) { controller?.interpretMapConfiguration(configuration) } func updateMarkers( - byAdding toAdd: [FGMPlatformMarker], changing toChange: [FGMPlatformMarker], - removing idsToRemove: [String], error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformMarker], + changing toChange: [PlatformMarker], + removing idsToRemove: [String] ) { controller?.markersController.add(toAdd) controller?.markersController.change(toChange) @@ -614,16 +625,17 @@ class MapCallHandler: NSObject, FGMMapsApi { } func updateClusterManagers( - byAdding toAdd: [FGMPlatformClusterManager], removing idsToRemove: [String], - error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformClusterManager], + removing idsToRemove: [String] ) { controller?.clusterManagersController.add(toAdd) controller?.clusterManagersController.removeClusterManagers(withIdentifiers: idsToRemove) } func updatePolygons( - byAdding toAdd: [FGMPlatformPolygon], changing toChange: [FGMPlatformPolygon], - removing idsToRemove: [String], error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformPolygon], + changing toChange: [PlatformPolygon], + removing idsToRemove: [String] ) { controller?.polygonsController.add(toAdd) controller?.polygonsController.change(toChange) @@ -631,8 +643,9 @@ class MapCallHandler: NSObject, FGMMapsApi { } func updatePolylines( - byAdding toAdd: [FGMPlatformPolyline], changing toChange: [FGMPlatformPolyline], - removing idsToRemove: [String], error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformPolyline], + changing toChange: [PlatformPolyline], + removing idsToRemove: [String] ) { controller?.polylinesController.add(toAdd) controller?.polylinesController.change(toChange) @@ -640,8 +653,9 @@ class MapCallHandler: NSObject, FGMMapsApi { } func updateTileOverlays( - byAdding toAdd: [FGMPlatformTileOverlay], changing toChange: [FGMPlatformTileOverlay], - removing idsToRemove: [String], error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformTileOverlay], + changing toChange: [PlatformTileOverlay], + removing idsToRemove: [String] ) { controller?.tileOverlaysController.add(toAdd) controller?.tileOverlaysController.change(toChange) @@ -649,150 +663,128 @@ class MapCallHandler: NSObject, FGMMapsApi { } func updateGroundOverlays( - byAdding toAdd: [FGMPlatformGroundOverlay], changing toChange: [FGMPlatformGroundOverlay], - removing idsToRemove: [String], error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformGroundOverlay], + changing toChange: [PlatformGroundOverlay], + removing idsToRemove: [String] ) { controller?.groundOverlaysController.add(toAdd) controller?.groundOverlaysController.change(toChange) controller?.groundOverlaysController.removeGroundOverlays(withIdentifiers: idsToRemove) } - func latLng( - forScreenCoordinate screenCoordinate: FGMPlatformPoint, - error: AutoreleasingUnsafeMutablePointer - ) -> FGMPlatformLatLng? { + func latLng(for screenCoordinate: PlatformPoint) throws -> PlatformLatLng { guard let mapView = controller?.mapView else { - error.pointee = FlutterError( + throw PigeonError( code: "GoogleMap uninitialized", message: "getLatLng called prior to map initialization", details: nil ) - return nil } let point = screenCoordinate.toCGPoint() let latlng = mapView.projection.coordinate(for: point) - return FGMPlatformLatLng.make(from: latlng) + return PlatformLatLng.make(from: latlng) } - func screenCoordinates( - for latLng: FGMPlatformLatLng, error: AutoreleasingUnsafeMutablePointer - ) -> FGMPlatformPoint? { + func screenCoordinates(for latLng: PlatformLatLng) throws -> PlatformPoint { guard let mapView = controller?.mapView else { - error.pointee = FlutterError( + throw PigeonError( code: "GoogleMap uninitialized", message: "getScreenCoordinate called prior to map initialization", details: nil ) - return nil } let location = latLng.toCLLocationCoordinate2D() let point = mapView.projection.point(for: location) - return FGMPlatformPoint.make(from: point) + return PlatformPoint.make(from: point) } - func visibleMapRegion(_ error: AutoreleasingUnsafeMutablePointer) - -> FGMPlatformLatLngBounds? - { + func visibleMapRegion() throws -> PlatformLatLngBounds { guard let mapView = controller?.mapView else { - error.pointee = FlutterError( + throw PigeonError( code: "GoogleMap uninitialized", message: "getVisibleRegion called prior to map initialization", details: nil ) - return nil } let visibleRegion = mapView.projection.visibleRegion() let bounds = GMSCoordinateBounds(region: visibleRegion) - return FGMPlatformLatLngBounds.make(from: bounds) + return PlatformLatLngBounds.make(from: bounds) } - func moveCamera( - with cameraUpdate: FGMPlatformCameraUpdate, - error: AutoreleasingUnsafeMutablePointer - ) { + func moveCamera(_ cameraUpdate: PlatformCameraUpdate) throws { guard let update = cameraUpdate.toGMSCameraUpdate() else { - error.pointee = FlutterError( + throw PigeonError( code: "Invalid update", message: "Unrecognized camera update", details: nil ) - return } controller?.mapView.moveCamera(update) } func animateCamera( - with cameraUpdate: FGMPlatformCameraUpdate, duration durationMilliseconds: NSNumber?, - error: AutoreleasingUnsafeMutablePointer - ) { + _ cameraUpdate: PlatformCameraUpdate, + duration durationMilliseconds: Int64? + ) throws { guard let update = cameraUpdate.toGMSCameraUpdate() else { - error.pointee = FlutterError( + throw PigeonError( code: "Invalid update", message: "Unrecognized camera update", details: nil ) - return } let transaction = durationMilliseconds != nil ? transactionWrapper : nil transaction?.begin() if let duration = durationMilliseconds { - transaction?.setAnimationDuration(duration.doubleValue / 1000.0) + transaction?.setAnimationDuration(Double(duration) / 1000.0) } controller?.mapView.animate(with: update) transaction?.commit() } - func currentZoomLevel(_ error: AutoreleasingUnsafeMutablePointer) -> NSNumber? { + func zoomLevel() throws -> Double { guard let mapView = controller?.mapView else { - return nil + throw PigeonError( + code: "GoogleMap uninitialized", + message: "getZoomLevel called prior to map initialization", + details: nil + ) } - return NSNumber(value: mapView.camera.zoom) + return Double(mapView.camera.zoom) } - func showInfoWindowForMarker( - withIdentifier markerId: String, error: AutoreleasingUnsafeMutablePointer - ) { - controller?.markersController.showMarkerInfoWindow(withIdentifier: markerId, error: error) + func showInfoWindowForMarker(withIdentifier markerId: String) throws { + try controller?.markersController.showMarkerInfoWindow(withIdentifier: markerId) } - func hideInfoWindowForMarker( - withIdentifier markerId: String, error: AutoreleasingUnsafeMutablePointer - ) { - controller?.markersController.hideMarkerInfoWindow(withIdentifier: markerId, error: error) + func hideInfoWindowForMarker(withIdentifier markerId: String) throws { + try controller?.markersController.hideMarkerInfoWindow(withIdentifier: markerId) } - func isShowingInfoWindowForMarker( - withIdentifier markerId: String, error: AutoreleasingUnsafeMutablePointer - ) -> NSNumber? { - return controller?.markersController.isInfoWindowShownForMarker( - withIdentifier: markerId, error: error) + func isShowingInfoWindowForMarker(withIdentifier markerId: String) throws -> Bool { + return try controller?.markersController.isInfoWindowShownForMarker(withIdentifier: markerId) + ?? false } - func setStyle(_ style: String, error: AutoreleasingUnsafeMutablePointer) -> String? - { + func setStyle(_ style: String) -> String? { return controller?.setMapStyle(style) } - func lastStyleError(_ error: AutoreleasingUnsafeMutablePointer) -> String? { + func lastStyleError() -> String? { return controller?.styleError } - func clearTileCacheForOverlay( - withIdentifier tileOverlayId: String, error: AutoreleasingUnsafeMutablePointer - ) { + func clearTileCacheForOverlay(withIdentifier tileOverlayId: String) { controller?.tileOverlaysController.clearTileCache(withIdentifier: tileOverlayId) } - func takeSnapshotWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> FlutterStandardTypedData? - { + func takeSnapshot() throws -> FlutterStandardTypedData? { guard let mapView = controller?.mapView else { - error.pointee = FlutterError( + throw PigeonError( code: "GoogleMap uninitialized", message: "takeSnapshot called prior to map initialization", details: nil ) - return nil } let renderer = UIGraphicsImageRenderer(size: mapView.bounds.size) let image = renderer.image { context in @@ -804,17 +796,12 @@ class MapCallHandler: NSObject, FGMMapsApi { return nil } - func isAdvancedMarkersAvailable(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return false - } - return NSNumber(value: mapView.mapCapabilities.contains(.advancedMarkers)) + func isAdvancedMarkersAvailable() -> Bool { + return controller?.mapView.mapCapabilities.contains(.advancedMarkers) ?? false } } -class MapInspector: NSObject, FGMMapsInspectorApi { +class MapInspector: NSObject, MapsInspectorApi { weak var controller: GoogleMapController? let messenger: FlutterBinaryMessenger let pigeonSuffix: String @@ -828,131 +815,85 @@ class MapInspector: NSObject, FGMMapsInspectorApi { super.init() } - func areBuildingsEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.isBuildingsEnabled) + func areBuildingsEnabled() -> Bool { + return controller?.mapView.isBuildingsEnabled ?? false } - func areRotateGesturesEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.settings.rotateGestures) + func areRotateGesturesEnabled() -> Bool { + return controller?.mapView.settings.rotateGestures ?? false } - func areScrollGesturesEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.settings.scrollGestures) + func areScrollGesturesEnabled() -> Bool { + return controller?.mapView.settings.scrollGestures ?? false } - func areTiltGesturesEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.settings.tiltGestures) + func areTiltGesturesEnabled() -> Bool { + return controller?.mapView.settings.tiltGestures ?? false } - func areZoomGesturesEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.settings.zoomGestures) + func areZoomGesturesEnabled() -> Bool { + return controller?.mapView.settings.zoomGestures ?? false + } + + func isCompassEnabled() -> Bool { + return controller?.mapView.settings.compassButton ?? false + } + + func isMyLocationButtonEnabled() -> Bool { + return controller?.mapView.settings.myLocationButton ?? false + } + + func isTrafficEnabled() -> Bool { + return controller?.mapView.isTrafficEnabled ?? false } - func tileOverlay( - withIdentifier tileOverlayId: String, error: AutoreleasingUnsafeMutablePointer - ) -> FGMPlatformTileLayer? { + func tileOverlay(withIdentifier tileOverlayId: String) -> PlatformTileLayer? { guard let controller = controller, let layer = controller.tileOverlaysController.tileOverlay(withIdentifier: tileOverlayId)? .layer else { return nil } - return FGMPlatformTileLayer.make( - withVisible: layer.map != nil, + return PlatformTileLayer( + visible: layer.map != nil, fadeIn: layer.fadeIn, opacity: Double(layer.opacity), - zIndex: Int(layer.zIndex) + zIndex: Int64(layer.zIndex) ) } - func heatmap( - withIdentifier heatmapId: String, error: AutoreleasingUnsafeMutablePointer - ) -> FGMPlatformHeatmap? { + func heatmap(withIdentifier heatmapId: String) -> PlatformHeatmap? { return controller?.heatmapsController.heatmap(withIdentifier: heatmapId) } - func clusters( - withIdentifier clusterManagerId: String, error: AutoreleasingUnsafeMutablePointer - ) -> [FGMPlatformCluster]? { - return controller?.clusterManagersController.clusters( - withIdentifier: clusterManagerId, error: error) - } - - func isCompassEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.settings.compassButton) - } - - func isMyLocationButtonEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.settings.myLocationButton) - } - - func isTrafficEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.isTrafficEnabled) + func clusters(withIdentifier clusterManagerId: String) throws -> [PlatformCluster] { + return try controller?.clusterManagersController.clusters(withIdentifier: clusterManagerId) + ?? [] } - func zoomRange(_ error: AutoreleasingUnsafeMutablePointer) -> FGMPlatformZoomRange? - { + func zoomRange() throws -> PlatformZoomRange { guard let mapView = controller?.mapView else { - return nil + throw PigeonError( + code: "GoogleMap uninitialized", + message: "zoomRange called prior to map initialization", + details: nil + ) } - return FGMPlatformZoomRange.make( - withMin: NSNumber(value: mapView.minZoom), - max: NSNumber(value: mapView.maxZoom) - ) + return PlatformZoomRange(min: Double(mapView.minZoom), max: Double(mapView.maxZoom)) } - func groundOverlay( - withIdentifier groundOverlayId: String, error: AutoreleasingUnsafeMutablePointer - ) -> FGMPlatformGroundOverlay? { + func groundOverlay(withIdentifier groundOverlayId: String) -> PlatformGroundOverlay? { return controller?.groundOverlaysController.groundOverlay(withIdentifier: groundOverlayId) } - func cameraPosition(_ error: AutoreleasingUnsafeMutablePointer) - -> FGMPlatformCameraPosition? - { + func cameraPosition() throws -> PlatformCameraPosition { guard let mapView = controller?.mapView else { - return nil + throw PigeonError( + code: "GoogleMap uninitialized", + message: "cameraPosition called prior to map initialization", + details: nil + ) } - return FGMPlatformCameraPosition.make(from: mapView.camera) + return PlatformCameraPosition.make(from: mapView.camera) } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapFactory.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapFactory.swift index bbd27c27ee46..5e263d2cff79 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapFactory.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapFactory.swift @@ -5,10 +5,6 @@ import Flutter import GoogleMaps -#if canImport(google_maps_flutter_ios_sdk9_objc) - import google_maps_flutter_ios_sdk9_objc -#endif - class GoogleMapFactory: NSObject, FlutterPlatformViewFactory { weak var registrar: FlutterPluginRegistrar? static var sharedMapServices = GMSServices.sharedServices() @@ -25,10 +21,10 @@ class GoogleMapFactory: NSObject, FlutterPlatformViewFactory { return GoogleMapController( frame: frame, viewIdentifier: viewId, - creationParameters: args as! FGMPlatformMapViewCreationParams, registrar: registrar!) + creationParameters: args as! PlatformMapViewCreationParams, registrar: registrar!) } func createArgsCodec() -> any FlutterMessageCodec & NSObjectProtocol { - return FGMGetGoogleMapsFlutterPigeonMessagesCodec() + return MessagesPigeonCodec.shared } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GroundOverlayController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GroundOverlayController.swift index e69037287f36..b56f78e96743 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GroundOverlayController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GroundOverlayController.swift @@ -6,16 +6,12 @@ import GoogleMaps import GoogleMapsUtils import UIKit -#if canImport(google_maps_flutter_ios_sdk9_objc) - import google_maps_flutter_ios_sdk9_objc -#endif - /// Controller of a single ground overlay on the map. class GroundOverlayController: NSObject { let groundOverlay: GMSGroundOverlay private weak var mapView: GMSMapView? let createdWithBounds: Bool - var zoomLevel: NSNumber? + var zoomLevel: Double? init( groundOverlay: GMSGroundOverlay, identifier: String, mapView: GMSMapView, @@ -32,11 +28,12 @@ class GroundOverlayController: NSObject { groundOverlay.map = nil } - /// Updates the controller's ground overlay with the properties from a FGMPlatformGroundOverlay. + /// Updates the controller's ground overlay with the properties from a PlatformGroundOverlay. /// /// Setting the ground overlay to visible will set its map to the controller's mapView. func update( - from platformGroundOverlay: FGMPlatformGroundOverlay, assetProvider: AssetProvider, + from platformGroundOverlay: PlatformGroundOverlay, + assetProvider: AssetProvider, screenScale: CGFloat ) { if let mapView = mapView { @@ -51,12 +48,12 @@ class GroundOverlayController: NSObject { } } - /// Updates the given GMSGroundOverlay with the properties from a FGMPlatformGroundOverlay. + /// Updates the given GMSGroundOverlay with the properties from a PlatformGroundOverlay. /// /// Setting the ground overlay to visible will set its map to the given mapView. static func update( _ groundOverlay: GMSGroundOverlay, - from platformGroundOverlay: FGMPlatformGroundOverlay, + from platformGroundOverlay: PlatformGroundOverlay, mapView: GMSMapView, assetProvider: AssetProvider, screenScale: CGFloat, @@ -114,7 +111,7 @@ class GroundOverlaysController: NSObject { super.init() } - func add(_ groundOverlaysToAdd: [FGMPlatformGroundOverlay]) { + func add(_ groundOverlaysToAdd: [PlatformGroundOverlay]) { guard let mapView = mapView else { return } let screenScale = getScreenScale() for groundOverlay in groundOverlaysToAdd { @@ -136,7 +133,7 @@ class GroundOverlaysController: NSObject { ), // The actual icon will be set in the update() call below. icon: nil, - zoomLevel: CGFloat(zoomLevel.doubleValue) + zoomLevel: CGFloat(zoomLevel) ) } else { isCreatedWithBounds = true @@ -169,6 +166,7 @@ class GroundOverlaysController: NSObject { mapView: mapView, isCreatedWithBounds: isCreatedWithBounds ) + let zoomLevel = groundOverlay.zoomLevel controller.zoomLevel = groundOverlay.zoomLevel controller.update( from: groundOverlay, @@ -179,7 +177,7 @@ class GroundOverlaysController: NSObject { } } - func change(_ groundOverlaysToChange: [FGMPlatformGroundOverlay]) { + func change(_ groundOverlaysToChange: [PlatformGroundOverlay]) { let screenScale = getScreenScale() for groundOverlay in groundOverlaysToChange { let identifier = groundOverlay.groundOverlayId @@ -220,11 +218,11 @@ class GroundOverlaysController: NSObject { return mapView?.traitCollection.displayScale ?? 1.0 } - func groundOverlay(withIdentifier identifier: String) -> FGMPlatformGroundOverlay? { + func groundOverlay(withIdentifier identifier: String) -> PlatformGroundOverlay? { guard let controller = groundOverlayControllerByIdentifier[identifier] else { return nil } - return FGMPlatformGroundOverlay.make( + return PlatformGroundOverlay.make( from: controller.groundOverlay, overlayId: identifier, isCreatedWithBounds: controller.createdWithBounds, diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/HeatmapController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/HeatmapController.swift index e777b374e129..b65b05bc7aa4 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/HeatmapController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/HeatmapController.swift @@ -5,16 +5,12 @@ import GoogleMaps import GoogleMapsUtils -#if canImport(google_maps_flutter_ios_sdk9_objc) - import google_maps_flutter_ios_sdk9_objc -#endif - /// Controller of a single Heatmap on the map. class HeatmapController: NSObject { let heatmapTileLayer: GMUHeatmapTileLayer private weak var mapView: GMSMapView? - init(heatmap: FGMPlatformHeatmap, tileLayer: GMUHeatmapTileLayer, mapView: GMSMapView) { + init(heatmap: PlatformHeatmap, tileLayer: GMUHeatmapTileLayer, mapView: GMSMapView) { self.heatmapTileLayer = tileLayer self.mapView = mapView super.init() @@ -29,7 +25,7 @@ class HeatmapController: NSObject { heatmapTileLayer.clearTileCache() } - func update(from platformHeatmap: FGMPlatformHeatmap) { + func update(from platformHeatmap: PlatformHeatmap) { if let mapView = mapView { HeatmapController.update(heatmapTileLayer, from: platformHeatmap, mapView: mapView) } @@ -40,7 +36,7 @@ class HeatmapController: NSObject { /// Setting the heatmap to visible will set its map to the given mapView. static func update( _ heatmapTileLayer: GMUHeatmapTileLayer, - from platformHeatmap: FGMPlatformHeatmap, + from platformHeatmap: PlatformHeatmap, mapView: GMSMapView ) { heatmapTileLayer.weightedData = platformHeatmap.data.map({ $0.toGMUWeightedLatLng() }) @@ -68,7 +64,7 @@ class HeatmapsController: NSObject { super.init() } - func add(_ heatmapsToAdd: [FGMPlatformHeatmap]) { + func add(_ heatmapsToAdd: [PlatformHeatmap]) { guard let mapView = mapView else { return } for heatmap in heatmapsToAdd { let heatmapTileLayer = GMUHeatmapTileLayer() @@ -81,7 +77,7 @@ class HeatmapsController: NSObject { } } - func change(_ heatmapsToChange: [FGMPlatformHeatmap]) { + func change(_ heatmapsToChange: [PlatformHeatmap]) { for heatmap in heatmapsToChange { if let controller = heatmapIdToController[heatmap.heatmapId] { controller.update(from: heatmap) @@ -103,17 +99,17 @@ class HeatmapsController: NSObject { return heatmapIdToController[identifier] != nil } - func heatmap(withIdentifier identifier: String) -> FGMPlatformHeatmap? { + func heatmap(withIdentifier identifier: String) -> PlatformHeatmap? { guard let controller = heatmapIdToController[identifier] else { return nil } let heatmap = controller.heatmapTileLayer - return FGMPlatformHeatmap.make( - withHeatmapId: identifier, - data: heatmap.weightedData.map { FGMPlatformWeightedLatLng.make(from: $0) }, - gradient: FGMPlatformHeatmapGradient.make(from: heatmap.gradient), + return PlatformHeatmap( + heatmapId: identifier, + data: heatmap.weightedData.map { PlatformWeightedLatLng.make(from: $0) }, + gradient: PlatformHeatmapGradient.make(from: heatmap.gradient), opacity: Double(heatmap.opacity), - radius: Int(heatmap.radius), - minimumZoomIntensity: Int(heatmap.minimumZoomIntensity), - maximumZoomIntensity: Int(heatmap.maximumZoomIntensity) + radius: Int64(heatmap.radius), + minimumZoomIntensity: Int64(heatmap.minimumZoomIntensity), + maximumZoomIntensity: Int64(heatmap.maximumZoomIntensity) ) } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ImageUtils.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ImageUtils.swift index 7d47237a6543..5560d0eed5ef 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ImageUtils.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ImageUtils.swift @@ -6,11 +6,7 @@ import Flutter import GoogleMaps import UIKit -#if canImport(google_maps_flutter_ios_sdk9_objc) - import google_maps_flutter_ios_sdk9_objc -#endif - -extension FGMPlatformBitmap { +extension PlatformBitmap { /// Creates a UIImage from the Pigeon bitmap representation, suitable for use as a marker icon. func createIcon( assetProvider: AssetProvider, @@ -23,15 +19,14 @@ extension FGMPlatformBitmap { // See comment in messages.dart for why this is so loosely typed. See also // https://github.com/flutter/flutter/issues/117819. switch bitmap { - case let bitmap as FGMPlatformBitmapDefaultMarker: - let hue = bitmap.hue?.doubleValue ?? 0 + case let bitmap as PlatformBitmapDefaultMarker: image = GMSMarker.markerImage( with: UIColor( - hue: CGFloat(hue) / 360.0, + hue: CGFloat(bitmap.hue ?? 0) / 360.0, saturation: 1.0, brightness: 0.7, alpha: 1.0)) - case let bitmap as FGMPlatformBitmapAsset: + case let bitmap as PlatformBitmapAsset: // Deprecated: This message handling for 'fromAsset' has been replaced by 'asset'. // Refer to the flutter google_maps_flutter_platform_interface package for details. if let pkg = bitmap.pkg { @@ -43,7 +38,7 @@ extension FGMPlatformBitmap { image = assetProvider.imageNamed(key) } } - case let bitmap as FGMPlatformBitmapAssetImage: + case let bitmap as PlatformBitmapAssetImage: // Deprecated: This message handling for 'fromAssetImage' has been replaced by 'asset'. // Refer to the flutter google_maps_flutter_platform_interface package for details. if let key = assetProvider.lookupKey(forAsset: bitmap.name) { @@ -51,11 +46,11 @@ extension FGMPlatformBitmap { image = scaledImage(assetImage, scale: bitmap.scale) } } - case let bitmap as FGMPlatformBitmapBytes: + case let bitmap as PlatformBitmapBytes: // Deprecated: This message handling for 'fromBytes' has been replaced by 'bytes'. // Refer to the flutter google_maps_flutter_platform_interface package for details. image = UIImage(data: bitmap.byteData.data, scale: screenScale) - case let bitmap as FGMPlatformBitmapAssetMap: + case let bitmap as PlatformBitmapAssetMap: if let key = assetProvider.lookupKey(forAsset: bitmap.assetName) { image = assetProvider.imageNamed(key) } @@ -69,7 +64,7 @@ extension FGMPlatformBitmap { image = scaledImage(currentImage, scale: CGFloat(bitmap.imagePixelRatio)) } } - case let bitmap as FGMPlatformBitmapBytesMap: + case let bitmap as PlatformBitmapBytesMap: let bytes = bitmap.byteData image = UIImage(data: bytes.data, scale: screenScale) if let currentImage = image { @@ -88,7 +83,7 @@ extension FGMPlatformBitmap { image = UIImage(data: bytes.data) } } - case let bitmap as FGMPlatformBitmapPinConfig: + case let bitmap as PlatformBitmapPinConfig: let options = GMSPinImageOptions() if let backgroundColor = bitmap.backgroundColor { options.backgroundColor = backgroundColor.toUIColor() @@ -209,16 +204,16 @@ private func scaledImage(_ image: UIImage, to size: CGSize) -> UIImage { /// widht and height are not given. private func scaledImage( _ image: UIImage, - width: NSNumber?, - height: NSNumber?, + width: Double?, + height: Double?, screenScale: CGFloat ) -> UIImage { if width == nil && height == nil { return image } - let targetWidth = width == nil ? image.size.width : CGFloat(width!.doubleValue) - let targetHeight = height == nil ? image.size.height : CGFloat(height!.doubleValue) + let targetWidth = width ?? image.size.width + let targetHeight = height ?? image.size.height var calculatedWidth = targetWidth var calculatedHeight = targetHeight diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MapEventDelegate.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MapEventDelegate.swift index f3125ba6199c..2c90d8d235bb 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MapEventDelegate.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MapEventDelegate.swift @@ -8,7 +8,7 @@ /// Delegate for map event notifications. /// -/// This is abstraction of the map event portions of FGMMapsCallbackApi, to +/// This is abstraction of the map event portions of MapsCallbackApi, to /// avoid coupling all the individual controllers to the Pigeon implementation /// of event handling, and to allow for mocks/fakes in unit tests. protocol MapEventDelegate: AnyObject { @@ -16,28 +16,28 @@ protocol MapEventDelegate: AnyObject { func didStartCameraMove() /// Called when the map camera moves. - func didMoveCamera(to cameraPosition: FGMPlatformCameraPosition) + func didMoveCamera(to cameraPosition: PlatformCameraPosition) /// Called when the map camera stops moving. func didIdleCamera() /// Called when the map, not a specifc map object, is tapped. - func didTap(at position: FGMPlatformLatLng) + func didTap(at position: PlatformLatLng) /// Called when the map, not a specifc map object, is long pressed. - func didLongPress(at position: FGMPlatformLatLng) + func didLongPress(at position: PlatformLatLng) /// Called when a marker is tapped. func didTapMarker(withIdentifier markerId: String) /// Called when a marker drag starts. - func didStartDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) + func didStartDragForMarker(withIdentifier markerId: String, at position: PlatformLatLng) /// Called when a marker drag updates. - func didDragMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) + func didDragMarker(withIdentifier markerId: String, at position: PlatformLatLng) /// Called when a marker drag ends. - func didEndDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) + func didEndDragForMarker(withIdentifier markerId: String, at position: PlatformLatLng) /// Called when a marker's info window is tapped. func didTapInfoWindowOfMarker(withIdentifier markerId: String) @@ -46,7 +46,7 @@ protocol MapEventDelegate: AnyObject { func didTapCircle(withIdentifier circleId: String) /// Called when a marker cluster is tapped. - func didTapCluster(_ cluster: FGMPlatformCluster) + func didTapCluster(_ cluster: PlatformCluster) /// Called when a polygon is tapped. func didTapPolygon(withIdentifier polygonId: String) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MarkerController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MarkerController.swift index 97cda598470d..5cd3d106472e 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MarkerController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MarkerController.swift @@ -6,10 +6,6 @@ import Flutter import GoogleMaps import UIKit -#if canImport(google_maps_flutter_ios_sdk9_objc) - import google_maps_flutter_ios_sdk9_objc -#endif - /// Defines marker controllable by Flutter. class MarkerController: NSObject { let marker: GMSMarker @@ -43,11 +39,11 @@ class MarkerController: NSObject { marker.map = nil } - /// Updates the controller's marker with the properties from a FGMPlatformMarker. + /// Updates the controller's marker with the properties from a PlatformMarker. /// /// Setting the marker to visible will set its map to the controller's mapView. func update( - from platformMarker: FGMPlatformMarker, + from platformMarker: PlatformMarker, assetProvider: AssetProvider, screenScale: CGFloat ) { @@ -71,12 +67,12 @@ class MarkerController: NSObject { ) } - /// Updates the given GMSMarker with the properties from a FGMPlatformMarker. + /// Updates the given GMSMarker with the properties from a PlatformMarker. /// /// Setting the marker to visible will set its map to the given mapView. static func update( _ marker: GMSMarker, - from platformMarker: FGMPlatformMarker, + from platformMarker: PlatformMarker, mapView: GMSMapView?, assetProvider: AssetProvider, screenScale: CGFloat, @@ -102,7 +98,7 @@ class MarkerController: NSObject { if let advancedMarker = marker as? GMSAdvancedMarker, let collisionBehaviorValue = platformMarker.collisionBehavior { - advancedMarker.collisionBehavior = collisionBehaviorValue.value.gmsCollisionBehavior + advancedMarker.collisionBehavior = collisionBehaviorValue.gmsCollisionBehavior } // This must be done last, to avoid visual flickers of default property values. @@ -122,14 +118,14 @@ class MarkersController: NSObject { private weak var clusterManagersController: ClusterManagersController? private let assetProvider: AssetProvider private weak var mapView: GMSMapView? - private let markerType: FGMPlatformMarkerType + private let markerType: PlatformMarkerType init( mapView: GMSMapView, eventDelegate: MapEventDelegate, clusterManagersController: ClusterManagersController?, assetProvider: AssetProvider, - markerType: FGMPlatformMarkerType + markerType: PlatformMarkerType ) { self.mapView = mapView self.eventDelegate = eventDelegate @@ -139,13 +135,13 @@ class MarkersController: NSObject { super.init() } - func add(_ markersToAdd: [FGMPlatformMarker]) { + func add(_ markersToAdd: [PlatformMarker]) { for marker in markersToAdd { addMarker(marker) } } - private func addMarker(_ markerToAdd: FGMPlatformMarker) { + private func addMarker(_ markerToAdd: PlatformMarker) { guard let mapView = mapView else { return } let position = markerToAdd.position.toCLLocationCoordinate2D() let markerIdentifier = markerToAdd.markerId @@ -175,13 +171,13 @@ class MarkersController: NSObject { markerIdentifierToController[markerIdentifier] = controller } - func change(_ markersToChange: [FGMPlatformMarker]) { + func change(_ markersToChange: [PlatformMarker]) { for marker in markersToChange { changeMarker(marker) } } - private func changeMarker(_ markerToChange: FGMPlatformMarker) { + private func changeMarker(_ markerToChange: PlatformMarker) { let markerIdentifier = markerToChange.markerId guard let controller = markerIdentifierToController[markerIdentifier] else { return } @@ -231,7 +227,7 @@ class MarkersController: NSObject { guard markerIdentifierToController[identifier] != nil else { return } eventDelegate?.didStartDragForMarker( withIdentifier: identifier, - at: FGMPlatformLatLng.make(from: location) + at: PlatformLatLng.make(from: location) ) } @@ -239,7 +235,7 @@ class MarkersController: NSObject { guard markerIdentifierToController[identifier] != nil else { return } eventDelegate?.didDragMarker( withIdentifier: identifier, - at: FGMPlatformLatLng.make(from: location) + at: PlatformLatLng.make(from: location) ) } @@ -247,7 +243,7 @@ class MarkersController: NSObject { guard markerIdentifierToController[identifier] != nil else { return } eventDelegate?.didEndDragForMarker( withIdentifier: identifier, - at: FGMPlatformLatLng.make(from: location) + at: PlatformLatLng.make(from: location) ) } @@ -257,50 +253,37 @@ class MarkersController: NSObject { } } - func showMarkerInfoWindow( - withIdentifier identifier: String, - error: AutoreleasingUnsafeMutablePointer - ) { - if let controller = markerIdentifierToController[identifier] { - controller.showInfoWindow() - } else { - error.pointee = FlutterError( + func showMarkerInfoWindow(withIdentifier identifier: String) throws { + guard let controller = markerIdentifierToController[identifier] else { + throw PigeonError( code: "Invalid markerId", message: "showInfoWindow called with invalid markerId", details: nil ) } + controller.showInfoWindow() } - func hideMarkerInfoWindow( - withIdentifier identifier: String, - error: AutoreleasingUnsafeMutablePointer - ) { - if let controller = markerIdentifierToController[identifier] { - controller.hideInfoWindow() - } else { - error.pointee = FlutterError( + func hideMarkerInfoWindow(withIdentifier identifier: String) throws { + guard let controller = markerIdentifierToController[identifier] else { + throw PigeonError( code: "Invalid markerId", message: "hideInfoWindow called with invalid markerId", details: nil ) } + controller.hideInfoWindow() } - func isInfoWindowShownForMarker( - withIdentifier identifier: String, - error: AutoreleasingUnsafeMutablePointer - ) -> NSNumber? { - if let controller = markerIdentifierToController[identifier] { - return NSNumber(value: controller.isInfoWindowShown()) - } else { - error.pointee = FlutterError( + func isInfoWindowShownForMarker(withIdentifier identifier: String) throws -> Bool { + guard let controller = markerIdentifierToController[identifier] else { + throw PigeonError( code: "Invalid markerId", message: "isInfoWindowShown called with invalid markerId", details: nil ) - return nil } + return controller.isInfoWindowShown() } func getScreenScale() -> CGFloat { diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/Messages.g.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/Messages.g.swift new file mode 100644 index 000000000000..b7a383670a1a --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/Messages.g.swift @@ -0,0 +1,4253 @@ +// Copyright 2013 The Flutter Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// Autogenerated from Pigeon (v27.3.2), do not edit directly. +// See also: https://pub.dev/packages/pigeon + +import Foundation + +#if os(iOS) + import Flutter +#elseif os(macOS) + import FlutterMacOS +#else + #error("Unsupported platform.") +#endif + +/// Error class for passing custom error details to Dart side. +final class PigeonError: Error { + let code: String + let message: String? + let details: Sendable? + + init(code: String, message: String?, details: Sendable?) { + self.code = code + self.message = message + self.details = details + } + + var localizedDescription: String { + return + "PigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" + } +} + +private func wrapResult(_ result: Any?) -> [Any?] { + return [result] +} + +private func wrapError(_ error: Any) -> [Any?] { + if let pigeonError = error as? PigeonError { + return [ + pigeonError.code, + pigeonError.message, + pigeonError.details, + ] + } + if let flutterError = error as? FlutterError { + return [ + flutterError.code, + flutterError.message, + flutterError.details, + ] + } + return [ + "\(error)", + "\(Swift.type(of: error))", + "Stacktrace: \(Thread.callStackSymbols)", + ] +} + +private func createConnectionError(withChannelName channelName: String) -> PigeonError { + return PigeonError( + code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", + details: "") +} + +enum MessagesPigeonInternal { + static func isNullish(_ value: Any?) -> Bool { + guard let innerValue = value else { + return true + } + + if case Optional.some(Optional.none) = value { + return true + } + + return innerValue is NSNull + } + static func doubleEquals(_ lhs: Double, _ rhs: Double) -> Bool { + return (lhs.isNaN && rhs.isNaN) || lhs == rhs + } + + static func doubleHash(_ value: Double, _ hasher: inout Hasher) { + if value.isNaN { + hasher.combine(0x7FF8_0000_0000_0000) + } else { + // Normalize -0.0 to 0.0 + hasher.combine(value == 0 ? 0 : value) + } + } + + static func deepEquals(_ lhs: Any?, _ rhs: Any?) -> Bool { + let cleanLhs = nilOrValue(lhs) as Any? + let cleanRhs = nilOrValue(rhs) as Any? + switch (cleanLhs, cleanRhs) { + case (nil, nil): + return true + + case (nil, _), (_, nil): + return false + + case (let lhs as AnyObject, let rhs as AnyObject) where lhs === rhs: + return true + + case is (Void, Void): + return true + + case (let lhsArray, let rhsArray) as ([Any?], [Any?]): + guard lhsArray.count == rhsArray.count else { return false } + for (index, element) in lhsArray.enumerated() { + if !deepEquals(element, rhsArray[index]) { + return false + } + } + return true + + case (let lhsArray, let rhsArray) as ([Double], [Double]): + guard lhsArray.count == rhsArray.count else { return false } + for (index, element) in lhsArray.enumerated() { + if !doubleEquals(element, rhsArray[index]) { + return false + } + } + return true + + case (let lhsDictionary, let rhsDictionary) as ([AnyHashable: Any?], [AnyHashable: Any?]): + guard lhsDictionary.count == rhsDictionary.count else { return false } + for (lhsKey, lhsValue) in lhsDictionary { + var found = false + for (rhsKey, rhsValue) in rhsDictionary { + if deepEquals(lhsKey, rhsKey) { + if deepEquals(lhsValue, rhsValue) { + found = true + break + } else { + return false + } + } + } + if !found { return false } + } + return true + + case (let lhs as Double, let rhs as Double): + return doubleEquals(lhs, rhs) + + case (let lhsHashable, let rhsHashable) as (AnyHashable, AnyHashable): + return lhsHashable == rhsHashable + + default: + return false + } + } + + static func deepHash(value: Any?, hasher: inout Hasher) { + let cleanValue = nilOrValue(value) as Any? + if let cleanValue = cleanValue { + if let doubleValue = cleanValue as? Double { + doubleHash(doubleValue, &hasher) + } else if let valueList = cleanValue as? [Any?] { + for item in valueList { + deepHash(value: item, hasher: &hasher) + } + } else if let valueList = cleanValue as? [Double] { + for item in valueList { + doubleHash(item, &hasher) + } + } else if let valueDict = cleanValue as? [AnyHashable: Any?] { + var result = 0 + for (key, value) in valueDict { + var entryKeyHasher = Hasher() + deepHash(value: key, hasher: &entryKeyHasher) + var entryValueHasher = Hasher() + deepHash(value: value, hasher: &entryValueHasher) + result = result &+ ((entryKeyHasher.finalize() &* 31) ^ entryValueHasher.finalize()) + } + hasher.combine(result) + } else if let hashableValue = cleanValue as? AnyHashable { + hasher.combine(hashableValue) + } else { + hasher.combine(String(describing: cleanValue)) + } + } else { + hasher.combine(0) + } + } + +} + +private func nilOrValue(_ value: Any?) -> T? { + if value is NSNull { return nil } + return value as! T? +} + +/// Pigeon equivalent of MapType +enum PlatformMapType: Int, CaseIterable { + case none = 0 + case normal = 1 + case satellite = 2 + case terrain = 3 + case hybrid = 4 +} + +/// Pigeon equivalent of the MarkerCollisionBehavior enum. +enum PlatformMarkerCollisionBehavior: Int, CaseIterable { + case requiredDisplay = 0 + case optionalAndHidesLowerPriority = 1 + case requiredAndHidesOptional = 2 +} + +/// Join types for polyline joints. +enum PlatformJointType: Int, CaseIterable { + case mitered = 0 + case bevel = 1 + case round = 2 +} + +/// Enumeration of possible types for PatternItem. +enum PlatformPatternItemType: Int, CaseIterable { + case dot = 0 + case dash = 1 + case gap = 2 +} + +enum PlatformMarkerType: Int, CaseIterable { + case marker = 0 + case advancedMarker = 1 +} + +/// Pigeon equivalent of [MapBitmapScaling]. +enum PlatformMapBitmapScaling: Int, CaseIterable { + case auto = 0 + case none = 1 +} + +/// Pigeon representatation of a CameraPosition. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraPosition: Hashable, CustomStringConvertible { + var bearing: Double + var target: PlatformLatLng + var tilt: Double + var zoom: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraPosition? { + let bearing = pigeonVar_list[0] as! Double + let target = pigeonVar_list[1] as! PlatformLatLng + let tilt = pigeonVar_list[2] as! Double + let zoom = pigeonVar_list[3] as! Double + + return PlatformCameraPosition( + bearing: bearing, + target: target, + tilt: tilt, + zoom: zoom + ) + } + func toList() -> [Any?] { + return [ + bearing, + target, + tilt, + zoom, + ] + } + static func == (lhs: PlatformCameraPosition, rhs: PlatformCameraPosition) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.bearing, rhs.bearing) + && MessagesPigeonInternal.deepEquals(lhs.target, rhs.target) + && MessagesPigeonInternal.deepEquals(lhs.tilt, rhs.tilt) + && MessagesPigeonInternal.deepEquals(lhs.zoom, rhs.zoom) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraPosition") + MessagesPigeonInternal.deepHash(value: bearing, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: target, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: tilt, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zoom, hasher: &hasher) + } + + public var description: String { + return + "PlatformCameraPosition(bearing: \(String(describing: bearing)), target: \(String(describing: target)), tilt: \(String(describing: tilt)), zoom: \(String(describing: zoom)))" + } +} + +/// Pigeon representation of a CameraUpdate. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdate: Hashable, CustomStringConvertible { + /// This Object must be one of the classes below prefixed with + /// PlatformCameraUpdate. Each such class represents a different type of + /// camera update, and each holds a different set of data, preventing the + /// use of a single unified class. + var cameraUpdate: Any + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdate? { + let cameraUpdate = pigeonVar_list[0]! + + return PlatformCameraUpdate( + cameraUpdate: cameraUpdate + ) + } + func toList() -> [Any?] { + return [ + cameraUpdate + ] + } + static func == (lhs: PlatformCameraUpdate, rhs: PlatformCameraUpdate) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.cameraUpdate, rhs.cameraUpdate) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdate") + MessagesPigeonInternal.deepHash(value: cameraUpdate, hasher: &hasher) + } + + public var description: String { + return "PlatformCameraUpdate(cameraUpdate: \(String(describing: cameraUpdate)))" + } +} + +/// Pigeon equivalent of NewCameraPosition +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateNewCameraPosition: Hashable, CustomStringConvertible { + var cameraPosition: PlatformCameraPosition + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateNewCameraPosition? { + let cameraPosition = pigeonVar_list[0] as! PlatformCameraPosition + + return PlatformCameraUpdateNewCameraPosition( + cameraPosition: cameraPosition + ) + } + func toList() -> [Any?] { + return [ + cameraPosition + ] + } + static func == ( + lhs: PlatformCameraUpdateNewCameraPosition, rhs: PlatformCameraUpdateNewCameraPosition + ) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.cameraPosition, rhs.cameraPosition) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateNewCameraPosition") + MessagesPigeonInternal.deepHash(value: cameraPosition, hasher: &hasher) + } + + public var description: String { + return + "PlatformCameraUpdateNewCameraPosition(cameraPosition: \(String(describing: cameraPosition)))" + } +} + +/// Pigeon equivalent of NewLatLng +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateNewLatLng: Hashable, CustomStringConvertible { + var latLng: PlatformLatLng + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateNewLatLng? { + let latLng = pigeonVar_list[0] as! PlatformLatLng + + return PlatformCameraUpdateNewLatLng( + latLng: latLng + ) + } + func toList() -> [Any?] { + return [ + latLng + ] + } + static func == (lhs: PlatformCameraUpdateNewLatLng, rhs: PlatformCameraUpdateNewLatLng) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.latLng, rhs.latLng) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateNewLatLng") + MessagesPigeonInternal.deepHash(value: latLng, hasher: &hasher) + } + + public var description: String { + return "PlatformCameraUpdateNewLatLng(latLng: \(String(describing: latLng)))" + } +} + +/// Pigeon equivalent of NewLatLngBounds +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateNewLatLngBounds: Hashable, CustomStringConvertible { + var bounds: PlatformLatLngBounds + var padding: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateNewLatLngBounds? { + let bounds = pigeonVar_list[0] as! PlatformLatLngBounds + let padding = pigeonVar_list[1] as! Double + + return PlatformCameraUpdateNewLatLngBounds( + bounds: bounds, + padding: padding + ) + } + func toList() -> [Any?] { + return [ + bounds, + padding, + ] + } + static func == ( + lhs: PlatformCameraUpdateNewLatLngBounds, rhs: PlatformCameraUpdateNewLatLngBounds + ) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.bounds, rhs.bounds) + && MessagesPigeonInternal.deepEquals(lhs.padding, rhs.padding) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateNewLatLngBounds") + MessagesPigeonInternal.deepHash(value: bounds, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: padding, hasher: &hasher) + } + + public var description: String { + return + "PlatformCameraUpdateNewLatLngBounds(bounds: \(String(describing: bounds)), padding: \(String(describing: padding)))" + } +} + +/// Pigeon equivalent of NewLatLngZoom +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateNewLatLngZoom: Hashable, CustomStringConvertible { + var latLng: PlatformLatLng + var zoom: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateNewLatLngZoom? { + let latLng = pigeonVar_list[0] as! PlatformLatLng + let zoom = pigeonVar_list[1] as! Double + + return PlatformCameraUpdateNewLatLngZoom( + latLng: latLng, + zoom: zoom + ) + } + func toList() -> [Any?] { + return [ + latLng, + zoom, + ] + } + static func == (lhs: PlatformCameraUpdateNewLatLngZoom, rhs: PlatformCameraUpdateNewLatLngZoom) + -> Bool + { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.latLng, rhs.latLng) + && MessagesPigeonInternal.deepEquals(lhs.zoom, rhs.zoom) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateNewLatLngZoom") + MessagesPigeonInternal.deepHash(value: latLng, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zoom, hasher: &hasher) + } + + public var description: String { + return + "PlatformCameraUpdateNewLatLngZoom(latLng: \(String(describing: latLng)), zoom: \(String(describing: zoom)))" + } +} + +/// Pigeon equivalent of ScrollBy +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateScrollBy: Hashable, CustomStringConvertible { + var dx: Double + var dy: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateScrollBy? { + let dx = pigeonVar_list[0] as! Double + let dy = pigeonVar_list[1] as! Double + + return PlatformCameraUpdateScrollBy( + dx: dx, + dy: dy + ) + } + func toList() -> [Any?] { + return [ + dx, + dy, + ] + } + static func == (lhs: PlatformCameraUpdateScrollBy, rhs: PlatformCameraUpdateScrollBy) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.dx, rhs.dx) + && MessagesPigeonInternal.deepEquals(lhs.dy, rhs.dy) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateScrollBy") + MessagesPigeonInternal.deepHash(value: dx, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: dy, hasher: &hasher) + } + + public var description: String { + return + "PlatformCameraUpdateScrollBy(dx: \(String(describing: dx)), dy: \(String(describing: dy)))" + } +} + +/// Pigeon equivalent of ZoomBy +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateZoomBy: Hashable, CustomStringConvertible { + var amount: Double + var focus: PlatformPoint? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateZoomBy? { + let amount = pigeonVar_list[0] as! Double + let focus: PlatformPoint? = nilOrValue(pigeonVar_list[1]) + + return PlatformCameraUpdateZoomBy( + amount: amount, + focus: focus + ) + } + func toList() -> [Any?] { + return [ + amount, + focus, + ] + } + static func == (lhs: PlatformCameraUpdateZoomBy, rhs: PlatformCameraUpdateZoomBy) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.amount, rhs.amount) + && MessagesPigeonInternal.deepEquals(lhs.focus, rhs.focus) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateZoomBy") + MessagesPigeonInternal.deepHash(value: amount, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: focus, hasher: &hasher) + } + + public var description: String { + return + "PlatformCameraUpdateZoomBy(amount: \(String(describing: amount)), focus: \(String(describing: focus)))" + } +} + +/// Pigeon equivalent of ZoomIn/ZoomOut +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateZoom: Hashable, CustomStringConvertible { + var out: Bool + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateZoom? { + let out = pigeonVar_list[0] as! Bool + + return PlatformCameraUpdateZoom( + out: out + ) + } + func toList() -> [Any?] { + return [ + out + ] + } + static func == (lhs: PlatformCameraUpdateZoom, rhs: PlatformCameraUpdateZoom) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.out, rhs.out) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateZoom") + MessagesPigeonInternal.deepHash(value: out, hasher: &hasher) + } + + public var description: String { + return "PlatformCameraUpdateZoom(out: \(String(describing: out)))" + } +} + +/// Pigeon equivalent of ZoomTo +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateZoomTo: Hashable, CustomStringConvertible { + var zoom: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateZoomTo? { + let zoom = pigeonVar_list[0] as! Double + + return PlatformCameraUpdateZoomTo( + zoom: zoom + ) + } + func toList() -> [Any?] { + return [ + zoom + ] + } + static func == (lhs: PlatformCameraUpdateZoomTo, rhs: PlatformCameraUpdateZoomTo) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.zoom, rhs.zoom) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateZoomTo") + MessagesPigeonInternal.deepHash(value: zoom, hasher: &hasher) + } + + public var description: String { + return "PlatformCameraUpdateZoomTo(zoom: \(String(describing: zoom)))" + } +} + +/// Pigeon equivalent of the Circle class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCircle: Hashable, CustomStringConvertible { + var consumeTapEvents: Bool + var fillColor: PlatformColor + var strokeColor: PlatformColor + var visible: Bool + var strokeWidth: Int64 + var zIndex: Double + var center: PlatformLatLng + var radius: Double + var circleId: String + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCircle? { + let consumeTapEvents = pigeonVar_list[0] as! Bool + let fillColor = pigeonVar_list[1] as! PlatformColor + let strokeColor = pigeonVar_list[2] as! PlatformColor + let visible = pigeonVar_list[3] as! Bool + let strokeWidth = pigeonVar_list[4] as! Int64 + let zIndex = pigeonVar_list[5] as! Double + let center = pigeonVar_list[6] as! PlatformLatLng + let radius = pigeonVar_list[7] as! Double + let circleId = pigeonVar_list[8] as! String + + return PlatformCircle( + consumeTapEvents: consumeTapEvents, + fillColor: fillColor, + strokeColor: strokeColor, + visible: visible, + strokeWidth: strokeWidth, + zIndex: zIndex, + center: center, + radius: radius, + circleId: circleId + ) + } + func toList() -> [Any?] { + return [ + consumeTapEvents, + fillColor, + strokeColor, + visible, + strokeWidth, + zIndex, + center, + radius, + circleId, + ] + } + static func == (lhs: PlatformCircle, rhs: PlatformCircle) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.consumeTapEvents, rhs.consumeTapEvents) + && MessagesPigeonInternal.deepEquals(lhs.fillColor, rhs.fillColor) + && MessagesPigeonInternal.deepEquals(lhs.strokeColor, rhs.strokeColor) + && MessagesPigeonInternal.deepEquals(lhs.visible, rhs.visible) + && MessagesPigeonInternal.deepEquals(lhs.strokeWidth, rhs.strokeWidth) + && MessagesPigeonInternal.deepEquals(lhs.zIndex, rhs.zIndex) + && MessagesPigeonInternal.deepEquals(lhs.center, rhs.center) + && MessagesPigeonInternal.deepEquals(lhs.radius, rhs.radius) + && MessagesPigeonInternal.deepEquals(lhs.circleId, rhs.circleId) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCircle") + MessagesPigeonInternal.deepHash(value: consumeTapEvents, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: fillColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: strokeColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: visible, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: strokeWidth, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zIndex, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: center, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: radius, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: circleId, hasher: &hasher) + } + + public var description: String { + return + "PlatformCircle(consumeTapEvents: \(String(describing: consumeTapEvents)), fillColor: \(String(describing: fillColor)), strokeColor: \(String(describing: strokeColor)), visible: \(String(describing: visible)), strokeWidth: \(String(describing: strokeWidth)), zIndex: \(String(describing: zIndex)), center: \(String(describing: center)), radius: \(String(describing: radius)), circleId: \(String(describing: circleId)))" + } +} + +/// Pigeon equivalent of the Heatmap class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformHeatmap: Hashable, CustomStringConvertible { + var heatmapId: String + var data: [PlatformWeightedLatLng] + var gradient: PlatformHeatmapGradient? = nil + var opacity: Double + var radius: Int64 + var minimumZoomIntensity: Int64 + var maximumZoomIntensity: Int64 + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformHeatmap? { + let heatmapId = pigeonVar_list[0] as! String + let data = pigeonVar_list[1] as! [PlatformWeightedLatLng] + let gradient: PlatformHeatmapGradient? = nilOrValue(pigeonVar_list[2]) + let opacity = pigeonVar_list[3] as! Double + let radius = pigeonVar_list[4] as! Int64 + let minimumZoomIntensity = pigeonVar_list[5] as! Int64 + let maximumZoomIntensity = pigeonVar_list[6] as! Int64 + + return PlatformHeatmap( + heatmapId: heatmapId, + data: data, + gradient: gradient, + opacity: opacity, + radius: radius, + minimumZoomIntensity: minimumZoomIntensity, + maximumZoomIntensity: maximumZoomIntensity + ) + } + func toList() -> [Any?] { + return [ + heatmapId, + data, + gradient, + opacity, + radius, + minimumZoomIntensity, + maximumZoomIntensity, + ] + } + static func == (lhs: PlatformHeatmap, rhs: PlatformHeatmap) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.heatmapId, rhs.heatmapId) + && MessagesPigeonInternal.deepEquals(lhs.data, rhs.data) + && MessagesPigeonInternal.deepEquals(lhs.gradient, rhs.gradient) + && MessagesPigeonInternal.deepEquals(lhs.opacity, rhs.opacity) + && MessagesPigeonInternal.deepEquals(lhs.radius, rhs.radius) + && MessagesPigeonInternal.deepEquals(lhs.minimumZoomIntensity, rhs.minimumZoomIntensity) + && MessagesPigeonInternal.deepEquals(lhs.maximumZoomIntensity, rhs.maximumZoomIntensity) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformHeatmap") + MessagesPigeonInternal.deepHash(value: heatmapId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: data, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: gradient, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: opacity, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: radius, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: minimumZoomIntensity, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: maximumZoomIntensity, hasher: &hasher) + } + + public var description: String { + return + "PlatformHeatmap(heatmapId: \(String(describing: heatmapId)), data: \(String(describing: data)), gradient: \(String(describing: gradient)), opacity: \(String(describing: opacity)), radius: \(String(describing: radius)), minimumZoomIntensity: \(String(describing: minimumZoomIntensity)), maximumZoomIntensity: \(String(describing: maximumZoomIntensity)))" + } +} + +/// Pigeon equivalent of the HeatmapGradient class. +/// +/// The GMUGradient structure is slightly different from HeatmapGradient, so +/// this matches the iOS API so that conversion can be done on the Dart side +/// where the structures are easier to work with. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformHeatmapGradient: Hashable, CustomStringConvertible { + var colors: [PlatformColor] + var startPoints: [Double] + var colorMapSize: Int64 + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformHeatmapGradient? { + let colors = pigeonVar_list[0] as! [PlatformColor] + let startPoints = pigeonVar_list[1] as! [Double] + let colorMapSize = pigeonVar_list[2] as! Int64 + + return PlatformHeatmapGradient( + colors: colors, + startPoints: startPoints, + colorMapSize: colorMapSize + ) + } + func toList() -> [Any?] { + return [ + colors, + startPoints, + colorMapSize, + ] + } + static func == (lhs: PlatformHeatmapGradient, rhs: PlatformHeatmapGradient) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.colors, rhs.colors) + && MessagesPigeonInternal.deepEquals(lhs.startPoints, rhs.startPoints) + && MessagesPigeonInternal.deepEquals(lhs.colorMapSize, rhs.colorMapSize) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformHeatmapGradient") + MessagesPigeonInternal.deepHash(value: colors, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: startPoints, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: colorMapSize, hasher: &hasher) + } + + public var description: String { + return + "PlatformHeatmapGradient(colors: \(String(describing: colors)), startPoints: \(String(describing: startPoints)), colorMapSize: \(String(describing: colorMapSize)))" + } +} + +/// Pigeon equivalent of the WeightedLatLng class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformWeightedLatLng: Hashable, CustomStringConvertible { + var point: PlatformLatLng + var weight: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformWeightedLatLng? { + let point = pigeonVar_list[0] as! PlatformLatLng + let weight = pigeonVar_list[1] as! Double + + return PlatformWeightedLatLng( + point: point, + weight: weight + ) + } + func toList() -> [Any?] { + return [ + point, + weight, + ] + } + static func == (lhs: PlatformWeightedLatLng, rhs: PlatformWeightedLatLng) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.point, rhs.point) + && MessagesPigeonInternal.deepEquals(lhs.weight, rhs.weight) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformWeightedLatLng") + MessagesPigeonInternal.deepHash(value: point, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: weight, hasher: &hasher) + } + + public var description: String { + return + "PlatformWeightedLatLng(point: \(String(describing: point)), weight: \(String(describing: weight)))" + } +} + +/// Pigeon equivalent of the InfoWindow class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformInfoWindow: Hashable, CustomStringConvertible { + var title: String? = nil + var snippet: String? = nil + var anchor: PlatformPoint + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformInfoWindow? { + let title: String? = nilOrValue(pigeonVar_list[0]) + let snippet: String? = nilOrValue(pigeonVar_list[1]) + let anchor = pigeonVar_list[2] as! PlatformPoint + + return PlatformInfoWindow( + title: title, + snippet: snippet, + anchor: anchor + ) + } + func toList() -> [Any?] { + return [ + title, + snippet, + anchor, + ] + } + static func == (lhs: PlatformInfoWindow, rhs: PlatformInfoWindow) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.title, rhs.title) + && MessagesPigeonInternal.deepEquals(lhs.snippet, rhs.snippet) + && MessagesPigeonInternal.deepEquals(lhs.anchor, rhs.anchor) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformInfoWindow") + MessagesPigeonInternal.deepHash(value: title, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: snippet, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: anchor, hasher: &hasher) + } + + public var description: String { + return + "PlatformInfoWindow(title: \(String(describing: title)), snippet: \(String(describing: snippet)), anchor: \(String(describing: anchor)))" + } +} + +/// Pigeon equivalent of Cluster. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCluster: Hashable, CustomStringConvertible { + var clusterManagerId: String + var position: PlatformLatLng + var bounds: PlatformLatLngBounds + var markerIds: [String] + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCluster? { + let clusterManagerId = pigeonVar_list[0] as! String + let position = pigeonVar_list[1] as! PlatformLatLng + let bounds = pigeonVar_list[2] as! PlatformLatLngBounds + let markerIds = pigeonVar_list[3] as! [String] + + return PlatformCluster( + clusterManagerId: clusterManagerId, + position: position, + bounds: bounds, + markerIds: markerIds + ) + } + func toList() -> [Any?] { + return [ + clusterManagerId, + position, + bounds, + markerIds, + ] + } + static func == (lhs: PlatformCluster, rhs: PlatformCluster) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.clusterManagerId, rhs.clusterManagerId) + && MessagesPigeonInternal.deepEquals(lhs.position, rhs.position) + && MessagesPigeonInternal.deepEquals(lhs.bounds, rhs.bounds) + && MessagesPigeonInternal.deepEquals(lhs.markerIds, rhs.markerIds) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCluster") + MessagesPigeonInternal.deepHash(value: clusterManagerId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: position, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: bounds, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: markerIds, hasher: &hasher) + } + + public var description: String { + return + "PlatformCluster(clusterManagerId: \(String(describing: clusterManagerId)), position: \(String(describing: position)), bounds: \(String(describing: bounds)), markerIds: \(String(describing: markerIds)))" + } +} + +/// Pigeon equivalent of the ClusterManager class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformClusterManager: Hashable, CustomStringConvertible { + var identifier: String + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformClusterManager? { + let identifier = pigeonVar_list[0] as! String + + return PlatformClusterManager( + identifier: identifier + ) + } + func toList() -> [Any?] { + return [ + identifier + ] + } + static func == (lhs: PlatformClusterManager, rhs: PlatformClusterManager) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.identifier, rhs.identifier) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformClusterManager") + MessagesPigeonInternal.deepHash(value: identifier, hasher: &hasher) + } + + public var description: String { + return "PlatformClusterManager(identifier: \(String(describing: identifier)))" + } +} + +/// Pigeon equivalent of the Marker class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformMarker: Hashable, CustomStringConvertible { + var alpha: Double + var anchor: PlatformPoint + var consumeTapEvents: Bool + var draggable: Bool + var flat: Bool + var icon: PlatformBitmap + var infoWindow: PlatformInfoWindow + var position: PlatformLatLng + var rotation: Double + var visible: Bool + var zIndex: Int64 + var markerId: String + var clusterManagerId: String? = nil + var collisionBehavior: PlatformMarkerCollisionBehavior? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformMarker? { + let alpha = pigeonVar_list[0] as! Double + let anchor = pigeonVar_list[1] as! PlatformPoint + let consumeTapEvents = pigeonVar_list[2] as! Bool + let draggable = pigeonVar_list[3] as! Bool + let flat = pigeonVar_list[4] as! Bool + let icon = pigeonVar_list[5] as! PlatformBitmap + let infoWindow = pigeonVar_list[6] as! PlatformInfoWindow + let position = pigeonVar_list[7] as! PlatformLatLng + let rotation = pigeonVar_list[8] as! Double + let visible = pigeonVar_list[9] as! Bool + let zIndex = pigeonVar_list[10] as! Int64 + let markerId = pigeonVar_list[11] as! String + let clusterManagerId: String? = nilOrValue(pigeonVar_list[12]) + let collisionBehavior: PlatformMarkerCollisionBehavior? = nilOrValue(pigeonVar_list[13]) + + return PlatformMarker( + alpha: alpha, + anchor: anchor, + consumeTapEvents: consumeTapEvents, + draggable: draggable, + flat: flat, + icon: icon, + infoWindow: infoWindow, + position: position, + rotation: rotation, + visible: visible, + zIndex: zIndex, + markerId: markerId, + clusterManagerId: clusterManagerId, + collisionBehavior: collisionBehavior + ) + } + func toList() -> [Any?] { + return [ + alpha, + anchor, + consumeTapEvents, + draggable, + flat, + icon, + infoWindow, + position, + rotation, + visible, + zIndex, + markerId, + clusterManagerId, + collisionBehavior, + ] + } + static func == (lhs: PlatformMarker, rhs: PlatformMarker) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.alpha, rhs.alpha) + && MessagesPigeonInternal.deepEquals(lhs.anchor, rhs.anchor) + && MessagesPigeonInternal.deepEquals(lhs.consumeTapEvents, rhs.consumeTapEvents) + && MessagesPigeonInternal.deepEquals(lhs.draggable, rhs.draggable) + && MessagesPigeonInternal.deepEquals(lhs.flat, rhs.flat) + && MessagesPigeonInternal.deepEquals(lhs.icon, rhs.icon) + && MessagesPigeonInternal.deepEquals(lhs.infoWindow, rhs.infoWindow) + && MessagesPigeonInternal.deepEquals(lhs.position, rhs.position) + && MessagesPigeonInternal.deepEquals(lhs.rotation, rhs.rotation) + && MessagesPigeonInternal.deepEquals(lhs.visible, rhs.visible) + && MessagesPigeonInternal.deepEquals(lhs.zIndex, rhs.zIndex) + && MessagesPigeonInternal.deepEquals(lhs.markerId, rhs.markerId) + && MessagesPigeonInternal.deepEquals(lhs.clusterManagerId, rhs.clusterManagerId) + && MessagesPigeonInternal.deepEquals(lhs.collisionBehavior, rhs.collisionBehavior) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformMarker") + MessagesPigeonInternal.deepHash(value: alpha, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: anchor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: consumeTapEvents, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: draggable, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: flat, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: icon, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: infoWindow, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: position, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: rotation, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: visible, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zIndex, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: markerId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: clusterManagerId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: collisionBehavior, hasher: &hasher) + } + + public var description: String { + return + "PlatformMarker(alpha: \(String(describing: alpha)), anchor: \(String(describing: anchor)), consumeTapEvents: \(String(describing: consumeTapEvents)), draggable: \(String(describing: draggable)), flat: \(String(describing: flat)), icon: \(String(describing: icon)), infoWindow: \(String(describing: infoWindow)), position: \(String(describing: position)), rotation: \(String(describing: rotation)), visible: \(String(describing: visible)), zIndex: \(String(describing: zIndex)), markerId: \(String(describing: markerId)), clusterManagerId: \(String(describing: clusterManagerId)), collisionBehavior: \(String(describing: collisionBehavior)))" + } +} + +/// Pigeon equivalent of the Polygon class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformPolygon: Hashable, CustomStringConvertible { + var polygonId: String + var consumesTapEvents: Bool + var fillColor: PlatformColor + var geodesic: Bool + var points: [PlatformLatLng] + var holes: [[PlatformLatLng]] + var visible: Bool + var strokeColor: PlatformColor + var strokeWidth: Int64 + var zIndex: Int64 + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformPolygon? { + let polygonId = pigeonVar_list[0] as! String + let consumesTapEvents = pigeonVar_list[1] as! Bool + let fillColor = pigeonVar_list[2] as! PlatformColor + let geodesic = pigeonVar_list[3] as! Bool + let points = pigeonVar_list[4] as! [PlatformLatLng] + let holes = pigeonVar_list[5] as! [[PlatformLatLng]] + let visible = pigeonVar_list[6] as! Bool + let strokeColor = pigeonVar_list[7] as! PlatformColor + let strokeWidth = pigeonVar_list[8] as! Int64 + let zIndex = pigeonVar_list[9] as! Int64 + + return PlatformPolygon( + polygonId: polygonId, + consumesTapEvents: consumesTapEvents, + fillColor: fillColor, + geodesic: geodesic, + points: points, + holes: holes, + visible: visible, + strokeColor: strokeColor, + strokeWidth: strokeWidth, + zIndex: zIndex + ) + } + func toList() -> [Any?] { + return [ + polygonId, + consumesTapEvents, + fillColor, + geodesic, + points, + holes, + visible, + strokeColor, + strokeWidth, + zIndex, + ] + } + static func == (lhs: PlatformPolygon, rhs: PlatformPolygon) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.polygonId, rhs.polygonId) + && MessagesPigeonInternal.deepEquals(lhs.consumesTapEvents, rhs.consumesTapEvents) + && MessagesPigeonInternal.deepEquals(lhs.fillColor, rhs.fillColor) + && MessagesPigeonInternal.deepEquals(lhs.geodesic, rhs.geodesic) + && MessagesPigeonInternal.deepEquals(lhs.points, rhs.points) + && MessagesPigeonInternal.deepEquals(lhs.holes, rhs.holes) + && MessagesPigeonInternal.deepEquals(lhs.visible, rhs.visible) + && MessagesPigeonInternal.deepEquals(lhs.strokeColor, rhs.strokeColor) + && MessagesPigeonInternal.deepEquals(lhs.strokeWidth, rhs.strokeWidth) + && MessagesPigeonInternal.deepEquals(lhs.zIndex, rhs.zIndex) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformPolygon") + MessagesPigeonInternal.deepHash(value: polygonId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: consumesTapEvents, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: fillColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: geodesic, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: points, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: holes, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: visible, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: strokeColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: strokeWidth, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zIndex, hasher: &hasher) + } + + public var description: String { + return + "PlatformPolygon(polygonId: \(String(describing: polygonId)), consumesTapEvents: \(String(describing: consumesTapEvents)), fillColor: \(String(describing: fillColor)), geodesic: \(String(describing: geodesic)), points: \(String(describing: points)), holes: \(String(describing: holes)), visible: \(String(describing: visible)), strokeColor: \(String(describing: strokeColor)), strokeWidth: \(String(describing: strokeWidth)), zIndex: \(String(describing: zIndex)))" + } +} + +/// Pigeon equivalent of the Polyline class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformPolyline: Hashable, CustomStringConvertible { + var polylineId: String + var consumesTapEvents: Bool + var color: PlatformColor + var geodesic: Bool + /// The joint type. + var jointType: PlatformJointType + /// The pattern data, as a list of pattern items. + var patterns: [PlatformPatternItem] + var points: [PlatformLatLng] + var visible: Bool + var width: Int64 + var zIndex: Int64 + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformPolyline? { + let polylineId = pigeonVar_list[0] as! String + let consumesTapEvents = pigeonVar_list[1] as! Bool + let color = pigeonVar_list[2] as! PlatformColor + let geodesic = pigeonVar_list[3] as! Bool + let jointType = pigeonVar_list[4] as! PlatformJointType + let patterns = pigeonVar_list[5] as! [PlatformPatternItem] + let points = pigeonVar_list[6] as! [PlatformLatLng] + let visible = pigeonVar_list[7] as! Bool + let width = pigeonVar_list[8] as! Int64 + let zIndex = pigeonVar_list[9] as! Int64 + + return PlatformPolyline( + polylineId: polylineId, + consumesTapEvents: consumesTapEvents, + color: color, + geodesic: geodesic, + jointType: jointType, + patterns: patterns, + points: points, + visible: visible, + width: width, + zIndex: zIndex + ) + } + func toList() -> [Any?] { + return [ + polylineId, + consumesTapEvents, + color, + geodesic, + jointType, + patterns, + points, + visible, + width, + zIndex, + ] + } + static func == (lhs: PlatformPolyline, rhs: PlatformPolyline) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.polylineId, rhs.polylineId) + && MessagesPigeonInternal.deepEquals(lhs.consumesTapEvents, rhs.consumesTapEvents) + && MessagesPigeonInternal.deepEquals(lhs.color, rhs.color) + && MessagesPigeonInternal.deepEquals(lhs.geodesic, rhs.geodesic) + && MessagesPigeonInternal.deepEquals(lhs.jointType, rhs.jointType) + && MessagesPigeonInternal.deepEquals(lhs.patterns, rhs.patterns) + && MessagesPigeonInternal.deepEquals(lhs.points, rhs.points) + && MessagesPigeonInternal.deepEquals(lhs.visible, rhs.visible) + && MessagesPigeonInternal.deepEquals(lhs.width, rhs.width) + && MessagesPigeonInternal.deepEquals(lhs.zIndex, rhs.zIndex) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformPolyline") + MessagesPigeonInternal.deepHash(value: polylineId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: consumesTapEvents, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: color, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: geodesic, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: jointType, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: patterns, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: points, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: visible, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: width, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zIndex, hasher: &hasher) + } + + public var description: String { + return + "PlatformPolyline(polylineId: \(String(describing: polylineId)), consumesTapEvents: \(String(describing: consumesTapEvents)), color: \(String(describing: color)), geodesic: \(String(describing: geodesic)), jointType: \(String(describing: jointType)), patterns: \(String(describing: patterns)), points: \(String(describing: points)), visible: \(String(describing: visible)), width: \(String(describing: width)), zIndex: \(String(describing: zIndex)))" + } +} + +/// Pigeon equivalent of the PatternItem class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformPatternItem: Hashable, CustomStringConvertible { + var type: PlatformPatternItemType + var length: Double? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformPatternItem? { + let type = pigeonVar_list[0] as! PlatformPatternItemType + let length: Double? = nilOrValue(pigeonVar_list[1]) + + return PlatformPatternItem( + type: type, + length: length + ) + } + func toList() -> [Any?] { + return [ + type, + length, + ] + } + static func == (lhs: PlatformPatternItem, rhs: PlatformPatternItem) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.type, rhs.type) + && MessagesPigeonInternal.deepEquals(lhs.length, rhs.length) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformPatternItem") + MessagesPigeonInternal.deepHash(value: type, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: length, hasher: &hasher) + } + + public var description: String { + return + "PlatformPatternItem(type: \(String(describing: type)), length: \(String(describing: length)))" + } +} + +/// Pigeon equivalent of the Tile class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformTile: Hashable, CustomStringConvertible { + var width: Int64 + var height: Int64 + var data: FlutterStandardTypedData? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformTile? { + let width = pigeonVar_list[0] as! Int64 + let height = pigeonVar_list[1] as! Int64 + let data: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[2]) + + return PlatformTile( + width: width, + height: height, + data: data + ) + } + func toList() -> [Any?] { + return [ + width, + height, + data, + ] + } + static func == (lhs: PlatformTile, rhs: PlatformTile) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.width, rhs.width) + && MessagesPigeonInternal.deepEquals(lhs.height, rhs.height) + && MessagesPigeonInternal.deepEquals(lhs.data, rhs.data) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformTile") + MessagesPigeonInternal.deepHash(value: width, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: height, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: data, hasher: &hasher) + } + + public var description: String { + return + "PlatformTile(width: \(String(describing: width)), height: \(String(describing: height)), data: \(String(describing: data)))" + } +} + +/// Pigeon equivalent of the TileOverlay class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformTileOverlay: Hashable, CustomStringConvertible { + var tileOverlayId: String + var fadeIn: Bool + var transparency: Double + var zIndex: Int64 + var visible: Bool + var tileSize: Int64 + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformTileOverlay? { + let tileOverlayId = pigeonVar_list[0] as! String + let fadeIn = pigeonVar_list[1] as! Bool + let transparency = pigeonVar_list[2] as! Double + let zIndex = pigeonVar_list[3] as! Int64 + let visible = pigeonVar_list[4] as! Bool + let tileSize = pigeonVar_list[5] as! Int64 + + return PlatformTileOverlay( + tileOverlayId: tileOverlayId, + fadeIn: fadeIn, + transparency: transparency, + zIndex: zIndex, + visible: visible, + tileSize: tileSize + ) + } + func toList() -> [Any?] { + return [ + tileOverlayId, + fadeIn, + transparency, + zIndex, + visible, + tileSize, + ] + } + static func == (lhs: PlatformTileOverlay, rhs: PlatformTileOverlay) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.tileOverlayId, rhs.tileOverlayId) + && MessagesPigeonInternal.deepEquals(lhs.fadeIn, rhs.fadeIn) + && MessagesPigeonInternal.deepEquals(lhs.transparency, rhs.transparency) + && MessagesPigeonInternal.deepEquals(lhs.zIndex, rhs.zIndex) + && MessagesPigeonInternal.deepEquals(lhs.visible, rhs.visible) + && MessagesPigeonInternal.deepEquals(lhs.tileSize, rhs.tileSize) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformTileOverlay") + MessagesPigeonInternal.deepHash(value: tileOverlayId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: fadeIn, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: transparency, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zIndex, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: visible, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: tileSize, hasher: &hasher) + } + + public var description: String { + return + "PlatformTileOverlay(tileOverlayId: \(String(describing: tileOverlayId)), fadeIn: \(String(describing: fadeIn)), transparency: \(String(describing: transparency)), zIndex: \(String(describing: zIndex)), visible: \(String(describing: visible)), tileSize: \(String(describing: tileSize)))" + } +} + +/// Pigeon equivalent of Flutter's EdgeInsets. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformEdgeInsets: Hashable, CustomStringConvertible { + var top: Double + var bottom: Double + var left: Double + var right: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformEdgeInsets? { + let top = pigeonVar_list[0] as! Double + let bottom = pigeonVar_list[1] as! Double + let left = pigeonVar_list[2] as! Double + let right = pigeonVar_list[3] as! Double + + return PlatformEdgeInsets( + top: top, + bottom: bottom, + left: left, + right: right + ) + } + func toList() -> [Any?] { + return [ + top, + bottom, + left, + right, + ] + } + static func == (lhs: PlatformEdgeInsets, rhs: PlatformEdgeInsets) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.top, rhs.top) + && MessagesPigeonInternal.deepEquals(lhs.bottom, rhs.bottom) + && MessagesPigeonInternal.deepEquals(lhs.left, rhs.left) + && MessagesPigeonInternal.deepEquals(lhs.right, rhs.right) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformEdgeInsets") + MessagesPigeonInternal.deepHash(value: top, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: bottom, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: left, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: right, hasher: &hasher) + } + + public var description: String { + return + "PlatformEdgeInsets(top: \(String(describing: top)), bottom: \(String(describing: bottom)), left: \(String(describing: left)), right: \(String(describing: right)))" + } +} + +/// Pigeon equivalent of LatLng. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformLatLng: Hashable, CustomStringConvertible { + var latitude: Double + var longitude: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformLatLng? { + let latitude = pigeonVar_list[0] as! Double + let longitude = pigeonVar_list[1] as! Double + + return PlatformLatLng( + latitude: latitude, + longitude: longitude + ) + } + func toList() -> [Any?] { + return [ + latitude, + longitude, + ] + } + static func == (lhs: PlatformLatLng, rhs: PlatformLatLng) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.latitude, rhs.latitude) + && MessagesPigeonInternal.deepEquals(lhs.longitude, rhs.longitude) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformLatLng") + MessagesPigeonInternal.deepHash(value: latitude, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: longitude, hasher: &hasher) + } + + public var description: String { + return + "PlatformLatLng(latitude: \(String(describing: latitude)), longitude: \(String(describing: longitude)))" + } +} + +/// Pigeon equivalent of LatLngBounds. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformLatLngBounds: Hashable, CustomStringConvertible { + var northeast: PlatformLatLng + var southwest: PlatformLatLng + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformLatLngBounds? { + let northeast = pigeonVar_list[0] as! PlatformLatLng + let southwest = pigeonVar_list[1] as! PlatformLatLng + + return PlatformLatLngBounds( + northeast: northeast, + southwest: southwest + ) + } + func toList() -> [Any?] { + return [ + northeast, + southwest, + ] + } + static func == (lhs: PlatformLatLngBounds, rhs: PlatformLatLngBounds) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.northeast, rhs.northeast) + && MessagesPigeonInternal.deepEquals(lhs.southwest, rhs.southwest) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformLatLngBounds") + MessagesPigeonInternal.deepHash(value: northeast, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: southwest, hasher: &hasher) + } + + public var description: String { + return + "PlatformLatLngBounds(northeast: \(String(describing: northeast)), southwest: \(String(describing: southwest)))" + } +} + +/// Pigeon equivalent of CameraTargetBounds. +/// +/// As with the Dart version, it exists to distinguish between not setting a +/// a target, and having an explicitly unbounded target (null [bounds]). +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraTargetBounds: Hashable, CustomStringConvertible { + var bounds: PlatformLatLngBounds? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraTargetBounds? { + let bounds: PlatformLatLngBounds? = nilOrValue(pigeonVar_list[0]) + + return PlatformCameraTargetBounds( + bounds: bounds + ) + } + func toList() -> [Any?] { + return [ + bounds + ] + } + static func == (lhs: PlatformCameraTargetBounds, rhs: PlatformCameraTargetBounds) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.bounds, rhs.bounds) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraTargetBounds") + MessagesPigeonInternal.deepHash(value: bounds, hasher: &hasher) + } + + public var description: String { + return "PlatformCameraTargetBounds(bounds: \(String(describing: bounds)))" + } +} + +/// Pigeon equivalent of the GroundOverlay class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformGroundOverlay: Hashable, CustomStringConvertible { + var groundOverlayId: String + var image: PlatformBitmap + var position: PlatformLatLng? = nil + var bounds: PlatformLatLngBounds? = nil + var anchor: PlatformPoint? = nil + var transparency: Double + var bearing: Double + var zIndex: Int64 + var visible: Bool + var clickable: Bool + var zoomLevel: Double? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformGroundOverlay? { + let groundOverlayId = pigeonVar_list[0] as! String + let image = pigeonVar_list[1] as! PlatformBitmap + let position: PlatformLatLng? = nilOrValue(pigeonVar_list[2]) + let bounds: PlatformLatLngBounds? = nilOrValue(pigeonVar_list[3]) + let anchor: PlatformPoint? = nilOrValue(pigeonVar_list[4]) + let transparency = pigeonVar_list[5] as! Double + let bearing = pigeonVar_list[6] as! Double + let zIndex = pigeonVar_list[7] as! Int64 + let visible = pigeonVar_list[8] as! Bool + let clickable = pigeonVar_list[9] as! Bool + let zoomLevel: Double? = nilOrValue(pigeonVar_list[10]) + + return PlatformGroundOverlay( + groundOverlayId: groundOverlayId, + image: image, + position: position, + bounds: bounds, + anchor: anchor, + transparency: transparency, + bearing: bearing, + zIndex: zIndex, + visible: visible, + clickable: clickable, + zoomLevel: zoomLevel + ) + } + func toList() -> [Any?] { + return [ + groundOverlayId, + image, + position, + bounds, + anchor, + transparency, + bearing, + zIndex, + visible, + clickable, + zoomLevel, + ] + } + static func == (lhs: PlatformGroundOverlay, rhs: PlatformGroundOverlay) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.groundOverlayId, rhs.groundOverlayId) + && MessagesPigeonInternal.deepEquals(lhs.image, rhs.image) + && MessagesPigeonInternal.deepEquals(lhs.position, rhs.position) + && MessagesPigeonInternal.deepEquals(lhs.bounds, rhs.bounds) + && MessagesPigeonInternal.deepEquals(lhs.anchor, rhs.anchor) + && MessagesPigeonInternal.deepEquals(lhs.transparency, rhs.transparency) + && MessagesPigeonInternal.deepEquals(lhs.bearing, rhs.bearing) + && MessagesPigeonInternal.deepEquals(lhs.zIndex, rhs.zIndex) + && MessagesPigeonInternal.deepEquals(lhs.visible, rhs.visible) + && MessagesPigeonInternal.deepEquals(lhs.clickable, rhs.clickable) + && MessagesPigeonInternal.deepEquals(lhs.zoomLevel, rhs.zoomLevel) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformGroundOverlay") + MessagesPigeonInternal.deepHash(value: groundOverlayId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: image, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: position, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: bounds, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: anchor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: transparency, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: bearing, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zIndex, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: visible, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: clickable, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zoomLevel, hasher: &hasher) + } + + public var description: String { + return + "PlatformGroundOverlay(groundOverlayId: \(String(describing: groundOverlayId)), image: \(String(describing: image)), position: \(String(describing: position)), bounds: \(String(describing: bounds)), anchor: \(String(describing: anchor)), transparency: \(String(describing: transparency)), bearing: \(String(describing: bearing)), zIndex: \(String(describing: zIndex)), visible: \(String(describing: visible)), clickable: \(String(describing: clickable)), zoomLevel: \(String(describing: zoomLevel)))" + } +} + +/// Information passed to the platform view creation. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformMapViewCreationParams: Hashable, CustomStringConvertible { + var initialCameraPosition: PlatformCameraPosition + var mapConfiguration: PlatformMapConfiguration + var initialCircles: [PlatformCircle] + var initialMarkers: [PlatformMarker] + var initialPolygons: [PlatformPolygon] + var initialPolylines: [PlatformPolyline] + var initialHeatmaps: [PlatformHeatmap] + var initialTileOverlays: [PlatformTileOverlay] + var initialClusterManagers: [PlatformClusterManager] + var initialGroundOverlays: [PlatformGroundOverlay] + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformMapViewCreationParams? { + let initialCameraPosition = pigeonVar_list[0] as! PlatformCameraPosition + let mapConfiguration = pigeonVar_list[1] as! PlatformMapConfiguration + let initialCircles = pigeonVar_list[2] as! [PlatformCircle] + let initialMarkers = pigeonVar_list[3] as! [PlatformMarker] + let initialPolygons = pigeonVar_list[4] as! [PlatformPolygon] + let initialPolylines = pigeonVar_list[5] as! [PlatformPolyline] + let initialHeatmaps = pigeonVar_list[6] as! [PlatformHeatmap] + let initialTileOverlays = pigeonVar_list[7] as! [PlatformTileOverlay] + let initialClusterManagers = pigeonVar_list[8] as! [PlatformClusterManager] + let initialGroundOverlays = pigeonVar_list[9] as! [PlatformGroundOverlay] + + return PlatformMapViewCreationParams( + initialCameraPosition: initialCameraPosition, + mapConfiguration: mapConfiguration, + initialCircles: initialCircles, + initialMarkers: initialMarkers, + initialPolygons: initialPolygons, + initialPolylines: initialPolylines, + initialHeatmaps: initialHeatmaps, + initialTileOverlays: initialTileOverlays, + initialClusterManagers: initialClusterManagers, + initialGroundOverlays: initialGroundOverlays + ) + } + func toList() -> [Any?] { + return [ + initialCameraPosition, + mapConfiguration, + initialCircles, + initialMarkers, + initialPolygons, + initialPolylines, + initialHeatmaps, + initialTileOverlays, + initialClusterManagers, + initialGroundOverlays, + ] + } + static func == (lhs: PlatformMapViewCreationParams, rhs: PlatformMapViewCreationParams) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.initialCameraPosition, rhs.initialCameraPosition) + && MessagesPigeonInternal.deepEquals(lhs.mapConfiguration, rhs.mapConfiguration) + && MessagesPigeonInternal.deepEquals(lhs.initialCircles, rhs.initialCircles) + && MessagesPigeonInternal.deepEquals(lhs.initialMarkers, rhs.initialMarkers) + && MessagesPigeonInternal.deepEquals(lhs.initialPolygons, rhs.initialPolygons) + && MessagesPigeonInternal.deepEquals(lhs.initialPolylines, rhs.initialPolylines) + && MessagesPigeonInternal.deepEquals(lhs.initialHeatmaps, rhs.initialHeatmaps) + && MessagesPigeonInternal.deepEquals(lhs.initialTileOverlays, rhs.initialTileOverlays) + && MessagesPigeonInternal.deepEquals(lhs.initialClusterManagers, rhs.initialClusterManagers) + && MessagesPigeonInternal.deepEquals(lhs.initialGroundOverlays, rhs.initialGroundOverlays) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformMapViewCreationParams") + MessagesPigeonInternal.deepHash(value: initialCameraPosition, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: mapConfiguration, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialCircles, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialMarkers, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialPolygons, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialPolylines, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialHeatmaps, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialTileOverlays, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialClusterManagers, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialGroundOverlays, hasher: &hasher) + } + + public var description: String { + return + "PlatformMapViewCreationParams(initialCameraPosition: \(String(describing: initialCameraPosition)), mapConfiguration: \(String(describing: mapConfiguration)), initialCircles: \(String(describing: initialCircles)), initialMarkers: \(String(describing: initialMarkers)), initialPolygons: \(String(describing: initialPolygons)), initialPolylines: \(String(describing: initialPolylines)), initialHeatmaps: \(String(describing: initialHeatmaps)), initialTileOverlays: \(String(describing: initialTileOverlays)), initialClusterManagers: \(String(describing: initialClusterManagers)), initialGroundOverlays: \(String(describing: initialGroundOverlays)))" + } +} + +/// Pigeon equivalent of MapConfiguration. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformMapConfiguration: Hashable, CustomStringConvertible { + var compassEnabled: Bool? = nil + var cameraTargetBounds: PlatformCameraTargetBounds? = nil + var mapType: PlatformMapType? = nil + var minMaxZoomPreference: PlatformZoomRange? = nil + var rotateGesturesEnabled: Bool? = nil + var scrollGesturesEnabled: Bool? = nil + var tiltGesturesEnabled: Bool? = nil + var trackCameraPosition: Bool? = nil + var zoomGesturesEnabled: Bool? = nil + var myLocationEnabled: Bool? = nil + var myLocationButtonEnabled: Bool? = nil + var padding: PlatformEdgeInsets? = nil + var indoorViewEnabled: Bool? = nil + var trafficEnabled: Bool? = nil + var buildingsEnabled: Bool? = nil + var markerType: PlatformMarkerType + var mapId: String? = nil + var style: String? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformMapConfiguration? { + let compassEnabled: Bool? = nilOrValue(pigeonVar_list[0]) + let cameraTargetBounds: PlatformCameraTargetBounds? = nilOrValue(pigeonVar_list[1]) + let mapType: PlatformMapType? = nilOrValue(pigeonVar_list[2]) + let minMaxZoomPreference: PlatformZoomRange? = nilOrValue(pigeonVar_list[3]) + let rotateGesturesEnabled: Bool? = nilOrValue(pigeonVar_list[4]) + let scrollGesturesEnabled: Bool? = nilOrValue(pigeonVar_list[5]) + let tiltGesturesEnabled: Bool? = nilOrValue(pigeonVar_list[6]) + let trackCameraPosition: Bool? = nilOrValue(pigeonVar_list[7]) + let zoomGesturesEnabled: Bool? = nilOrValue(pigeonVar_list[8]) + let myLocationEnabled: Bool? = nilOrValue(pigeonVar_list[9]) + let myLocationButtonEnabled: Bool? = nilOrValue(pigeonVar_list[10]) + let padding: PlatformEdgeInsets? = nilOrValue(pigeonVar_list[11]) + let indoorViewEnabled: Bool? = nilOrValue(pigeonVar_list[12]) + let trafficEnabled: Bool? = nilOrValue(pigeonVar_list[13]) + let buildingsEnabled: Bool? = nilOrValue(pigeonVar_list[14]) + let markerType = pigeonVar_list[15] as! PlatformMarkerType + let mapId: String? = nilOrValue(pigeonVar_list[16]) + let style: String? = nilOrValue(pigeonVar_list[17]) + + return PlatformMapConfiguration( + compassEnabled: compassEnabled, + cameraTargetBounds: cameraTargetBounds, + mapType: mapType, + minMaxZoomPreference: minMaxZoomPreference, + rotateGesturesEnabled: rotateGesturesEnabled, + scrollGesturesEnabled: scrollGesturesEnabled, + tiltGesturesEnabled: tiltGesturesEnabled, + trackCameraPosition: trackCameraPosition, + zoomGesturesEnabled: zoomGesturesEnabled, + myLocationEnabled: myLocationEnabled, + myLocationButtonEnabled: myLocationButtonEnabled, + padding: padding, + indoorViewEnabled: indoorViewEnabled, + trafficEnabled: trafficEnabled, + buildingsEnabled: buildingsEnabled, + markerType: markerType, + mapId: mapId, + style: style + ) + } + func toList() -> [Any?] { + return [ + compassEnabled, + cameraTargetBounds, + mapType, + minMaxZoomPreference, + rotateGesturesEnabled, + scrollGesturesEnabled, + tiltGesturesEnabled, + trackCameraPosition, + zoomGesturesEnabled, + myLocationEnabled, + myLocationButtonEnabled, + padding, + indoorViewEnabled, + trafficEnabled, + buildingsEnabled, + markerType, + mapId, + style, + ] + } + static func == (lhs: PlatformMapConfiguration, rhs: PlatformMapConfiguration) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.compassEnabled, rhs.compassEnabled) + && MessagesPigeonInternal.deepEquals(lhs.cameraTargetBounds, rhs.cameraTargetBounds) + && MessagesPigeonInternal.deepEquals(lhs.mapType, rhs.mapType) + && MessagesPigeonInternal.deepEquals(lhs.minMaxZoomPreference, rhs.minMaxZoomPreference) + && MessagesPigeonInternal.deepEquals(lhs.rotateGesturesEnabled, rhs.rotateGesturesEnabled) + && MessagesPigeonInternal.deepEquals(lhs.scrollGesturesEnabled, rhs.scrollGesturesEnabled) + && MessagesPigeonInternal.deepEquals(lhs.tiltGesturesEnabled, rhs.tiltGesturesEnabled) + && MessagesPigeonInternal.deepEquals(lhs.trackCameraPosition, rhs.trackCameraPosition) + && MessagesPigeonInternal.deepEquals(lhs.zoomGesturesEnabled, rhs.zoomGesturesEnabled) + && MessagesPigeonInternal.deepEquals(lhs.myLocationEnabled, rhs.myLocationEnabled) + && MessagesPigeonInternal.deepEquals(lhs.myLocationButtonEnabled, rhs.myLocationButtonEnabled) + && MessagesPigeonInternal.deepEquals(lhs.padding, rhs.padding) + && MessagesPigeonInternal.deepEquals(lhs.indoorViewEnabled, rhs.indoorViewEnabled) + && MessagesPigeonInternal.deepEquals(lhs.trafficEnabled, rhs.trafficEnabled) + && MessagesPigeonInternal.deepEquals(lhs.buildingsEnabled, rhs.buildingsEnabled) + && MessagesPigeonInternal.deepEquals(lhs.markerType, rhs.markerType) + && MessagesPigeonInternal.deepEquals(lhs.mapId, rhs.mapId) + && MessagesPigeonInternal.deepEquals(lhs.style, rhs.style) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformMapConfiguration") + MessagesPigeonInternal.deepHash(value: compassEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: cameraTargetBounds, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: mapType, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: minMaxZoomPreference, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: rotateGesturesEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: scrollGesturesEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: tiltGesturesEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: trackCameraPosition, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zoomGesturesEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: myLocationEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: myLocationButtonEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: padding, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: indoorViewEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: trafficEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: buildingsEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: markerType, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: mapId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: style, hasher: &hasher) + } + + public var description: String { + return + "PlatformMapConfiguration(compassEnabled: \(String(describing: compassEnabled)), cameraTargetBounds: \(String(describing: cameraTargetBounds)), mapType: \(String(describing: mapType)), minMaxZoomPreference: \(String(describing: minMaxZoomPreference)), rotateGesturesEnabled: \(String(describing: rotateGesturesEnabled)), scrollGesturesEnabled: \(String(describing: scrollGesturesEnabled)), tiltGesturesEnabled: \(String(describing: tiltGesturesEnabled)), trackCameraPosition: \(String(describing: trackCameraPosition)), zoomGesturesEnabled: \(String(describing: zoomGesturesEnabled)), myLocationEnabled: \(String(describing: myLocationEnabled)), myLocationButtonEnabled: \(String(describing: myLocationButtonEnabled)), padding: \(String(describing: padding)), indoorViewEnabled: \(String(describing: indoorViewEnabled)), trafficEnabled: \(String(describing: trafficEnabled)), buildingsEnabled: \(String(describing: buildingsEnabled)), markerType: \(String(describing: markerType)), mapId: \(String(describing: mapId)), style: \(String(describing: style)))" + } +} + +/// Pigeon representation of an x,y coordinate. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformPoint: Hashable, CustomStringConvertible { + var x: Double + var y: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformPoint? { + let x = pigeonVar_list[0] as! Double + let y = pigeonVar_list[1] as! Double + + return PlatformPoint( + x: x, + y: y + ) + } + func toList() -> [Any?] { + return [ + x, + y, + ] + } + static func == (lhs: PlatformPoint, rhs: PlatformPoint) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.x, rhs.x) + && MessagesPigeonInternal.deepEquals(lhs.y, rhs.y) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformPoint") + MessagesPigeonInternal.deepHash(value: x, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: y, hasher: &hasher) + } + + public var description: String { + return "PlatformPoint(x: \(String(describing: x)), y: \(String(describing: y)))" + } +} + +/// Pigeon representation of a size. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformSize: Hashable, CustomStringConvertible { + var width: Double + var height: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformSize? { + let width = pigeonVar_list[0] as! Double + let height = pigeonVar_list[1] as! Double + + return PlatformSize( + width: width, + height: height + ) + } + func toList() -> [Any?] { + return [ + width, + height, + ] + } + static func == (lhs: PlatformSize, rhs: PlatformSize) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.width, rhs.width) + && MessagesPigeonInternal.deepEquals(lhs.height, rhs.height) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformSize") + MessagesPigeonInternal.deepHash(value: width, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: height, hasher: &hasher) + } + + public var description: String { + return + "PlatformSize(width: \(String(describing: width)), height: \(String(describing: height)))" + } +} + +/// Pigeon representation of a color. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformColor: Hashable, CustomStringConvertible { + var red: Double + var green: Double + var blue: Double + var alpha: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformColor? { + let red = pigeonVar_list[0] as! Double + let green = pigeonVar_list[1] as! Double + let blue = pigeonVar_list[2] as! Double + let alpha = pigeonVar_list[3] as! Double + + return PlatformColor( + red: red, + green: green, + blue: blue, + alpha: alpha + ) + } + func toList() -> [Any?] { + return [ + red, + green, + blue, + alpha, + ] + } + static func == (lhs: PlatformColor, rhs: PlatformColor) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.red, rhs.red) + && MessagesPigeonInternal.deepEquals(lhs.green, rhs.green) + && MessagesPigeonInternal.deepEquals(lhs.blue, rhs.blue) + && MessagesPigeonInternal.deepEquals(lhs.alpha, rhs.alpha) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformColor") + MessagesPigeonInternal.deepHash(value: red, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: green, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: blue, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: alpha, hasher: &hasher) + } + + public var description: String { + return + "PlatformColor(red: \(String(describing: red)), green: \(String(describing: green)), blue: \(String(describing: blue)), alpha: \(String(describing: alpha)))" + } +} + +/// Pigeon equivalent of GMSTileLayer properties. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformTileLayer: Hashable, CustomStringConvertible { + var visible: Bool + var fadeIn: Bool + var opacity: Double + var zIndex: Int64 + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformTileLayer? { + let visible = pigeonVar_list[0] as! Bool + let fadeIn = pigeonVar_list[1] as! Bool + let opacity = pigeonVar_list[2] as! Double + let zIndex = pigeonVar_list[3] as! Int64 + + return PlatformTileLayer( + visible: visible, + fadeIn: fadeIn, + opacity: opacity, + zIndex: zIndex + ) + } + func toList() -> [Any?] { + return [ + visible, + fadeIn, + opacity, + zIndex, + ] + } + static func == (lhs: PlatformTileLayer, rhs: PlatformTileLayer) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.visible, rhs.visible) + && MessagesPigeonInternal.deepEquals(lhs.fadeIn, rhs.fadeIn) + && MessagesPigeonInternal.deepEquals(lhs.opacity, rhs.opacity) + && MessagesPigeonInternal.deepEquals(lhs.zIndex, rhs.zIndex) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformTileLayer") + MessagesPigeonInternal.deepHash(value: visible, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: fadeIn, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: opacity, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zIndex, hasher: &hasher) + } + + public var description: String { + return + "PlatformTileLayer(visible: \(String(describing: visible)), fadeIn: \(String(describing: fadeIn)), opacity: \(String(describing: opacity)), zIndex: \(String(describing: zIndex)))" + } +} + +/// Pigeon equivalent of MinMaxZoomPreference. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformZoomRange: Hashable, CustomStringConvertible { + var min: Double? = nil + var max: Double? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformZoomRange? { + let min: Double? = nilOrValue(pigeonVar_list[0]) + let max: Double? = nilOrValue(pigeonVar_list[1]) + + return PlatformZoomRange( + min: min, + max: max + ) + } + func toList() -> [Any?] { + return [ + min, + max, + ] + } + static func == (lhs: PlatformZoomRange, rhs: PlatformZoomRange) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.min, rhs.min) + && MessagesPigeonInternal.deepEquals(lhs.max, rhs.max) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformZoomRange") + MessagesPigeonInternal.deepHash(value: min, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: max, hasher: &hasher) + } + + public var description: String { + return "PlatformZoomRange(min: \(String(describing: min)), max: \(String(describing: max)))" + } +} + +/// Pigeon equivalent of [BitmapDescriptor]. As there are multiple disjoint +/// types of [BitmapDescriptor], [PlatformBitmap] contains a single field which +/// may hold the pigeon equivalent type of any of them. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformBitmap: Hashable, CustomStringConvertible { + /// One of [PlatformBitmapAssetMap], [PlatformBitmapAsset], + /// [PlatformBitmapAssetImage], [PlatformBitmapBytesMap], + /// [PlatformBitmapBytes], or [PlatformBitmapDefaultMarker]. + /// As Pigeon does not currently support data class inheritance, this + /// approach allows for the different bitmap implementations to be valid + /// argument and return types of the API methods. See + /// https://github.com/flutter/flutter/issues/117819. + var bitmap: Any + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmap? { + let bitmap = pigeonVar_list[0]! + + return PlatformBitmap( + bitmap: bitmap + ) + } + func toList() -> [Any?] { + return [ + bitmap + ] + } + static func == (lhs: PlatformBitmap, rhs: PlatformBitmap) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.bitmap, rhs.bitmap) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformBitmap") + MessagesPigeonInternal.deepHash(value: bitmap, hasher: &hasher) + } + + public var description: String { + return "PlatformBitmap(bitmap: \(String(describing: bitmap)))" + } +} + +/// Pigeon equivalent of [DefaultMarker]. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformBitmapDefaultMarker: Hashable, CustomStringConvertible { + var hue: Double? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmapDefaultMarker? { + let hue: Double? = nilOrValue(pigeonVar_list[0]) + + return PlatformBitmapDefaultMarker( + hue: hue + ) + } + func toList() -> [Any?] { + return [ + hue + ] + } + static func == (lhs: PlatformBitmapDefaultMarker, rhs: PlatformBitmapDefaultMarker) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.hue, rhs.hue) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformBitmapDefaultMarker") + MessagesPigeonInternal.deepHash(value: hue, hasher: &hasher) + } + + public var description: String { + return "PlatformBitmapDefaultMarker(hue: \(String(describing: hue)))" + } +} + +/// Pigeon equivalent of [BytesBitmap]. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformBitmapBytes: Hashable, CustomStringConvertible { + var byteData: FlutterStandardTypedData + var size: PlatformSize? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmapBytes? { + let byteData = pigeonVar_list[0] as! FlutterStandardTypedData + let size: PlatformSize? = nilOrValue(pigeonVar_list[1]) + + return PlatformBitmapBytes( + byteData: byteData, + size: size + ) + } + func toList() -> [Any?] { + return [ + byteData, + size, + ] + } + static func == (lhs: PlatformBitmapBytes, rhs: PlatformBitmapBytes) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.byteData, rhs.byteData) + && MessagesPigeonInternal.deepEquals(lhs.size, rhs.size) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformBitmapBytes") + MessagesPigeonInternal.deepHash(value: byteData, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: size, hasher: &hasher) + } + + public var description: String { + return + "PlatformBitmapBytes(byteData: \(String(describing: byteData)), size: \(String(describing: size)))" + } +} + +/// Pigeon equivalent of [AssetBitmap]. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformBitmapAsset: Hashable, CustomStringConvertible { + var name: String + var pkg: String? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmapAsset? { + let name = pigeonVar_list[0] as! String + let pkg: String? = nilOrValue(pigeonVar_list[1]) + + return PlatformBitmapAsset( + name: name, + pkg: pkg + ) + } + func toList() -> [Any?] { + return [ + name, + pkg, + ] + } + static func == (lhs: PlatformBitmapAsset, rhs: PlatformBitmapAsset) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.name, rhs.name) + && MessagesPigeonInternal.deepEquals(lhs.pkg, rhs.pkg) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformBitmapAsset") + MessagesPigeonInternal.deepHash(value: name, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: pkg, hasher: &hasher) + } + + public var description: String { + return "PlatformBitmapAsset(name: \(String(describing: name)), pkg: \(String(describing: pkg)))" + } +} + +/// Pigeon equivalent of [AssetImageBitmap]. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformBitmapAssetImage: Hashable, CustomStringConvertible { + var name: String + var scale: Double + var size: PlatformSize? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmapAssetImage? { + let name = pigeonVar_list[0] as! String + let scale = pigeonVar_list[1] as! Double + let size: PlatformSize? = nilOrValue(pigeonVar_list[2]) + + return PlatformBitmapAssetImage( + name: name, + scale: scale, + size: size + ) + } + func toList() -> [Any?] { + return [ + name, + scale, + size, + ] + } + static func == (lhs: PlatformBitmapAssetImage, rhs: PlatformBitmapAssetImage) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.name, rhs.name) + && MessagesPigeonInternal.deepEquals(lhs.scale, rhs.scale) + && MessagesPigeonInternal.deepEquals(lhs.size, rhs.size) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformBitmapAssetImage") + MessagesPigeonInternal.deepHash(value: name, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: scale, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: size, hasher: &hasher) + } + + public var description: String { + return + "PlatformBitmapAssetImage(name: \(String(describing: name)), scale: \(String(describing: scale)), size: \(String(describing: size)))" + } +} + +/// Pigeon equivalent of [AssetMapBitmap]. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformBitmapAssetMap: Hashable, CustomStringConvertible { + var assetName: String + var bitmapScaling: PlatformMapBitmapScaling + var imagePixelRatio: Double + var width: Double? = nil + var height: Double? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmapAssetMap? { + let assetName = pigeonVar_list[0] as! String + let bitmapScaling = pigeonVar_list[1] as! PlatformMapBitmapScaling + let imagePixelRatio = pigeonVar_list[2] as! Double + let width: Double? = nilOrValue(pigeonVar_list[3]) + let height: Double? = nilOrValue(pigeonVar_list[4]) + + return PlatformBitmapAssetMap( + assetName: assetName, + bitmapScaling: bitmapScaling, + imagePixelRatio: imagePixelRatio, + width: width, + height: height + ) + } + func toList() -> [Any?] { + return [ + assetName, + bitmapScaling, + imagePixelRatio, + width, + height, + ] + } + static func == (lhs: PlatformBitmapAssetMap, rhs: PlatformBitmapAssetMap) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.assetName, rhs.assetName) + && MessagesPigeonInternal.deepEquals(lhs.bitmapScaling, rhs.bitmapScaling) + && MessagesPigeonInternal.deepEquals(lhs.imagePixelRatio, rhs.imagePixelRatio) + && MessagesPigeonInternal.deepEquals(lhs.width, rhs.width) + && MessagesPigeonInternal.deepEquals(lhs.height, rhs.height) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformBitmapAssetMap") + MessagesPigeonInternal.deepHash(value: assetName, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: bitmapScaling, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: imagePixelRatio, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: width, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: height, hasher: &hasher) + } + + public var description: String { + return + "PlatformBitmapAssetMap(assetName: \(String(describing: assetName)), bitmapScaling: \(String(describing: bitmapScaling)), imagePixelRatio: \(String(describing: imagePixelRatio)), width: \(String(describing: width)), height: \(String(describing: height)))" + } +} + +/// Pigeon equivalent of [BytesMapBitmap]. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformBitmapBytesMap: Hashable, CustomStringConvertible { + var byteData: FlutterStandardTypedData + var bitmapScaling: PlatformMapBitmapScaling + var imagePixelRatio: Double + var width: Double? = nil + var height: Double? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmapBytesMap? { + let byteData = pigeonVar_list[0] as! FlutterStandardTypedData + let bitmapScaling = pigeonVar_list[1] as! PlatformMapBitmapScaling + let imagePixelRatio = pigeonVar_list[2] as! Double + let width: Double? = nilOrValue(pigeonVar_list[3]) + let height: Double? = nilOrValue(pigeonVar_list[4]) + + return PlatformBitmapBytesMap( + byteData: byteData, + bitmapScaling: bitmapScaling, + imagePixelRatio: imagePixelRatio, + width: width, + height: height + ) + } + func toList() -> [Any?] { + return [ + byteData, + bitmapScaling, + imagePixelRatio, + width, + height, + ] + } + static func == (lhs: PlatformBitmapBytesMap, rhs: PlatformBitmapBytesMap) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.byteData, rhs.byteData) + && MessagesPigeonInternal.deepEquals(lhs.bitmapScaling, rhs.bitmapScaling) + && MessagesPigeonInternal.deepEquals(lhs.imagePixelRatio, rhs.imagePixelRatio) + && MessagesPigeonInternal.deepEquals(lhs.width, rhs.width) + && MessagesPigeonInternal.deepEquals(lhs.height, rhs.height) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformBitmapBytesMap") + MessagesPigeonInternal.deepHash(value: byteData, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: bitmapScaling, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: imagePixelRatio, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: width, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: height, hasher: &hasher) + } + + public var description: String { + return + "PlatformBitmapBytesMap(byteData: \(String(describing: byteData)), bitmapScaling: \(String(describing: bitmapScaling)), imagePixelRatio: \(String(describing: imagePixelRatio)), width: \(String(describing: width)), height: \(String(describing: height)))" + } +} + +/// Pigeon equivalent of [PinConfig]. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformBitmapPinConfig: Hashable, CustomStringConvertible { + var backgroundColor: PlatformColor? = nil + var borderColor: PlatformColor? = nil + var glyphColor: PlatformColor? = nil + var glyphTextColor: PlatformColor? = nil + var glyphText: String? = nil + var glyphBitmap: PlatformBitmap? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmapPinConfig? { + let backgroundColor: PlatformColor? = nilOrValue(pigeonVar_list[0]) + let borderColor: PlatformColor? = nilOrValue(pigeonVar_list[1]) + let glyphColor: PlatformColor? = nilOrValue(pigeonVar_list[2]) + let glyphTextColor: PlatformColor? = nilOrValue(pigeonVar_list[3]) + let glyphText: String? = nilOrValue(pigeonVar_list[4]) + let glyphBitmap: PlatformBitmap? = nilOrValue(pigeonVar_list[5]) + + return PlatformBitmapPinConfig( + backgroundColor: backgroundColor, + borderColor: borderColor, + glyphColor: glyphColor, + glyphTextColor: glyphTextColor, + glyphText: glyphText, + glyphBitmap: glyphBitmap + ) + } + func toList() -> [Any?] { + return [ + backgroundColor, + borderColor, + glyphColor, + glyphTextColor, + glyphText, + glyphBitmap, + ] + } + static func == (lhs: PlatformBitmapPinConfig, rhs: PlatformBitmapPinConfig) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.backgroundColor, rhs.backgroundColor) + && MessagesPigeonInternal.deepEquals(lhs.borderColor, rhs.borderColor) + && MessagesPigeonInternal.deepEquals(lhs.glyphColor, rhs.glyphColor) + && MessagesPigeonInternal.deepEquals(lhs.glyphTextColor, rhs.glyphTextColor) + && MessagesPigeonInternal.deepEquals(lhs.glyphText, rhs.glyphText) + && MessagesPigeonInternal.deepEquals(lhs.glyphBitmap, rhs.glyphBitmap) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformBitmapPinConfig") + MessagesPigeonInternal.deepHash(value: backgroundColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: borderColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: glyphColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: glyphTextColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: glyphText, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: glyphBitmap, hasher: &hasher) + } + + public var description: String { + return + "PlatformBitmapPinConfig(backgroundColor: \(String(describing: backgroundColor)), borderColor: \(String(describing: borderColor)), glyphColor: \(String(describing: glyphColor)), glyphTextColor: \(String(describing: glyphTextColor)), glyphText: \(String(describing: glyphText)), glyphBitmap: \(String(describing: glyphBitmap)))" + } +} + +private class MessagesPigeonCodecReader: FlutterStandardReader { + override func readValue(ofType type: UInt8) -> Any? { + switch type { + case 129: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return PlatformMapType(rawValue: enumResultAsInt) + } + return nil + case 130: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return PlatformMarkerCollisionBehavior(rawValue: enumResultAsInt) + } + return nil + case 131: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return PlatformJointType(rawValue: enumResultAsInt) + } + return nil + case 132: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return PlatformPatternItemType(rawValue: enumResultAsInt) + } + return nil + case 133: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return PlatformMarkerType(rawValue: enumResultAsInt) + } + return nil + case 134: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return PlatformMapBitmapScaling(rawValue: enumResultAsInt) + } + return nil + case 135: + return PlatformCameraPosition.fromList(self.readValue() as! [Any?]) + case 136: + return PlatformCameraUpdate.fromList(self.readValue() as! [Any?]) + case 137: + return PlatformCameraUpdateNewCameraPosition.fromList(self.readValue() as! [Any?]) + case 138: + return PlatformCameraUpdateNewLatLng.fromList(self.readValue() as! [Any?]) + case 139: + return PlatformCameraUpdateNewLatLngBounds.fromList(self.readValue() as! [Any?]) + case 140: + return PlatformCameraUpdateNewLatLngZoom.fromList(self.readValue() as! [Any?]) + case 141: + return PlatformCameraUpdateScrollBy.fromList(self.readValue() as! [Any?]) + case 142: + return PlatformCameraUpdateZoomBy.fromList(self.readValue() as! [Any?]) + case 143: + return PlatformCameraUpdateZoom.fromList(self.readValue() as! [Any?]) + case 144: + return PlatformCameraUpdateZoomTo.fromList(self.readValue() as! [Any?]) + case 145: + return PlatformCircle.fromList(self.readValue() as! [Any?]) + case 146: + return PlatformHeatmap.fromList(self.readValue() as! [Any?]) + case 147: + return PlatformHeatmapGradient.fromList(self.readValue() as! [Any?]) + case 148: + return PlatformWeightedLatLng.fromList(self.readValue() as! [Any?]) + case 149: + return PlatformInfoWindow.fromList(self.readValue() as! [Any?]) + case 150: + return PlatformCluster.fromList(self.readValue() as! [Any?]) + case 151: + return PlatformClusterManager.fromList(self.readValue() as! [Any?]) + case 152: + return PlatformMarker.fromList(self.readValue() as! [Any?]) + case 153: + return PlatformPolygon.fromList(self.readValue() as! [Any?]) + case 154: + return PlatformPolyline.fromList(self.readValue() as! [Any?]) + case 155: + return PlatformPatternItem.fromList(self.readValue() as! [Any?]) + case 156: + return PlatformTile.fromList(self.readValue() as! [Any?]) + case 157: + return PlatformTileOverlay.fromList(self.readValue() as! [Any?]) + case 158: + return PlatformEdgeInsets.fromList(self.readValue() as! [Any?]) + case 159: + return PlatformLatLng.fromList(self.readValue() as! [Any?]) + case 160: + return PlatformLatLngBounds.fromList(self.readValue() as! [Any?]) + case 161: + return PlatformCameraTargetBounds.fromList(self.readValue() as! [Any?]) + case 162: + return PlatformGroundOverlay.fromList(self.readValue() as! [Any?]) + case 163: + return PlatformMapViewCreationParams.fromList(self.readValue() as! [Any?]) + case 164: + return PlatformMapConfiguration.fromList(self.readValue() as! [Any?]) + case 165: + return PlatformPoint.fromList(self.readValue() as! [Any?]) + case 166: + return PlatformSize.fromList(self.readValue() as! [Any?]) + case 167: + return PlatformColor.fromList(self.readValue() as! [Any?]) + case 168: + return PlatformTileLayer.fromList(self.readValue() as! [Any?]) + case 169: + return PlatformZoomRange.fromList(self.readValue() as! [Any?]) + case 170: + return PlatformBitmap.fromList(self.readValue() as! [Any?]) + case 171: + return PlatformBitmapDefaultMarker.fromList(self.readValue() as! [Any?]) + case 172: + return PlatformBitmapBytes.fromList(self.readValue() as! [Any?]) + case 173: + return PlatformBitmapAsset.fromList(self.readValue() as! [Any?]) + case 174: + return PlatformBitmapAssetImage.fromList(self.readValue() as! [Any?]) + case 175: + return PlatformBitmapAssetMap.fromList(self.readValue() as! [Any?]) + case 176: + return PlatformBitmapBytesMap.fromList(self.readValue() as! [Any?]) + case 177: + return PlatformBitmapPinConfig.fromList(self.readValue() as! [Any?]) + default: + return super.readValue(ofType: type) + } + } +} + +private class MessagesPigeonCodecWriter: FlutterStandardWriter { + override func writeValue(_ value: Any) { + if let value = value as? PlatformMapType { + super.writeByte(129) + super.writeValue(value.rawValue) + } else if let value = value as? PlatformMarkerCollisionBehavior { + super.writeByte(130) + super.writeValue(value.rawValue) + } else if let value = value as? PlatformJointType { + super.writeByte(131) + super.writeValue(value.rawValue) + } else if let value = value as? PlatformPatternItemType { + super.writeByte(132) + super.writeValue(value.rawValue) + } else if let value = value as? PlatformMarkerType { + super.writeByte(133) + super.writeValue(value.rawValue) + } else if let value = value as? PlatformMapBitmapScaling { + super.writeByte(134) + super.writeValue(value.rawValue) + } else if let value = value as? PlatformCameraPosition { + super.writeByte(135) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdate { + super.writeByte(136) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateNewCameraPosition { + super.writeByte(137) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateNewLatLng { + super.writeByte(138) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateNewLatLngBounds { + super.writeByte(139) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateNewLatLngZoom { + super.writeByte(140) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateScrollBy { + super.writeByte(141) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateZoomBy { + super.writeByte(142) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateZoom { + super.writeByte(143) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateZoomTo { + super.writeByte(144) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCircle { + super.writeByte(145) + super.writeValue(value.toList()) + } else if let value = value as? PlatformHeatmap { + super.writeByte(146) + super.writeValue(value.toList()) + } else if let value = value as? PlatformHeatmapGradient { + super.writeByte(147) + super.writeValue(value.toList()) + } else if let value = value as? PlatformWeightedLatLng { + super.writeByte(148) + super.writeValue(value.toList()) + } else if let value = value as? PlatformInfoWindow { + super.writeByte(149) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCluster { + super.writeByte(150) + super.writeValue(value.toList()) + } else if let value = value as? PlatformClusterManager { + super.writeByte(151) + super.writeValue(value.toList()) + } else if let value = value as? PlatformMarker { + super.writeByte(152) + super.writeValue(value.toList()) + } else if let value = value as? PlatformPolygon { + super.writeByte(153) + super.writeValue(value.toList()) + } else if let value = value as? PlatformPolyline { + super.writeByte(154) + super.writeValue(value.toList()) + } else if let value = value as? PlatformPatternItem { + super.writeByte(155) + super.writeValue(value.toList()) + } else if let value = value as? PlatformTile { + super.writeByte(156) + super.writeValue(value.toList()) + } else if let value = value as? PlatformTileOverlay { + super.writeByte(157) + super.writeValue(value.toList()) + } else if let value = value as? PlatformEdgeInsets { + super.writeByte(158) + super.writeValue(value.toList()) + } else if let value = value as? PlatformLatLng { + super.writeByte(159) + super.writeValue(value.toList()) + } else if let value = value as? PlatformLatLngBounds { + super.writeByte(160) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraTargetBounds { + super.writeByte(161) + super.writeValue(value.toList()) + } else if let value = value as? PlatformGroundOverlay { + super.writeByte(162) + super.writeValue(value.toList()) + } else if let value = value as? PlatformMapViewCreationParams { + super.writeByte(163) + super.writeValue(value.toList()) + } else if let value = value as? PlatformMapConfiguration { + super.writeByte(164) + super.writeValue(value.toList()) + } else if let value = value as? PlatformPoint { + super.writeByte(165) + super.writeValue(value.toList()) + } else if let value = value as? PlatformSize { + super.writeByte(166) + super.writeValue(value.toList()) + } else if let value = value as? PlatformColor { + super.writeByte(167) + super.writeValue(value.toList()) + } else if let value = value as? PlatformTileLayer { + super.writeByte(168) + super.writeValue(value.toList()) + } else if let value = value as? PlatformZoomRange { + super.writeByte(169) + super.writeValue(value.toList()) + } else if let value = value as? PlatformBitmap { + super.writeByte(170) + super.writeValue(value.toList()) + } else if let value = value as? PlatformBitmapDefaultMarker { + super.writeByte(171) + super.writeValue(value.toList()) + } else if let value = value as? PlatformBitmapBytes { + super.writeByte(172) + super.writeValue(value.toList()) + } else if let value = value as? PlatformBitmapAsset { + super.writeByte(173) + super.writeValue(value.toList()) + } else if let value = value as? PlatformBitmapAssetImage { + super.writeByte(174) + super.writeValue(value.toList()) + } else if let value = value as? PlatformBitmapAssetMap { + super.writeByte(175) + super.writeValue(value.toList()) + } else if let value = value as? PlatformBitmapBytesMap { + super.writeByte(176) + super.writeValue(value.toList()) + } else if let value = value as? PlatformBitmapPinConfig { + super.writeByte(177) + super.writeValue(value.toList()) + } else { + super.writeValue(value) + } + } +} + +private class MessagesPigeonCodecReaderWriter: FlutterStandardReaderWriter { + override func reader(with data: Data) -> FlutterStandardReader { + return MessagesPigeonCodecReader(data: data) + } + + override func writer(with data: NSMutableData) -> FlutterStandardWriter { + return MessagesPigeonCodecWriter(data: data) + } +} + +class MessagesPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { + static let shared = MessagesPigeonCodec(readerWriter: MessagesPigeonCodecReaderWriter()) +} + +/// Interface for non-test interactions with the native SDK. +/// +/// For test-only state queries, see [MapsInspectorApi]. +/// +/// Generated protocol from Pigeon that represents a handler of messages from Flutter. +protocol MapsApi { + /// Returns once the map instance is available. + func waitForMap() throws + /// Updates the map's configuration options. + /// + /// Only non-null configuration values will result in updates; options with + /// null values will remain unchanged. + func updateWithMapConfiguration(_ configuration: PlatformMapConfiguration) throws + /// Updates the set of circles on the map. + func updateCircles( + adding toAdd: [PlatformCircle], changing toChange: [PlatformCircle], + removing idsToRemove: [String]) throws + /// Updates the set of heatmaps on the map. + func updateHeatmaps( + adding toAdd: [PlatformHeatmap], changing toChange: [PlatformHeatmap], + removing idsToRemove: [String]) throws + /// Updates the set of custer managers for clusters on the map. + func updateClusterManagers(adding toAdd: [PlatformClusterManager], removing idsToRemove: [String]) + throws + /// Updates the set of markers on the map. + func updateMarkers( + adding toAdd: [PlatformMarker], changing toChange: [PlatformMarker], + removing idsToRemove: [String]) throws + /// Updates the set of polygonss on the map. + func updatePolygons( + adding toAdd: [PlatformPolygon], changing toChange: [PlatformPolygon], + removing idsToRemove: [String]) throws + /// Updates the set of polylines on the map. + func updatePolylines( + adding toAdd: [PlatformPolyline], changing toChange: [PlatformPolyline], + removing idsToRemove: [String]) throws + /// Updates the set of tile overlays on the map. + func updateTileOverlays( + adding toAdd: [PlatformTileOverlay], changing toChange: [PlatformTileOverlay], + removing idsToRemove: [String]) throws + /// Updates the set of ground overlays on the map. + func updateGroundOverlays( + adding toAdd: [PlatformGroundOverlay], changing toChange: [PlatformGroundOverlay], + removing idsToRemove: [String]) throws + /// Gets the screen coordinate for the given map location. + func screenCoordinates(for latLng: PlatformLatLng) throws -> PlatformPoint + /// Gets the map location for the given screen coordinate. + func latLng(for screenCoordinate: PlatformPoint) throws -> PlatformLatLng + /// Gets the map region currently displayed on the map. + func visibleMapRegion() throws -> PlatformLatLngBounds + /// Moves the camera according to [cameraUpdate] immediately, with no + /// animation. + func moveCamera(_ cameraUpdate: PlatformCameraUpdate) throws + /// Moves the camera according to [cameraUpdate], animating the update using a + /// duration in milliseconds if provided. + func animateCamera(_ cameraUpdate: PlatformCameraUpdate, duration durationMilliseconds: Int64?) + throws + /// Gets the current map zoom level. + func zoomLevel() throws -> Double + /// Show the info window for the marker with the given ID. + func showInfoWindowForMarker(withIdentifier markerId: String) throws + /// Hide the info window for the marker with the given ID. + func hideInfoWindowForMarker(withIdentifier markerId: String) throws + /// Returns true if the marker with the given ID is currently displaying its + /// info window. + func isShowingInfoWindowForMarker(withIdentifier markerId: String) throws -> Bool + /// Sets the style to the given map style string, where an empty string + /// indicates that the style should be cleared. + /// + /// If there was an error setting the style, such as an invalid style string, + /// returns the error message. + func setStyle(_ style: String) throws -> String? + /// Returns the error string from the last attempt to set the map style, if + /// any. + /// + /// This allows checking asynchronously for initial style failures, as there + /// is no way to return failures from map initialization. + func lastStyleError() throws -> String? + /// Clears the cache of tiles previously requseted from the tile provider. + func clearTileCacheForOverlay(withIdentifier tileOverlayId: String) throws + /// Takes a snapshot of the map and returns its image data. + func takeSnapshot() throws -> FlutterStandardTypedData? + /// Returns true if the map supports advanced markers. + func isAdvancedMarkersAvailable() throws -> Bool +} + +/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. +class MapsApiSetup { + static var codec: FlutterStandardMessageCodec { MessagesPigeonCodec.shared } + /// Sets up an instance of `MapsApi` to handle messages through the `binaryMessenger`. + static func setUp( + binaryMessenger: FlutterBinaryMessenger, api: MapsApi?, messageChannelSuffix: String = "" + ) { + let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + /// Returns once the map instance is available. + let waitForMapChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.waitForMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + waitForMapChannel.setMessageHandler { _, reply in + do { + try api.waitForMap() + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + waitForMapChannel.setMessageHandler(nil) + } + /// Updates the map's configuration options. + /// + /// Only non-null configuration values will result in updates; options with + /// null values will remain unchanged. + let updateMapConfigurationChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateMapConfiguration\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateMapConfigurationChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let configurationArg = args[0] as! PlatformMapConfiguration + do { + try api.updateWithMapConfiguration(configurationArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updateMapConfigurationChannel.setMessageHandler(nil) + } + /// Updates the set of circles on the map. + let updateCirclesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateCircles\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateCirclesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformCircle] + let toChangeArg = args[1] as! [PlatformCircle] + let idsToRemoveArg = args[2] as! [String] + do { + try api.updateCircles(adding: toAddArg, changing: toChangeArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updateCirclesChannel.setMessageHandler(nil) + } + /// Updates the set of heatmaps on the map. + let updateHeatmapsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateHeatmaps\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateHeatmapsChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformHeatmap] + let toChangeArg = args[1] as! [PlatformHeatmap] + let idsToRemoveArg = args[2] as! [String] + do { + try api.updateHeatmaps(adding: toAddArg, changing: toChangeArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updateHeatmapsChannel.setMessageHandler(nil) + } + /// Updates the set of custer managers for clusters on the map. + let updateClusterManagersChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateClusterManagers\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateClusterManagersChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformClusterManager] + let idsToRemoveArg = args[1] as! [String] + do { + try api.updateClusterManagers(adding: toAddArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updateClusterManagersChannel.setMessageHandler(nil) + } + /// Updates the set of markers on the map. + let updateMarkersChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateMarkers\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateMarkersChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformMarker] + let toChangeArg = args[1] as! [PlatformMarker] + let idsToRemoveArg = args[2] as! [String] + do { + try api.updateMarkers(adding: toAddArg, changing: toChangeArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updateMarkersChannel.setMessageHandler(nil) + } + /// Updates the set of polygonss on the map. + let updatePolygonsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updatePolygons\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updatePolygonsChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformPolygon] + let toChangeArg = args[1] as! [PlatformPolygon] + let idsToRemoveArg = args[2] as! [String] + do { + try api.updatePolygons(adding: toAddArg, changing: toChangeArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updatePolygonsChannel.setMessageHandler(nil) + } + /// Updates the set of polylines on the map. + let updatePolylinesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updatePolylines\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updatePolylinesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformPolyline] + let toChangeArg = args[1] as! [PlatformPolyline] + let idsToRemoveArg = args[2] as! [String] + do { + try api.updatePolylines(adding: toAddArg, changing: toChangeArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updatePolylinesChannel.setMessageHandler(nil) + } + /// Updates the set of tile overlays on the map. + let updateTileOverlaysChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateTileOverlays\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateTileOverlaysChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformTileOverlay] + let toChangeArg = args[1] as! [PlatformTileOverlay] + let idsToRemoveArg = args[2] as! [String] + do { + try api.updateTileOverlays( + adding: toAddArg, changing: toChangeArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updateTileOverlaysChannel.setMessageHandler(nil) + } + /// Updates the set of ground overlays on the map. + let updateGroundOverlaysChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateGroundOverlays\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateGroundOverlaysChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformGroundOverlay] + let toChangeArg = args[1] as! [PlatformGroundOverlay] + let idsToRemoveArg = args[2] as! [String] + do { + try api.updateGroundOverlays( + adding: toAddArg, changing: toChangeArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updateGroundOverlaysChannel.setMessageHandler(nil) + } + /// Gets the screen coordinate for the given map location. + let getScreenCoordinateChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getScreenCoordinate\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getScreenCoordinateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let latLngArg = args[0] as! PlatformLatLng + do { + let result = try api.screenCoordinates(for: latLngArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getScreenCoordinateChannel.setMessageHandler(nil) + } + /// Gets the map location for the given screen coordinate. + let getLatLngChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getLatLng\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getLatLngChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let screenCoordinateArg = args[0] as! PlatformPoint + do { + let result = try api.latLng(for: screenCoordinateArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getLatLngChannel.setMessageHandler(nil) + } + /// Gets the map region currently displayed on the map. + let getVisibleRegionChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getVisibleRegion\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getVisibleRegionChannel.setMessageHandler { _, reply in + do { + let result = try api.visibleMapRegion() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getVisibleRegionChannel.setMessageHandler(nil) + } + /// Moves the camera according to [cameraUpdate] immediately, with no + /// animation. + let moveCameraChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.moveCamera\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + moveCameraChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let cameraUpdateArg = args[0] as! PlatformCameraUpdate + do { + try api.moveCamera(cameraUpdateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + moveCameraChannel.setMessageHandler(nil) + } + /// Moves the camera according to [cameraUpdate], animating the update using a + /// duration in milliseconds if provided. + let animateCameraChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.animateCamera\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + animateCameraChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let cameraUpdateArg = args[0] as! PlatformCameraUpdate + let durationMillisecondsArg: Int64? = nilOrValue(args[1]) + do { + try api.animateCamera(cameraUpdateArg, duration: durationMillisecondsArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + animateCameraChannel.setMessageHandler(nil) + } + /// Gets the current map zoom level. + let getZoomLevelChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getZoomLevel\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getZoomLevelChannel.setMessageHandler { _, reply in + do { + let result = try api.zoomLevel() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getZoomLevelChannel.setMessageHandler(nil) + } + /// Show the info window for the marker with the given ID. + let showInfoWindowChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.showInfoWindow\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + showInfoWindowChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let markerIdArg = args[0] as! String + do { + try api.showInfoWindowForMarker(withIdentifier: markerIdArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + showInfoWindowChannel.setMessageHandler(nil) + } + /// Hide the info window for the marker with the given ID. + let hideInfoWindowChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.hideInfoWindow\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + hideInfoWindowChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let markerIdArg = args[0] as! String + do { + try api.hideInfoWindowForMarker(withIdentifier: markerIdArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + hideInfoWindowChannel.setMessageHandler(nil) + } + /// Returns true if the marker with the given ID is currently displaying its + /// info window. + let isInfoWindowShownChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.isInfoWindowShown\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + isInfoWindowShownChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let markerIdArg = args[0] as! String + do { + let result = try api.isShowingInfoWindowForMarker(withIdentifier: markerIdArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + isInfoWindowShownChannel.setMessageHandler(nil) + } + /// Sets the style to the given map style string, where an empty string + /// indicates that the style should be cleared. + /// + /// If there was an error setting the style, such as an invalid style string, + /// returns the error message. + let setStyleChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.setStyle\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setStyleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let styleArg = args[0] as! String + do { + let result = try api.setStyle(styleArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + setStyleChannel.setMessageHandler(nil) + } + /// Returns the error string from the last attempt to set the map style, if + /// any. + /// + /// This allows checking asynchronously for initial style failures, as there + /// is no way to return failures from map initialization. + let getLastStyleErrorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getLastStyleError\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getLastStyleErrorChannel.setMessageHandler { _, reply in + do { + let result = try api.lastStyleError() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getLastStyleErrorChannel.setMessageHandler(nil) + } + /// Clears the cache of tiles previously requseted from the tile provider. + let clearTileCacheChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.clearTileCache\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + clearTileCacheChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let tileOverlayIdArg = args[0] as! String + do { + try api.clearTileCacheForOverlay(withIdentifier: tileOverlayIdArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + clearTileCacheChannel.setMessageHandler(nil) + } + /// Takes a snapshot of the map and returns its image data. + let takeSnapshotChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.takeSnapshot\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + takeSnapshotChannel.setMessageHandler { _, reply in + do { + let result = try api.takeSnapshot() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + takeSnapshotChannel.setMessageHandler(nil) + } + /// Returns true if the map supports advanced markers. + let isAdvancedMarkersAvailableChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.isAdvancedMarkersAvailable\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + isAdvancedMarkersAvailableChannel.setMessageHandler { _, reply in + do { + let result = try api.isAdvancedMarkersAvailable() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + isAdvancedMarkersAvailableChannel.setMessageHandler(nil) + } + } +} + +/// Interface for calls from the native SDK to Dart. +/// +/// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift. +protocol MapsCallbackApiProtocol { + /// Called when the map camera starts moving. + func didStartCameraMove(completion: @escaping (Result) -> Void) + /// Called when the map camera moves. + func didMoveCamera( + to cameraPositionArg: PlatformCameraPosition, + completion: @escaping (Result) -> Void) + /// Called when the map camera stops moving. + func didIdleCamera(completion: @escaping (Result) -> Void) + /// Called when the map, not a specifc map object, is tapped. + func didTap( + at positionArg: PlatformLatLng, completion: @escaping (Result) -> Void) + /// Called when the map, not a specifc map object, is long pressed. + func didLongPress( + at positionArg: PlatformLatLng, completion: @escaping (Result) -> Void) + /// Called when a marker is tapped. + func didTapMarker( + withIdentifier markerIdArg: String, completion: @escaping (Result) -> Void) + /// Called when a marker drag starts. + func didStartDragForMarker( + withIdentifier markerIdArg: String, at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void) + /// Called when a marker drag updates. + func didDragMarker( + withIdentifier markerIdArg: String, at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void) + /// Called when a marker drag ends. + func didEndDragForMarker( + withIdentifier markerIdArg: String, at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void) + /// Called when a marker's info window is tapped. + func didTapInfoWindowOfMarker( + withIdentifier markerIdArg: String, completion: @escaping (Result) -> Void) + /// Called when a circle is tapped. + func didTapCircle( + withIdentifier circleIdArg: String, completion: @escaping (Result) -> Void) + /// Called when a marker cluster is tapped. + func didTapCluster( + _ clusterArg: PlatformCluster, completion: @escaping (Result) -> Void) + /// Called when a polygon is tapped. + func didTapPolygon( + withIdentifier polygonIdArg: String, completion: @escaping (Result) -> Void) + /// Called when a polyline is tapped. + func didTapPolyline( + withIdentifier polylineIdArg: String, completion: @escaping (Result) -> Void) + /// Called when a ground overlay is tapped. + func didTapGroundOverlay( + withIdentifier groundOverlayIdArg: String, + completion: @escaping (Result) -> Void) + /// Called to get data for a map tile. + func tile( + withOverlayIdentifier tileOverlayIdArg: String, location locationArg: PlatformPoint, + zoom zoomArg: Int64, completion: @escaping (Result) -> Void) +} +class MapsCallbackApi: MapsCallbackApiProtocol { + private let binaryMessenger: FlutterBinaryMessenger + private let messageChannelSuffix: String + init(binaryMessenger: FlutterBinaryMessenger, messageChannelSuffix: String = "") { + self.binaryMessenger = binaryMessenger + self.messageChannelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + } + var codec: MessagesPigeonCodec { + return MessagesPigeonCodec.shared + } + /// Called when the map camera starts moving. + func didStartCameraMove(completion: @escaping (Result) -> Void) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCameraMoveStarted\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage(nil) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when the map camera moves. + func didMoveCamera( + to cameraPositionArg: PlatformCameraPosition, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCameraMove\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([cameraPositionArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when the map camera stops moving. + func didIdleCamera(completion: @escaping (Result) -> Void) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCameraIdle\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage(nil) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when the map, not a specifc map object, is tapped. + func didTap( + at positionArg: PlatformLatLng, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([positionArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when the map, not a specifc map object, is long pressed. + func didLongPress( + at positionArg: PlatformLatLng, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onLongPress\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([positionArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a marker is tapped. + func didTapMarker( + withIdentifier markerIdArg: String, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([markerIdArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a marker drag starts. + func didStartDragForMarker( + withIdentifier markerIdArg: String, at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDragStart\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([markerIdArg, positionArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a marker drag updates. + func didDragMarker( + withIdentifier markerIdArg: String, at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDrag\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([markerIdArg, positionArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a marker drag ends. + func didEndDragForMarker( + withIdentifier markerIdArg: String, at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDragEnd\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([markerIdArg, positionArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a marker's info window is tapped. + func didTapInfoWindowOfMarker( + withIdentifier markerIdArg: String, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onInfoWindowTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([markerIdArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a circle is tapped. + func didTapCircle( + withIdentifier circleIdArg: String, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCircleTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([circleIdArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a marker cluster is tapped. + func didTapCluster( + _ clusterArg: PlatformCluster, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onClusterTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([clusterArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a polygon is tapped. + func didTapPolygon( + withIdentifier polygonIdArg: String, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onPolygonTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([polygonIdArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a polyline is tapped. + func didTapPolyline( + withIdentifier polylineIdArg: String, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onPolylineTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([polylineIdArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a ground overlay is tapped. + func didTapGroundOverlay( + withIdentifier groundOverlayIdArg: String, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onGroundOverlayTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([groundOverlayIdArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called to get data for a map tile. + func tile( + withOverlayIdentifier tileOverlayIdArg: String, location locationArg: PlatformPoint, + zoom zoomArg: Int64, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.getTileOverlayTile\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([tileOverlayIdArg, locationArg, zoomArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! PlatformTile + completion(.success(result)) + } + } + } +} +/// Dummy interface to force generation of the platform view creation params, +/// which are not used in any Pigeon calls, only the platform view creation +/// call made internally by Flutter. +/// +/// Generated protocol from Pigeon that represents a handler of messages from Flutter. +protocol MapsPlatformViewApi { + func createView(type: PlatformMapViewCreationParams?) throws +} + +/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. +class MapsPlatformViewApiSetup { + static var codec: FlutterStandardMessageCodec { MessagesPigeonCodec.shared } + /// Sets up an instance of `MapsPlatformViewApi` to handle messages through the `binaryMessenger`. + static func setUp( + binaryMessenger: FlutterBinaryMessenger, api: MapsPlatformViewApi?, + messageChannelSuffix: String = "" + ) { + let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + let createViewChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsPlatformViewApi.createView\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + createViewChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let typeArg: PlatformMapViewCreationParams? = nilOrValue(args[0]) + do { + try api.createView(type: typeArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + createViewChannel.setMessageHandler(nil) + } + } +} +/// Inspector API only intended for use in integration tests. +/// +/// Generated protocol from Pigeon that represents a handler of messages from Flutter. +protocol MapsInspectorApi { + func areBuildingsEnabled() throws -> Bool + func areRotateGesturesEnabled() throws -> Bool + func areScrollGesturesEnabled() throws -> Bool + func areTiltGesturesEnabled() throws -> Bool + func areZoomGesturesEnabled() throws -> Bool + func isCompassEnabled() throws -> Bool + func isMyLocationButtonEnabled() throws -> Bool + func isTrafficEnabled() throws -> Bool + func tileOverlay(withIdentifier tileOverlayId: String) throws -> PlatformTileLayer? + func groundOverlay(withIdentifier groundOverlayId: String) throws -> PlatformGroundOverlay? + func heatmap(withIdentifier heatmapId: String) throws -> PlatformHeatmap? + func zoomRange() throws -> PlatformZoomRange + func clusters(withIdentifier clusterManagerId: String) throws -> [PlatformCluster] + func cameraPosition() throws -> PlatformCameraPosition +} + +/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. +class MapsInspectorApiSetup { + static var codec: FlutterStandardMessageCodec { MessagesPigeonCodec.shared } + /// Sets up an instance of `MapsInspectorApi` to handle messages through the `binaryMessenger`. + static func setUp( + binaryMessenger: FlutterBinaryMessenger, api: MapsInspectorApi?, + messageChannelSuffix: String = "" + ) { + let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + let areBuildingsEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areBuildingsEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + areBuildingsEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.areBuildingsEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + areBuildingsEnabledChannel.setMessageHandler(nil) + } + let areRotateGesturesEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areRotateGesturesEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + areRotateGesturesEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.areRotateGesturesEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + areRotateGesturesEnabledChannel.setMessageHandler(nil) + } + let areScrollGesturesEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areScrollGesturesEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + areScrollGesturesEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.areScrollGesturesEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + areScrollGesturesEnabledChannel.setMessageHandler(nil) + } + let areTiltGesturesEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areTiltGesturesEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + areTiltGesturesEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.areTiltGesturesEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + areTiltGesturesEnabledChannel.setMessageHandler(nil) + } + let areZoomGesturesEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areZoomGesturesEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + areZoomGesturesEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.areZoomGesturesEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + areZoomGesturesEnabledChannel.setMessageHandler(nil) + } + let isCompassEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.isCompassEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + isCompassEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.isCompassEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + isCompassEnabledChannel.setMessageHandler(nil) + } + let isMyLocationButtonEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.isMyLocationButtonEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + isMyLocationButtonEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.isMyLocationButtonEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + isMyLocationButtonEnabledChannel.setMessageHandler(nil) + } + let isTrafficEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.isTrafficEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + isTrafficEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.isTrafficEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + isTrafficEnabledChannel.setMessageHandler(nil) + } + let getTileOverlayInfoChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getTileOverlayInfo\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getTileOverlayInfoChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let tileOverlayIdArg = args[0] as! String + do { + let result = try api.tileOverlay(withIdentifier: tileOverlayIdArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getTileOverlayInfoChannel.setMessageHandler(nil) + } + let getGroundOverlayInfoChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getGroundOverlayInfo\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getGroundOverlayInfoChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let groundOverlayIdArg = args[0] as! String + do { + let result = try api.groundOverlay(withIdentifier: groundOverlayIdArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getGroundOverlayInfoChannel.setMessageHandler(nil) + } + let getHeatmapInfoChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getHeatmapInfo\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getHeatmapInfoChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let heatmapIdArg = args[0] as! String + do { + let result = try api.heatmap(withIdentifier: heatmapIdArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getHeatmapInfoChannel.setMessageHandler(nil) + } + let getZoomRangeChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getZoomRange\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getZoomRangeChannel.setMessageHandler { _, reply in + do { + let result = try api.zoomRange() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getZoomRangeChannel.setMessageHandler(nil) + } + let getClustersChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getClusters\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getClustersChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let clusterManagerIdArg = args[0] as! String + do { + let result = try api.clusters(withIdentifier: clusterManagerIdArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getClustersChannel.setMessageHandler(nil) + } + let getCameraPositionChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getCameraPosition\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getCameraPositionChannel.setMessageHandler { _, reply in + do { + let result = try api.cameraPosition() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getCameraPositionChannel.setMessageHandler(nil) + } + } +} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolygonController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolygonController.swift index e2d78a7c6c40..04a8b9855e6f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolygonController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolygonController.swift @@ -4,10 +4,6 @@ import GoogleMaps -#if canImport(google_maps_flutter_ios_sdk9_objc) - import google_maps_flutter_ios_sdk9_objc -#endif - /// Defines polygon controllable by Flutter. class PolygonController: NSObject { let polygon: GMSPolygon @@ -24,20 +20,22 @@ class PolygonController: NSObject { polygon.map = nil } - /// Updates the controller's polygon with the properties from a FGMPlatformPolygon. + /// Updates the controller's polygon with the properties from a PlatformPolygon. /// /// Setting the polygon to visible will set its map to the controller's mapView. - func update(from platformPolygon: FGMPlatformPolygon) { + func update(from platformPolygon: PlatformPolygon) { if let mapView = mapView { PolygonController.update(polygon, from: platformPolygon, with: mapView) } } - /// Updates the given GMSPolygon with the properties from a FGMPlatformPolygon. + /// Updates the given GMSPolygon with the properties from a PlatformPolygon. /// /// Setting the polygon to visible will set its map to the given mapView. static func update( - _ polygon: GMSPolygon, from platformPolygon: FGMPlatformPolygon, with mapView: GMSMapView + _ polygon: GMSPolygon, + from platformPolygon: PlatformPolygon, + with mapView: GMSMapView ) { polygon.isTappable = platformPolygon.consumesTapEvents polygon.zIndex = Int32(platformPolygon.zIndex) @@ -65,7 +63,7 @@ class PolygonsController: NSObject { super.init() } - func add(_ polygons: [FGMPlatformPolygon]) { + func add(_ polygons: [PlatformPolygon]) { guard let mapView = mapView else { return } for polygon in polygons { let identifier = polygon.polygonId @@ -77,7 +75,7 @@ class PolygonsController: NSObject { } } - func change(_ polygons: [FGMPlatformPolygon]) { + func change(_ polygons: [PlatformPolygon]) { for polygon in polygons { let identifier = polygon.polygonId polygonIdentifierToController[identifier]?.update(from: polygon) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolylineController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolylineController.swift index 0ed24af32031..f91c4ad2a1a1 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolylineController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolylineController.swift @@ -4,10 +4,6 @@ import GoogleMaps -#if canImport(google_maps_flutter_ios_sdk9_objc) - import google_maps_flutter_ios_sdk9_objc -#endif - /// Defines polyline controllable by Flutter. class PolylineController: NSObject { let polyline: GMSPolyline @@ -24,20 +20,22 @@ class PolylineController: NSObject { polyline.map = nil } - /// Updates the controller's polyline with the properties from a FGMPlatformPolyline. + /// Updates the controller's polyline with the properties from a PlatformPolyline. /// /// Setting the polyline to visible will set its map to the controller's mapView. - func update(from platformPolyline: FGMPlatformPolyline) { + func update(from platformPolyline: PlatformPolyline) { if let mapView = mapView { PolylineController.update(polyline, from: platformPolyline, with: mapView) } } - /// Updates the given GMSPolyline with the properties from a FGMPlatformPolyline. + /// Updates the given GMSPolyline with the properties from a PlatformPolyline. /// /// Setting the polyline to visible will set its map to the given mapView. static func update( - _ polyline: GMSPolyline, from platformPolyline: FGMPlatformPolyline, with mapView: GMSMapView + _ polyline: GMSPolyline, + from platformPolyline: PlatformPolyline, + with mapView: GMSMapView ) { polyline.isTappable = platformPolyline.consumesTapEvents polyline.zIndex = Int32(platformPolyline.zIndex) @@ -70,7 +68,7 @@ class PolylinesController: NSObject { super.init() } - func add(_ polylines: [FGMPlatformPolyline]) { + func add(_ polylines: [PlatformPolyline]) { guard let mapView = mapView else { return } for polyline in polylines { let identifier = polyline.polylineId @@ -82,7 +80,7 @@ class PolylinesController: NSObject { } } - func change(_ polylines: [FGMPlatformPolyline]) { + func change(_ polylines: [PlatformPolyline]) { for polyline in polylines { let identifier = polyline.polylineId polylineIdentifierToController[identifier]?.update(from: polyline) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/TileOverlayController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/TileOverlayController.swift index 5f8dc3820e35..32c1ed94ed6a 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/TileOverlayController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/TileOverlayController.swift @@ -6,19 +6,15 @@ import Flutter import GoogleMaps import UIKit -#if canImport(google_maps_flutter_ios_sdk9_objc) - import google_maps_flutter_ios_sdk9_objc -#endif - /// Protocol for requesting tiles from the Dart side. // TODO(stuartmorgan): Adjust this to match the Swift API once the Pigeon // generation is switched to Swift. protocol TileProviderDelegate: AnyObject { func tile( withOverlayIdentifier tileOverlayId: String, - location: FGMPlatformPoint, - zoom: Int, - completion: @escaping (FGMPlatformTile?, FlutterError?) -> Void + location: PlatformPoint, + zoom: Int64, + completion: @escaping (Result) -> Void ) } @@ -27,7 +23,7 @@ class TileOverlayController: NSObject { let layer: GMSTileLayer private weak var mapView: GMSMapView? - init(tileOverlay: FGMPlatformTileOverlay, tileLayer: GMSTileLayer, mapView: GMSMapView) { + init(tileOverlay: PlatformTileOverlay, tileLayer: GMSTileLayer, mapView: GMSMapView) { self.layer = tileLayer self.mapView = mapView super.init() @@ -42,21 +38,21 @@ class TileOverlayController: NSObject { layer.clearTileCache() } - /// Updates the controller's tile overlay with the properties from a FGMPlatformTileOverlay. + /// Updates the controller's tile overlay with the properties from a PlatformTileOverlay. /// /// Setting the tile overlay to visible will set its map to the controller's mapView. - func update(from overlay: FGMPlatformTileOverlay) { + func update(from overlay: PlatformTileOverlay) { if let mapView = mapView { TileOverlayController.update(layer, from: overlay, with: mapView) } } - /// Updates the given GMSTileLayer with the properties from a FGMPlatformTileOverlay. + /// Updates the given GMSTileLayer with the properties from a PlatformTileOverlay. /// /// Setting the tile overlay to visible will set its map to the given mapView. static func update( _ tileLayer: GMSTileLayer, - from platformOverlay: FGMPlatformTileOverlay, + from platformOverlay: PlatformTileOverlay, with mapView: GMSMapView ) { tileLayer.opacity = Float(1.0 - platformOverlay.transparency) @@ -121,21 +117,20 @@ class TileProviderController: GMSTileLayer { } tileProviderDelegate.tile( withOverlayIdentifier: self.tileOverlayIdentifier, - location: FGMPlatformPoint.makeWith(x: Double(x), y: Double(y)), - zoom: Int(zoom) - ) { [weak self] tile, error in + location: PlatformPoint(x: Double(x), y: Double(y)), + zoom: Int64(zoom) + ) { [weak self] result in guard let self = self else { receiver.receiveTileWith(x: x, y: y, zoom: zoom, image: kGMSTileLayerNoTile) return } - let typedData = tile?.data - let tileImage: UIImage - if let data = typedData?.data { - tileImage = self.handleResultTile(UIImage(data: data)) ?? kGMSTileLayerNoTile - } else { - tileImage = kGMSTileLayerNoTile - } - if let error = error { + var tileImage = kGMSTileLayerNoTile + switch result { + case .success(let tile): + if let data = tile.data?.data { + tileImage = self.handleResultTile(UIImage(data: data)) ?? kGMSTileLayerNoTile + } + case .failure(let error): NSLog( "Can't get tile: errorCode = \(error.code), errorMessage = \(error.message ?? "nil"), details = \(error.details ?? "nil")" ) @@ -158,7 +153,7 @@ class TileOverlaysController: NSObject { super.init() } - func add(_ tileOverlaysToAdd: [FGMPlatformTileOverlay]) { + func add(_ tileOverlaysToAdd: [PlatformTileOverlay]) { guard let mapView = mapView, let tileProviderDelegate = tileProviderDelegate else { return } for tileOverlay in tileOverlaysToAdd { let identifier = tileOverlay.tileOverlayId @@ -175,7 +170,7 @@ class TileOverlaysController: NSObject { } } - func change(_ tileOverlaysToChange: [FGMPlatformTileOverlay]) { + func change(_ tileOverlaysToChange: [PlatformTileOverlay]) { for tileOverlay in tileOverlaysToChange { let identifier = tileOverlay.tileOverlayId tileOverlayIdentifierToController[identifier]?.update(from: tileOverlay) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/google_maps_flutter_pigeon_messages.g.m b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/google_maps_flutter_pigeon_messages.g.m deleted file mode 100644 index 205bc2a3ccad..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/google_maps_flutter_pigeon_messages.g.m +++ /dev/null @@ -1,4849 +0,0 @@ -// Copyright 2013 The Flutter Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// Autogenerated from Pigeon (v27.3.2), do not edit directly. -// See also: https://pub.dev/packages/pigeon - -#import "google_maps_flutter_pigeon_messages.g.h" - -#if TARGET_OS_OSX -@import FlutterMacOS; -#else -@import Flutter; -#endif - -static BOOL __attribute__((unused)) FLTPigeonDeepEquals(id _Nullable a, id _Nullable b) { - if (a == b) { - return YES; - } - if (a == nil) { - return b == [NSNull null]; - } - if (b == nil) { - return a == [NSNull null]; - } - if ([a isKindOfClass:[NSNumber class]] && [b isKindOfClass:[NSNumber class]]) { - return - [a isEqual:b] || (isnan([(NSNumber *)a doubleValue]) && isnan([(NSNumber *)b doubleValue])); - } - if ([a isKindOfClass:[NSArray class]] && [b isKindOfClass:[NSArray class]]) { - NSArray *arrayA = (NSArray *)a; - NSArray *arrayB = (NSArray *)b; - if (arrayA.count != arrayB.count) { - return NO; - } - for (NSUInteger i = 0; i < arrayA.count; i++) { - if (!FLTPigeonDeepEquals(arrayA[i], arrayB[i])) { - return NO; - } - } - return YES; - } - if ([a isKindOfClass:[NSDictionary class]] && [b isKindOfClass:[NSDictionary class]]) { - NSDictionary *dictA = (NSDictionary *)a; - NSDictionary *dictB = (NSDictionary *)b; - if (dictA.count != dictB.count) { - return NO; - } - for (id keyA in dictA) { - id valueA = dictA[keyA]; - BOOL found = NO; - for (id keyB in dictB) { - if (FLTPigeonDeepEquals(keyA, keyB)) { - id valueB = dictB[keyB]; - if (FLTPigeonDeepEquals(valueA, valueB)) { - found = YES; - break; - } else { - return NO; - } - } - } - if (!found) { - return NO; - } - } - return YES; - } - return [a isEqual:b]; -} - -static NSUInteger __attribute__((unused)) FLTPigeonDeepHash(id _Nullable value) { - if (value == nil || value == (id)[NSNull null]) { - return 0; - } - if ([value isKindOfClass:[NSNumber class]]) { - NSNumber *n = (NSNumber *)value; - double d = n.doubleValue; - if (isnan(d)) { - // Normalize NaN to a consistent hash. - return (NSUInteger)0x7FF8000000000000; - } - if (d == 0.0) { - // Normalize -0.0 to 0.0 so they have the same hash code. - d = 0.0; - } - return @(d).hash; - } - if ([value isKindOfClass:[NSArray class]]) { - NSUInteger result = 1; - for (id item in (NSArray *)value) { - result = result * 31 + FLTPigeonDeepHash(item); - } - return result; - } - if ([value isKindOfClass:[NSDictionary class]]) { - NSUInteger result = 0; - NSDictionary *dict = (NSDictionary *)value; - for (id key in dict) { - result += ((FLTPigeonDeepHash(key) * 31) ^ FLTPigeonDeepHash(dict[key])); - } - return result; - } - return [value hash]; -} - -static NSArray *wrapResult(id result, FlutterError *error) { - if (error) { - return @[ - error.code ?: [NSNull null], error.message ?: [NSNull null], error.details ?: [NSNull null] - ]; - } - return @[ result ?: [NSNull null] ]; -} - -static FlutterError *createConnectionError(NSString *channelName) { - return [FlutterError - errorWithCode:@"channel-error" - message:[NSString stringWithFormat:@"%@/%@/%@", - @"Unable to establish connection on channel: '", - channelName, @"'."] - details:@""]; -} - -static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { - id result = array[key]; - return (result == [NSNull null]) ? nil : result; -} - -/// Pigeon equivalent of MapType -@implementation FGMPlatformMapTypeBox -- (instancetype)initWithValue:(FGMPlatformMapType)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Pigeon equivalent of the MarkerCollisionBehavior enum. -@implementation FGMPlatformMarkerCollisionBehaviorBox -- (instancetype)initWithValue:(FGMPlatformMarkerCollisionBehavior)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Join types for polyline joints. -@implementation FGMPlatformJointTypeBox -- (instancetype)initWithValue:(FGMPlatformJointType)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Enumeration of possible types for PatternItem. -@implementation FGMPlatformPatternItemTypeBox -- (instancetype)initWithValue:(FGMPlatformPatternItemType)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -@implementation FGMPlatformMarkerTypeBox -- (instancetype)initWithValue:(FGMPlatformMarkerType)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Pigeon equivalent of [MapBitmapScaling]. -@implementation FGMPlatformMapBitmapScalingBox -- (instancetype)initWithValue:(FGMPlatformMapBitmapScaling)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -@interface FGMPlatformCameraPosition () -+ (FGMPlatformCameraPosition *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraPosition *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdate () -+ (FGMPlatformCameraUpdate *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdate *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateNewCameraPosition () -+ (FGMPlatformCameraUpdateNewCameraPosition *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateNewCameraPosition *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateNewLatLng () -+ (FGMPlatformCameraUpdateNewLatLng *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateNewLatLng *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateNewLatLngBounds () -+ (FGMPlatformCameraUpdateNewLatLngBounds *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateNewLatLngBounds *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateNewLatLngZoom () -+ (FGMPlatformCameraUpdateNewLatLngZoom *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateNewLatLngZoom *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateScrollBy () -+ (FGMPlatformCameraUpdateScrollBy *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateScrollBy *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateZoomBy () -+ (FGMPlatformCameraUpdateZoomBy *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateZoomBy *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateZoom () -+ (FGMPlatformCameraUpdateZoom *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateZoom *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateZoomTo () -+ (FGMPlatformCameraUpdateZoomTo *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateZoomTo *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCircle () -+ (FGMPlatformCircle *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCircle *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformHeatmap () -+ (FGMPlatformHeatmap *)fromList:(NSArray *)list; -+ (nullable FGMPlatformHeatmap *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformHeatmapGradient () -+ (FGMPlatformHeatmapGradient *)fromList:(NSArray *)list; -+ (nullable FGMPlatformHeatmapGradient *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformWeightedLatLng () -+ (FGMPlatformWeightedLatLng *)fromList:(NSArray *)list; -+ (nullable FGMPlatformWeightedLatLng *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformInfoWindow () -+ (FGMPlatformInfoWindow *)fromList:(NSArray *)list; -+ (nullable FGMPlatformInfoWindow *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCluster () -+ (FGMPlatformCluster *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCluster *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformClusterManager () -+ (FGMPlatformClusterManager *)fromList:(NSArray *)list; -+ (nullable FGMPlatformClusterManager *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformMarker () -+ (FGMPlatformMarker *)fromList:(NSArray *)list; -+ (nullable FGMPlatformMarker *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformPolygon () -+ (FGMPlatformPolygon *)fromList:(NSArray *)list; -+ (nullable FGMPlatformPolygon *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformPolyline () -+ (FGMPlatformPolyline *)fromList:(NSArray *)list; -+ (nullable FGMPlatformPolyline *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformPatternItem () -+ (FGMPlatformPatternItem *)fromList:(NSArray *)list; -+ (nullable FGMPlatformPatternItem *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformTile () -+ (FGMPlatformTile *)fromList:(NSArray *)list; -+ (nullable FGMPlatformTile *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformTileOverlay () -+ (FGMPlatformTileOverlay *)fromList:(NSArray *)list; -+ (nullable FGMPlatformTileOverlay *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformEdgeInsets () -+ (FGMPlatformEdgeInsets *)fromList:(NSArray *)list; -+ (nullable FGMPlatformEdgeInsets *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformLatLng () -+ (FGMPlatformLatLng *)fromList:(NSArray *)list; -+ (nullable FGMPlatformLatLng *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformLatLngBounds () -+ (FGMPlatformLatLngBounds *)fromList:(NSArray *)list; -+ (nullable FGMPlatformLatLngBounds *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraTargetBounds () -+ (FGMPlatformCameraTargetBounds *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraTargetBounds *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformGroundOverlay () -+ (FGMPlatformGroundOverlay *)fromList:(NSArray *)list; -+ (nullable FGMPlatformGroundOverlay *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformMapViewCreationParams () -+ (FGMPlatformMapViewCreationParams *)fromList:(NSArray *)list; -+ (nullable FGMPlatformMapViewCreationParams *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformMapConfiguration () -+ (FGMPlatformMapConfiguration *)fromList:(NSArray *)list; -+ (nullable FGMPlatformMapConfiguration *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformPoint () -+ (FGMPlatformPoint *)fromList:(NSArray *)list; -+ (nullable FGMPlatformPoint *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformSize () -+ (FGMPlatformSize *)fromList:(NSArray *)list; -+ (nullable FGMPlatformSize *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformColor () -+ (FGMPlatformColor *)fromList:(NSArray *)list; -+ (nullable FGMPlatformColor *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformTileLayer () -+ (FGMPlatformTileLayer *)fromList:(NSArray *)list; -+ (nullable FGMPlatformTileLayer *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformZoomRange () -+ (FGMPlatformZoomRange *)fromList:(NSArray *)list; -+ (nullable FGMPlatformZoomRange *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmap () -+ (FGMPlatformBitmap *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmap *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmapDefaultMarker () -+ (FGMPlatformBitmapDefaultMarker *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmapDefaultMarker *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmapBytes () -+ (FGMPlatformBitmapBytes *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmapBytes *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmapAsset () -+ (FGMPlatformBitmapAsset *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmapAsset *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmapAssetImage () -+ (FGMPlatformBitmapAssetImage *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmapAssetImage *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmapAssetMap () -+ (FGMPlatformBitmapAssetMap *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmapAssetMap *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmapBytesMap () -+ (FGMPlatformBitmapBytesMap *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmapBytesMap *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmapPinConfig () -+ (FGMPlatformBitmapPinConfig *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmapPinConfig *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@implementation FGMPlatformCameraPosition -+ (instancetype)makeWithBearing:(double)bearing - target:(FGMPlatformLatLng *)target - tilt:(double)tilt - zoom:(double)zoom { - FGMPlatformCameraPosition *pigeonResult = [[FGMPlatformCameraPosition alloc] init]; - pigeonResult.bearing = bearing; - pigeonResult.target = target; - pigeonResult.tilt = tilt; - pigeonResult.zoom = zoom; - return pigeonResult; -} -+ (FGMPlatformCameraPosition *)fromList:(NSArray *)list { - FGMPlatformCameraPosition *pigeonResult = [[FGMPlatformCameraPosition alloc] init]; - pigeonResult.bearing = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.target = GetNullableObjectAtIndex(list, 1); - pigeonResult.tilt = [GetNullableObjectAtIndex(list, 2) doubleValue]; - pigeonResult.zoom = [GetNullableObjectAtIndex(list, 3) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformCameraPosition *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraPosition fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.bearing), - self.target ?: [NSNull null], - @(self.tilt), - @(self.zoom), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraPosition *other = (FGMPlatformCameraPosition *)object; - return (self.bearing == other.bearing || (isnan(self.bearing) && isnan(other.bearing))) && - FLTPigeonDeepEquals(self.target, other.target) && - (self.tilt == other.tilt || (isnan(self.tilt) && isnan(other.tilt))) && - (self.zoom == other.zoom || (isnan(self.zoom) && isnan(other.zoom))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = - result * 31 + (isnan(self.bearing) ? (NSUInteger)0x7FF8000000000000 : @(self.bearing).hash); - result = result * 31 + FLTPigeonDeepHash(self.target); - result = result * 31 + (isnan(self.tilt) ? (NSUInteger)0x7FF8000000000000 : @(self.tilt).hash); - result = result * 31 + (isnan(self.zoom) ? (NSUInteger)0x7FF8000000000000 : @(self.zoom).hash); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformCameraPosition(bearing: %f, target: %@, tilt: %f, zoom: %f)", - self.bearing, self.target, self.tilt, self.zoom]; -} -@end - -@implementation FGMPlatformCameraUpdate -+ (instancetype)makeWithCameraUpdate:(id)cameraUpdate { - FGMPlatformCameraUpdate *pigeonResult = [[FGMPlatformCameraUpdate alloc] init]; - pigeonResult.cameraUpdate = cameraUpdate; - return pigeonResult; -} -+ (FGMPlatformCameraUpdate *)fromList:(NSArray *)list { - FGMPlatformCameraUpdate *pigeonResult = [[FGMPlatformCameraUpdate alloc] init]; - pigeonResult.cameraUpdate = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdate *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdate fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.cameraUpdate ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdate *other = (FGMPlatformCameraUpdate *)object; - return FLTPigeonDeepEquals(self.cameraUpdate, other.cameraUpdate); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.cameraUpdate); - return result; -} -- (NSString *)description { - return - [NSString stringWithFormat:@"FGMPlatformCameraUpdate(cameraUpdate: %@)", self.cameraUpdate]; -} -@end - -@implementation FGMPlatformCameraUpdateNewCameraPosition -+ (instancetype)makeWithCameraPosition:(FGMPlatformCameraPosition *)cameraPosition { - FGMPlatformCameraUpdateNewCameraPosition *pigeonResult = - [[FGMPlatformCameraUpdateNewCameraPosition alloc] init]; - pigeonResult.cameraPosition = cameraPosition; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateNewCameraPosition *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateNewCameraPosition *pigeonResult = - [[FGMPlatformCameraUpdateNewCameraPosition alloc] init]; - pigeonResult.cameraPosition = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateNewCameraPosition *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateNewCameraPosition fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.cameraPosition ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateNewCameraPosition *other = - (FGMPlatformCameraUpdateNewCameraPosition *)object; - return FLTPigeonDeepEquals(self.cameraPosition, other.cameraPosition); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.cameraPosition); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformCameraUpdateNewCameraPosition(cameraPosition: %@)", - self.cameraPosition]; -} -@end - -@implementation FGMPlatformCameraUpdateNewLatLng -+ (instancetype)makeWithLatLng:(FGMPlatformLatLng *)latLng { - FGMPlatformCameraUpdateNewLatLng *pigeonResult = [[FGMPlatformCameraUpdateNewLatLng alloc] init]; - pigeonResult.latLng = latLng; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateNewLatLng *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateNewLatLng *pigeonResult = [[FGMPlatformCameraUpdateNewLatLng alloc] init]; - pigeonResult.latLng = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateNewLatLng *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateNewLatLng fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.latLng ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateNewLatLng *other = (FGMPlatformCameraUpdateNewLatLng *)object; - return FLTPigeonDeepEquals(self.latLng, other.latLng); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.latLng); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformCameraUpdateNewLatLng(latLng: %@)", self.latLng]; -} -@end - -@implementation FGMPlatformCameraUpdateNewLatLngBounds -+ (instancetype)makeWithBounds:(FGMPlatformLatLngBounds *)bounds padding:(double)padding { - FGMPlatformCameraUpdateNewLatLngBounds *pigeonResult = - [[FGMPlatformCameraUpdateNewLatLngBounds alloc] init]; - pigeonResult.bounds = bounds; - pigeonResult.padding = padding; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateNewLatLngBounds *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateNewLatLngBounds *pigeonResult = - [[FGMPlatformCameraUpdateNewLatLngBounds alloc] init]; - pigeonResult.bounds = GetNullableObjectAtIndex(list, 0); - pigeonResult.padding = [GetNullableObjectAtIndex(list, 1) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateNewLatLngBounds *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateNewLatLngBounds fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.bounds ?: [NSNull null], - @(self.padding), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateNewLatLngBounds *other = (FGMPlatformCameraUpdateNewLatLngBounds *)object; - return FLTPigeonDeepEquals(self.bounds, other.bounds) && - (self.padding == other.padding || (isnan(self.padding) && isnan(other.padding))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.bounds); - result = - result * 31 + (isnan(self.padding) ? (NSUInteger)0x7FF8000000000000 : @(self.padding).hash); - return result; -} -- (NSString *)description { - return - [NSString stringWithFormat:@"FGMPlatformCameraUpdateNewLatLngBounds(bounds: %@, padding: %f)", - self.bounds, self.padding]; -} -@end - -@implementation FGMPlatformCameraUpdateNewLatLngZoom -+ (instancetype)makeWithLatLng:(FGMPlatformLatLng *)latLng zoom:(double)zoom { - FGMPlatformCameraUpdateNewLatLngZoom *pigeonResult = - [[FGMPlatformCameraUpdateNewLatLngZoom alloc] init]; - pigeonResult.latLng = latLng; - pigeonResult.zoom = zoom; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateNewLatLngZoom *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateNewLatLngZoom *pigeonResult = - [[FGMPlatformCameraUpdateNewLatLngZoom alloc] init]; - pigeonResult.latLng = GetNullableObjectAtIndex(list, 0); - pigeonResult.zoom = [GetNullableObjectAtIndex(list, 1) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateNewLatLngZoom *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateNewLatLngZoom fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.latLng ?: [NSNull null], - @(self.zoom), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateNewLatLngZoom *other = (FGMPlatformCameraUpdateNewLatLngZoom *)object; - return FLTPigeonDeepEquals(self.latLng, other.latLng) && - (self.zoom == other.zoom || (isnan(self.zoom) && isnan(other.zoom))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.latLng); - result = result * 31 + (isnan(self.zoom) ? (NSUInteger)0x7FF8000000000000 : @(self.zoom).hash); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformCameraUpdateNewLatLngZoom(latLng: %@, zoom: %f)", - self.latLng, self.zoom]; -} -@end - -@implementation FGMPlatformCameraUpdateScrollBy -+ (instancetype)makeWithDx:(double)dx dy:(double)dy { - FGMPlatformCameraUpdateScrollBy *pigeonResult = [[FGMPlatformCameraUpdateScrollBy alloc] init]; - pigeonResult.dx = dx; - pigeonResult.dy = dy; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateScrollBy *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateScrollBy *pigeonResult = [[FGMPlatformCameraUpdateScrollBy alloc] init]; - pigeonResult.dx = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.dy = [GetNullableObjectAtIndex(list, 1) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateScrollBy *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateScrollBy fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.dx), - @(self.dy), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateScrollBy *other = (FGMPlatformCameraUpdateScrollBy *)object; - return (self.dx == other.dx || (isnan(self.dx) && isnan(other.dx))) && - (self.dy == other.dy || (isnan(self.dy) && isnan(other.dy))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + (isnan(self.dx) ? (NSUInteger)0x7FF8000000000000 : @(self.dx).hash); - result = result * 31 + (isnan(self.dy) ? (NSUInteger)0x7FF8000000000000 : @(self.dy).hash); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformCameraUpdateScrollBy(dx: %f, dy: %f)", self.dx, self.dy]; -} -@end - -@implementation FGMPlatformCameraUpdateZoomBy -+ (instancetype)makeWithAmount:(double)amount focus:(nullable FGMPlatformPoint *)focus { - FGMPlatformCameraUpdateZoomBy *pigeonResult = [[FGMPlatformCameraUpdateZoomBy alloc] init]; - pigeonResult.amount = amount; - pigeonResult.focus = focus; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateZoomBy *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateZoomBy *pigeonResult = [[FGMPlatformCameraUpdateZoomBy alloc] init]; - pigeonResult.amount = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.focus = GetNullableObjectAtIndex(list, 1); - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateZoomBy *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateZoomBy fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.amount), - self.focus ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateZoomBy *other = (FGMPlatformCameraUpdateZoomBy *)object; - return (self.amount == other.amount || (isnan(self.amount) && isnan(other.amount))) && - FLTPigeonDeepEquals(self.focus, other.focus); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = - result * 31 + (isnan(self.amount) ? (NSUInteger)0x7FF8000000000000 : @(self.amount).hash); - result = result * 31 + FLTPigeonDeepHash(self.focus); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformCameraUpdateZoomBy(amount: %f, focus: %@)", - self.amount, self.focus]; -} -@end - -@implementation FGMPlatformCameraUpdateZoom -+ (instancetype)makeWithOut:(BOOL)out { - FGMPlatformCameraUpdateZoom *pigeonResult = [[FGMPlatformCameraUpdateZoom alloc] init]; - pigeonResult.out = out; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateZoom *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateZoom *pigeonResult = [[FGMPlatformCameraUpdateZoom alloc] init]; - pigeonResult.out = [GetNullableObjectAtIndex(list, 0) boolValue]; - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateZoom *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateZoom fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.out), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateZoom *other = (FGMPlatformCameraUpdateZoom *)object; - return self.out == other.out; -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + @(self.out).hash; - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformCameraUpdateZoom(out: %@)", self.out ? @"true" : @"false"]; -} -@end - -@implementation FGMPlatformCameraUpdateZoomTo -+ (instancetype)makeWithZoom:(double)zoom { - FGMPlatformCameraUpdateZoomTo *pigeonResult = [[FGMPlatformCameraUpdateZoomTo alloc] init]; - pigeonResult.zoom = zoom; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateZoomTo *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateZoomTo *pigeonResult = [[FGMPlatformCameraUpdateZoomTo alloc] init]; - pigeonResult.zoom = [GetNullableObjectAtIndex(list, 0) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateZoomTo *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateZoomTo fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.zoom), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateZoomTo *other = (FGMPlatformCameraUpdateZoomTo *)object; - return (self.zoom == other.zoom || (isnan(self.zoom) && isnan(other.zoom))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + (isnan(self.zoom) ? (NSUInteger)0x7FF8000000000000 : @(self.zoom).hash); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformCameraUpdateZoomTo(zoom: %f)", self.zoom]; -} -@end - -@implementation FGMPlatformCircle -+ (instancetype)makeWithConsumeTapEvents:(BOOL)consumeTapEvents - fillColor:(FGMPlatformColor *)fillColor - strokeColor:(FGMPlatformColor *)strokeColor - visible:(BOOL)visible - strokeWidth:(NSInteger)strokeWidth - zIndex:(double)zIndex - center:(FGMPlatformLatLng *)center - radius:(double)radius - circleId:(NSString *)circleId { - FGMPlatformCircle *pigeonResult = [[FGMPlatformCircle alloc] init]; - pigeonResult.consumeTapEvents = consumeTapEvents; - pigeonResult.fillColor = fillColor; - pigeonResult.strokeColor = strokeColor; - pigeonResult.visible = visible; - pigeonResult.strokeWidth = strokeWidth; - pigeonResult.zIndex = zIndex; - pigeonResult.center = center; - pigeonResult.radius = radius; - pigeonResult.circleId = circleId; - return pigeonResult; -} -+ (FGMPlatformCircle *)fromList:(NSArray *)list { - FGMPlatformCircle *pigeonResult = [[FGMPlatformCircle alloc] init]; - pigeonResult.consumeTapEvents = [GetNullableObjectAtIndex(list, 0) boolValue]; - pigeonResult.fillColor = GetNullableObjectAtIndex(list, 1); - pigeonResult.strokeColor = GetNullableObjectAtIndex(list, 2); - pigeonResult.visible = [GetNullableObjectAtIndex(list, 3) boolValue]; - pigeonResult.strokeWidth = [GetNullableObjectAtIndex(list, 4) integerValue]; - pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 5) doubleValue]; - pigeonResult.center = GetNullableObjectAtIndex(list, 6); - pigeonResult.radius = [GetNullableObjectAtIndex(list, 7) doubleValue]; - pigeonResult.circleId = GetNullableObjectAtIndex(list, 8); - return pigeonResult; -} -+ (nullable FGMPlatformCircle *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCircle fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.consumeTapEvents), - self.fillColor ?: [NSNull null], - self.strokeColor ?: [NSNull null], - @(self.visible), - @(self.strokeWidth), - @(self.zIndex), - self.center ?: [NSNull null], - @(self.radius), - self.circleId ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCircle *other = (FGMPlatformCircle *)object; - return self.consumeTapEvents == other.consumeTapEvents && - FLTPigeonDeepEquals(self.fillColor, other.fillColor) && - FLTPigeonDeepEquals(self.strokeColor, other.strokeColor) && - self.visible == other.visible && self.strokeWidth == other.strokeWidth && - (self.zIndex == other.zIndex || (isnan(self.zIndex) && isnan(other.zIndex))) && - FLTPigeonDeepEquals(self.center, other.center) && - (self.radius == other.radius || (isnan(self.radius) && isnan(other.radius))) && - FLTPigeonDeepEquals(self.circleId, other.circleId); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + @(self.consumeTapEvents).hash; - result = result * 31 + FLTPigeonDeepHash(self.fillColor); - result = result * 31 + FLTPigeonDeepHash(self.strokeColor); - result = result * 31 + @(self.visible).hash; - result = result * 31 + @(self.strokeWidth).hash; - result = - result * 31 + (isnan(self.zIndex) ? (NSUInteger)0x7FF8000000000000 : @(self.zIndex).hash); - result = result * 31 + FLTPigeonDeepHash(self.center); - result = - result * 31 + (isnan(self.radius) ? (NSUInteger)0x7FF8000000000000 : @(self.radius).hash); - result = result * 31 + FLTPigeonDeepHash(self.circleId); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat: - @"FGMPlatformCircle(consumeTapEvents: %@, fillColor: %@, strokeColor: %@, visible: %@, " - @"strokeWidth: %ld, zIndex: %f, center: %@, radius: %f, circleId: %@)", - self.consumeTapEvents ? @"true" : @"false", self.fillColor, self.strokeColor, - self.visible ? @"true" : @"false", (long)self.strokeWidth, self.zIndex, self.center, - self.radius, self.circleId]; -} -@end - -@implementation FGMPlatformHeatmap -+ (instancetype)makeWithHeatmapId:(NSString *)heatmapId - data:(NSArray *)data - gradient:(nullable FGMPlatformHeatmapGradient *)gradient - opacity:(double)opacity - radius:(NSInteger)radius - minimumZoomIntensity:(NSInteger)minimumZoomIntensity - maximumZoomIntensity:(NSInteger)maximumZoomIntensity { - FGMPlatformHeatmap *pigeonResult = [[FGMPlatformHeatmap alloc] init]; - pigeonResult.heatmapId = heatmapId; - pigeonResult.data = data; - pigeonResult.gradient = gradient; - pigeonResult.opacity = opacity; - pigeonResult.radius = radius; - pigeonResult.minimumZoomIntensity = minimumZoomIntensity; - pigeonResult.maximumZoomIntensity = maximumZoomIntensity; - return pigeonResult; -} -+ (FGMPlatformHeatmap *)fromList:(NSArray *)list { - FGMPlatformHeatmap *pigeonResult = [[FGMPlatformHeatmap alloc] init]; - pigeonResult.heatmapId = GetNullableObjectAtIndex(list, 0); - pigeonResult.data = GetNullableObjectAtIndex(list, 1); - pigeonResult.gradient = GetNullableObjectAtIndex(list, 2); - pigeonResult.opacity = [GetNullableObjectAtIndex(list, 3) doubleValue]; - pigeonResult.radius = [GetNullableObjectAtIndex(list, 4) integerValue]; - pigeonResult.minimumZoomIntensity = [GetNullableObjectAtIndex(list, 5) integerValue]; - pigeonResult.maximumZoomIntensity = [GetNullableObjectAtIndex(list, 6) integerValue]; - return pigeonResult; -} -+ (nullable FGMPlatformHeatmap *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformHeatmap fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.heatmapId ?: [NSNull null], - self.data ?: [NSNull null], - self.gradient ?: [NSNull null], - @(self.opacity), - @(self.radius), - @(self.minimumZoomIntensity), - @(self.maximumZoomIntensity), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformHeatmap *other = (FGMPlatformHeatmap *)object; - return FLTPigeonDeepEquals(self.heatmapId, other.heatmapId) && - FLTPigeonDeepEquals(self.data, other.data) && - FLTPigeonDeepEquals(self.gradient, other.gradient) && - (self.opacity == other.opacity || (isnan(self.opacity) && isnan(other.opacity))) && - self.radius == other.radius && self.minimumZoomIntensity == other.minimumZoomIntensity && - self.maximumZoomIntensity == other.maximumZoomIntensity; -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.heatmapId); - result = result * 31 + FLTPigeonDeepHash(self.data); - result = result * 31 + FLTPigeonDeepHash(self.gradient); - result = - result * 31 + (isnan(self.opacity) ? (NSUInteger)0x7FF8000000000000 : @(self.opacity).hash); - result = result * 31 + @(self.radius).hash; - result = result * 31 + @(self.minimumZoomIntensity).hash; - result = result * 31 + @(self.maximumZoomIntensity).hash; - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformHeatmap(heatmapId: %@, data: %@, gradient: %@, opacity: %f, " - @"radius: %ld, minimumZoomIntensity: %ld, maximumZoomIntensity: %ld)", - self.heatmapId, self.data, self.gradient, self.opacity, (long)self.radius, - (long)self.minimumZoomIntensity, (long)self.maximumZoomIntensity]; -} -@end - -@implementation FGMPlatformHeatmapGradient -+ (instancetype)makeWithColors:(NSArray *)colors - startPoints:(NSArray *)startPoints - colorMapSize:(NSInteger)colorMapSize { - FGMPlatformHeatmapGradient *pigeonResult = [[FGMPlatformHeatmapGradient alloc] init]; - pigeonResult.colors = colors; - pigeonResult.startPoints = startPoints; - pigeonResult.colorMapSize = colorMapSize; - return pigeonResult; -} -+ (FGMPlatformHeatmapGradient *)fromList:(NSArray *)list { - FGMPlatformHeatmapGradient *pigeonResult = [[FGMPlatformHeatmapGradient alloc] init]; - pigeonResult.colors = GetNullableObjectAtIndex(list, 0); - pigeonResult.startPoints = GetNullableObjectAtIndex(list, 1); - pigeonResult.colorMapSize = [GetNullableObjectAtIndex(list, 2) integerValue]; - return pigeonResult; -} -+ (nullable FGMPlatformHeatmapGradient *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformHeatmapGradient fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.colors ?: [NSNull null], - self.startPoints ?: [NSNull null], - @(self.colorMapSize), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformHeatmapGradient *other = (FGMPlatformHeatmapGradient *)object; - return FLTPigeonDeepEquals(self.colors, other.colors) && - FLTPigeonDeepEquals(self.startPoints, other.startPoints) && - self.colorMapSize == other.colorMapSize; -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.colors); - result = result * 31 + FLTPigeonDeepHash(self.startPoints); - result = result * 31 + @(self.colorMapSize).hash; - return result; -} -- (NSString *)description { - return - [NSString stringWithFormat: - @"FGMPlatformHeatmapGradient(colors: %@, startPoints: %@, colorMapSize: %ld)", - self.colors, self.startPoints, (long)self.colorMapSize]; -} -@end - -@implementation FGMPlatformWeightedLatLng -+ (instancetype)makeWithPoint:(FGMPlatformLatLng *)point weight:(double)weight { - FGMPlatformWeightedLatLng *pigeonResult = [[FGMPlatformWeightedLatLng alloc] init]; - pigeonResult.point = point; - pigeonResult.weight = weight; - return pigeonResult; -} -+ (FGMPlatformWeightedLatLng *)fromList:(NSArray *)list { - FGMPlatformWeightedLatLng *pigeonResult = [[FGMPlatformWeightedLatLng alloc] init]; - pigeonResult.point = GetNullableObjectAtIndex(list, 0); - pigeonResult.weight = [GetNullableObjectAtIndex(list, 1) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformWeightedLatLng *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformWeightedLatLng fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.point ?: [NSNull null], - @(self.weight), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformWeightedLatLng *other = (FGMPlatformWeightedLatLng *)object; - return FLTPigeonDeepEquals(self.point, other.point) && - (self.weight == other.weight || (isnan(self.weight) && isnan(other.weight))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.point); - result = - result * 31 + (isnan(self.weight) ? (NSUInteger)0x7FF8000000000000 : @(self.weight).hash); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformWeightedLatLng(point: %@, weight: %f)", self.point, - self.weight]; -} -@end - -@implementation FGMPlatformInfoWindow -+ (instancetype)makeWithTitle:(nullable NSString *)title - snippet:(nullable NSString *)snippet - anchor:(FGMPlatformPoint *)anchor { - FGMPlatformInfoWindow *pigeonResult = [[FGMPlatformInfoWindow alloc] init]; - pigeonResult.title = title; - pigeonResult.snippet = snippet; - pigeonResult.anchor = anchor; - return pigeonResult; -} -+ (FGMPlatformInfoWindow *)fromList:(NSArray *)list { - FGMPlatformInfoWindow *pigeonResult = [[FGMPlatformInfoWindow alloc] init]; - pigeonResult.title = GetNullableObjectAtIndex(list, 0); - pigeonResult.snippet = GetNullableObjectAtIndex(list, 1); - pigeonResult.anchor = GetNullableObjectAtIndex(list, 2); - return pigeonResult; -} -+ (nullable FGMPlatformInfoWindow *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformInfoWindow fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.title ?: [NSNull null], - self.snippet ?: [NSNull null], - self.anchor ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformInfoWindow *other = (FGMPlatformInfoWindow *)object; - return FLTPigeonDeepEquals(self.title, other.title) && - FLTPigeonDeepEquals(self.snippet, other.snippet) && - FLTPigeonDeepEquals(self.anchor, other.anchor); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.title); - result = result * 31 + FLTPigeonDeepHash(self.snippet); - result = result * 31 + FLTPigeonDeepHash(self.anchor); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformInfoWindow(title: %@, snippet: %@, anchor: %@)", - self.title, self.snippet, self.anchor]; -} -@end - -@implementation FGMPlatformCluster -+ (instancetype)makeWithClusterManagerId:(NSString *)clusterManagerId - position:(FGMPlatformLatLng *)position - bounds:(FGMPlatformLatLngBounds *)bounds - markerIds:(NSArray *)markerIds { - FGMPlatformCluster *pigeonResult = [[FGMPlatformCluster alloc] init]; - pigeonResult.clusterManagerId = clusterManagerId; - pigeonResult.position = position; - pigeonResult.bounds = bounds; - pigeonResult.markerIds = markerIds; - return pigeonResult; -} -+ (FGMPlatformCluster *)fromList:(NSArray *)list { - FGMPlatformCluster *pigeonResult = [[FGMPlatformCluster alloc] init]; - pigeonResult.clusterManagerId = GetNullableObjectAtIndex(list, 0); - pigeonResult.position = GetNullableObjectAtIndex(list, 1); - pigeonResult.bounds = GetNullableObjectAtIndex(list, 2); - pigeonResult.markerIds = GetNullableObjectAtIndex(list, 3); - return pigeonResult; -} -+ (nullable FGMPlatformCluster *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCluster fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.clusterManagerId ?: [NSNull null], - self.position ?: [NSNull null], - self.bounds ?: [NSNull null], - self.markerIds ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCluster *other = (FGMPlatformCluster *)object; - return FLTPigeonDeepEquals(self.clusterManagerId, other.clusterManagerId) && - FLTPigeonDeepEquals(self.position, other.position) && - FLTPigeonDeepEquals(self.bounds, other.bounds) && - FLTPigeonDeepEquals(self.markerIds, other.markerIds); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.clusterManagerId); - result = result * 31 + FLTPigeonDeepHash(self.position); - result = result * 31 + FLTPigeonDeepHash(self.bounds); - result = result * 31 + FLTPigeonDeepHash(self.markerIds); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat: - @"FGMPlatformCluster(clusterManagerId: %@, position: %@, bounds: %@, markerIds: %@)", - self.clusterManagerId, self.position, self.bounds, self.markerIds]; -} -@end - -@implementation FGMPlatformClusterManager -+ (instancetype)makeWithIdentifier:(NSString *)identifier { - FGMPlatformClusterManager *pigeonResult = [[FGMPlatformClusterManager alloc] init]; - pigeonResult.identifier = identifier; - return pigeonResult; -} -+ (FGMPlatformClusterManager *)fromList:(NSArray *)list { - FGMPlatformClusterManager *pigeonResult = [[FGMPlatformClusterManager alloc] init]; - pigeonResult.identifier = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FGMPlatformClusterManager *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformClusterManager fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.identifier ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformClusterManager *other = (FGMPlatformClusterManager *)object; - return FLTPigeonDeepEquals(self.identifier, other.identifier); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.identifier); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformClusterManager(identifier: %@)", self.identifier]; -} -@end - -@implementation FGMPlatformMarker -+ (instancetype)makeWithAlpha:(double)alpha - anchor:(FGMPlatformPoint *)anchor - consumeTapEvents:(BOOL)consumeTapEvents - draggable:(BOOL)draggable - flat:(BOOL)flat - icon:(FGMPlatformBitmap *)icon - infoWindow:(FGMPlatformInfoWindow *)infoWindow - position:(FGMPlatformLatLng *)position - rotation:(double)rotation - visible:(BOOL)visible - zIndex:(NSInteger)zIndex - markerId:(NSString *)markerId - clusterManagerId:(nullable NSString *)clusterManagerId - collisionBehavior:(nullable FGMPlatformMarkerCollisionBehaviorBox *)collisionBehavior { - FGMPlatformMarker *pigeonResult = [[FGMPlatformMarker alloc] init]; - pigeonResult.alpha = alpha; - pigeonResult.anchor = anchor; - pigeonResult.consumeTapEvents = consumeTapEvents; - pigeonResult.draggable = draggable; - pigeonResult.flat = flat; - pigeonResult.icon = icon; - pigeonResult.infoWindow = infoWindow; - pigeonResult.position = position; - pigeonResult.rotation = rotation; - pigeonResult.visible = visible; - pigeonResult.zIndex = zIndex; - pigeonResult.markerId = markerId; - pigeonResult.clusterManagerId = clusterManagerId; - pigeonResult.collisionBehavior = collisionBehavior; - return pigeonResult; -} -+ (FGMPlatformMarker *)fromList:(NSArray *)list { - FGMPlatformMarker *pigeonResult = [[FGMPlatformMarker alloc] init]; - pigeonResult.alpha = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.anchor = GetNullableObjectAtIndex(list, 1); - pigeonResult.consumeTapEvents = [GetNullableObjectAtIndex(list, 2) boolValue]; - pigeonResult.draggable = [GetNullableObjectAtIndex(list, 3) boolValue]; - pigeonResult.flat = [GetNullableObjectAtIndex(list, 4) boolValue]; - pigeonResult.icon = GetNullableObjectAtIndex(list, 5); - pigeonResult.infoWindow = GetNullableObjectAtIndex(list, 6); - pigeonResult.position = GetNullableObjectAtIndex(list, 7); - pigeonResult.rotation = [GetNullableObjectAtIndex(list, 8) doubleValue]; - pigeonResult.visible = [GetNullableObjectAtIndex(list, 9) boolValue]; - pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 10) integerValue]; - pigeonResult.markerId = GetNullableObjectAtIndex(list, 11); - pigeonResult.clusterManagerId = GetNullableObjectAtIndex(list, 12); - pigeonResult.collisionBehavior = GetNullableObjectAtIndex(list, 13); - return pigeonResult; -} -+ (nullable FGMPlatformMarker *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformMarker fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.alpha), - self.anchor ?: [NSNull null], - @(self.consumeTapEvents), - @(self.draggable), - @(self.flat), - self.icon ?: [NSNull null], - self.infoWindow ?: [NSNull null], - self.position ?: [NSNull null], - @(self.rotation), - @(self.visible), - @(self.zIndex), - self.markerId ?: [NSNull null], - self.clusterManagerId ?: [NSNull null], - self.collisionBehavior ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformMarker *other = (FGMPlatformMarker *)object; - return (self.alpha == other.alpha || (isnan(self.alpha) && isnan(other.alpha))) && - FLTPigeonDeepEquals(self.anchor, other.anchor) && - self.consumeTapEvents == other.consumeTapEvents && self.draggable == other.draggable && - self.flat == other.flat && FLTPigeonDeepEquals(self.icon, other.icon) && - FLTPigeonDeepEquals(self.infoWindow, other.infoWindow) && - FLTPigeonDeepEquals(self.position, other.position) && - (self.rotation == other.rotation || (isnan(self.rotation) && isnan(other.rotation))) && - self.visible == other.visible && self.zIndex == other.zIndex && - FLTPigeonDeepEquals(self.markerId, other.markerId) && - FLTPigeonDeepEquals(self.clusterManagerId, other.clusterManagerId) && - FLTPigeonDeepEquals(self.collisionBehavior, other.collisionBehavior); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + (isnan(self.alpha) ? (NSUInteger)0x7FF8000000000000 : @(self.alpha).hash); - result = result * 31 + FLTPigeonDeepHash(self.anchor); - result = result * 31 + @(self.consumeTapEvents).hash; - result = result * 31 + @(self.draggable).hash; - result = result * 31 + @(self.flat).hash; - result = result * 31 + FLTPigeonDeepHash(self.icon); - result = result * 31 + FLTPigeonDeepHash(self.infoWindow); - result = result * 31 + FLTPigeonDeepHash(self.position); - result = - result * 31 + (isnan(self.rotation) ? (NSUInteger)0x7FF8000000000000 : @(self.rotation).hash); - result = result * 31 + @(self.visible).hash; - result = result * 31 + @(self.zIndex).hash; - result = result * 31 + FLTPigeonDeepHash(self.markerId); - result = result * 31 + FLTPigeonDeepHash(self.clusterManagerId); - result = result * 31 + FLTPigeonDeepHash(self.collisionBehavior); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat: - @"FGMPlatformMarker(alpha: %f, anchor: %@, consumeTapEvents: %@, draggable: %@, flat: " - @"%@, icon: %@, infoWindow: %@, position: %@, rotation: %f, visible: %@, zIndex: %ld, " - @"markerId: %@, clusterManagerId: %@, collisionBehavior: %@)", - self.alpha, self.anchor, self.consumeTapEvents ? @"true" : @"false", - self.draggable ? @"true" : @"false", self.flat ? @"true" : @"false", self.icon, - self.infoWindow, self.position, self.rotation, self.visible ? @"true" : @"false", - (long)self.zIndex, self.markerId, self.clusterManagerId, self.collisionBehavior]; -} -@end - -@implementation FGMPlatformPolygon -+ (instancetype)makeWithPolygonId:(NSString *)polygonId - consumesTapEvents:(BOOL)consumesTapEvents - fillColor:(FGMPlatformColor *)fillColor - geodesic:(BOOL)geodesic - points:(NSArray *)points - holes:(NSArray *> *)holes - visible:(BOOL)visible - strokeColor:(FGMPlatformColor *)strokeColor - strokeWidth:(NSInteger)strokeWidth - zIndex:(NSInteger)zIndex { - FGMPlatformPolygon *pigeonResult = [[FGMPlatformPolygon alloc] init]; - pigeonResult.polygonId = polygonId; - pigeonResult.consumesTapEvents = consumesTapEvents; - pigeonResult.fillColor = fillColor; - pigeonResult.geodesic = geodesic; - pigeonResult.points = points; - pigeonResult.holes = holes; - pigeonResult.visible = visible; - pigeonResult.strokeColor = strokeColor; - pigeonResult.strokeWidth = strokeWidth; - pigeonResult.zIndex = zIndex; - return pigeonResult; -} -+ (FGMPlatformPolygon *)fromList:(NSArray *)list { - FGMPlatformPolygon *pigeonResult = [[FGMPlatformPolygon alloc] init]; - pigeonResult.polygonId = GetNullableObjectAtIndex(list, 0); - pigeonResult.consumesTapEvents = [GetNullableObjectAtIndex(list, 1) boolValue]; - pigeonResult.fillColor = GetNullableObjectAtIndex(list, 2); - pigeonResult.geodesic = [GetNullableObjectAtIndex(list, 3) boolValue]; - pigeonResult.points = GetNullableObjectAtIndex(list, 4); - pigeonResult.holes = GetNullableObjectAtIndex(list, 5); - pigeonResult.visible = [GetNullableObjectAtIndex(list, 6) boolValue]; - pigeonResult.strokeColor = GetNullableObjectAtIndex(list, 7); - pigeonResult.strokeWidth = [GetNullableObjectAtIndex(list, 8) integerValue]; - pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 9) integerValue]; - return pigeonResult; -} -+ (nullable FGMPlatformPolygon *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformPolygon fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.polygonId ?: [NSNull null], - @(self.consumesTapEvents), - self.fillColor ?: [NSNull null], - @(self.geodesic), - self.points ?: [NSNull null], - self.holes ?: [NSNull null], - @(self.visible), - self.strokeColor ?: [NSNull null], - @(self.strokeWidth), - @(self.zIndex), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformPolygon *other = (FGMPlatformPolygon *)object; - return FLTPigeonDeepEquals(self.polygonId, other.polygonId) && - self.consumesTapEvents == other.consumesTapEvents && - FLTPigeonDeepEquals(self.fillColor, other.fillColor) && self.geodesic == other.geodesic && - FLTPigeonDeepEquals(self.points, other.points) && - FLTPigeonDeepEquals(self.holes, other.holes) && self.visible == other.visible && - FLTPigeonDeepEquals(self.strokeColor, other.strokeColor) && - self.strokeWidth == other.strokeWidth && self.zIndex == other.zIndex; -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.polygonId); - result = result * 31 + @(self.consumesTapEvents).hash; - result = result * 31 + FLTPigeonDeepHash(self.fillColor); - result = result * 31 + @(self.geodesic).hash; - result = result * 31 + FLTPigeonDeepHash(self.points); - result = result * 31 + FLTPigeonDeepHash(self.holes); - result = result * 31 + @(self.visible).hash; - result = result * 31 + FLTPigeonDeepHash(self.strokeColor); - result = result * 31 + @(self.strokeWidth).hash; - result = result * 31 + @(self.zIndex).hash; - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat: - @"FGMPlatformPolygon(polygonId: %@, consumesTapEvents: %@, fillColor: %@, geodesic: %@, " - @"points: %@, holes: %@, visible: %@, strokeColor: %@, strokeWidth: %ld, zIndex: %ld)", - self.polygonId, self.consumesTapEvents ? @"true" : @"false", self.fillColor, - self.geodesic ? @"true" : @"false", self.points, self.holes, - self.visible ? @"true" : @"false", self.strokeColor, (long)self.strokeWidth, - (long)self.zIndex]; -} -@end - -@implementation FGMPlatformPolyline -+ (instancetype)makeWithPolylineId:(NSString *)polylineId - consumesTapEvents:(BOOL)consumesTapEvents - color:(FGMPlatformColor *)color - geodesic:(BOOL)geodesic - jointType:(FGMPlatformJointType)jointType - patterns:(NSArray *)patterns - points:(NSArray *)points - visible:(BOOL)visible - width:(NSInteger)width - zIndex:(NSInteger)zIndex { - FGMPlatformPolyline *pigeonResult = [[FGMPlatformPolyline alloc] init]; - pigeonResult.polylineId = polylineId; - pigeonResult.consumesTapEvents = consumesTapEvents; - pigeonResult.color = color; - pigeonResult.geodesic = geodesic; - pigeonResult.jointType = jointType; - pigeonResult.patterns = patterns; - pigeonResult.points = points; - pigeonResult.visible = visible; - pigeonResult.width = width; - pigeonResult.zIndex = zIndex; - return pigeonResult; -} -+ (FGMPlatformPolyline *)fromList:(NSArray *)list { - FGMPlatformPolyline *pigeonResult = [[FGMPlatformPolyline alloc] init]; - pigeonResult.polylineId = GetNullableObjectAtIndex(list, 0); - pigeonResult.consumesTapEvents = [GetNullableObjectAtIndex(list, 1) boolValue]; - pigeonResult.color = GetNullableObjectAtIndex(list, 2); - pigeonResult.geodesic = [GetNullableObjectAtIndex(list, 3) boolValue]; - FGMPlatformJointTypeBox *boxedFGMPlatformJointType = GetNullableObjectAtIndex(list, 4); - pigeonResult.jointType = boxedFGMPlatformJointType.value; - pigeonResult.patterns = GetNullableObjectAtIndex(list, 5); - pigeonResult.points = GetNullableObjectAtIndex(list, 6); - pigeonResult.visible = [GetNullableObjectAtIndex(list, 7) boolValue]; - pigeonResult.width = [GetNullableObjectAtIndex(list, 8) integerValue]; - pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 9) integerValue]; - return pigeonResult; -} -+ (nullable FGMPlatformPolyline *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformPolyline fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.polylineId ?: [NSNull null], - @(self.consumesTapEvents), - self.color ?: [NSNull null], - @(self.geodesic), - [[FGMPlatformJointTypeBox alloc] initWithValue:self.jointType], - self.patterns ?: [NSNull null], - self.points ?: [NSNull null], - @(self.visible), - @(self.width), - @(self.zIndex), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformPolyline *other = (FGMPlatformPolyline *)object; - return FLTPigeonDeepEquals(self.polylineId, other.polylineId) && - self.consumesTapEvents == other.consumesTapEvents && - FLTPigeonDeepEquals(self.color, other.color) && self.geodesic == other.geodesic && - self.jointType == other.jointType && FLTPigeonDeepEquals(self.patterns, other.patterns) && - FLTPigeonDeepEquals(self.points, other.points) && self.visible == other.visible && - self.width == other.width && self.zIndex == other.zIndex; -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.polylineId); - result = result * 31 + @(self.consumesTapEvents).hash; - result = result * 31 + FLTPigeonDeepHash(self.color); - result = result * 31 + @(self.geodesic).hash; - result = result * 31 + @(self.jointType).hash; - result = result * 31 + FLTPigeonDeepHash(self.patterns); - result = result * 31 + FLTPigeonDeepHash(self.points); - result = result * 31 + @(self.visible).hash; - result = result * 31 + @(self.width).hash; - result = result * 31 + @(self.zIndex).hash; - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat: - @"FGMPlatformPolyline(polylineId: %@, consumesTapEvents: %@, color: %@, geodesic: %@, " - @"jointType: %ld, patterns: %@, points: %@, visible: %@, width: %ld, zIndex: %ld)", - self.polylineId, self.consumesTapEvents ? @"true" : @"false", self.color, - self.geodesic ? @"true" : @"false", (long)self.jointType, self.patterns, self.points, - self.visible ? @"true" : @"false", (long)self.width, (long)self.zIndex]; -} -@end - -@implementation FGMPlatformPatternItem -+ (instancetype)makeWithType:(FGMPlatformPatternItemType)type length:(nullable NSNumber *)length { - FGMPlatformPatternItem *pigeonResult = [[FGMPlatformPatternItem alloc] init]; - pigeonResult.type = type; - pigeonResult.length = length; - return pigeonResult; -} -+ (FGMPlatformPatternItem *)fromList:(NSArray *)list { - FGMPlatformPatternItem *pigeonResult = [[FGMPlatformPatternItem alloc] init]; - FGMPlatformPatternItemTypeBox *boxedFGMPlatformPatternItemType = - GetNullableObjectAtIndex(list, 0); - pigeonResult.type = boxedFGMPlatformPatternItemType.value; - pigeonResult.length = GetNullableObjectAtIndex(list, 1); - return pigeonResult; -} -+ (nullable FGMPlatformPatternItem *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformPatternItem fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - [[FGMPlatformPatternItemTypeBox alloc] initWithValue:self.type], - self.length ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformPatternItem *other = (FGMPlatformPatternItem *)object; - return self.type == other.type && FLTPigeonDeepEquals(self.length, other.length); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + @(self.type).hash; - result = result * 31 + FLTPigeonDeepHash(self.length); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformPatternItem(type: %ld, length: %@)", - (long)self.type, self.length]; -} -@end - -@implementation FGMPlatformTile -+ (instancetype)makeWithWidth:(NSInteger)width - height:(NSInteger)height - data:(nullable FlutterStandardTypedData *)data { - FGMPlatformTile *pigeonResult = [[FGMPlatformTile alloc] init]; - pigeonResult.width = width; - pigeonResult.height = height; - pigeonResult.data = data; - return pigeonResult; -} -+ (FGMPlatformTile *)fromList:(NSArray *)list { - FGMPlatformTile *pigeonResult = [[FGMPlatformTile alloc] init]; - pigeonResult.width = [GetNullableObjectAtIndex(list, 0) integerValue]; - pigeonResult.height = [GetNullableObjectAtIndex(list, 1) integerValue]; - pigeonResult.data = GetNullableObjectAtIndex(list, 2); - return pigeonResult; -} -+ (nullable FGMPlatformTile *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformTile fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.width), - @(self.height), - self.data ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformTile *other = (FGMPlatformTile *)object; - return self.width == other.width && self.height == other.height && - FLTPigeonDeepEquals(self.data, other.data); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + @(self.width).hash; - result = result * 31 + @(self.height).hash; - result = result * 31 + FLTPigeonDeepHash(self.data); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformTile(width: %ld, height: %ld, data: %@)", - (long)self.width, (long)self.height, self.data]; -} -@end - -@implementation FGMPlatformTileOverlay -+ (instancetype)makeWithTileOverlayId:(NSString *)tileOverlayId - fadeIn:(BOOL)fadeIn - transparency:(double)transparency - zIndex:(NSInteger)zIndex - visible:(BOOL)visible - tileSize:(NSInteger)tileSize { - FGMPlatformTileOverlay *pigeonResult = [[FGMPlatformTileOverlay alloc] init]; - pigeonResult.tileOverlayId = tileOverlayId; - pigeonResult.fadeIn = fadeIn; - pigeonResult.transparency = transparency; - pigeonResult.zIndex = zIndex; - pigeonResult.visible = visible; - pigeonResult.tileSize = tileSize; - return pigeonResult; -} -+ (FGMPlatformTileOverlay *)fromList:(NSArray *)list { - FGMPlatformTileOverlay *pigeonResult = [[FGMPlatformTileOverlay alloc] init]; - pigeonResult.tileOverlayId = GetNullableObjectAtIndex(list, 0); - pigeonResult.fadeIn = [GetNullableObjectAtIndex(list, 1) boolValue]; - pigeonResult.transparency = [GetNullableObjectAtIndex(list, 2) doubleValue]; - pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 3) integerValue]; - pigeonResult.visible = [GetNullableObjectAtIndex(list, 4) boolValue]; - pigeonResult.tileSize = [GetNullableObjectAtIndex(list, 5) integerValue]; - return pigeonResult; -} -+ (nullable FGMPlatformTileOverlay *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformTileOverlay fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.tileOverlayId ?: [NSNull null], - @(self.fadeIn), - @(self.transparency), - @(self.zIndex), - @(self.visible), - @(self.tileSize), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformTileOverlay *other = (FGMPlatformTileOverlay *)object; - return FLTPigeonDeepEquals(self.tileOverlayId, other.tileOverlayId) && - self.fadeIn == other.fadeIn && - (self.transparency == other.transparency || - (isnan(self.transparency) && isnan(other.transparency))) && - self.zIndex == other.zIndex && self.visible == other.visible && - self.tileSize == other.tileSize; -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.tileOverlayId); - result = result * 31 + @(self.fadeIn).hash; - result = result * 31 + - (isnan(self.transparency) ? (NSUInteger)0x7FF8000000000000 : @(self.transparency).hash); - result = result * 31 + @(self.zIndex).hash; - result = result * 31 + @(self.visible).hash; - result = result * 31 + @(self.tileSize).hash; - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformTileOverlay(tileOverlayId: %@, fadeIn: %@, " - @"transparency: %f, zIndex: %ld, visible: %@, tileSize: %ld)", - self.tileOverlayId, self.fadeIn ? @"true" : @"false", - self.transparency, (long)self.zIndex, - self.visible ? @"true" : @"false", (long)self.tileSize]; -} -@end - -@implementation FGMPlatformEdgeInsets -+ (instancetype)makeWithTop:(double)top - bottom:(double)bottom - left:(double)left - right:(double)right { - FGMPlatformEdgeInsets *pigeonResult = [[FGMPlatformEdgeInsets alloc] init]; - pigeonResult.top = top; - pigeonResult.bottom = bottom; - pigeonResult.left = left; - pigeonResult.right = right; - return pigeonResult; -} -+ (FGMPlatformEdgeInsets *)fromList:(NSArray *)list { - FGMPlatformEdgeInsets *pigeonResult = [[FGMPlatformEdgeInsets alloc] init]; - pigeonResult.top = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.bottom = [GetNullableObjectAtIndex(list, 1) doubleValue]; - pigeonResult.left = [GetNullableObjectAtIndex(list, 2) doubleValue]; - pigeonResult.right = [GetNullableObjectAtIndex(list, 3) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformEdgeInsets *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformEdgeInsets fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.top), - @(self.bottom), - @(self.left), - @(self.right), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformEdgeInsets *other = (FGMPlatformEdgeInsets *)object; - return (self.top == other.top || (isnan(self.top) && isnan(other.top))) && - (self.bottom == other.bottom || (isnan(self.bottom) && isnan(other.bottom))) && - (self.left == other.left || (isnan(self.left) && isnan(other.left))) && - (self.right == other.right || (isnan(self.right) && isnan(other.right))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + (isnan(self.top) ? (NSUInteger)0x7FF8000000000000 : @(self.top).hash); - result = - result * 31 + (isnan(self.bottom) ? (NSUInteger)0x7FF8000000000000 : @(self.bottom).hash); - result = result * 31 + (isnan(self.left) ? (NSUInteger)0x7FF8000000000000 : @(self.left).hash); - result = result * 31 + (isnan(self.right) ? (NSUInteger)0x7FF8000000000000 : @(self.right).hash); - return result; -} -- (NSString *)description { - return - [NSString stringWithFormat:@"FGMPlatformEdgeInsets(top: %f, bottom: %f, left: %f, right: %f)", - self.top, self.bottom, self.left, self.right]; -} -@end - -@implementation FGMPlatformLatLng -+ (instancetype)makeWithLatitude:(double)latitude longitude:(double)longitude { - FGMPlatformLatLng *pigeonResult = [[FGMPlatformLatLng alloc] init]; - pigeonResult.latitude = latitude; - pigeonResult.longitude = longitude; - return pigeonResult; -} -+ (FGMPlatformLatLng *)fromList:(NSArray *)list { - FGMPlatformLatLng *pigeonResult = [[FGMPlatformLatLng alloc] init]; - pigeonResult.latitude = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.longitude = [GetNullableObjectAtIndex(list, 1) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformLatLng *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformLatLng fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.latitude), - @(self.longitude), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformLatLng *other = (FGMPlatformLatLng *)object; - return (self.latitude == other.latitude || (isnan(self.latitude) && isnan(other.latitude))) && - (self.longitude == other.longitude || (isnan(self.longitude) && isnan(other.longitude))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = - result * 31 + (isnan(self.latitude) ? (NSUInteger)0x7FF8000000000000 : @(self.latitude).hash); - result = result * 31 + - (isnan(self.longitude) ? (NSUInteger)0x7FF8000000000000 : @(self.longitude).hash); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformLatLng(latitude: %f, longitude: %f)", - self.latitude, self.longitude]; -} -@end - -@implementation FGMPlatformLatLngBounds -+ (instancetype)makeWithNortheast:(FGMPlatformLatLng *)northeast - southwest:(FGMPlatformLatLng *)southwest { - FGMPlatformLatLngBounds *pigeonResult = [[FGMPlatformLatLngBounds alloc] init]; - pigeonResult.northeast = northeast; - pigeonResult.southwest = southwest; - return pigeonResult; -} -+ (FGMPlatformLatLngBounds *)fromList:(NSArray *)list { - FGMPlatformLatLngBounds *pigeonResult = [[FGMPlatformLatLngBounds alloc] init]; - pigeonResult.northeast = GetNullableObjectAtIndex(list, 0); - pigeonResult.southwest = GetNullableObjectAtIndex(list, 1); - return pigeonResult; -} -+ (nullable FGMPlatformLatLngBounds *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformLatLngBounds fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.northeast ?: [NSNull null], - self.southwest ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformLatLngBounds *other = (FGMPlatformLatLngBounds *)object; - return FLTPigeonDeepEquals(self.northeast, other.northeast) && - FLTPigeonDeepEquals(self.southwest, other.southwest); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.northeast); - result = result * 31 + FLTPigeonDeepHash(self.southwest); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformLatLngBounds(northeast: %@, southwest: %@)", - self.northeast, self.southwest]; -} -@end - -@implementation FGMPlatformCameraTargetBounds -+ (instancetype)makeWithBounds:(nullable FGMPlatformLatLngBounds *)bounds { - FGMPlatformCameraTargetBounds *pigeonResult = [[FGMPlatformCameraTargetBounds alloc] init]; - pigeonResult.bounds = bounds; - return pigeonResult; -} -+ (FGMPlatformCameraTargetBounds *)fromList:(NSArray *)list { - FGMPlatformCameraTargetBounds *pigeonResult = [[FGMPlatformCameraTargetBounds alloc] init]; - pigeonResult.bounds = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FGMPlatformCameraTargetBounds *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraTargetBounds fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.bounds ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraTargetBounds *other = (FGMPlatformCameraTargetBounds *)object; - return FLTPigeonDeepEquals(self.bounds, other.bounds); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.bounds); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformCameraTargetBounds(bounds: %@)", self.bounds]; -} -@end - -@implementation FGMPlatformGroundOverlay -+ (instancetype)makeWithGroundOverlayId:(NSString *)groundOverlayId - image:(FGMPlatformBitmap *)image - position:(nullable FGMPlatformLatLng *)position - bounds:(nullable FGMPlatformLatLngBounds *)bounds - anchor:(nullable FGMPlatformPoint *)anchor - transparency:(double)transparency - bearing:(double)bearing - zIndex:(NSInteger)zIndex - visible:(BOOL)visible - clickable:(BOOL)clickable - zoomLevel:(nullable NSNumber *)zoomLevel { - FGMPlatformGroundOverlay *pigeonResult = [[FGMPlatformGroundOverlay alloc] init]; - pigeonResult.groundOverlayId = groundOverlayId; - pigeonResult.image = image; - pigeonResult.position = position; - pigeonResult.bounds = bounds; - pigeonResult.anchor = anchor; - pigeonResult.transparency = transparency; - pigeonResult.bearing = bearing; - pigeonResult.zIndex = zIndex; - pigeonResult.visible = visible; - pigeonResult.clickable = clickable; - pigeonResult.zoomLevel = zoomLevel; - return pigeonResult; -} -+ (FGMPlatformGroundOverlay *)fromList:(NSArray *)list { - FGMPlatformGroundOverlay *pigeonResult = [[FGMPlatformGroundOverlay alloc] init]; - pigeonResult.groundOverlayId = GetNullableObjectAtIndex(list, 0); - pigeonResult.image = GetNullableObjectAtIndex(list, 1); - pigeonResult.position = GetNullableObjectAtIndex(list, 2); - pigeonResult.bounds = GetNullableObjectAtIndex(list, 3); - pigeonResult.anchor = GetNullableObjectAtIndex(list, 4); - pigeonResult.transparency = [GetNullableObjectAtIndex(list, 5) doubleValue]; - pigeonResult.bearing = [GetNullableObjectAtIndex(list, 6) doubleValue]; - pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 7) integerValue]; - pigeonResult.visible = [GetNullableObjectAtIndex(list, 8) boolValue]; - pigeonResult.clickable = [GetNullableObjectAtIndex(list, 9) boolValue]; - pigeonResult.zoomLevel = GetNullableObjectAtIndex(list, 10); - return pigeonResult; -} -+ (nullable FGMPlatformGroundOverlay *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformGroundOverlay fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.groundOverlayId ?: [NSNull null], - self.image ?: [NSNull null], - self.position ?: [NSNull null], - self.bounds ?: [NSNull null], - self.anchor ?: [NSNull null], - @(self.transparency), - @(self.bearing), - @(self.zIndex), - @(self.visible), - @(self.clickable), - self.zoomLevel ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformGroundOverlay *other = (FGMPlatformGroundOverlay *)object; - return FLTPigeonDeepEquals(self.groundOverlayId, other.groundOverlayId) && - FLTPigeonDeepEquals(self.image, other.image) && - FLTPigeonDeepEquals(self.position, other.position) && - FLTPigeonDeepEquals(self.bounds, other.bounds) && - FLTPigeonDeepEquals(self.anchor, other.anchor) && - (self.transparency == other.transparency || - (isnan(self.transparency) && isnan(other.transparency))) && - (self.bearing == other.bearing || (isnan(self.bearing) && isnan(other.bearing))) && - self.zIndex == other.zIndex && self.visible == other.visible && - self.clickable == other.clickable && FLTPigeonDeepEquals(self.zoomLevel, other.zoomLevel); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.groundOverlayId); - result = result * 31 + FLTPigeonDeepHash(self.image); - result = result * 31 + FLTPigeonDeepHash(self.position); - result = result * 31 + FLTPigeonDeepHash(self.bounds); - result = result * 31 + FLTPigeonDeepHash(self.anchor); - result = result * 31 + - (isnan(self.transparency) ? (NSUInteger)0x7FF8000000000000 : @(self.transparency).hash); - result = - result * 31 + (isnan(self.bearing) ? (NSUInteger)0x7FF8000000000000 : @(self.bearing).hash); - result = result * 31 + @(self.zIndex).hash; - result = result * 31 + @(self.visible).hash; - result = result * 31 + @(self.clickable).hash; - result = result * 31 + FLTPigeonDeepHash(self.zoomLevel); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformGroundOverlay(groundOverlayId: %@, image: %@, position: %@, " - @"bounds: %@, anchor: %@, transparency: %f, bearing: %f, zIndex: %ld, " - @"visible: %@, clickable: %@, zoomLevel: %@)", - self.groundOverlayId, self.image, self.position, self.bounds, self.anchor, - self.transparency, self.bearing, (long)self.zIndex, - self.visible ? @"true" : @"false", self.clickable ? @"true" : @"false", - self.zoomLevel]; -} -@end - -@implementation FGMPlatformMapViewCreationParams -+ (instancetype) - makeWithInitialCameraPosition:(FGMPlatformCameraPosition *)initialCameraPosition - mapConfiguration:(FGMPlatformMapConfiguration *)mapConfiguration - initialCircles:(NSArray *)initialCircles - initialMarkers:(NSArray *)initialMarkers - initialPolygons:(NSArray *)initialPolygons - initialPolylines:(NSArray *)initialPolylines - initialHeatmaps:(NSArray *)initialHeatmaps - initialTileOverlays:(NSArray *)initialTileOverlays - initialClusterManagers:(NSArray *)initialClusterManagers - initialGroundOverlays:(NSArray *)initialGroundOverlays { - FGMPlatformMapViewCreationParams *pigeonResult = [[FGMPlatformMapViewCreationParams alloc] init]; - pigeonResult.initialCameraPosition = initialCameraPosition; - pigeonResult.mapConfiguration = mapConfiguration; - pigeonResult.initialCircles = initialCircles; - pigeonResult.initialMarkers = initialMarkers; - pigeonResult.initialPolygons = initialPolygons; - pigeonResult.initialPolylines = initialPolylines; - pigeonResult.initialHeatmaps = initialHeatmaps; - pigeonResult.initialTileOverlays = initialTileOverlays; - pigeonResult.initialClusterManagers = initialClusterManagers; - pigeonResult.initialGroundOverlays = initialGroundOverlays; - return pigeonResult; -} -+ (FGMPlatformMapViewCreationParams *)fromList:(NSArray *)list { - FGMPlatformMapViewCreationParams *pigeonResult = [[FGMPlatformMapViewCreationParams alloc] init]; - pigeonResult.initialCameraPosition = GetNullableObjectAtIndex(list, 0); - pigeonResult.mapConfiguration = GetNullableObjectAtIndex(list, 1); - pigeonResult.initialCircles = GetNullableObjectAtIndex(list, 2); - pigeonResult.initialMarkers = GetNullableObjectAtIndex(list, 3); - pigeonResult.initialPolygons = GetNullableObjectAtIndex(list, 4); - pigeonResult.initialPolylines = GetNullableObjectAtIndex(list, 5); - pigeonResult.initialHeatmaps = GetNullableObjectAtIndex(list, 6); - pigeonResult.initialTileOverlays = GetNullableObjectAtIndex(list, 7); - pigeonResult.initialClusterManagers = GetNullableObjectAtIndex(list, 8); - pigeonResult.initialGroundOverlays = GetNullableObjectAtIndex(list, 9); - return pigeonResult; -} -+ (nullable FGMPlatformMapViewCreationParams *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformMapViewCreationParams fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.initialCameraPosition ?: [NSNull null], - self.mapConfiguration ?: [NSNull null], - self.initialCircles ?: [NSNull null], - self.initialMarkers ?: [NSNull null], - self.initialPolygons ?: [NSNull null], - self.initialPolylines ?: [NSNull null], - self.initialHeatmaps ?: [NSNull null], - self.initialTileOverlays ?: [NSNull null], - self.initialClusterManagers ?: [NSNull null], - self.initialGroundOverlays ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformMapViewCreationParams *other = (FGMPlatformMapViewCreationParams *)object; - return FLTPigeonDeepEquals(self.initialCameraPosition, other.initialCameraPosition) && - FLTPigeonDeepEquals(self.mapConfiguration, other.mapConfiguration) && - FLTPigeonDeepEquals(self.initialCircles, other.initialCircles) && - FLTPigeonDeepEquals(self.initialMarkers, other.initialMarkers) && - FLTPigeonDeepEquals(self.initialPolygons, other.initialPolygons) && - FLTPigeonDeepEquals(self.initialPolylines, other.initialPolylines) && - FLTPigeonDeepEquals(self.initialHeatmaps, other.initialHeatmaps) && - FLTPigeonDeepEquals(self.initialTileOverlays, other.initialTileOverlays) && - FLTPigeonDeepEquals(self.initialClusterManagers, other.initialClusterManagers) && - FLTPigeonDeepEquals(self.initialGroundOverlays, other.initialGroundOverlays); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.initialCameraPosition); - result = result * 31 + FLTPigeonDeepHash(self.mapConfiguration); - result = result * 31 + FLTPigeonDeepHash(self.initialCircles); - result = result * 31 + FLTPigeonDeepHash(self.initialMarkers); - result = result * 31 + FLTPigeonDeepHash(self.initialPolygons); - result = result * 31 + FLTPigeonDeepHash(self.initialPolylines); - result = result * 31 + FLTPigeonDeepHash(self.initialHeatmaps); - result = result * 31 + FLTPigeonDeepHash(self.initialTileOverlays); - result = result * 31 + FLTPigeonDeepHash(self.initialClusterManagers); - result = result * 31 + FLTPigeonDeepHash(self.initialGroundOverlays); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat: - @"FGMPlatformMapViewCreationParams(initialCameraPosition: %@, mapConfiguration: %@, " - @"initialCircles: %@, initialMarkers: %@, initialPolygons: %@, initialPolylines: %@, " - @"initialHeatmaps: %@, initialTileOverlays: %@, initialClusterManagers: %@, " - @"initialGroundOverlays: %@)", - self.initialCameraPosition, self.mapConfiguration, self.initialCircles, - self.initialMarkers, self.initialPolygons, self.initialPolylines, self.initialHeatmaps, - self.initialTileOverlays, self.initialClusterManagers, self.initialGroundOverlays]; -} -@end - -@implementation FGMPlatformMapConfiguration -+ (instancetype)makeWithCompassEnabled:(nullable NSNumber *)compassEnabled - cameraTargetBounds:(nullable FGMPlatformCameraTargetBounds *)cameraTargetBounds - mapType:(nullable FGMPlatformMapTypeBox *)mapType - minMaxZoomPreference:(nullable FGMPlatformZoomRange *)minMaxZoomPreference - rotateGesturesEnabled:(nullable NSNumber *)rotateGesturesEnabled - scrollGesturesEnabled:(nullable NSNumber *)scrollGesturesEnabled - tiltGesturesEnabled:(nullable NSNumber *)tiltGesturesEnabled - trackCameraPosition:(nullable NSNumber *)trackCameraPosition - zoomGesturesEnabled:(nullable NSNumber *)zoomGesturesEnabled - myLocationEnabled:(nullable NSNumber *)myLocationEnabled - myLocationButtonEnabled:(nullable NSNumber *)myLocationButtonEnabled - padding:(nullable FGMPlatformEdgeInsets *)padding - indoorViewEnabled:(nullable NSNumber *)indoorViewEnabled - trafficEnabled:(nullable NSNumber *)trafficEnabled - buildingsEnabled:(nullable NSNumber *)buildingsEnabled - markerType:(FGMPlatformMarkerType)markerType - mapId:(nullable NSString *)mapId - style:(nullable NSString *)style { - FGMPlatformMapConfiguration *pigeonResult = [[FGMPlatformMapConfiguration alloc] init]; - pigeonResult.compassEnabled = compassEnabled; - pigeonResult.cameraTargetBounds = cameraTargetBounds; - pigeonResult.mapType = mapType; - pigeonResult.minMaxZoomPreference = minMaxZoomPreference; - pigeonResult.rotateGesturesEnabled = rotateGesturesEnabled; - pigeonResult.scrollGesturesEnabled = scrollGesturesEnabled; - pigeonResult.tiltGesturesEnabled = tiltGesturesEnabled; - pigeonResult.trackCameraPosition = trackCameraPosition; - pigeonResult.zoomGesturesEnabled = zoomGesturesEnabled; - pigeonResult.myLocationEnabled = myLocationEnabled; - pigeonResult.myLocationButtonEnabled = myLocationButtonEnabled; - pigeonResult.padding = padding; - pigeonResult.indoorViewEnabled = indoorViewEnabled; - pigeonResult.trafficEnabled = trafficEnabled; - pigeonResult.buildingsEnabled = buildingsEnabled; - pigeonResult.markerType = markerType; - pigeonResult.mapId = mapId; - pigeonResult.style = style; - return pigeonResult; -} -+ (FGMPlatformMapConfiguration *)fromList:(NSArray *)list { - FGMPlatformMapConfiguration *pigeonResult = [[FGMPlatformMapConfiguration alloc] init]; - pigeonResult.compassEnabled = GetNullableObjectAtIndex(list, 0); - pigeonResult.cameraTargetBounds = GetNullableObjectAtIndex(list, 1); - pigeonResult.mapType = GetNullableObjectAtIndex(list, 2); - pigeonResult.minMaxZoomPreference = GetNullableObjectAtIndex(list, 3); - pigeonResult.rotateGesturesEnabled = GetNullableObjectAtIndex(list, 4); - pigeonResult.scrollGesturesEnabled = GetNullableObjectAtIndex(list, 5); - pigeonResult.tiltGesturesEnabled = GetNullableObjectAtIndex(list, 6); - pigeonResult.trackCameraPosition = GetNullableObjectAtIndex(list, 7); - pigeonResult.zoomGesturesEnabled = GetNullableObjectAtIndex(list, 8); - pigeonResult.myLocationEnabled = GetNullableObjectAtIndex(list, 9); - pigeonResult.myLocationButtonEnabled = GetNullableObjectAtIndex(list, 10); - pigeonResult.padding = GetNullableObjectAtIndex(list, 11); - pigeonResult.indoorViewEnabled = GetNullableObjectAtIndex(list, 12); - pigeonResult.trafficEnabled = GetNullableObjectAtIndex(list, 13); - pigeonResult.buildingsEnabled = GetNullableObjectAtIndex(list, 14); - FGMPlatformMarkerTypeBox *boxedFGMPlatformMarkerType = GetNullableObjectAtIndex(list, 15); - pigeonResult.markerType = boxedFGMPlatformMarkerType.value; - pigeonResult.mapId = GetNullableObjectAtIndex(list, 16); - pigeonResult.style = GetNullableObjectAtIndex(list, 17); - return pigeonResult; -} -+ (nullable FGMPlatformMapConfiguration *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformMapConfiguration fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.compassEnabled ?: [NSNull null], - self.cameraTargetBounds ?: [NSNull null], - self.mapType ?: [NSNull null], - self.minMaxZoomPreference ?: [NSNull null], - self.rotateGesturesEnabled ?: [NSNull null], - self.scrollGesturesEnabled ?: [NSNull null], - self.tiltGesturesEnabled ?: [NSNull null], - self.trackCameraPosition ?: [NSNull null], - self.zoomGesturesEnabled ?: [NSNull null], - self.myLocationEnabled ?: [NSNull null], - self.myLocationButtonEnabled ?: [NSNull null], - self.padding ?: [NSNull null], - self.indoorViewEnabled ?: [NSNull null], - self.trafficEnabled ?: [NSNull null], - self.buildingsEnabled ?: [NSNull null], - [[FGMPlatformMarkerTypeBox alloc] initWithValue:self.markerType], - self.mapId ?: [NSNull null], - self.style ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformMapConfiguration *other = (FGMPlatformMapConfiguration *)object; - return FLTPigeonDeepEquals(self.compassEnabled, other.compassEnabled) && - FLTPigeonDeepEquals(self.cameraTargetBounds, other.cameraTargetBounds) && - FLTPigeonDeepEquals(self.mapType, other.mapType) && - FLTPigeonDeepEquals(self.minMaxZoomPreference, other.minMaxZoomPreference) && - FLTPigeonDeepEquals(self.rotateGesturesEnabled, other.rotateGesturesEnabled) && - FLTPigeonDeepEquals(self.scrollGesturesEnabled, other.scrollGesturesEnabled) && - FLTPigeonDeepEquals(self.tiltGesturesEnabled, other.tiltGesturesEnabled) && - FLTPigeonDeepEquals(self.trackCameraPosition, other.trackCameraPosition) && - FLTPigeonDeepEquals(self.zoomGesturesEnabled, other.zoomGesturesEnabled) && - FLTPigeonDeepEquals(self.myLocationEnabled, other.myLocationEnabled) && - FLTPigeonDeepEquals(self.myLocationButtonEnabled, other.myLocationButtonEnabled) && - FLTPigeonDeepEquals(self.padding, other.padding) && - FLTPigeonDeepEquals(self.indoorViewEnabled, other.indoorViewEnabled) && - FLTPigeonDeepEquals(self.trafficEnabled, other.trafficEnabled) && - FLTPigeonDeepEquals(self.buildingsEnabled, other.buildingsEnabled) && - self.markerType == other.markerType && FLTPigeonDeepEquals(self.mapId, other.mapId) && - FLTPigeonDeepEquals(self.style, other.style); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.compassEnabled); - result = result * 31 + FLTPigeonDeepHash(self.cameraTargetBounds); - result = result * 31 + FLTPigeonDeepHash(self.mapType); - result = result * 31 + FLTPigeonDeepHash(self.minMaxZoomPreference); - result = result * 31 + FLTPigeonDeepHash(self.rotateGesturesEnabled); - result = result * 31 + FLTPigeonDeepHash(self.scrollGesturesEnabled); - result = result * 31 + FLTPigeonDeepHash(self.tiltGesturesEnabled); - result = result * 31 + FLTPigeonDeepHash(self.trackCameraPosition); - result = result * 31 + FLTPigeonDeepHash(self.zoomGesturesEnabled); - result = result * 31 + FLTPigeonDeepHash(self.myLocationEnabled); - result = result * 31 + FLTPigeonDeepHash(self.myLocationButtonEnabled); - result = result * 31 + FLTPigeonDeepHash(self.padding); - result = result * 31 + FLTPigeonDeepHash(self.indoorViewEnabled); - result = result * 31 + FLTPigeonDeepHash(self.trafficEnabled); - result = result * 31 + FLTPigeonDeepHash(self.buildingsEnabled); - result = result * 31 + @(self.markerType).hash; - result = result * 31 + FLTPigeonDeepHash(self.mapId); - result = result * 31 + FLTPigeonDeepHash(self.style); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat: - @"FGMPlatformMapConfiguration(compassEnabled: %@, cameraTargetBounds: %@, mapType: %@, " - @"minMaxZoomPreference: %@, rotateGesturesEnabled: %@, scrollGesturesEnabled: %@, " - @"tiltGesturesEnabled: %@, trackCameraPosition: %@, zoomGesturesEnabled: %@, " - @"myLocationEnabled: %@, myLocationButtonEnabled: %@, padding: %@, indoorViewEnabled: " - @"%@, trafficEnabled: %@, buildingsEnabled: %@, markerType: %ld, mapId: %@, style: %@)", - self.compassEnabled, self.cameraTargetBounds, self.mapType, self.minMaxZoomPreference, - self.rotateGesturesEnabled, self.scrollGesturesEnabled, self.tiltGesturesEnabled, - self.trackCameraPosition, self.zoomGesturesEnabled, self.myLocationEnabled, - self.myLocationButtonEnabled, self.padding, self.indoorViewEnabled, self.trafficEnabled, - self.buildingsEnabled, (long)self.markerType, self.mapId, self.style]; -} -@end - -@implementation FGMPlatformPoint -+ (instancetype)makeWithX:(double)x y:(double)y { - FGMPlatformPoint *pigeonResult = [[FGMPlatformPoint alloc] init]; - pigeonResult.x = x; - pigeonResult.y = y; - return pigeonResult; -} -+ (FGMPlatformPoint *)fromList:(NSArray *)list { - FGMPlatformPoint *pigeonResult = [[FGMPlatformPoint alloc] init]; - pigeonResult.x = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.y = [GetNullableObjectAtIndex(list, 1) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformPoint *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformPoint fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.x), - @(self.y), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformPoint *other = (FGMPlatformPoint *)object; - return (self.x == other.x || (isnan(self.x) && isnan(other.x))) && - (self.y == other.y || (isnan(self.y) && isnan(other.y))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + (isnan(self.x) ? (NSUInteger)0x7FF8000000000000 : @(self.x).hash); - result = result * 31 + (isnan(self.y) ? (NSUInteger)0x7FF8000000000000 : @(self.y).hash); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformPoint(x: %f, y: %f)", self.x, self.y]; -} -@end - -@implementation FGMPlatformSize -+ (instancetype)makeWithWidth:(double)width height:(double)height { - FGMPlatformSize *pigeonResult = [[FGMPlatformSize alloc] init]; - pigeonResult.width = width; - pigeonResult.height = height; - return pigeonResult; -} -+ (FGMPlatformSize *)fromList:(NSArray *)list { - FGMPlatformSize *pigeonResult = [[FGMPlatformSize alloc] init]; - pigeonResult.width = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.height = [GetNullableObjectAtIndex(list, 1) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformSize *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformSize fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.width), - @(self.height), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformSize *other = (FGMPlatformSize *)object; - return (self.width == other.width || (isnan(self.width) && isnan(other.width))) && - (self.height == other.height || (isnan(self.height) && isnan(other.height))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + (isnan(self.width) ? (NSUInteger)0x7FF8000000000000 : @(self.width).hash); - result = - result * 31 + (isnan(self.height) ? (NSUInteger)0x7FF8000000000000 : @(self.height).hash); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformSize(width: %f, height: %f)", self.width, self.height]; -} -@end - -@implementation FGMPlatformColor -+ (instancetype)makeWithRed:(double)red green:(double)green blue:(double)blue alpha:(double)alpha { - FGMPlatformColor *pigeonResult = [[FGMPlatformColor alloc] init]; - pigeonResult.red = red; - pigeonResult.green = green; - pigeonResult.blue = blue; - pigeonResult.alpha = alpha; - return pigeonResult; -} -+ (FGMPlatformColor *)fromList:(NSArray *)list { - FGMPlatformColor *pigeonResult = [[FGMPlatformColor alloc] init]; - pigeonResult.red = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.green = [GetNullableObjectAtIndex(list, 1) doubleValue]; - pigeonResult.blue = [GetNullableObjectAtIndex(list, 2) doubleValue]; - pigeonResult.alpha = [GetNullableObjectAtIndex(list, 3) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformColor *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformColor fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.red), - @(self.green), - @(self.blue), - @(self.alpha), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformColor *other = (FGMPlatformColor *)object; - return (self.red == other.red || (isnan(self.red) && isnan(other.red))) && - (self.green == other.green || (isnan(self.green) && isnan(other.green))) && - (self.blue == other.blue || (isnan(self.blue) && isnan(other.blue))) && - (self.alpha == other.alpha || (isnan(self.alpha) && isnan(other.alpha))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + (isnan(self.red) ? (NSUInteger)0x7FF8000000000000 : @(self.red).hash); - result = result * 31 + (isnan(self.green) ? (NSUInteger)0x7FF8000000000000 : @(self.green).hash); - result = result * 31 + (isnan(self.blue) ? (NSUInteger)0x7FF8000000000000 : @(self.blue).hash); - result = result * 31 + (isnan(self.alpha) ? (NSUInteger)0x7FF8000000000000 : @(self.alpha).hash); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformColor(red: %f, green: %f, blue: %f, alpha: %f)", - self.red, self.green, self.blue, self.alpha]; -} -@end - -@implementation FGMPlatformTileLayer -+ (instancetype)makeWithVisible:(BOOL)visible - fadeIn:(BOOL)fadeIn - opacity:(double)opacity - zIndex:(NSInteger)zIndex { - FGMPlatformTileLayer *pigeonResult = [[FGMPlatformTileLayer alloc] init]; - pigeonResult.visible = visible; - pigeonResult.fadeIn = fadeIn; - pigeonResult.opacity = opacity; - pigeonResult.zIndex = zIndex; - return pigeonResult; -} -+ (FGMPlatformTileLayer *)fromList:(NSArray *)list { - FGMPlatformTileLayer *pigeonResult = [[FGMPlatformTileLayer alloc] init]; - pigeonResult.visible = [GetNullableObjectAtIndex(list, 0) boolValue]; - pigeonResult.fadeIn = [GetNullableObjectAtIndex(list, 1) boolValue]; - pigeonResult.opacity = [GetNullableObjectAtIndex(list, 2) doubleValue]; - pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 3) integerValue]; - return pigeonResult; -} -+ (nullable FGMPlatformTileLayer *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformTileLayer fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.visible), - @(self.fadeIn), - @(self.opacity), - @(self.zIndex), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformTileLayer *other = (FGMPlatformTileLayer *)object; - return self.visible == other.visible && self.fadeIn == other.fadeIn && - (self.opacity == other.opacity || (isnan(self.opacity) && isnan(other.opacity))) && - self.zIndex == other.zIndex; -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + @(self.visible).hash; - result = result * 31 + @(self.fadeIn).hash; - result = - result * 31 + (isnan(self.opacity) ? (NSUInteger)0x7FF8000000000000 : @(self.opacity).hash); - result = result * 31 + @(self.zIndex).hash; - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformTileLayer(visible: %@, fadeIn: %@, opacity: %f, zIndex: %ld)", - self.visible ? @"true" : @"false", self.fadeIn ? @"true" : @"false", - self.opacity, (long)self.zIndex]; -} -@end - -@implementation FGMPlatformZoomRange -+ (instancetype)makeWithMin:(nullable NSNumber *)min max:(nullable NSNumber *)max { - FGMPlatformZoomRange *pigeonResult = [[FGMPlatformZoomRange alloc] init]; - pigeonResult.min = min; - pigeonResult.max = max; - return pigeonResult; -} -+ (FGMPlatformZoomRange *)fromList:(NSArray *)list { - FGMPlatformZoomRange *pigeonResult = [[FGMPlatformZoomRange alloc] init]; - pigeonResult.min = GetNullableObjectAtIndex(list, 0); - pigeonResult.max = GetNullableObjectAtIndex(list, 1); - return pigeonResult; -} -+ (nullable FGMPlatformZoomRange *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformZoomRange fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.min ?: [NSNull null], - self.max ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformZoomRange *other = (FGMPlatformZoomRange *)object; - return FLTPigeonDeepEquals(self.min, other.min) && FLTPigeonDeepEquals(self.max, other.max); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.min); - result = result * 31 + FLTPigeonDeepHash(self.max); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformZoomRange(min: %@, max: %@)", self.min, self.max]; -} -@end - -@implementation FGMPlatformBitmap -+ (instancetype)makeWithBitmap:(id)bitmap { - FGMPlatformBitmap *pigeonResult = [[FGMPlatformBitmap alloc] init]; - pigeonResult.bitmap = bitmap; - return pigeonResult; -} -+ (FGMPlatformBitmap *)fromList:(NSArray *)list { - FGMPlatformBitmap *pigeonResult = [[FGMPlatformBitmap alloc] init]; - pigeonResult.bitmap = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FGMPlatformBitmap *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmap fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.bitmap ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmap *other = (FGMPlatformBitmap *)object; - return FLTPigeonDeepEquals(self.bitmap, other.bitmap); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.bitmap); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformBitmap(bitmap: %@)", self.bitmap]; -} -@end - -@implementation FGMPlatformBitmapDefaultMarker -+ (instancetype)makeWithHue:(nullable NSNumber *)hue { - FGMPlatformBitmapDefaultMarker *pigeonResult = [[FGMPlatformBitmapDefaultMarker alloc] init]; - pigeonResult.hue = hue; - return pigeonResult; -} -+ (FGMPlatformBitmapDefaultMarker *)fromList:(NSArray *)list { - FGMPlatformBitmapDefaultMarker *pigeonResult = [[FGMPlatformBitmapDefaultMarker alloc] init]; - pigeonResult.hue = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FGMPlatformBitmapDefaultMarker *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmapDefaultMarker fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.hue ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmapDefaultMarker *other = (FGMPlatformBitmapDefaultMarker *)object; - return FLTPigeonDeepEquals(self.hue, other.hue); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.hue); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformBitmapDefaultMarker(hue: %@)", self.hue]; -} -@end - -@implementation FGMPlatformBitmapBytes -+ (instancetype)makeWithByteData:(FlutterStandardTypedData *)byteData - size:(nullable FGMPlatformSize *)size { - FGMPlatformBitmapBytes *pigeonResult = [[FGMPlatformBitmapBytes alloc] init]; - pigeonResult.byteData = byteData; - pigeonResult.size = size; - return pigeonResult; -} -+ (FGMPlatformBitmapBytes *)fromList:(NSArray *)list { - FGMPlatformBitmapBytes *pigeonResult = [[FGMPlatformBitmapBytes alloc] init]; - pigeonResult.byteData = GetNullableObjectAtIndex(list, 0); - pigeonResult.size = GetNullableObjectAtIndex(list, 1); - return pigeonResult; -} -+ (nullable FGMPlatformBitmapBytes *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmapBytes fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.byteData ?: [NSNull null], - self.size ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmapBytes *other = (FGMPlatformBitmapBytes *)object; - return FLTPigeonDeepEquals(self.byteData, other.byteData) && - FLTPigeonDeepEquals(self.size, other.size); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.byteData); - result = result * 31 + FLTPigeonDeepHash(self.size); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformBitmapBytes(byteData: %@, size: %@)", self.byteData, self.size]; -} -@end - -@implementation FGMPlatformBitmapAsset -+ (instancetype)makeWithName:(NSString *)name pkg:(nullable NSString *)pkg { - FGMPlatformBitmapAsset *pigeonResult = [[FGMPlatformBitmapAsset alloc] init]; - pigeonResult.name = name; - pigeonResult.pkg = pkg; - return pigeonResult; -} -+ (FGMPlatformBitmapAsset *)fromList:(NSArray *)list { - FGMPlatformBitmapAsset *pigeonResult = [[FGMPlatformBitmapAsset alloc] init]; - pigeonResult.name = GetNullableObjectAtIndex(list, 0); - pigeonResult.pkg = GetNullableObjectAtIndex(list, 1); - return pigeonResult; -} -+ (nullable FGMPlatformBitmapAsset *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmapAsset fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.name ?: [NSNull null], - self.pkg ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmapAsset *other = (FGMPlatformBitmapAsset *)object; - return FLTPigeonDeepEquals(self.name, other.name) && FLTPigeonDeepEquals(self.pkg, other.pkg); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.name); - result = result * 31 + FLTPigeonDeepHash(self.pkg); - return result; -} -- (NSString *)description { - return - [NSString stringWithFormat:@"FGMPlatformBitmapAsset(name: %@, pkg: %@)", self.name, self.pkg]; -} -@end - -@implementation FGMPlatformBitmapAssetImage -+ (instancetype)makeWithName:(NSString *)name - scale:(double)scale - size:(nullable FGMPlatformSize *)size { - FGMPlatformBitmapAssetImage *pigeonResult = [[FGMPlatformBitmapAssetImage alloc] init]; - pigeonResult.name = name; - pigeonResult.scale = scale; - pigeonResult.size = size; - return pigeonResult; -} -+ (FGMPlatformBitmapAssetImage *)fromList:(NSArray *)list { - FGMPlatformBitmapAssetImage *pigeonResult = [[FGMPlatformBitmapAssetImage alloc] init]; - pigeonResult.name = GetNullableObjectAtIndex(list, 0); - pigeonResult.scale = [GetNullableObjectAtIndex(list, 1) doubleValue]; - pigeonResult.size = GetNullableObjectAtIndex(list, 2); - return pigeonResult; -} -+ (nullable FGMPlatformBitmapAssetImage *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmapAssetImage fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.name ?: [NSNull null], - @(self.scale), - self.size ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmapAssetImage *other = (FGMPlatformBitmapAssetImage *)object; - return FLTPigeonDeepEquals(self.name, other.name) && - (self.scale == other.scale || (isnan(self.scale) && isnan(other.scale))) && - FLTPigeonDeepEquals(self.size, other.size); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.name); - result = result * 31 + (isnan(self.scale) ? (NSUInteger)0x7FF8000000000000 : @(self.scale).hash); - result = result * 31 + FLTPigeonDeepHash(self.size); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformBitmapAssetImage(name: %@, scale: %f, size: %@)", - self.name, self.scale, self.size]; -} -@end - -@implementation FGMPlatformBitmapAssetMap -+ (instancetype)makeWithAssetName:(NSString *)assetName - bitmapScaling:(FGMPlatformMapBitmapScaling)bitmapScaling - imagePixelRatio:(double)imagePixelRatio - width:(nullable NSNumber *)width - height:(nullable NSNumber *)height { - FGMPlatformBitmapAssetMap *pigeonResult = [[FGMPlatformBitmapAssetMap alloc] init]; - pigeonResult.assetName = assetName; - pigeonResult.bitmapScaling = bitmapScaling; - pigeonResult.imagePixelRatio = imagePixelRatio; - pigeonResult.width = width; - pigeonResult.height = height; - return pigeonResult; -} -+ (FGMPlatformBitmapAssetMap *)fromList:(NSArray *)list { - FGMPlatformBitmapAssetMap *pigeonResult = [[FGMPlatformBitmapAssetMap alloc] init]; - pigeonResult.assetName = GetNullableObjectAtIndex(list, 0); - FGMPlatformMapBitmapScalingBox *boxedFGMPlatformMapBitmapScaling = - GetNullableObjectAtIndex(list, 1); - pigeonResult.bitmapScaling = boxedFGMPlatformMapBitmapScaling.value; - pigeonResult.imagePixelRatio = [GetNullableObjectAtIndex(list, 2) doubleValue]; - pigeonResult.width = GetNullableObjectAtIndex(list, 3); - pigeonResult.height = GetNullableObjectAtIndex(list, 4); - return pigeonResult; -} -+ (nullable FGMPlatformBitmapAssetMap *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmapAssetMap fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.assetName ?: [NSNull null], - [[FGMPlatformMapBitmapScalingBox alloc] initWithValue:self.bitmapScaling], - @(self.imagePixelRatio), - self.width ?: [NSNull null], - self.height ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmapAssetMap *other = (FGMPlatformBitmapAssetMap *)object; - return FLTPigeonDeepEquals(self.assetName, other.assetName) && - self.bitmapScaling == other.bitmapScaling && - (self.imagePixelRatio == other.imagePixelRatio || - (isnan(self.imagePixelRatio) && isnan(other.imagePixelRatio))) && - FLTPigeonDeepEquals(self.width, other.width) && - FLTPigeonDeepEquals(self.height, other.height); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.assetName); - result = result * 31 + @(self.bitmapScaling).hash; - result = result * 31 + (isnan(self.imagePixelRatio) ? (NSUInteger)0x7FF8000000000000 - : @(self.imagePixelRatio).hash); - result = result * 31 + FLTPigeonDeepHash(self.width); - result = result * 31 + FLTPigeonDeepHash(self.height); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformBitmapAssetMap(assetName: %@, bitmapScaling: %ld, " - @"imagePixelRatio: %f, width: %@, height: %@)", - self.assetName, (long)self.bitmapScaling, self.imagePixelRatio, - self.width, self.height]; -} -@end - -@implementation FGMPlatformBitmapBytesMap -+ (instancetype)makeWithByteData:(FlutterStandardTypedData *)byteData - bitmapScaling:(FGMPlatformMapBitmapScaling)bitmapScaling - imagePixelRatio:(double)imagePixelRatio - width:(nullable NSNumber *)width - height:(nullable NSNumber *)height { - FGMPlatformBitmapBytesMap *pigeonResult = [[FGMPlatformBitmapBytesMap alloc] init]; - pigeonResult.byteData = byteData; - pigeonResult.bitmapScaling = bitmapScaling; - pigeonResult.imagePixelRatio = imagePixelRatio; - pigeonResult.width = width; - pigeonResult.height = height; - return pigeonResult; -} -+ (FGMPlatformBitmapBytesMap *)fromList:(NSArray *)list { - FGMPlatformBitmapBytesMap *pigeonResult = [[FGMPlatformBitmapBytesMap alloc] init]; - pigeonResult.byteData = GetNullableObjectAtIndex(list, 0); - FGMPlatformMapBitmapScalingBox *boxedFGMPlatformMapBitmapScaling = - GetNullableObjectAtIndex(list, 1); - pigeonResult.bitmapScaling = boxedFGMPlatformMapBitmapScaling.value; - pigeonResult.imagePixelRatio = [GetNullableObjectAtIndex(list, 2) doubleValue]; - pigeonResult.width = GetNullableObjectAtIndex(list, 3); - pigeonResult.height = GetNullableObjectAtIndex(list, 4); - return pigeonResult; -} -+ (nullable FGMPlatformBitmapBytesMap *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmapBytesMap fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.byteData ?: [NSNull null], - [[FGMPlatformMapBitmapScalingBox alloc] initWithValue:self.bitmapScaling], - @(self.imagePixelRatio), - self.width ?: [NSNull null], - self.height ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmapBytesMap *other = (FGMPlatformBitmapBytesMap *)object; - return FLTPigeonDeepEquals(self.byteData, other.byteData) && - self.bitmapScaling == other.bitmapScaling && - (self.imagePixelRatio == other.imagePixelRatio || - (isnan(self.imagePixelRatio) && isnan(other.imagePixelRatio))) && - FLTPigeonDeepEquals(self.width, other.width) && - FLTPigeonDeepEquals(self.height, other.height); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.byteData); - result = result * 31 + @(self.bitmapScaling).hash; - result = result * 31 + (isnan(self.imagePixelRatio) ? (NSUInteger)0x7FF8000000000000 - : @(self.imagePixelRatio).hash); - result = result * 31 + FLTPigeonDeepHash(self.width); - result = result * 31 + FLTPigeonDeepHash(self.height); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformBitmapBytesMap(byteData: %@, bitmapScaling: %ld, " - @"imagePixelRatio: %f, width: %@, height: %@)", - self.byteData, (long)self.bitmapScaling, self.imagePixelRatio, - self.width, self.height]; -} -@end - -@implementation FGMPlatformBitmapPinConfig -+ (instancetype)makeWithBackgroundColor:(nullable FGMPlatformColor *)backgroundColor - borderColor:(nullable FGMPlatformColor *)borderColor - glyphColor:(nullable FGMPlatformColor *)glyphColor - glyphTextColor:(nullable FGMPlatformColor *)glyphTextColor - glyphText:(nullable NSString *)glyphText - glyphBitmap:(nullable FGMPlatformBitmap *)glyphBitmap { - FGMPlatformBitmapPinConfig *pigeonResult = [[FGMPlatformBitmapPinConfig alloc] init]; - pigeonResult.backgroundColor = backgroundColor; - pigeonResult.borderColor = borderColor; - pigeonResult.glyphColor = glyphColor; - pigeonResult.glyphTextColor = glyphTextColor; - pigeonResult.glyphText = glyphText; - pigeonResult.glyphBitmap = glyphBitmap; - return pigeonResult; -} -+ (FGMPlatformBitmapPinConfig *)fromList:(NSArray *)list { - FGMPlatformBitmapPinConfig *pigeonResult = [[FGMPlatformBitmapPinConfig alloc] init]; - pigeonResult.backgroundColor = GetNullableObjectAtIndex(list, 0); - pigeonResult.borderColor = GetNullableObjectAtIndex(list, 1); - pigeonResult.glyphColor = GetNullableObjectAtIndex(list, 2); - pigeonResult.glyphTextColor = GetNullableObjectAtIndex(list, 3); - pigeonResult.glyphText = GetNullableObjectAtIndex(list, 4); - pigeonResult.glyphBitmap = GetNullableObjectAtIndex(list, 5); - return pigeonResult; -} -+ (nullable FGMPlatformBitmapPinConfig *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmapPinConfig fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.backgroundColor ?: [NSNull null], - self.borderColor ?: [NSNull null], - self.glyphColor ?: [NSNull null], - self.glyphTextColor ?: [NSNull null], - self.glyphText ?: [NSNull null], - self.glyphBitmap ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmapPinConfig *other = (FGMPlatformBitmapPinConfig *)object; - return FLTPigeonDeepEquals(self.backgroundColor, other.backgroundColor) && - FLTPigeonDeepEquals(self.borderColor, other.borderColor) && - FLTPigeonDeepEquals(self.glyphColor, other.glyphColor) && - FLTPigeonDeepEquals(self.glyphTextColor, other.glyphTextColor) && - FLTPigeonDeepEquals(self.glyphText, other.glyphText) && - FLTPigeonDeepEquals(self.glyphBitmap, other.glyphBitmap); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.backgroundColor); - result = result * 31 + FLTPigeonDeepHash(self.borderColor); - result = result * 31 + FLTPigeonDeepHash(self.glyphColor); - result = result * 31 + FLTPigeonDeepHash(self.glyphTextColor); - result = result * 31 + FLTPigeonDeepHash(self.glyphText); - result = result * 31 + FLTPigeonDeepHash(self.glyphBitmap); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformBitmapPinConfig(backgroundColor: %@, borderColor: %@, " - @"glyphColor: %@, glyphTextColor: %@, glyphText: %@, glyphBitmap: %@)", - self.backgroundColor, self.borderColor, self.glyphColor, self.glyphTextColor, - self.glyphText, self.glyphBitmap]; -} -@end - -@interface FGMGoogleMapsFlutterPigeonMessagesPigeonCodecReader : FlutterStandardReader -@end -@implementation FGMGoogleMapsFlutterPigeonMessagesPigeonCodecReader -- (nullable id)readValueOfType:(UInt8)type { - switch (type) { - case 129: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil - ? nil - : [[FGMPlatformMapTypeBox alloc] initWithValue:[enumAsNumber integerValue]]; - } - case 130: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil ? nil - : [[FGMPlatformMarkerCollisionBehaviorBox alloc] - initWithValue:[enumAsNumber integerValue]]; - } - case 131: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil - ? nil - : [[FGMPlatformJointTypeBox alloc] initWithValue:[enumAsNumber integerValue]]; - } - case 132: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil ? nil - : [[FGMPlatformPatternItemTypeBox alloc] - initWithValue:[enumAsNumber integerValue]]; - } - case 133: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil - ? nil - : [[FGMPlatformMarkerTypeBox alloc] initWithValue:[enumAsNumber integerValue]]; - } - case 134: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil ? nil - : [[FGMPlatformMapBitmapScalingBox alloc] - initWithValue:[enumAsNumber integerValue]]; - } - case 135: - return [FGMPlatformCameraPosition fromList:[self readValue]]; - case 136: - return [FGMPlatformCameraUpdate fromList:[self readValue]]; - case 137: - return [FGMPlatformCameraUpdateNewCameraPosition fromList:[self readValue]]; - case 138: - return [FGMPlatformCameraUpdateNewLatLng fromList:[self readValue]]; - case 139: - return [FGMPlatformCameraUpdateNewLatLngBounds fromList:[self readValue]]; - case 140: - return [FGMPlatformCameraUpdateNewLatLngZoom fromList:[self readValue]]; - case 141: - return [FGMPlatformCameraUpdateScrollBy fromList:[self readValue]]; - case 142: - return [FGMPlatformCameraUpdateZoomBy fromList:[self readValue]]; - case 143: - return [FGMPlatformCameraUpdateZoom fromList:[self readValue]]; - case 144: - return [FGMPlatformCameraUpdateZoomTo fromList:[self readValue]]; - case 145: - return [FGMPlatformCircle fromList:[self readValue]]; - case 146: - return [FGMPlatformHeatmap fromList:[self readValue]]; - case 147: - return [FGMPlatformHeatmapGradient fromList:[self readValue]]; - case 148: - return [FGMPlatformWeightedLatLng fromList:[self readValue]]; - case 149: - return [FGMPlatformInfoWindow fromList:[self readValue]]; - case 150: - return [FGMPlatformCluster fromList:[self readValue]]; - case 151: - return [FGMPlatformClusterManager fromList:[self readValue]]; - case 152: - return [FGMPlatformMarker fromList:[self readValue]]; - case 153: - return [FGMPlatformPolygon fromList:[self readValue]]; - case 154: - return [FGMPlatformPolyline fromList:[self readValue]]; - case 155: - return [FGMPlatformPatternItem fromList:[self readValue]]; - case 156: - return [FGMPlatformTile fromList:[self readValue]]; - case 157: - return [FGMPlatformTileOverlay fromList:[self readValue]]; - case 158: - return [FGMPlatformEdgeInsets fromList:[self readValue]]; - case 159: - return [FGMPlatformLatLng fromList:[self readValue]]; - case 160: - return [FGMPlatformLatLngBounds fromList:[self readValue]]; - case 161: - return [FGMPlatformCameraTargetBounds fromList:[self readValue]]; - case 162: - return [FGMPlatformGroundOverlay fromList:[self readValue]]; - case 163: - return [FGMPlatformMapViewCreationParams fromList:[self readValue]]; - case 164: - return [FGMPlatformMapConfiguration fromList:[self readValue]]; - case 165: - return [FGMPlatformPoint fromList:[self readValue]]; - case 166: - return [FGMPlatformSize fromList:[self readValue]]; - case 167: - return [FGMPlatformColor fromList:[self readValue]]; - case 168: - return [FGMPlatformTileLayer fromList:[self readValue]]; - case 169: - return [FGMPlatformZoomRange fromList:[self readValue]]; - case 170: - return [FGMPlatformBitmap fromList:[self readValue]]; - case 171: - return [FGMPlatformBitmapDefaultMarker fromList:[self readValue]]; - case 172: - return [FGMPlatformBitmapBytes fromList:[self readValue]]; - case 173: - return [FGMPlatformBitmapAsset fromList:[self readValue]]; - case 174: - return [FGMPlatformBitmapAssetImage fromList:[self readValue]]; - case 175: - return [FGMPlatformBitmapAssetMap fromList:[self readValue]]; - case 176: - return [FGMPlatformBitmapBytesMap fromList:[self readValue]]; - case 177: - return [FGMPlatformBitmapPinConfig fromList:[self readValue]]; - default: - return [super readValueOfType:type]; - } -} -@end - -@interface FGMGoogleMapsFlutterPigeonMessagesPigeonCodecWriter : FlutterStandardWriter -@end -@implementation FGMGoogleMapsFlutterPigeonMessagesPigeonCodecWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[FGMPlatformMapTypeBox class]]) { - FGMPlatformMapTypeBox *box = (FGMPlatformMapTypeBox *)value; - [self writeByte:129]; - [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[FGMPlatformMarkerCollisionBehaviorBox class]]) { - FGMPlatformMarkerCollisionBehaviorBox *box = (FGMPlatformMarkerCollisionBehaviorBox *)value; - [self writeByte:130]; - [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[FGMPlatformJointTypeBox class]]) { - FGMPlatformJointTypeBox *box = (FGMPlatformJointTypeBox *)value; - [self writeByte:131]; - [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[FGMPlatformPatternItemTypeBox class]]) { - FGMPlatformPatternItemTypeBox *box = (FGMPlatformPatternItemTypeBox *)value; - [self writeByte:132]; - [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[FGMPlatformMarkerTypeBox class]]) { - FGMPlatformMarkerTypeBox *box = (FGMPlatformMarkerTypeBox *)value; - [self writeByte:133]; - [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[FGMPlatformMapBitmapScalingBox class]]) { - FGMPlatformMapBitmapScalingBox *box = (FGMPlatformMapBitmapScalingBox *)value; - [self writeByte:134]; - [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[FGMPlatformCameraPosition class]]) { - [self writeByte:135]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdate class]]) { - [self writeByte:136]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateNewCameraPosition class]]) { - [self writeByte:137]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateNewLatLng class]]) { - [self writeByte:138]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateNewLatLngBounds class]]) { - [self writeByte:139]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateNewLatLngZoom class]]) { - [self writeByte:140]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateScrollBy class]]) { - [self writeByte:141]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateZoomBy class]]) { - [self writeByte:142]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateZoom class]]) { - [self writeByte:143]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateZoomTo class]]) { - [self writeByte:144]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCircle class]]) { - [self writeByte:145]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformHeatmap class]]) { - [self writeByte:146]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformHeatmapGradient class]]) { - [self writeByte:147]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformWeightedLatLng class]]) { - [self writeByte:148]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformInfoWindow class]]) { - [self writeByte:149]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCluster class]]) { - [self writeByte:150]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformClusterManager class]]) { - [self writeByte:151]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformMarker class]]) { - [self writeByte:152]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformPolygon class]]) { - [self writeByte:153]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformPolyline class]]) { - [self writeByte:154]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformPatternItem class]]) { - [self writeByte:155]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformTile class]]) { - [self writeByte:156]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformTileOverlay class]]) { - [self writeByte:157]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformEdgeInsets class]]) { - [self writeByte:158]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformLatLng class]]) { - [self writeByte:159]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformLatLngBounds class]]) { - [self writeByte:160]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraTargetBounds class]]) { - [self writeByte:161]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformGroundOverlay class]]) { - [self writeByte:162]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformMapViewCreationParams class]]) { - [self writeByte:163]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformMapConfiguration class]]) { - [self writeByte:164]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformPoint class]]) { - [self writeByte:165]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformSize class]]) { - [self writeByte:166]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformColor class]]) { - [self writeByte:167]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformTileLayer class]]) { - [self writeByte:168]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformZoomRange class]]) { - [self writeByte:169]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmap class]]) { - [self writeByte:170]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmapDefaultMarker class]]) { - [self writeByte:171]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmapBytes class]]) { - [self writeByte:172]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmapAsset class]]) { - [self writeByte:173]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmapAssetImage class]]) { - [self writeByte:174]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmapAssetMap class]]) { - [self writeByte:175]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmapBytesMap class]]) { - [self writeByte:176]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmapPinConfig class]]) { - [self writeByte:177]; - [self writeValue:[value toList]]; - } else { - [super writeValue:value]; - } -} -@end - -@interface FGMGoogleMapsFlutterPigeonMessagesPigeonCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation FGMGoogleMapsFlutterPigeonMessagesPigeonCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FGMGoogleMapsFlutterPigeonMessagesPigeonCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FGMGoogleMapsFlutterPigeonMessagesPigeonCodecReader alloc] initWithData:data]; -} -@end - -NSObject *FGMGetGoogleMapsFlutterPigeonMessagesCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - static dispatch_once_t sPred = 0; - dispatch_once(&sPred, ^{ - FGMGoogleMapsFlutterPigeonMessagesPigeonCodecReaderWriter *readerWriter = - [[FGMGoogleMapsFlutterPigeonMessagesPigeonCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); - return sSharedObject; -} -void SetUpFGMMapsApi(id binaryMessenger, NSObject *api) { - SetUpFGMMapsApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFGMMapsApiWithSuffix(id binaryMessenger, - NSObject *api, NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - /// Returns once the map instance is available. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.waitForMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(waitForMapWithError:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(waitForMapWithError:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - [api waitForMapWithError:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the map's configuration options. - /// - /// Only non-null configuration values will result in updates; options with - /// null values will remain unchanged. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.updateMapConfiguration", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(updateWithMapConfiguration:error:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(updateWithMapConfiguration:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FGMPlatformMapConfiguration *arg_configuration = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - [api updateWithMapConfiguration:arg_configuration error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of circles on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateCircles", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updateCirclesByAdding:changing:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updateCirclesByAdding:changing:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_toChange = GetNullableObjectAtIndex(args, 1); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api updateCirclesByAdding:arg_toAdd - changing:arg_toChange - removing:arg_idsToRemove - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of heatmaps on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.updateHeatmaps", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updateHeatmapsByAdding:changing:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updateHeatmapsByAdding:changing:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_toChange = GetNullableObjectAtIndex(args, 1); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api updateHeatmapsByAdding:arg_toAdd - changing:arg_toChange - removing:arg_idsToRemove - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of custer managers for clusters on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.updateClusterManagers", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updateClusterManagersByAdding:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updateClusterManagersByAdding:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 1); - FlutterError *error; - [api updateClusterManagersByAdding:arg_toAdd removing:arg_idsToRemove error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of markers on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateMarkers", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updateMarkersByAdding:changing:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updateMarkersByAdding:changing:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_toChange = GetNullableObjectAtIndex(args, 1); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api updateMarkersByAdding:arg_toAdd - changing:arg_toChange - removing:arg_idsToRemove - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of polygonss on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.updatePolygons", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updatePolygonsByAdding:changing:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updatePolygonsByAdding:changing:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_toChange = GetNullableObjectAtIndex(args, 1); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api updatePolygonsByAdding:arg_toAdd - changing:arg_toChange - removing:arg_idsToRemove - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of polylines on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.updatePolylines", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updatePolylinesByAdding: - changing:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updatePolylinesByAdding:changing:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_toChange = GetNullableObjectAtIndex(args, 1); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api updatePolylinesByAdding:arg_toAdd - changing:arg_toChange - removing:arg_idsToRemove - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of tile overlays on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.updateTileOverlays", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updateTileOverlaysByAdding: - changing:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updateTileOverlaysByAdding:changing:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_toChange = GetNullableObjectAtIndex(args, 1); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api updateTileOverlaysByAdding:arg_toAdd - changing:arg_toChange - removing:arg_idsToRemove - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of ground overlays on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.updateGroundOverlays", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updateGroundOverlaysByAdding: - changing:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updateGroundOverlaysByAdding:changing:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_toChange = GetNullableObjectAtIndex(args, 1); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api updateGroundOverlaysByAdding:arg_toAdd - changing:arg_toChange - removing:arg_idsToRemove - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Gets the screen coordinate for the given map location. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.getScreenCoordinate", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(screenCoordinatesForLatLng:error:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(screenCoordinatesForLatLng:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FGMPlatformLatLng *arg_latLng = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FGMPlatformPoint *output = [api screenCoordinatesForLatLng:arg_latLng error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Gets the map location for the given screen coordinate. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getLatLng", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(latLngForScreenCoordinate:error:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(latLngForScreenCoordinate:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FGMPlatformPoint *arg_screenCoordinate = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FGMPlatformLatLng *output = [api latLngForScreenCoordinate:arg_screenCoordinate - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Gets the map region currently displayed on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.getVisibleRegion", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(visibleMapRegion:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(visibleMapRegion:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - FGMPlatformLatLngBounds *output = [api visibleMapRegion:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Moves the camera according to [cameraUpdate] immediately, with no - /// animation. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.moveCamera", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(moveCameraWithUpdate:error:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(moveCameraWithUpdate:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FGMPlatformCameraUpdate *arg_cameraUpdate = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - [api moveCameraWithUpdate:arg_cameraUpdate error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Moves the camera according to [cameraUpdate], animating the update using a - /// duration in milliseconds if provided. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.animateCamera", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(animateCameraWithUpdate:duration:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(animateCameraWithUpdate:duration:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FGMPlatformCameraUpdate *arg_cameraUpdate = GetNullableObjectAtIndex(args, 0); - NSNumber *arg_durationMilliseconds = GetNullableObjectAtIndex(args, 1); - FlutterError *error; - [api animateCameraWithUpdate:arg_cameraUpdate - duration:arg_durationMilliseconds - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Gets the current map zoom level. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getZoomLevel", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(currentZoomLevel:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(currentZoomLevel:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api currentZoomLevel:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Show the info window for the marker with the given ID. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.showInfoWindow", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(showInfoWindowForMarkerWithIdentifier:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(showInfoWindowForMarkerWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_markerId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - [api showInfoWindowForMarkerWithIdentifier:arg_markerId error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Hide the info window for the marker with the given ID. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.hideInfoWindow", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(hideInfoWindowForMarkerWithIdentifier:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(hideInfoWindowForMarkerWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_markerId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - [api hideInfoWindowForMarkerWithIdentifier:arg_markerId error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns true if the marker with the given ID is currently displaying its - /// info window. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.isInfoWindowShown", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(isShowingInfoWindowForMarkerWithIdentifier: - error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(isShowingInfoWindowForMarkerWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_markerId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSNumber *output = [api isShowingInfoWindowForMarkerWithIdentifier:arg_markerId - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Sets the style to the given map style string, where an empty string - /// indicates that the style should be cleared. - /// - /// If there was an error setting the style, such as an invalid style string, - /// returns the error message. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.setStyle", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(setStyle:error:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(setStyle:error:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_style = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSString *output = [api setStyle:arg_style error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the error string from the last attempt to set the map style, if - /// any. - /// - /// This allows checking asynchronously for initial style failures, as there - /// is no way to return failures from map initialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.getLastStyleError", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(lastStyleError:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(lastStyleError:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSString *output = [api lastStyleError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Clears the cache of tiles previously requseted from the tile provider. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.clearTileCache", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(clearTileCacheForOverlayWithIdentifier:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(clearTileCacheForOverlayWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_tileOverlayId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - [api clearTileCacheForOverlayWithIdentifier:arg_tileOverlayId error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Takes a snapshot of the map and returns its image data. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.takeSnapshot", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(takeSnapshotWithError:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(takeSnapshotWithError:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - FlutterStandardTypedData *output = [api takeSnapshotWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns true if the map supports advanced markers. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.isAdvancedMarkersAvailable", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(isAdvancedMarkersAvailable:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(isAdvancedMarkersAvailable:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api isAdvancedMarkersAvailable:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -@interface FGMMapsCallbackApi () -@property(nonatomic, strong) NSObject *binaryMessenger; -@property(nonatomic, strong) NSString *messageChannelSuffix; -@end - -@implementation FGMMapsCallbackApi - -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; -} -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 - ? @"" - : [NSString stringWithFormat:@".%@", messageChannelSuffix]; - } - return self; -} -- (void)didStartCameraMoveWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCameraMoveStarted", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didMoveCameraToPosition:(FGMPlatformCameraPosition *)arg_cameraPosition - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCameraMove", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_cameraPosition ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didIdleCameraWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCameraIdle", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapAtPosition:(FGMPlatformLatLng *)arg_position - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_position ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didLongPressAtPosition:(FGMPlatformLatLng *)arg_position - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onLongPress", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_position ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapMarkerWithIdentifier:(NSString *)arg_markerId - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_markerId ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didStartDragForMarkerWithIdentifier:(NSString *)arg_markerId - atPosition:(FGMPlatformLatLng *)arg_position - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDragStart", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_markerId ?: [NSNull null], arg_position ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didDragMarkerWithIdentifier:(NSString *)arg_markerId - atPosition:(FGMPlatformLatLng *)arg_position - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDrag", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_markerId ?: [NSNull null], arg_position ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didEndDragForMarkerWithIdentifier:(NSString *)arg_markerId - atPosition:(FGMPlatformLatLng *)arg_position - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDragEnd", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_markerId ?: [NSNull null], arg_position ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapInfoWindowOfMarkerWithIdentifier:(NSString *)arg_markerId - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onInfoWindowTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_markerId ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapCircleWithIdentifier:(NSString *)arg_circleId - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCircleTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_circleId ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapCluster:(FGMPlatformCluster *)arg_cluster - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onClusterTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_cluster ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapPolygonWithIdentifier:(NSString *)arg_polygonId - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onPolygonTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_polygonId ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapPolylineWithIdentifier:(NSString *)arg_polylineId - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onPolylineTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_polylineId ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapGroundOverlayWithIdentifier:(NSString *)arg_groundOverlayId - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onGroundOverlayTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_groundOverlayId ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)tileWithOverlayIdentifier:(NSString *)arg_tileOverlayId - location:(FGMPlatformPoint *)arg_location - zoom:(NSInteger)arg_zoom - completion:(void (^)(FGMPlatformTile *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.getTileOverlayTile", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ - arg_tileOverlayId ?: [NSNull null], arg_location ?: [NSNull null], @(arg_zoom) - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FGMPlatformTile *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -@end - -void SetUpFGMMapsPlatformViewApi(id binaryMessenger, - NSObject *api) { - SetUpFGMMapsPlatformViewApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFGMMapsPlatformViewApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsPlatformViewApi.createView", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(createViewType:error:)], - @"FGMMapsPlatformViewApi api (%@) doesn't respond to @selector(createViewType:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FGMPlatformMapViewCreationParams *arg_type = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - [api createViewType:arg_type error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -void SetUpFGMMapsInspectorApi(id binaryMessenger, - NSObject *api) { - SetUpFGMMapsInspectorApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFGMMapsInspectorApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.areBuildingsEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(areBuildingsEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(areBuildingsEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api areBuildingsEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.areRotateGesturesEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(areRotateGesturesEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(areRotateGesturesEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api areRotateGesturesEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.areScrollGesturesEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(areScrollGesturesEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(areScrollGesturesEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api areScrollGesturesEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.areTiltGesturesEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(areTiltGesturesEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(areTiltGesturesEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api areTiltGesturesEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.areZoomGesturesEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(areZoomGesturesEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(areZoomGesturesEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api areZoomGesturesEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.isCompassEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(isCompassEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to @selector(isCompassEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api isCompassEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.isMyLocationButtonEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(isMyLocationButtonEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(isMyLocationButtonEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api isMyLocationButtonEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.isTrafficEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(isTrafficEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to @selector(isTrafficEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api isTrafficEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.getTileOverlayInfo", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(tileOverlayWithIdentifier:error:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(tileOverlayWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_tileOverlayId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FGMPlatformTileLayer *output = [api tileOverlayWithIdentifier:arg_tileOverlayId - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.getGroundOverlayInfo", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(groundOverlayWithIdentifier:error:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(groundOverlayWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_groundOverlayId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FGMPlatformGroundOverlay *output = [api groundOverlayWithIdentifier:arg_groundOverlayId - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.getHeatmapInfo", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(heatmapWithIdentifier:error:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(heatmapWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_heatmapId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FGMPlatformHeatmap *output = [api heatmapWithIdentifier:arg_heatmapId error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.getZoomRange", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(zoomRange:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to @selector(zoomRange:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - FGMPlatformZoomRange *output = [api zoomRange:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.getClusters", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(clustersWithIdentifier:error:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(clustersWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_clusterManagerId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSArray *output = [api clustersWithIdentifier:arg_clusterManagerId - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.getCameraPosition", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(cameraPosition:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to @selector(cameraPosition:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - FGMPlatformCameraPosition *output = [api cameraPosition:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/google_maps_flutter_ios_sdk9_objc/google_maps_flutter_pigeon_messages.g.h b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/google_maps_flutter_ios_sdk9_objc/google_maps_flutter_pigeon_messages.g.h deleted file mode 100644 index fbd78a7c44a9..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/google_maps_flutter_ios_sdk9_objc/google_maps_flutter_pigeon_messages.g.h +++ /dev/null @@ -1,991 +0,0 @@ -// Copyright 2013 The Flutter Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// Autogenerated from Pigeon (v27.3.2), do not edit directly. -// See also: https://pub.dev/packages/pigeon - -@import Foundation; - -@protocol FlutterBinaryMessenger; -@protocol FlutterMessageCodec; -@class FlutterError; -@class FlutterStandardTypedData; - -NS_ASSUME_NONNULL_BEGIN - -/// Pigeon equivalent of MapType -typedef NS_ENUM(NSUInteger, FGMPlatformMapType) { - FGMPlatformMapTypeNone = 0, - FGMPlatformMapTypeNormal = 1, - FGMPlatformMapTypeSatellite = 2, - FGMPlatformMapTypeTerrain = 3, - FGMPlatformMapTypeHybrid = 4, -}; - -/// Wrapper for FGMPlatformMapType to allow for nullability. -@interface FGMPlatformMapTypeBox : NSObject -@property(nonatomic, assign) FGMPlatformMapType value; -- (instancetype)initWithValue:(FGMPlatformMapType)value; -@end - -/// Pigeon equivalent of the MarkerCollisionBehavior enum. -typedef NS_ENUM(NSUInteger, FGMPlatformMarkerCollisionBehavior) { - FGMPlatformMarkerCollisionBehaviorRequiredDisplay = 0, - FGMPlatformMarkerCollisionBehaviorOptionalAndHidesLowerPriority = 1, - FGMPlatformMarkerCollisionBehaviorRequiredAndHidesOptional = 2, -}; - -/// Wrapper for FGMPlatformMarkerCollisionBehavior to allow for nullability. -@interface FGMPlatformMarkerCollisionBehaviorBox : NSObject -@property(nonatomic, assign) FGMPlatformMarkerCollisionBehavior value; -- (instancetype)initWithValue:(FGMPlatformMarkerCollisionBehavior)value; -@end - -/// Join types for polyline joints. -typedef NS_ENUM(NSUInteger, FGMPlatformJointType) { - FGMPlatformJointTypeMitered = 0, - FGMPlatformJointTypeBevel = 1, - FGMPlatformJointTypeRound = 2, -}; - -/// Wrapper for FGMPlatformJointType to allow for nullability. -@interface FGMPlatformJointTypeBox : NSObject -@property(nonatomic, assign) FGMPlatformJointType value; -- (instancetype)initWithValue:(FGMPlatformJointType)value; -@end - -/// Enumeration of possible types for PatternItem. -typedef NS_ENUM(NSUInteger, FGMPlatformPatternItemType) { - FGMPlatformPatternItemTypeDot = 0, - FGMPlatformPatternItemTypeDash = 1, - FGMPlatformPatternItemTypeGap = 2, -}; - -/// Wrapper for FGMPlatformPatternItemType to allow for nullability. -@interface FGMPlatformPatternItemTypeBox : NSObject -@property(nonatomic, assign) FGMPlatformPatternItemType value; -- (instancetype)initWithValue:(FGMPlatformPatternItemType)value; -@end - -typedef NS_ENUM(NSUInteger, FGMPlatformMarkerType) { - FGMPlatformMarkerTypeMarker = 0, - FGMPlatformMarkerTypeAdvancedMarker = 1, -}; - -/// Wrapper for FGMPlatformMarkerType to allow for nullability. -@interface FGMPlatformMarkerTypeBox : NSObject -@property(nonatomic, assign) FGMPlatformMarkerType value; -- (instancetype)initWithValue:(FGMPlatformMarkerType)value; -@end - -/// Pigeon equivalent of [MapBitmapScaling]. -typedef NS_ENUM(NSUInteger, FGMPlatformMapBitmapScaling) { - FGMPlatformMapBitmapScalingAuto = 0, - FGMPlatformMapBitmapScalingNone = 1, -}; - -/// Wrapper for FGMPlatformMapBitmapScaling to allow for nullability. -@interface FGMPlatformMapBitmapScalingBox : NSObject -@property(nonatomic, assign) FGMPlatformMapBitmapScaling value; -- (instancetype)initWithValue:(FGMPlatformMapBitmapScaling)value; -@end - -@class FGMPlatformCameraPosition; -@class FGMPlatformCameraUpdate; -@class FGMPlatformCameraUpdateNewCameraPosition; -@class FGMPlatformCameraUpdateNewLatLng; -@class FGMPlatformCameraUpdateNewLatLngBounds; -@class FGMPlatformCameraUpdateNewLatLngZoom; -@class FGMPlatformCameraUpdateScrollBy; -@class FGMPlatformCameraUpdateZoomBy; -@class FGMPlatformCameraUpdateZoom; -@class FGMPlatformCameraUpdateZoomTo; -@class FGMPlatformCircle; -@class FGMPlatformHeatmap; -@class FGMPlatformHeatmapGradient; -@class FGMPlatformWeightedLatLng; -@class FGMPlatformInfoWindow; -@class FGMPlatformCluster; -@class FGMPlatformClusterManager; -@class FGMPlatformMarker; -@class FGMPlatformPolygon; -@class FGMPlatformPolyline; -@class FGMPlatformPatternItem; -@class FGMPlatformTile; -@class FGMPlatformTileOverlay; -@class FGMPlatformEdgeInsets; -@class FGMPlatformLatLng; -@class FGMPlatformLatLngBounds; -@class FGMPlatformCameraTargetBounds; -@class FGMPlatformGroundOverlay; -@class FGMPlatformMapViewCreationParams; -@class FGMPlatformMapConfiguration; -@class FGMPlatformPoint; -@class FGMPlatformSize; -@class FGMPlatformColor; -@class FGMPlatformTileLayer; -@class FGMPlatformZoomRange; -@class FGMPlatformBitmap; -@class FGMPlatformBitmapDefaultMarker; -@class FGMPlatformBitmapBytes; -@class FGMPlatformBitmapAsset; -@class FGMPlatformBitmapAssetImage; -@class FGMPlatformBitmapAssetMap; -@class FGMPlatformBitmapBytesMap; -@class FGMPlatformBitmapPinConfig; - -/// Pigeon representatation of a CameraPosition. -@interface FGMPlatformCameraPosition : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithBearing:(double)bearing - target:(FGMPlatformLatLng *)target - tilt:(double)tilt - zoom:(double)zoom; -@property(nonatomic, assign) double bearing; -@property(nonatomic, strong) FGMPlatformLatLng *target; -@property(nonatomic, assign) double tilt; -@property(nonatomic, assign) double zoom; -@end - -/// Pigeon representation of a CameraUpdate. -@interface FGMPlatformCameraUpdate : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithCameraUpdate:(id)cameraUpdate; -/// This Object must be one of the classes below prefixed with -/// PlatformCameraUpdate. Each such class represents a different type of -/// camera update, and each holds a different set of data, preventing the -/// use of a single unified class. -@property(nonatomic, strong) id cameraUpdate; -@end - -/// Pigeon equivalent of NewCameraPosition -@interface FGMPlatformCameraUpdateNewCameraPosition : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithCameraPosition:(FGMPlatformCameraPosition *)cameraPosition; -@property(nonatomic, strong) FGMPlatformCameraPosition *cameraPosition; -@end - -/// Pigeon equivalent of NewLatLng -@interface FGMPlatformCameraUpdateNewLatLng : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithLatLng:(FGMPlatformLatLng *)latLng; -@property(nonatomic, strong) FGMPlatformLatLng *latLng; -@end - -/// Pigeon equivalent of NewLatLngBounds -@interface FGMPlatformCameraUpdateNewLatLngBounds : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithBounds:(FGMPlatformLatLngBounds *)bounds padding:(double)padding; -@property(nonatomic, strong) FGMPlatformLatLngBounds *bounds; -@property(nonatomic, assign) double padding; -@end - -/// Pigeon equivalent of NewLatLngZoom -@interface FGMPlatformCameraUpdateNewLatLngZoom : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithLatLng:(FGMPlatformLatLng *)latLng zoom:(double)zoom; -@property(nonatomic, strong) FGMPlatformLatLng *latLng; -@property(nonatomic, assign) double zoom; -@end - -/// Pigeon equivalent of ScrollBy -@interface FGMPlatformCameraUpdateScrollBy : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithDx:(double)dx dy:(double)dy; -@property(nonatomic, assign) double dx; -@property(nonatomic, assign) double dy; -@end - -/// Pigeon equivalent of ZoomBy -@interface FGMPlatformCameraUpdateZoomBy : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithAmount:(double)amount focus:(nullable FGMPlatformPoint *)focus; -@property(nonatomic, assign) double amount; -@property(nonatomic, strong, nullable) FGMPlatformPoint *focus; -@end - -/// Pigeon equivalent of ZoomIn/ZoomOut -@interface FGMPlatformCameraUpdateZoom : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithOut:(BOOL)out; -@property(nonatomic, assign) BOOL out; -@end - -/// Pigeon equivalent of ZoomTo -@interface FGMPlatformCameraUpdateZoomTo : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithZoom:(double)zoom; -@property(nonatomic, assign) double zoom; -@end - -/// Pigeon equivalent of the Circle class. -@interface FGMPlatformCircle : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithConsumeTapEvents:(BOOL)consumeTapEvents - fillColor:(FGMPlatformColor *)fillColor - strokeColor:(FGMPlatformColor *)strokeColor - visible:(BOOL)visible - strokeWidth:(NSInteger)strokeWidth - zIndex:(double)zIndex - center:(FGMPlatformLatLng *)center - radius:(double)radius - circleId:(NSString *)circleId; -@property(nonatomic, assign) BOOL consumeTapEvents; -@property(nonatomic, strong) FGMPlatformColor *fillColor; -@property(nonatomic, strong) FGMPlatformColor *strokeColor; -@property(nonatomic, assign) BOOL visible; -@property(nonatomic, assign) NSInteger strokeWidth; -@property(nonatomic, assign) double zIndex; -@property(nonatomic, strong) FGMPlatformLatLng *center; -@property(nonatomic, assign) double radius; -@property(nonatomic, copy) NSString *circleId; -@end - -/// Pigeon equivalent of the Heatmap class. -@interface FGMPlatformHeatmap : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithHeatmapId:(NSString *)heatmapId - data:(NSArray *)data - gradient:(nullable FGMPlatformHeatmapGradient *)gradient - opacity:(double)opacity - radius:(NSInteger)radius - minimumZoomIntensity:(NSInteger)minimumZoomIntensity - maximumZoomIntensity:(NSInteger)maximumZoomIntensity; -@property(nonatomic, copy) NSString *heatmapId; -@property(nonatomic, copy) NSArray *data; -@property(nonatomic, strong, nullable) FGMPlatformHeatmapGradient *gradient; -@property(nonatomic, assign) double opacity; -@property(nonatomic, assign) NSInteger radius; -@property(nonatomic, assign) NSInteger minimumZoomIntensity; -@property(nonatomic, assign) NSInteger maximumZoomIntensity; -@end - -/// Pigeon equivalent of the HeatmapGradient class. -/// -/// The GMUGradient structure is slightly different from HeatmapGradient, so -/// this matches the iOS API so that conversion can be done on the Dart side -/// where the structures are easier to work with. -@interface FGMPlatformHeatmapGradient : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithColors:(NSArray *)colors - startPoints:(NSArray *)startPoints - colorMapSize:(NSInteger)colorMapSize; -@property(nonatomic, copy) NSArray *colors; -@property(nonatomic, copy) NSArray *startPoints; -@property(nonatomic, assign) NSInteger colorMapSize; -@end - -/// Pigeon equivalent of the WeightedLatLng class. -@interface FGMPlatformWeightedLatLng : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithPoint:(FGMPlatformLatLng *)point weight:(double)weight; -@property(nonatomic, strong) FGMPlatformLatLng *point; -@property(nonatomic, assign) double weight; -@end - -/// Pigeon equivalent of the InfoWindow class. -@interface FGMPlatformInfoWindow : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithTitle:(nullable NSString *)title - snippet:(nullable NSString *)snippet - anchor:(FGMPlatformPoint *)anchor; -@property(nonatomic, copy, nullable) NSString *title; -@property(nonatomic, copy, nullable) NSString *snippet; -@property(nonatomic, strong) FGMPlatformPoint *anchor; -@end - -/// Pigeon equivalent of Cluster. -@interface FGMPlatformCluster : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithClusterManagerId:(NSString *)clusterManagerId - position:(FGMPlatformLatLng *)position - bounds:(FGMPlatformLatLngBounds *)bounds - markerIds:(NSArray *)markerIds; -@property(nonatomic, copy) NSString *clusterManagerId; -@property(nonatomic, strong) FGMPlatformLatLng *position; -@property(nonatomic, strong) FGMPlatformLatLngBounds *bounds; -@property(nonatomic, copy) NSArray *markerIds; -@end - -/// Pigeon equivalent of the ClusterManager class. -@interface FGMPlatformClusterManager : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithIdentifier:(NSString *)identifier; -@property(nonatomic, copy) NSString *identifier; -@end - -/// Pigeon equivalent of the Marker class. -@interface FGMPlatformMarker : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithAlpha:(double)alpha - anchor:(FGMPlatformPoint *)anchor - consumeTapEvents:(BOOL)consumeTapEvents - draggable:(BOOL)draggable - flat:(BOOL)flat - icon:(FGMPlatformBitmap *)icon - infoWindow:(FGMPlatformInfoWindow *)infoWindow - position:(FGMPlatformLatLng *)position - rotation:(double)rotation - visible:(BOOL)visible - zIndex:(NSInteger)zIndex - markerId:(NSString *)markerId - clusterManagerId:(nullable NSString *)clusterManagerId - collisionBehavior:(nullable FGMPlatformMarkerCollisionBehaviorBox *)collisionBehavior; -@property(nonatomic, assign) double alpha; -@property(nonatomic, strong) FGMPlatformPoint *anchor; -@property(nonatomic, assign) BOOL consumeTapEvents; -@property(nonatomic, assign) BOOL draggable; -@property(nonatomic, assign) BOOL flat; -@property(nonatomic, strong) FGMPlatformBitmap *icon; -@property(nonatomic, strong) FGMPlatformInfoWindow *infoWindow; -@property(nonatomic, strong) FGMPlatformLatLng *position; -@property(nonatomic, assign) double rotation; -@property(nonatomic, assign) BOOL visible; -@property(nonatomic, assign) NSInteger zIndex; -@property(nonatomic, copy) NSString *markerId; -@property(nonatomic, copy, nullable) NSString *clusterManagerId; -@property(nonatomic, strong, nullable) FGMPlatformMarkerCollisionBehaviorBox *collisionBehavior; -@end - -/// Pigeon equivalent of the Polygon class. -@interface FGMPlatformPolygon : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithPolygonId:(NSString *)polygonId - consumesTapEvents:(BOOL)consumesTapEvents - fillColor:(FGMPlatformColor *)fillColor - geodesic:(BOOL)geodesic - points:(NSArray *)points - holes:(NSArray *> *)holes - visible:(BOOL)visible - strokeColor:(FGMPlatformColor *)strokeColor - strokeWidth:(NSInteger)strokeWidth - zIndex:(NSInteger)zIndex; -@property(nonatomic, copy) NSString *polygonId; -@property(nonatomic, assign) BOOL consumesTapEvents; -@property(nonatomic, strong) FGMPlatformColor *fillColor; -@property(nonatomic, assign) BOOL geodesic; -@property(nonatomic, copy) NSArray *points; -@property(nonatomic, copy) NSArray *> *holes; -@property(nonatomic, assign) BOOL visible; -@property(nonatomic, strong) FGMPlatformColor *strokeColor; -@property(nonatomic, assign) NSInteger strokeWidth; -@property(nonatomic, assign) NSInteger zIndex; -@end - -/// Pigeon equivalent of the Polyline class. -@interface FGMPlatformPolyline : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithPolylineId:(NSString *)polylineId - consumesTapEvents:(BOOL)consumesTapEvents - color:(FGMPlatformColor *)color - geodesic:(BOOL)geodesic - jointType:(FGMPlatformJointType)jointType - patterns:(NSArray *)patterns - points:(NSArray *)points - visible:(BOOL)visible - width:(NSInteger)width - zIndex:(NSInteger)zIndex; -@property(nonatomic, copy) NSString *polylineId; -@property(nonatomic, assign) BOOL consumesTapEvents; -@property(nonatomic, strong) FGMPlatformColor *color; -@property(nonatomic, assign) BOOL geodesic; -/// The joint type. -@property(nonatomic, assign) FGMPlatformJointType jointType; -/// The pattern data, as a list of pattern items. -@property(nonatomic, copy) NSArray *patterns; -@property(nonatomic, copy) NSArray *points; -@property(nonatomic, assign) BOOL visible; -@property(nonatomic, assign) NSInteger width; -@property(nonatomic, assign) NSInteger zIndex; -@end - -/// Pigeon equivalent of the PatternItem class. -@interface FGMPlatformPatternItem : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithType:(FGMPlatformPatternItemType)type length:(nullable NSNumber *)length; -@property(nonatomic, assign) FGMPlatformPatternItemType type; -@property(nonatomic, strong, nullable) NSNumber *length; -@end - -/// Pigeon equivalent of the Tile class. -@interface FGMPlatformTile : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithWidth:(NSInteger)width - height:(NSInteger)height - data:(nullable FlutterStandardTypedData *)data; -@property(nonatomic, assign) NSInteger width; -@property(nonatomic, assign) NSInteger height; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *data; -@end - -/// Pigeon equivalent of the TileOverlay class. -@interface FGMPlatformTileOverlay : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithTileOverlayId:(NSString *)tileOverlayId - fadeIn:(BOOL)fadeIn - transparency:(double)transparency - zIndex:(NSInteger)zIndex - visible:(BOOL)visible - tileSize:(NSInteger)tileSize; -@property(nonatomic, copy) NSString *tileOverlayId; -@property(nonatomic, assign) BOOL fadeIn; -@property(nonatomic, assign) double transparency; -@property(nonatomic, assign) NSInteger zIndex; -@property(nonatomic, assign) BOOL visible; -@property(nonatomic, assign) NSInteger tileSize; -@end - -/// Pigeon equivalent of Flutter's EdgeInsets. -@interface FGMPlatformEdgeInsets : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithTop:(double)top bottom:(double)bottom left:(double)left right:(double)right; -@property(nonatomic, assign) double top; -@property(nonatomic, assign) double bottom; -@property(nonatomic, assign) double left; -@property(nonatomic, assign) double right; -@end - -/// Pigeon equivalent of LatLng. -@interface FGMPlatformLatLng : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithLatitude:(double)latitude longitude:(double)longitude; -@property(nonatomic, assign) double latitude; -@property(nonatomic, assign) double longitude; -@end - -/// Pigeon equivalent of LatLngBounds. -@interface FGMPlatformLatLngBounds : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithNortheast:(FGMPlatformLatLng *)northeast - southwest:(FGMPlatformLatLng *)southwest; -@property(nonatomic, strong) FGMPlatformLatLng *northeast; -@property(nonatomic, strong) FGMPlatformLatLng *southwest; -@end - -/// Pigeon equivalent of CameraTargetBounds. -/// -/// As with the Dart version, it exists to distinguish between not setting a -/// a target, and having an explicitly unbounded target (null [bounds]). -@interface FGMPlatformCameraTargetBounds : NSObject -+ (instancetype)makeWithBounds:(nullable FGMPlatformLatLngBounds *)bounds; -@property(nonatomic, strong, nullable) FGMPlatformLatLngBounds *bounds; -@end - -/// Pigeon equivalent of the GroundOverlay class. -@interface FGMPlatformGroundOverlay : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithGroundOverlayId:(NSString *)groundOverlayId - image:(FGMPlatformBitmap *)image - position:(nullable FGMPlatformLatLng *)position - bounds:(nullable FGMPlatformLatLngBounds *)bounds - anchor:(nullable FGMPlatformPoint *)anchor - transparency:(double)transparency - bearing:(double)bearing - zIndex:(NSInteger)zIndex - visible:(BOOL)visible - clickable:(BOOL)clickable - zoomLevel:(nullable NSNumber *)zoomLevel; -@property(nonatomic, copy) NSString *groundOverlayId; -@property(nonatomic, strong) FGMPlatformBitmap *image; -@property(nonatomic, strong, nullable) FGMPlatformLatLng *position; -@property(nonatomic, strong, nullable) FGMPlatformLatLngBounds *bounds; -@property(nonatomic, strong, nullable) FGMPlatformPoint *anchor; -@property(nonatomic, assign) double transparency; -@property(nonatomic, assign) double bearing; -@property(nonatomic, assign) NSInteger zIndex; -@property(nonatomic, assign) BOOL visible; -@property(nonatomic, assign) BOOL clickable; -@property(nonatomic, strong, nullable) NSNumber *zoomLevel; -@end - -/// Information passed to the platform view creation. -@interface FGMPlatformMapViewCreationParams : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype) - makeWithInitialCameraPosition:(FGMPlatformCameraPosition *)initialCameraPosition - mapConfiguration:(FGMPlatformMapConfiguration *)mapConfiguration - initialCircles:(NSArray *)initialCircles - initialMarkers:(NSArray *)initialMarkers - initialPolygons:(NSArray *)initialPolygons - initialPolylines:(NSArray *)initialPolylines - initialHeatmaps:(NSArray *)initialHeatmaps - initialTileOverlays:(NSArray *)initialTileOverlays - initialClusterManagers:(NSArray *)initialClusterManagers - initialGroundOverlays:(NSArray *)initialGroundOverlays; -@property(nonatomic, strong) FGMPlatformCameraPosition *initialCameraPosition; -@property(nonatomic, strong) FGMPlatformMapConfiguration *mapConfiguration; -@property(nonatomic, copy) NSArray *initialCircles; -@property(nonatomic, copy) NSArray *initialMarkers; -@property(nonatomic, copy) NSArray *initialPolygons; -@property(nonatomic, copy) NSArray *initialPolylines; -@property(nonatomic, copy) NSArray *initialHeatmaps; -@property(nonatomic, copy) NSArray *initialTileOverlays; -@property(nonatomic, copy) NSArray *initialClusterManagers; -@property(nonatomic, copy) NSArray *initialGroundOverlays; -@end - -/// Pigeon equivalent of MapConfiguration. -@interface FGMPlatformMapConfiguration : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithCompassEnabled:(nullable NSNumber *)compassEnabled - cameraTargetBounds:(nullable FGMPlatformCameraTargetBounds *)cameraTargetBounds - mapType:(nullable FGMPlatformMapTypeBox *)mapType - minMaxZoomPreference:(nullable FGMPlatformZoomRange *)minMaxZoomPreference - rotateGesturesEnabled:(nullable NSNumber *)rotateGesturesEnabled - scrollGesturesEnabled:(nullable NSNumber *)scrollGesturesEnabled - tiltGesturesEnabled:(nullable NSNumber *)tiltGesturesEnabled - trackCameraPosition:(nullable NSNumber *)trackCameraPosition - zoomGesturesEnabled:(nullable NSNumber *)zoomGesturesEnabled - myLocationEnabled:(nullable NSNumber *)myLocationEnabled - myLocationButtonEnabled:(nullable NSNumber *)myLocationButtonEnabled - padding:(nullable FGMPlatformEdgeInsets *)padding - indoorViewEnabled:(nullable NSNumber *)indoorViewEnabled - trafficEnabled:(nullable NSNumber *)trafficEnabled - buildingsEnabled:(nullable NSNumber *)buildingsEnabled - markerType:(FGMPlatformMarkerType)markerType - mapId:(nullable NSString *)mapId - style:(nullable NSString *)style; -@property(nonatomic, strong, nullable) NSNumber *compassEnabled; -@property(nonatomic, strong, nullable) FGMPlatformCameraTargetBounds *cameraTargetBounds; -@property(nonatomic, strong, nullable) FGMPlatformMapTypeBox *mapType; -@property(nonatomic, strong, nullable) FGMPlatformZoomRange *minMaxZoomPreference; -@property(nonatomic, strong, nullable) NSNumber *rotateGesturesEnabled; -@property(nonatomic, strong, nullable) NSNumber *scrollGesturesEnabled; -@property(nonatomic, strong, nullable) NSNumber *tiltGesturesEnabled; -@property(nonatomic, strong, nullable) NSNumber *trackCameraPosition; -@property(nonatomic, strong, nullable) NSNumber *zoomGesturesEnabled; -@property(nonatomic, strong, nullable) NSNumber *myLocationEnabled; -@property(nonatomic, strong, nullable) NSNumber *myLocationButtonEnabled; -@property(nonatomic, strong, nullable) FGMPlatformEdgeInsets *padding; -@property(nonatomic, strong, nullable) NSNumber *indoorViewEnabled; -@property(nonatomic, strong, nullable) NSNumber *trafficEnabled; -@property(nonatomic, strong, nullable) NSNumber *buildingsEnabled; -@property(nonatomic, assign) FGMPlatformMarkerType markerType; -@property(nonatomic, copy, nullable) NSString *mapId; -@property(nonatomic, copy, nullable) NSString *style; -@end - -/// Pigeon representation of an x,y coordinate. -@interface FGMPlatformPoint : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithX:(double)x y:(double)y; -@property(nonatomic, assign) double x; -@property(nonatomic, assign) double y; -@end - -/// Pigeon representation of a size. -@interface FGMPlatformSize : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithWidth:(double)width height:(double)height; -@property(nonatomic, assign) double width; -@property(nonatomic, assign) double height; -@end - -/// Pigeon representation of a color. -@interface FGMPlatformColor : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithRed:(double)red green:(double)green blue:(double)blue alpha:(double)alpha; -@property(nonatomic, assign) double red; -@property(nonatomic, assign) double green; -@property(nonatomic, assign) double blue; -@property(nonatomic, assign) double alpha; -@end - -/// Pigeon equivalent of GMSTileLayer properties. -@interface FGMPlatformTileLayer : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithVisible:(BOOL)visible - fadeIn:(BOOL)fadeIn - opacity:(double)opacity - zIndex:(NSInteger)zIndex; -@property(nonatomic, assign) BOOL visible; -@property(nonatomic, assign) BOOL fadeIn; -@property(nonatomic, assign) double opacity; -@property(nonatomic, assign) NSInteger zIndex; -@end - -/// Pigeon equivalent of MinMaxZoomPreference. -@interface FGMPlatformZoomRange : NSObject -+ (instancetype)makeWithMin:(nullable NSNumber *)min max:(nullable NSNumber *)max; -@property(nonatomic, strong, nullable) NSNumber *min; -@property(nonatomic, strong, nullable) NSNumber *max; -@end - -/// Pigeon equivalent of [BitmapDescriptor]. As there are multiple disjoint -/// types of [BitmapDescriptor], [PlatformBitmap] contains a single field which -/// may hold the pigeon equivalent type of any of them. -@interface FGMPlatformBitmap : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithBitmap:(id)bitmap; -/// One of [PlatformBitmapAssetMap], [PlatformBitmapAsset], -/// [PlatformBitmapAssetImage], [PlatformBitmapBytesMap], -/// [PlatformBitmapBytes], or [PlatformBitmapDefaultMarker]. -/// As Pigeon does not currently support data class inheritance, this -/// approach allows for the different bitmap implementations to be valid -/// argument and return types of the API methods. See -/// https://github.com/flutter/flutter/issues/117819. -@property(nonatomic, strong) id bitmap; -@end - -/// Pigeon equivalent of [DefaultMarker]. -@interface FGMPlatformBitmapDefaultMarker : NSObject -+ (instancetype)makeWithHue:(nullable NSNumber *)hue; -@property(nonatomic, strong, nullable) NSNumber *hue; -@end - -/// Pigeon equivalent of [BytesBitmap]. -@interface FGMPlatformBitmapBytes : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithByteData:(FlutterStandardTypedData *)byteData - size:(nullable FGMPlatformSize *)size; -@property(nonatomic, strong) FlutterStandardTypedData *byteData; -@property(nonatomic, strong, nullable) FGMPlatformSize *size; -@end - -/// Pigeon equivalent of [AssetBitmap]. -@interface FGMPlatformBitmapAsset : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithName:(NSString *)name pkg:(nullable NSString *)pkg; -@property(nonatomic, copy) NSString *name; -@property(nonatomic, copy, nullable) NSString *pkg; -@end - -/// Pigeon equivalent of [AssetImageBitmap]. -@interface FGMPlatformBitmapAssetImage : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithName:(NSString *)name - scale:(double)scale - size:(nullable FGMPlatformSize *)size; -@property(nonatomic, copy) NSString *name; -@property(nonatomic, assign) double scale; -@property(nonatomic, strong, nullable) FGMPlatformSize *size; -@end - -/// Pigeon equivalent of [AssetMapBitmap]. -@interface FGMPlatformBitmapAssetMap : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithAssetName:(NSString *)assetName - bitmapScaling:(FGMPlatformMapBitmapScaling)bitmapScaling - imagePixelRatio:(double)imagePixelRatio - width:(nullable NSNumber *)width - height:(nullable NSNumber *)height; -@property(nonatomic, copy) NSString *assetName; -@property(nonatomic, assign) FGMPlatformMapBitmapScaling bitmapScaling; -@property(nonatomic, assign) double imagePixelRatio; -@property(nonatomic, strong, nullable) NSNumber *width; -@property(nonatomic, strong, nullable) NSNumber *height; -@end - -/// Pigeon equivalent of [BytesMapBitmap]. -@interface FGMPlatformBitmapBytesMap : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithByteData:(FlutterStandardTypedData *)byteData - bitmapScaling:(FGMPlatformMapBitmapScaling)bitmapScaling - imagePixelRatio:(double)imagePixelRatio - width:(nullable NSNumber *)width - height:(nullable NSNumber *)height; -@property(nonatomic, strong) FlutterStandardTypedData *byteData; -@property(nonatomic, assign) FGMPlatformMapBitmapScaling bitmapScaling; -@property(nonatomic, assign) double imagePixelRatio; -@property(nonatomic, strong, nullable) NSNumber *width; -@property(nonatomic, strong, nullable) NSNumber *height; -@end - -/// Pigeon equivalent of [PinConfig]. -@interface FGMPlatformBitmapPinConfig : NSObject -+ (instancetype)makeWithBackgroundColor:(nullable FGMPlatformColor *)backgroundColor - borderColor:(nullable FGMPlatformColor *)borderColor - glyphColor:(nullable FGMPlatformColor *)glyphColor - glyphTextColor:(nullable FGMPlatformColor *)glyphTextColor - glyphText:(nullable NSString *)glyphText - glyphBitmap:(nullable FGMPlatformBitmap *)glyphBitmap; -@property(nonatomic, strong, nullable) FGMPlatformColor *backgroundColor; -@property(nonatomic, strong, nullable) FGMPlatformColor *borderColor; -@property(nonatomic, strong, nullable) FGMPlatformColor *glyphColor; -@property(nonatomic, strong, nullable) FGMPlatformColor *glyphTextColor; -@property(nonatomic, copy, nullable) NSString *glyphText; -@property(nonatomic, strong, nullable) FGMPlatformBitmap *glyphBitmap; -@end - -/// The codec used by all APIs. -NSObject *FGMGetGoogleMapsFlutterPigeonMessagesCodec(void); - -/// Interface for non-test interactions with the native SDK. -/// -/// For test-only state queries, see [MapsInspectorApi]. -@protocol FGMMapsApi -/// Returns once the map instance is available. -- (void)waitForMapWithError:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the map's configuration options. -/// -/// Only non-null configuration values will result in updates; options with -/// null values will remain unchanged. -- (void)updateWithMapConfiguration:(FGMPlatformMapConfiguration *)configuration - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of circles on the map. -- (void)updateCirclesByAdding:(NSArray *)toAdd - changing:(NSArray *)toChange - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of heatmaps on the map. -- (void)updateHeatmapsByAdding:(NSArray *)toAdd - changing:(NSArray *)toChange - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of custer managers for clusters on the map. -- (void)updateClusterManagersByAdding:(NSArray *)toAdd - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of markers on the map. -- (void)updateMarkersByAdding:(NSArray *)toAdd - changing:(NSArray *)toChange - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of polygonss on the map. -- (void)updatePolygonsByAdding:(NSArray *)toAdd - changing:(NSArray *)toChange - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of polylines on the map. -- (void)updatePolylinesByAdding:(NSArray *)toAdd - changing:(NSArray *)toChange - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of tile overlays on the map. -- (void)updateTileOverlaysByAdding:(NSArray *)toAdd - changing:(NSArray *)toChange - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of ground overlays on the map. -- (void)updateGroundOverlaysByAdding:(NSArray *)toAdd - changing:(NSArray *)toChange - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Gets the screen coordinate for the given map location. -/// -/// @return `nil` only when `error != nil`. -- (nullable FGMPlatformPoint *)screenCoordinatesForLatLng:(FGMPlatformLatLng *)latLng - error:(FlutterError *_Nullable *_Nonnull)error; -/// Gets the map location for the given screen coordinate. -/// -/// @return `nil` only when `error != nil`. -- (nullable FGMPlatformLatLng *)latLngForScreenCoordinate:(FGMPlatformPoint *)screenCoordinate - error:(FlutterError *_Nullable *_Nonnull)error; -/// Gets the map region currently displayed on the map. -/// -/// @return `nil` only when `error != nil`. -- (nullable FGMPlatformLatLngBounds *)visibleMapRegion:(FlutterError *_Nullable *_Nonnull)error; -/// Moves the camera according to [cameraUpdate] immediately, with no -/// animation. -- (void)moveCameraWithUpdate:(FGMPlatformCameraUpdate *)cameraUpdate - error:(FlutterError *_Nullable *_Nonnull)error; -/// Moves the camera according to [cameraUpdate], animating the update using a -/// duration in milliseconds if provided. -- (void)animateCameraWithUpdate:(FGMPlatformCameraUpdate *)cameraUpdate - duration:(nullable NSNumber *)durationMilliseconds - error:(FlutterError *_Nullable *_Nonnull)error; -/// Gets the current map zoom level. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)currentZoomLevel:(FlutterError *_Nullable *_Nonnull)error; -/// Show the info window for the marker with the given ID. -- (void)showInfoWindowForMarkerWithIdentifier:(NSString *)markerId - error:(FlutterError *_Nullable *_Nonnull)error; -/// Hide the info window for the marker with the given ID. -- (void)hideInfoWindowForMarkerWithIdentifier:(NSString *)markerId - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns true if the marker with the given ID is currently displaying its -/// info window. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *) - isShowingInfoWindowForMarkerWithIdentifier:(NSString *)markerId - error:(FlutterError *_Nullable *_Nonnull)error; -/// Sets the style to the given map style string, where an empty string -/// indicates that the style should be cleared. -/// -/// If there was an error setting the style, such as an invalid style string, -/// returns the error message. -- (nullable NSString *)setStyle:(NSString *)style error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the error string from the last attempt to set the map style, if -/// any. -/// -/// This allows checking asynchronously for initial style failures, as there -/// is no way to return failures from map initialization. -- (nullable NSString *)lastStyleError:(FlutterError *_Nullable *_Nonnull)error; -/// Clears the cache of tiles previously requseted from the tile provider. -- (void)clearTileCacheForOverlayWithIdentifier:(NSString *)tileOverlayId - error:(FlutterError *_Nullable *_Nonnull)error; -/// Takes a snapshot of the map and returns its image data. -- (nullable FlutterStandardTypedData *)takeSnapshotWithError: - (FlutterError *_Nullable *_Nonnull)error; -/// Returns true if the map supports advanced markers. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)isAdvancedMarkersAvailable:(FlutterError *_Nullable *_Nonnull)error; -@end - -extern void SetUpFGMMapsApi(id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFGMMapsApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); - -/// Interface for calls from the native SDK to Dart. -@interface FGMMapsCallbackApi : NSObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix; -/// Called when the map camera starts moving. -- (void)didStartCameraMoveWithCompletion:(void (^)(FlutterError *_Nullable))completion; -/// Called when the map camera moves. -- (void)didMoveCameraToPosition:(FGMPlatformCameraPosition *)cameraPosition - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when the map camera stops moving. -- (void)didIdleCameraWithCompletion:(void (^)(FlutterError *_Nullable))completion; -/// Called when the map, not a specifc map object, is tapped. -- (void)didTapAtPosition:(FGMPlatformLatLng *)position - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when the map, not a specifc map object, is long pressed. -- (void)didLongPressAtPosition:(FGMPlatformLatLng *)position - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a marker is tapped. -- (void)didTapMarkerWithIdentifier:(NSString *)markerId - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a marker drag starts. -- (void)didStartDragForMarkerWithIdentifier:(NSString *)markerId - atPosition:(FGMPlatformLatLng *)position - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a marker drag updates. -- (void)didDragMarkerWithIdentifier:(NSString *)markerId - atPosition:(FGMPlatformLatLng *)position - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a marker drag ends. -- (void)didEndDragForMarkerWithIdentifier:(NSString *)markerId - atPosition:(FGMPlatformLatLng *)position - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a marker's info window is tapped. -- (void)didTapInfoWindowOfMarkerWithIdentifier:(NSString *)markerId - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a circle is tapped. -- (void)didTapCircleWithIdentifier:(NSString *)circleId - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a marker cluster is tapped. -- (void)didTapCluster:(FGMPlatformCluster *)cluster - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a polygon is tapped. -- (void)didTapPolygonWithIdentifier:(NSString *)polygonId - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a polyline is tapped. -- (void)didTapPolylineWithIdentifier:(NSString *)polylineId - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a ground overlay is tapped. -- (void)didTapGroundOverlayWithIdentifier:(NSString *)groundOverlayId - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called to get data for a map tile. -- (void)tileWithOverlayIdentifier:(NSString *)tileOverlayId - location:(FGMPlatformPoint *)location - zoom:(NSInteger)zoom - completion:(void (^)(FGMPlatformTile *_Nullable, - FlutterError *_Nullable))completion; -@end - -/// Dummy interface to force generation of the platform view creation params, -/// which are not used in any Pigeon calls, only the platform view creation -/// call made internally by Flutter. -@protocol FGMMapsPlatformViewApi -- (void)createViewType:(nullable FGMPlatformMapViewCreationParams *)type - error:(FlutterError *_Nullable *_Nonnull)error; -@end - -extern void SetUpFGMMapsPlatformViewApi(id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFGMMapsPlatformViewApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); - -/// Inspector API only intended for use in integration tests. -@protocol FGMMapsInspectorApi -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)areBuildingsEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)areRotateGesturesEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)areScrollGesturesEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)areTiltGesturesEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)areZoomGesturesEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)isCompassEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)isMyLocationButtonEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)isTrafficEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -- (nullable FGMPlatformTileLayer *)tileOverlayWithIdentifier:(NSString *)tileOverlayId - error: - (FlutterError *_Nullable *_Nonnull)error; -- (nullable FGMPlatformGroundOverlay *) - groundOverlayWithIdentifier:(NSString *)groundOverlayId - error:(FlutterError *_Nullable *_Nonnull)error; -- (nullable FGMPlatformHeatmap *)heatmapWithIdentifier:(NSString *)heatmapId - error:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable FGMPlatformZoomRange *)zoomRange:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSArray *) - clustersWithIdentifier:(NSString *)clusterManagerId - error:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable FGMPlatformCameraPosition *)cameraPosition:(FlutterError *_Nullable *_Nonnull)error; -@end - -extern void SetUpFGMMapsInspectorApi(id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFGMMapsInspectorApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); - -NS_ASSUME_NONNULL_END diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/pigeons/messages.dart b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/pigeons/messages.dart index ff2d091e429b..eee6b03f7fa6 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/pigeons/messages.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/pigeons/messages.dart @@ -7,14 +7,8 @@ import 'package:pigeon/pigeon.dart'; @ConfigurePigeon( PigeonOptions( dartOut: 'lib/src/messages.g.dart', - // This uses a different output name to avoid conflicts with the pigeon - // files in other packages, without having to use full relative paths - // in #includes (which would make source sharing harder to manage). - objcHeaderOut: - 'ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/google_maps_flutter_ios_sdk9_objc/google_maps_flutter_pigeon_messages.g.h', - objcSourceOut: - 'ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/google_maps_flutter_pigeon_messages.g.m', - objcOptions: ObjcOptions(prefix: 'FGM'), + swiftOut: + 'ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/Messages.g.swift', copyrightHeader: 'pigeons/copyright.txt', // Use the base package name so that the generated code can be shared // across the implementation copies. @@ -655,11 +649,11 @@ abstract class MapsApi { /// /// Only non-null configuration values will result in updates; options with /// null values will remain unchanged. - @ObjCSelector('updateWithMapConfiguration:') + @SwiftFunction('updateWithMapConfiguration(_:)') void updateMapConfiguration(PlatformMapConfiguration configuration); /// Updates the set of circles on the map. - @ObjCSelector('updateCirclesByAdding:changing:removing:') + @SwiftFunction('updateCircles(adding:changing:removing:)') void updateCircles( List toAdd, List toChange, @@ -667,7 +661,7 @@ abstract class MapsApi { ); /// Updates the set of heatmaps on the map. - @ObjCSelector('updateHeatmapsByAdding:changing:removing:') + @SwiftFunction('updateHeatmaps(adding:changing:removing:)') void updateHeatmaps( List toAdd, List toChange, @@ -675,11 +669,11 @@ abstract class MapsApi { ); /// Updates the set of custer managers for clusters on the map. - @ObjCSelector('updateClusterManagersByAdding:removing:') + @SwiftFunction('updateClusterManagers(adding:removing:)') void updateClusterManagers(List toAdd, List idsToRemove); /// Updates the set of markers on the map. - @ObjCSelector('updateMarkersByAdding:changing:removing:') + @SwiftFunction('updateMarkers(adding:changing:removing:)') void updateMarkers( List toAdd, List toChange, @@ -687,7 +681,7 @@ abstract class MapsApi { ); /// Updates the set of polygonss on the map. - @ObjCSelector('updatePolygonsByAdding:changing:removing:') + @SwiftFunction('updatePolygons(adding:changing:removing:)') void updatePolygons( List toAdd, List toChange, @@ -695,7 +689,7 @@ abstract class MapsApi { ); /// Updates the set of polylines on the map. - @ObjCSelector('updatePolylinesByAdding:changing:removing:') + @SwiftFunction('updatePolylines(adding:changing:removing:)') void updatePolylines( List toAdd, List toChange, @@ -703,7 +697,7 @@ abstract class MapsApi { ); /// Updates the set of tile overlays on the map. - @ObjCSelector('updateTileOverlaysByAdding:changing:removing:') + @SwiftFunction('updateTileOverlays(adding:changing:removing:)') void updateTileOverlays( List toAdd, List toChange, @@ -711,7 +705,7 @@ abstract class MapsApi { ); /// Updates the set of ground overlays on the map. - @ObjCSelector('updateGroundOverlaysByAdding:changing:removing:') + @SwiftFunction('updateGroundOverlays(adding:changing:removing:)') void updateGroundOverlays( List toAdd, List toChange, @@ -719,42 +713,42 @@ abstract class MapsApi { ); /// Gets the screen coordinate for the given map location. - @ObjCSelector('screenCoordinatesForLatLng:') + @SwiftFunction('screenCoordinates(for:)') PlatformPoint getScreenCoordinate(PlatformLatLng latLng); /// Gets the map location for the given screen coordinate. - @ObjCSelector('latLngForScreenCoordinate:') + @SwiftFunction('latLng(for:)') PlatformLatLng getLatLng(PlatformPoint screenCoordinate); /// Gets the map region currently displayed on the map. - @ObjCSelector('visibleMapRegion') + @SwiftFunction('visibleMapRegion()') PlatformLatLngBounds getVisibleRegion(); /// Moves the camera according to [cameraUpdate] immediately, with no /// animation. - @ObjCSelector('moveCameraWithUpdate:') + @SwiftFunction('moveCamera(_:)') void moveCamera(PlatformCameraUpdate cameraUpdate); /// Moves the camera according to [cameraUpdate], animating the update using a /// duration in milliseconds if provided. - @ObjCSelector('animateCameraWithUpdate:duration:') + @SwiftFunction('animateCamera(_:duration:)') void animateCamera(PlatformCameraUpdate cameraUpdate, int? durationMilliseconds); /// Gets the current map zoom level. - @ObjCSelector('currentZoomLevel') + @SwiftFunction('zoomLevel()') double getZoomLevel(); /// Show the info window for the marker with the given ID. - @ObjCSelector('showInfoWindowForMarkerWithIdentifier:') + @SwiftFunction('showInfoWindowForMarker(withIdentifier:)') void showInfoWindow(String markerId); /// Hide the info window for the marker with the given ID. - @ObjCSelector('hideInfoWindowForMarkerWithIdentifier:') + @SwiftFunction('hideInfoWindowForMarker(withIdentifier:)') void hideInfoWindow(String markerId); /// Returns true if the marker with the given ID is currently displaying its /// info window. - @ObjCSelector('isShowingInfoWindowForMarkerWithIdentifier:') + @SwiftFunction('isShowingInfoWindowForMarker(withIdentifier:)') bool isInfoWindowShown(String markerId); /// Sets the style to the given map style string, where an empty string @@ -762,7 +756,7 @@ abstract class MapsApi { /// /// If there was an error setting the style, such as an invalid style string, /// returns the error message. - @ObjCSelector('setStyle:') + @SwiftFunction('setStyle(_:)') String? setStyle(String style); /// Returns the error string from the last attempt to set the map style, if @@ -770,18 +764,18 @@ abstract class MapsApi { /// /// This allows checking asynchronously for initial style failures, as there /// is no way to return failures from map initialization. - @ObjCSelector('lastStyleError') + @SwiftFunction('lastStyleError()') String? getLastStyleError(); /// Clears the cache of tiles previously requseted from the tile provider. - @ObjCSelector('clearTileCacheForOverlayWithIdentifier:') + @SwiftFunction('clearTileCacheForOverlay(withIdentifier:)') void clearTileCache(String tileOverlayId); /// Takes a snapshot of the map and returns its image data. Uint8List? takeSnapshot(); /// Returns true if the map supports advanced markers. - @ObjCSelector('isAdvancedMarkersAvailable') + @SwiftFunction('isAdvancedMarkersAvailable()') bool isAdvancedMarkersAvailable(); } @@ -789,68 +783,68 @@ abstract class MapsApi { @FlutterApi() abstract class MapsCallbackApi { /// Called when the map camera starts moving. - @ObjCSelector('didStartCameraMoveWithCompletion') + @SwiftFunction('didStartCameraMove()') void onCameraMoveStarted(); /// Called when the map camera moves. - @ObjCSelector('didMoveCameraToPosition:') + @SwiftFunction('didMoveCamera(to:)') void onCameraMove(PlatformCameraPosition cameraPosition); /// Called when the map camera stops moving. - @ObjCSelector('didIdleCameraWithCompletion') + @SwiftFunction('didIdleCamera()') void onCameraIdle(); /// Called when the map, not a specifc map object, is tapped. - @ObjCSelector('didTapAtPosition:') + @SwiftFunction('didTap(at:)') void onTap(PlatformLatLng position); /// Called when the map, not a specifc map object, is long pressed. - @ObjCSelector('didLongPressAtPosition:') + @SwiftFunction('didLongPress(at:)') void onLongPress(PlatformLatLng position); /// Called when a marker is tapped. - @ObjCSelector('didTapMarkerWithIdentifier:') + @SwiftFunction('didTapMarker(withIdentifier:)') void onMarkerTap(String markerId); /// Called when a marker drag starts. - @ObjCSelector('didStartDragForMarkerWithIdentifier:atPosition:') + @SwiftFunction('didStartDragForMarker(withIdentifier:at:)') void onMarkerDragStart(String markerId, PlatformLatLng position); /// Called when a marker drag updates. - @ObjCSelector('didDragMarkerWithIdentifier:atPosition:') + @SwiftFunction('didDragMarker(withIdentifier:at:)') void onMarkerDrag(String markerId, PlatformLatLng position); /// Called when a marker drag ends. - @ObjCSelector('didEndDragForMarkerWithIdentifier:atPosition:') + @SwiftFunction('didEndDragForMarker(withIdentifier:at:)') void onMarkerDragEnd(String markerId, PlatformLatLng position); /// Called when a marker's info window is tapped. - @ObjCSelector('didTapInfoWindowOfMarkerWithIdentifier:') + @SwiftFunction('didTapInfoWindowOfMarker(withIdentifier:)') void onInfoWindowTap(String markerId); /// Called when a circle is tapped. - @ObjCSelector('didTapCircleWithIdentifier:') + @SwiftFunction('didTapCircle(withIdentifier:)') void onCircleTap(String circleId); /// Called when a marker cluster is tapped. - @ObjCSelector('didTapCluster:') + @SwiftFunction('didTapCluster(_:)') void onClusterTap(PlatformCluster cluster); /// Called when a polygon is tapped. - @ObjCSelector('didTapPolygonWithIdentifier:') + @SwiftFunction('didTapPolygon(withIdentifier:)') void onPolygonTap(String polygonId); /// Called when a polyline is tapped. - @ObjCSelector('didTapPolylineWithIdentifier:') + @SwiftFunction('didTapPolyline(withIdentifier:)') void onPolylineTap(String polylineId); /// Called when a ground overlay is tapped. - @ObjCSelector('didTapGroundOverlayWithIdentifier:') + @SwiftFunction('didTapGroundOverlay(withIdentifier:)') void onGroundOverlayTap(String groundOverlayId); /// Called to get data for a map tile. @async - @ObjCSelector('tileWithOverlayIdentifier:location:zoom:') + @SwiftFunction('tile(withOverlayIdentifier:location:zoom:)') PlatformTile getTileOverlayTile(String tileOverlayId, PlatformPoint location, int zoom); } @@ -874,16 +868,16 @@ abstract class MapsInspectorApi { bool isCompassEnabled(); bool isMyLocationButtonEnabled(); bool isTrafficEnabled(); - @ObjCSelector('tileOverlayWithIdentifier:') + @SwiftFunction('tileOverlay(withIdentifier:)') PlatformTileLayer? getTileOverlayInfo(String tileOverlayId); - @ObjCSelector('groundOverlayWithIdentifier:') + @SwiftFunction('groundOverlay(withIdentifier:)') PlatformGroundOverlay? getGroundOverlayInfo(String groundOverlayId); - @ObjCSelector('heatmapWithIdentifier:') + @SwiftFunction('heatmap(withIdentifier:)') PlatformHeatmap? getHeatmapInfo(String heatmapId); - @ObjCSelector('zoomRange') + @SwiftFunction('zoomRange()') PlatformZoomRange getZoomRange(); - @ObjCSelector('clustersWithIdentifier:') + @SwiftFunction('clusters(withIdentifier:)') List getClusters(String clusterManagerId); - @ObjCSelector('cameraPosition') + @SwiftFunction('cameraPosition()') PlatformCameraPosition getCameraPosition(); } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/tool/unshared_source_files.dart b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/tool/unshared_source_files.dart index 2b9405a62502..1cfb85a852ac 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/tool/unshared_source_files.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/tool/unshared_source_files.dart @@ -12,6 +12,4 @@ const intentionallyUnsharedSourceFiles = [ 'test/package_specific_test_import.dart', // Each package will have its own list. 'tool/unshared_source_files.dart', - // Unshared due to https://github.com/flutter/flutter/issues/183441. - 'ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9_objc/include/google_maps_flutter_ios_sdk9_objc/GoogleMapsUtilsTrampoline.h', ]; From 15381093505c471f002c1b6da140520c49125849 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Wed, 2 Sep 2026 13:34:44 -0400 Subject: [PATCH 03/14] Remove NSObject inheritance that is no longer needed --- .../example/ios/RunnerTests/GoogleMapsTests.swift | 2 +- .../ios/RunnerTests/TileProviderControllerTests.swift | 3 +-- .../google_maps_flutter_ios_sdk9/CircleController.swift | 6 ++---- .../ClusterManagersController.swift | 3 +-- .../GoogleMapController.swift | 8 +++----- .../GroundOverlayController.swift | 6 ++---- .../google_maps_flutter_ios_sdk9/HeatmapController.swift | 6 ++---- .../google_maps_flutter_ios_sdk9/MarkerController.swift | 6 ++---- .../google_maps_flutter_ios_sdk9/PolygonController.swift | 6 ++---- .../google_maps_flutter_ios_sdk9/PolylineController.swift | 6 ++---- .../TileOverlayController.swift | 6 ++---- 11 files changed, 20 insertions(+), 38 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GoogleMapsTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GoogleMapsTests.swift index 42b4cf50ce58..f3198f970da6 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GoogleMapsTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GoogleMapsTests.swift @@ -8,7 +8,7 @@ import Testing @testable import google_maps_flutter_ios_sdk9 -class MockCATransaction: NSObject, MapAnimationCATransactionProtocol { +class MockCATransaction: MapAnimationCATransactionProtocol { var beginCalled = false var commitCalled = false var animationDuration: CFTimeInterval = 0.0 diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TileProviderControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TileProviderControllerTests.swift index bd5fcf4ccbc0..88d3931b183f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TileProviderControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TileProviderControllerTests.swift @@ -17,12 +17,11 @@ class StubTileReceiver: NSObject, GMSTileReceiver { // A tile provider that expects a single call to // tileWithOverlayIdentifier:location:zoom:completion: on the main thread, // and then confirms it. -class TestTileProvider: NSObject, TileProviderDelegate { +class TestTileProvider: TileProviderDelegate { var onTileCalled: () -> Void init(onTileCalled: @escaping () -> Void) { self.onTileCalled = onTileCalled - super.init() } func tile( diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/CircleController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/CircleController.swift index 956882a26bb8..f9f8a8082b95 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/CircleController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/CircleController.swift @@ -5,7 +5,7 @@ import GoogleMaps /// Defines circle controllable by Flutter. -class CircleController: NSObject { +class CircleController { let circle: GMSCircle private weak var mapView: GMSMapView? @@ -13,7 +13,6 @@ class CircleController: NSObject { self.circle = GMSCircle() self.mapView = mapView self.circle.userData = [circle.circleId] - super.init() CircleController.update(self.circle, from: circle, with: mapView) } @@ -49,7 +48,7 @@ class CircleController: NSObject { } } -class CirclesController: NSObject { +class CirclesController { private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? private var circleIdToController: [String: CircleController] = [:] @@ -57,7 +56,6 @@ class CirclesController: NSObject { init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate - super.init() } func add(_ circles: [PlatformCircle]) { diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ClusterManagersController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ClusterManagersController.swift index 0e33f2c4d9a3..8163d44d412b 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ClusterManagersController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ClusterManagersController.swift @@ -7,7 +7,7 @@ import GoogleMaps import GoogleMapsUtils /// A controller that manages all of the cluster managers on a map. -class ClusterManagersController: NSObject { +class ClusterManagersController { private var clusterManagerIdentifierToManagers: [String: GMUClusterManager] = [:] private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? @@ -15,7 +15,6 @@ class ClusterManagersController: NSObject { init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate - super.init() } func add(_ clusterManagersToAdd: [PlatformClusterManager]) { diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapController.swift index fef962a73295..1141b409e156 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapController.swift @@ -546,7 +546,7 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV // TODO(stuartmorgan): Remove this in favor of an extension to add TileProviderDelegate to // the Pigeon Flutter API object once this plugin has switched to Swift Pigeon generation // (adjusting the protocol to match the Swift version of the signature). -private class ConcreteTileProvider: NSObject, TileProviderDelegate { +private class ConcreteTileProvider: TileProviderDelegate { let handler: MapsCallbackApi init(dartCallbackHandler: MapsCallbackApi) { @@ -568,7 +568,7 @@ private class ConcreteTileProvider: NSObject, TileProviderDelegate { } } -class MapCallHandler: NSObject, MapsApi { +class MapCallHandler: MapsApi { weak var controller: GoogleMapController? let messenger: FlutterBinaryMessenger let pigeonSuffix: String @@ -581,7 +581,6 @@ class MapCallHandler: NSObject, MapsApi { self.messenger = messenger self.pigeonSuffix = suffix self.transactionWrapper = DefaultMapAnimationCATransaction() - super.init() } func waitForMap() { @@ -801,7 +800,7 @@ class MapCallHandler: NSObject, MapsApi { } } -class MapInspector: NSObject, MapsInspectorApi { +class MapInspector: MapsInspectorApi { weak var controller: GoogleMapController? let messenger: FlutterBinaryMessenger let pigeonSuffix: String @@ -812,7 +811,6 @@ class MapInspector: NSObject, MapsInspectorApi { ) { self.messenger = messenger self.pigeonSuffix = suffix - super.init() } func areBuildingsEnabled() -> Bool { diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GroundOverlayController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GroundOverlayController.swift index b56f78e96743..25258b9e26c0 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GroundOverlayController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GroundOverlayController.swift @@ -7,7 +7,7 @@ import GoogleMapsUtils import UIKit /// Controller of a single ground overlay on the map. -class GroundOverlayController: NSObject { +class GroundOverlayController { let groundOverlay: GMSGroundOverlay private weak var mapView: GMSMapView? let createdWithBounds: Bool @@ -21,7 +21,6 @@ class GroundOverlayController: NSObject { self.mapView = mapView self.groundOverlay.userData = [identifier] self.createdWithBounds = isCreatedWithBounds - super.init() } func removeGroundOverlay() { @@ -98,7 +97,7 @@ class GroundOverlayController: NSObject { } /// Controller of multiple ground overlays on the map. -class GroundOverlaysController: NSObject { +class GroundOverlaysController { private var groundOverlayControllerByIdentifier: [String: GroundOverlayController] = [:] private weak var eventDelegate: MapEventDelegate? private let assetProvider: AssetProvider @@ -108,7 +107,6 @@ class GroundOverlaysController: NSObject { self.mapView = mapView self.eventDelegate = eventDelegate self.assetProvider = assetProvider - super.init() } func add(_ groundOverlaysToAdd: [PlatformGroundOverlay]) { diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/HeatmapController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/HeatmapController.swift index b65b05bc7aa4..bda3a2199e9e 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/HeatmapController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/HeatmapController.swift @@ -6,14 +6,13 @@ import GoogleMaps import GoogleMapsUtils /// Controller of a single Heatmap on the map. -class HeatmapController: NSObject { +class HeatmapController { let heatmapTileLayer: GMUHeatmapTileLayer private weak var mapView: GMSMapView? init(heatmap: PlatformHeatmap, tileLayer: GMUHeatmapTileLayer, mapView: GMSMapView) { self.heatmapTileLayer = tileLayer self.mapView = mapView - super.init() HeatmapController.update(tileLayer, from: heatmap, mapView: mapView) } @@ -55,13 +54,12 @@ class HeatmapController: NSObject { } /// Controller of multiple Heatmaps on the map. -class HeatmapsController: NSObject { +class HeatmapsController { private var heatmapIdToController: [String: HeatmapController] = [:] private weak var mapView: GMSMapView? init(mapView: GMSMapView) { self.mapView = mapView - super.init() } func add(_ heatmapsToAdd: [PlatformHeatmap]) { diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MarkerController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MarkerController.swift index 5cd3d106472e..213d665f9172 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MarkerController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MarkerController.swift @@ -7,7 +7,7 @@ import GoogleMaps import UIKit /// Defines marker controllable by Flutter. -class MarkerController: NSObject { +class MarkerController { let marker: GMSMarker private weak var mapView: GMSMapView? private(set) var consumeTapEvents: Bool = false @@ -18,7 +18,6 @@ class MarkerController: NSObject { self.marker = marker self.markerIdentifier = markerIdentifier self.mapView = mapView - super.init() } func showInfoWindow() { @@ -112,7 +111,7 @@ class MarkerController: NSObject { } /// Controller of multiple markers on the map. -class MarkersController: NSObject { +class MarkersController { private(set) var markerIdentifierToController: [String: MarkerController] = [:] private weak var eventDelegate: MapEventDelegate? private weak var clusterManagersController: ClusterManagersController? @@ -132,7 +131,6 @@ class MarkersController: NSObject { self.clusterManagersController = clusterManagersController self.assetProvider = assetProvider self.markerType = markerType - super.init() } func add(_ markersToAdd: [PlatformMarker]) { diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolygonController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolygonController.swift index 04a8b9855e6f..8492de2a447f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolygonController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolygonController.swift @@ -5,7 +5,7 @@ import GoogleMaps /// Defines polygon controllable by Flutter. -class PolygonController: NSObject { +class PolygonController { let polygon: GMSPolygon private weak var mapView: GMSMapView? @@ -13,7 +13,6 @@ class PolygonController: NSObject { self.polygon = GMSPolygon() self.mapView = mapView self.polygon.userData = [identifier] - super.init() } func removePolygon() { @@ -52,7 +51,7 @@ class PolygonController: NSObject { } } -class PolygonsController: NSObject { +class PolygonsController { private var polygonIdentifierToController: [String: PolygonController] = [:] private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? @@ -60,7 +59,6 @@ class PolygonsController: NSObject { init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate - super.init() } func add(_ polygons: [PlatformPolygon]) { diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolylineController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolylineController.swift index f91c4ad2a1a1..49242e362d8b 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolylineController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolylineController.swift @@ -5,7 +5,7 @@ import GoogleMaps /// Defines polyline controllable by Flutter. -class PolylineController: NSObject { +class PolylineController { let polyline: GMSPolyline private weak var mapView: GMSMapView? @@ -13,7 +13,6 @@ class PolylineController: NSObject { self.polyline = GMSPolyline() self.mapView = mapView self.polyline.userData = [identifier] - super.init() } func removePolyline() { @@ -57,7 +56,7 @@ class PolylineController: NSObject { } } -class PolylinesController: NSObject { +class PolylinesController { private var polylineIdentifierToController: [String: PolylineController] = [:] private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? @@ -65,7 +64,6 @@ class PolylinesController: NSObject { init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate - super.init() } func add(_ polylines: [PlatformPolyline]) { diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/TileOverlayController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/TileOverlayController.swift index 32c1ed94ed6a..c68f00f6909d 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/TileOverlayController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/TileOverlayController.swift @@ -19,14 +19,13 @@ protocol TileProviderDelegate: AnyObject { } /// Controller of a single tile overlay on the map. -class TileOverlayController: NSObject { +class TileOverlayController { let layer: GMSTileLayer private weak var mapView: GMSMapView? init(tileOverlay: PlatformTileOverlay, tileLayer: GMSTileLayer, mapView: GMSMapView) { self.layer = tileLayer self.mapView = mapView - super.init() TileOverlayController.update(tileLayer, from: tileOverlay, with: mapView) } @@ -142,7 +141,7 @@ class TileProviderController: GMSTileLayer { } /// Controller of multiple tile overlays on the map. -class TileOverlaysController: NSObject { +class TileOverlaysController { private var tileOverlayIdentifierToController: [String: TileOverlayController] = [:] private weak var tileProviderDelegate: TileProviderDelegate? private weak var mapView: GMSMapView? @@ -150,7 +149,6 @@ class TileOverlaysController: NSObject { init(mapView: GMSMapView, tileProvider: TileProviderDelegate) { self.mapView = mapView self.tileProviderDelegate = tileProvider - super.init() } func add(_ tileOverlaysToAdd: [PlatformTileOverlay]) { From df117c1b1682f2ce2d7dbb205f9b92ef32c0ab5d Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Wed, 2 Sep 2026 13:59:33 -0400 Subject: [PATCH 04/14] Remove the need for a custom event protocol and handler --- .../ios/RunnerTests/GoogleMapsTests.swift | 1 + .../TestUtils/TestMapEventHandler.swift | 106 +++++++++++++++--- .../CircleController.swift | 2 +- .../ClusterManagersController.swift | 2 +- .../GoogleMapController.swift | 100 +++-------------- .../GroundOverlayController.swift | 3 +- .../MapEventDelegate.swift | 53 +-------- .../MarkerController.swift | 10 +- .../PolygonController.swift | 2 +- .../PolylineController.swift | 2 +- 10 files changed, 118 insertions(+), 163 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GoogleMapsTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GoogleMapsTests.swift index f3198f970da6..2f1e88caa669 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GoogleMapsTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GoogleMapsTests.swift @@ -256,6 +256,7 @@ class StubPluginRegistrar: NSObject, FlutterPluginRegistrar { #expect(mapView.frameObserverCount == 1) + withExtendedLifetime(controller) {} // Deallocate the controller controller = nil diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift index 76576b6f45cf..fbb253beb7d9 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift @@ -8,35 +8,109 @@ import Foundation /// Fake implementation of MapEventDelegate for unit tests. class TestMapEventHandler: MapEventDelegate { - func didStartCameraMove() {} - - func didMoveCamera(to cameraPosition: PlatformCameraPosition) {} + func didStartCameraMove(completion: @escaping (Result) -> Void) {} + + func didMoveCamera( + to cameraPositionArg: PlatformCameraPosition, + completion: + @escaping ( + Result + ) -> Void + ) {} - func didIdleCamera() {} + func didIdleCamera(completion: @escaping (Result) -> Void) {} - func didTap(at position: PlatformLatLng) {} + func didTap( + at positionArg: PlatformLatLng, + completion: + @escaping ( + Result + ) -> Void + ) {} - func didLongPress(at position: PlatformLatLng) {} + func didLongPress( + at positionArg: PlatformLatLng, + completion: + @escaping ( + Result + ) -> Void + ) {} - func didTapMarker(withIdentifier markerId: String) {} + func didTapMarker( + withIdentifier markerIdArg: String, + completion: @escaping (Result) -> Void + ) {} func didStartDragForMarker( - withIdentifier markerId: String, at position: PlatformLatLng + withIdentifier markerIdArg: String, + at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void ) {} - func didDragMarker(withIdentifier markerId: String, at position: PlatformLatLng) {} + func didDragMarker( + withIdentifier markerIdArg: String, + at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void + ) {} - func didEndDragForMarker(withIdentifier markerId: String, at position: PlatformLatLng) {} + func didEndDragForMarker( + withIdentifier markerIdArg: String, + at positionArg: PlatformLatLng, + completion: + @escaping ( + Result + ) -> Void + ) {} - func didTapInfoWindowOfMarker(withIdentifier markerId: String) {} + func didTapInfoWindowOfMarker( + withIdentifier markerIdArg: String, + completion: + @escaping ( + Result + ) -> Void + ) {} - func didTapCircle(withIdentifier circleId: String) {} + func didTapCircle( + withIdentifier circleIdArg: String, + completion: @escaping (Result) -> Void + ) {} - func didTapCluster(_ cluster: PlatformCluster) {} + func didTapCluster( + _ clusterArg: PlatformCluster, + completion: + @escaping ( + Result + ) -> Void + ) {} - func didTapPolygon(withIdentifier polygonId: String) {} + func didTapPolygon( + withIdentifier polygonIdArg: String, + completion: + @escaping ( + Result + ) -> Void + ) {} - func didTapPolyline(withIdentifier polylineId: String) {} + func didTapPolyline( + withIdentifier polylineIdArg: String, + completion: @escaping (Result) -> Void + ) {} - func didTapGroundOverlay(withIdentifier groundOverlayId: String) {} + func didTapGroundOverlay( + withIdentifier groundOverlayIdArg: String, + completion: + @escaping ( + Result + ) -> Void + ) {} + + func tile( + withOverlayIdentifier tileOverlayIdArg: String, + location locationArg: PlatformPoint, + zoom zoomArg: Int64, + completion: + @escaping ( + Result + ) -> Void + ) {} } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/CircleController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/CircleController.swift index f9f8a8082b95..f9870af7c0a7 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/CircleController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/CircleController.swift @@ -86,7 +86,7 @@ class CirclesController { func didTapCircle(withIdentifier identifier: String) { if hasCircle(withIdentifier: identifier) { - eventDelegate?.didTapCircle(withIdentifier: identifier) + eventDelegate?.didTapCircle(withIdentifier: identifier) { _ in } } } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ClusterManagersController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ClusterManagersController.swift index 8163d44d412b..6c8bc4a417d7 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ClusterManagersController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ClusterManagersController.swift @@ -73,7 +73,7 @@ class ClusterManagersController { guard let clusterManagerId = clusterManagerIdentifier(for: cluster) else { return } let platformCluster = PlatformCluster.make( from: cluster, clusterManagerIdentifier: clusterManagerId) - eventDelegate?.didTapCluster(platformCluster) + eventDelegate?.didTapCluster(platformCluster) { _ in } } /// Returns the cluster manager identifier for given cluster. diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapController.swift index 1141b409e156..93d482d4bb24 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapController.swift @@ -13,6 +13,9 @@ protocol MapAnimationCATransactionProtocol { func setAnimationDuration(_ duration: CFTimeInterval) } +/// Add the AnyObject-required protocol to MapsCallbackApi to allow it to be passed to sub-controllers. +extension MapsCallbackApi: MapEventDelegate {} + /// Non-test implementation of MapAnimationCATransactionProtocol. class DefaultMapAnimationCATransaction: MapAnimationCATransactionProtocol { func begin() { @@ -49,84 +52,11 @@ class DefaultAssetProvider: AssetProvider { } } -/// Non-test implementation of MapEventDelegate, wrapping a MapsCallbackApi instance. -class DefaultMapEventHandler: MapEventDelegate { - let callbackHandler: MapsCallbackApi - - init(callbackHandler: MapsCallbackApi) { - self.callbackHandler = callbackHandler - } - - func didStartCameraMove() { - callbackHandler.didStartCameraMove { _ in } - } - - func didMoveCamera(to cameraPosition: PlatformCameraPosition) { - callbackHandler.didMoveCamera(to: cameraPosition) { _ in } - } - - func didIdleCamera() { - callbackHandler.didIdleCamera { _ in } - } - - func didTap(at position: PlatformLatLng) { - callbackHandler.didTap(at: position) { _ in } - } - - func didLongPress(at position: PlatformLatLng) { - callbackHandler.didLongPress(at: position) { _ in } - } - - func didTapMarker(withIdentifier markerId: String) { - callbackHandler.didTapMarker(withIdentifier: markerId) { _ in } - } - - func didStartDragForMarker( - withIdentifier markerId: String, at position: PlatformLatLng - ) { - callbackHandler.didStartDragForMarker(withIdentifier: markerId, at: position) { _ in } - } - - func didDragMarker(withIdentifier markerId: String, at position: PlatformLatLng) { - callbackHandler.didDragMarker(withIdentifier: markerId, at: position) { _ in } - } - - func didEndDragForMarker(withIdentifier markerId: String, at position: PlatformLatLng) { - callbackHandler.didEndDragForMarker(withIdentifier: markerId, at: position) { _ in } - } - - func didTapInfoWindowOfMarker(withIdentifier markerId: String) { - callbackHandler.didTapInfoWindowOfMarker(withIdentifier: markerId) { _ in } - } - - func didTapCircle(withIdentifier circleId: String) { - callbackHandler.didTapCircle(withIdentifier: circleId) { _ in } - } - - func didTapCluster(_ cluster: PlatformCluster) { - callbackHandler.didTapCluster(cluster) { _ in } - } - - func didTapPolygon(withIdentifier polygonId: String) { - callbackHandler.didTapPolygon(withIdentifier: polygonId) { _ in } - } - - func didTapPolyline(withIdentifier polylineId: String) { - callbackHandler.didTapPolyline(withIdentifier: polylineId) { _ in } - } - - func didTapGroundOverlay(withIdentifier groundOverlayId: String) { - callbackHandler.didTapGroundOverlay(withIdentifier: groundOverlayId) { _ in } - } -} - public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformView { /// The Google Maps SDK map view managed by this controller. let mapView: GMSMapView /// The Pigeon callback API implementation, used to send events to the Dart side. let dartCallbackHandler: MapsCallbackApi - /// The map SDK event handler, which routes events to the Dart callback handler. - let mapEventHandler: DefaultMapEventHandler /// The main Pigeon API implementation, separate to avoid lifetime extension. let callHandler: MapCallHandler /// The inspector API implementation, separate to avoid lifetime extension. @@ -208,32 +138,30 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV messageChannelSuffix: pigeonSuffix ) - mapEventHandler = DefaultMapEventHandler(callbackHandler: dartCallbackHandler) - let markerType = creationParameters.mapConfiguration.markerType clusterManagersController = ClusterManagersController( mapView: mapView, - eventDelegate: mapEventHandler + eventDelegate: dartCallbackHandler ) markersController = MarkersController( mapView: mapView, - eventDelegate: mapEventHandler, + eventDelegate: dartCallbackHandler, clusterManagersController: clusterManagersController, assetProvider: assetProvider, markerType: markerType ) polygonsController = PolygonsController( mapView: mapView, - eventDelegate: mapEventHandler + eventDelegate: dartCallbackHandler ) polylinesController = PolylinesController( mapView: mapView, - eventDelegate: mapEventHandler + eventDelegate: dartCallbackHandler ) circlesController = CirclesController( mapView: mapView, - eventDelegate: mapEventHandler + eventDelegate: dartCallbackHandler ) heatmapsController = HeatmapsController(mapView: mapView) tileProvider = ConcreteTileProvider(dartCallbackHandler: dartCallbackHandler) @@ -243,7 +171,7 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV ) groundOverlaysController = GroundOverlaysController( mapView: mapView, - eventDelegate: mapEventHandler, + eventDelegate: dartCallbackHandler, assetProvider: assetProvider ) @@ -385,17 +313,17 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV // MARK: - GMSMapViewDelegate methods public func mapView(_ mapView: GMSMapView, willMove gesture: Bool) { - mapEventHandler.didStartCameraMove() + dartCallbackHandler.didStartCameraMove { _ in } } public func mapView(_ mapView: GMSMapView, didChange position: GMSCameraPosition) { if trackCameraPosition { - mapEventHandler.didMoveCamera(to: PlatformCameraPosition.make(from: position)) + dartCallbackHandler.didMoveCamera(to: PlatformCameraPosition.make(from: position)) { _ in } } } public func mapView(_ mapView: GMSMapView, idleAt position: GMSCameraPosition) { - mapEventHandler.didIdleCamera() + dartCallbackHandler.didIdleCamera { _ in } } public func mapView(_ mapView: GMSMapView, didTap marker: GMSMarker) -> Bool { @@ -451,11 +379,11 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV } public func mapView(_ mapView: GMSMapView, didTapAt coordinate: CLLocationCoordinate2D) { - mapEventHandler.didTap(at: PlatformLatLng.make(from: coordinate)) + dartCallbackHandler.didTap(at: PlatformLatLng.make(from: coordinate)) { _ in } } public func mapView(_ mapView: GMSMapView, didLongPressAt coordinate: CLLocationCoordinate2D) { - mapEventHandler.didLongPress(at: PlatformLatLng.make(from: coordinate)) + dartCallbackHandler.didLongPress(at: PlatformLatLng.make(from: coordinate)) { _ in } } func interpretMapConfiguration(_ config: PlatformMapConfiguration) { diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GroundOverlayController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GroundOverlayController.swift index 25258b9e26c0..58fc2830a383 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GroundOverlayController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GroundOverlayController.swift @@ -164,7 +164,6 @@ class GroundOverlaysController { mapView: mapView, isCreatedWithBounds: isCreatedWithBounds ) - let zoomLevel = groundOverlay.zoomLevel controller.zoomLevel = groundOverlay.zoomLevel controller.update( from: groundOverlay, @@ -198,7 +197,7 @@ class GroundOverlaysController { func didTapGroundOverlay(withIdentifier identifier: String) { if hasGroundOverlays(withIdentifier: identifier) { - eventDelegate?.didTapGroundOverlay(withIdentifier: identifier) + eventDelegate?.didTapGroundOverlay(withIdentifier: identifier) { _ in } } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MapEventDelegate.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MapEventDelegate.swift index 2c90d8d235bb..7f0b53c98675 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MapEventDelegate.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MapEventDelegate.swift @@ -6,54 +6,7 @@ import google_maps_flutter_ios_sdk9_objc #endif -/// Delegate for map event notifications. +/// Delegate for map callbacks that need Dart handling. /// -/// This is abstraction of the map event portions of MapsCallbackApi, to -/// avoid coupling all the individual controllers to the Pigeon implementation -/// of event handling, and to allow for mocks/fakes in unit tests. -protocol MapEventDelegate: AnyObject { - /// Called when the map camera starts moving. - func didStartCameraMove() - - /// Called when the map camera moves. - func didMoveCamera(to cameraPosition: PlatformCameraPosition) - - /// Called when the map camera stops moving. - func didIdleCamera() - - /// Called when the map, not a specifc map object, is tapped. - func didTap(at position: PlatformLatLng) - - /// Called when the map, not a specifc map object, is long pressed. - func didLongPress(at position: PlatformLatLng) - - /// Called when a marker is tapped. - func didTapMarker(withIdentifier markerId: String) - - /// Called when a marker drag starts. - func didStartDragForMarker(withIdentifier markerId: String, at position: PlatformLatLng) - - /// Called when a marker drag updates. - func didDragMarker(withIdentifier markerId: String, at position: PlatformLatLng) - - /// Called when a marker drag ends. - func didEndDragForMarker(withIdentifier markerId: String, at position: PlatformLatLng) - - /// Called when a marker's info window is tapped. - func didTapInfoWindowOfMarker(withIdentifier markerId: String) - - /// Called when a circle is tapped. - func didTapCircle(withIdentifier circleId: String) - - /// Called when a marker cluster is tapped. - func didTapCluster(_ cluster: PlatformCluster) - - /// Called when a polygon is tapped. - func didTapPolygon(withIdentifier polygonId: String) - - /// Called when a polyline is tapped. - func didTapPolyline(withIdentifier polylineId: String) - - /// Called when a ground overlay is tapped. - func didTapGroundOverlay(withIdentifier groundOverlayId: String) -} +/// This exists to add AnyObject to the requirements, so that references to it can be weak. +protocol MapEventDelegate: AnyObject, MapsCallbackApiProtocol {} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MarkerController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MarkerController.swift index 213d665f9172..8ca280bc2a29 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MarkerController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/MarkerController.swift @@ -217,7 +217,7 @@ class MarkersController { func didTapMarker(withIdentifier identifier: String) -> Bool { guard let controller = markerIdentifierToController[identifier] else { return false } - eventDelegate?.didTapMarker(withIdentifier: identifier) + eventDelegate?.didTapMarker(withIdentifier: identifier) { _ in } return controller.consumeTapEvents } @@ -226,7 +226,7 @@ class MarkersController { eventDelegate?.didStartDragForMarker( withIdentifier: identifier, at: PlatformLatLng.make(from: location) - ) + ) { _ in } } func didDragMarker(withIdentifier identifier: String, location: CLLocationCoordinate2D) { @@ -234,7 +234,7 @@ class MarkersController { eventDelegate?.didDragMarker( withIdentifier: identifier, at: PlatformLatLng.make(from: location) - ) + ) { _ in } } func didEndDraggingMarker(withIdentifier identifier: String, location: CLLocationCoordinate2D) { @@ -242,12 +242,12 @@ class MarkersController { eventDelegate?.didEndDragForMarker( withIdentifier: identifier, at: PlatformLatLng.make(from: location) - ) + ) { _ in } } func didTapInfoWindowOfMarker(withIdentifier identifier: String) { if markerIdentifierToController[identifier] != nil { - eventDelegate?.didTapInfoWindowOfMarker(withIdentifier: identifier) + eventDelegate?.didTapInfoWindowOfMarker(withIdentifier: identifier) { _ in } } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolygonController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolygonController.swift index 8492de2a447f..40d771fbbea5 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolygonController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolygonController.swift @@ -91,7 +91,7 @@ class PolygonsController { func didTapPolygon(withIdentifier identifier: String) { if hasPolygon(withIdentifier: identifier) { - eventDelegate?.didTapPolygon(withIdentifier: identifier) + eventDelegate?.didTapPolygon(withIdentifier: identifier) { _ in } } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolylineController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolylineController.swift index 49242e362d8b..9b00b37f34ee 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolylineController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/PolylineController.swift @@ -96,7 +96,7 @@ class PolylinesController { func didTapPolyline(withIdentifier identifier: String) { if hasPolyline(withIdentifier: identifier) { - eventDelegate?.didTapPolyline(withIdentifier: identifier) + eventDelegate?.didTapPolyline(withIdentifier: identifier) { _ in } } } From 8769afeb0e3ee8d27e89c6c6a7782ebaf77e6be8 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Wed, 2 Sep 2026 14:10:27 -0400 Subject: [PATCH 05/14] Remove class nesting in favor of subclassing --- .../RunnerTests/ConversionsUtilsTests.swift | 22 +- .../ios/RunnerTests/GoogleMapsTests.swift | 6 +- .../ConversionUtils.swift | 3 +- .../Messages.g.swift | 219 +++++++---------- .../lib/src/google_maps_flutter_ios.dart | 46 ++-- .../lib/src/messages.g.dart | 227 +++++++----------- .../pigeons/messages.dart | 28 +-- 7 files changed, 220 insertions(+), 331 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ConversionsUtilsTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ConversionsUtilsTests.swift index 35ab712077c7..b0af0c160b40 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ConversionsUtilsTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ConversionsUtilsTests.swift @@ -139,7 +139,7 @@ import Testing } @Test func cameraUpdateFromNewCameraPosition() { - let newPositionUpdate = PlatformCameraUpdateNewCameraPosition( + let platformUpdate = PlatformCameraUpdateNewCameraPosition( cameraPosition: PlatformCameraPosition( bearing: 4, target: PlatformLatLng(latitude: 1, longitude: 2), @@ -147,7 +147,7 @@ import Testing zoom: 3 ) ) - _ = PlatformCameraUpdate(cameraUpdate: newPositionUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test @@ -161,7 +161,7 @@ import Testing latLng: PlatformLatLng(latitude: lat, longitude: lng) ) - _ = PlatformCameraUpdate(cameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test @@ -180,7 +180,7 @@ import Testing bounds: PlatformLatLngBounds.make(from: bounds), padding: padding ) - _ = PlatformCameraUpdate(cameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test @@ -196,7 +196,7 @@ import Testing zoom: zoom ) - _ = PlatformCameraUpdate(cameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test @@ -208,7 +208,7 @@ import Testing let y: Double = 2 let platformUpdate = PlatformCameraUpdateScrollBy(dx: x, dy: y) - _ = PlatformCameraUpdate(cameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test @@ -219,7 +219,7 @@ import Testing let zoom: Double = 1 let platformUpdateNoPoint = PlatformCameraUpdateZoomBy(amount: zoom, focus: nil) - _ = PlatformCameraUpdate(cameraUpdate: platformUpdateNoPoint).toGMSCameraUpdate() + _ = platformUpdateNoPoint.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test @@ -232,7 +232,7 @@ import Testing let y: Double = 3 let platformUpdate = PlatformCameraUpdateZoomBy(amount: zoom, focus: PlatformPoint(x: x, y: y)) - _ = PlatformCameraUpdate(cameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test @@ -242,7 +242,7 @@ import Testing @Test func cameraUpdateFromZoomIn() { let platformUpdate = PlatformCameraUpdateZoom(out: false) - _ = PlatformCameraUpdate(cameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test @@ -252,7 +252,7 @@ import Testing @Test func cameraUpdateFromZoomOut() { let platformUpdate = PlatformCameraUpdateZoom(out: true) - _ = PlatformCameraUpdate(cameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test @@ -263,7 +263,7 @@ import Testing let zoom: Double = 1 let platformUpdate = PlatformCameraUpdateZoomTo(zoom: zoom) - _ = PlatformCameraUpdate(cameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GoogleMapsTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GoogleMapsTests.swift index 2f1e88caa669..189a00f20440 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GoogleMapsTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GoogleMapsTests.swift @@ -129,9 +129,8 @@ class StubPluginRegistrar: NSObject, FlutterPluginRegistrar { controller.callHandler.transactionWrapper = mockTransactionWrapper let zoomTo = PlatformCameraUpdateZoomTo(zoom: 10.0) - let cameraUpdate = PlatformCameraUpdate(cameraUpdate: zoomTo) - try controller.callHandler.animateCamera(cameraUpdate, duration: nil) + try controller.callHandler.animateCamera(zoomTo, duration: nil) #expect(mapView.didAnimateCamera) #expect(!mockTransactionWrapper.beginCalled) #expect(!mockTransactionWrapper.commitCalled) @@ -159,10 +158,9 @@ class StubPluginRegistrar: NSObject, FlutterPluginRegistrar { controller.callHandler.transactionWrapper = mockTransactionWrapper let zoomTo = PlatformCameraUpdateZoomTo(zoom: 10.0) - let cameraUpdate = PlatformCameraUpdate(cameraUpdate: zoomTo) let durationMilliseconds: Int64 = 100 - try controller.callHandler.animateCamera(cameraUpdate, duration: durationMilliseconds) + try controller.callHandler.animateCamera(zoomTo, duration: durationMilliseconds) #expect(mapView.didAnimateCamera) #expect(mockTransactionWrapper.beginCalled) #expect(mockTransactionWrapper.commitCalled) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ConversionUtils.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ConversionUtils.swift index 98bfccddd3c3..927eb4152557 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ConversionUtils.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ConversionUtils.swift @@ -191,8 +191,7 @@ extension PlatformWeightedLatLng { extension PlatformCameraUpdate { /// Creates a GMSCameraUpdate from its Pigeon equivalent. func toGMSCameraUpdate() -> GMSCameraUpdate? { - // See note in messages.dart for why this is so loosely typed. - switch cameraUpdate { + switch self { case let newCameraPosition as PlatformCameraUpdateNewCameraPosition: return GMSCameraUpdate.setCamera(newCameraPosition.cameraPosition.toGMSCameraPosition()) case let newLatLng as PlatformCameraUpdateNewLatLng: diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/Messages.g.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/Messages.g.swift index b7a383670a1a..db3ba0fced7d 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/Messages.g.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/Messages.g.swift @@ -291,47 +291,15 @@ struct PlatformCameraPosition: Hashable, CustomStringConvertible { /// Pigeon representation of a CameraUpdate. /// /// Generated class from Pigeon that represents data sent in messages. -struct PlatformCameraUpdate: Hashable, CustomStringConvertible { - /// This Object must be one of the classes below prefixed with - /// PlatformCameraUpdate. Each such class represents a different type of - /// camera update, and each holds a different set of data, preventing the - /// use of a single unified class. - var cameraUpdate: Any +/// This protocol should not be extended by any user class outside of the generated file. +protocol PlatformCameraUpdate { - // swift-format-ignore: AlwaysUseLowerCamelCase - static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdate? { - let cameraUpdate = pigeonVar_list[0]! - - return PlatformCameraUpdate( - cameraUpdate: cameraUpdate - ) - } - func toList() -> [Any?] { - return [ - cameraUpdate - ] - } - static func == (lhs: PlatformCameraUpdate, rhs: PlatformCameraUpdate) -> Bool { - if Swift.type(of: lhs) != Swift.type(of: rhs) { - return false - } - return MessagesPigeonInternal.deepEquals(lhs.cameraUpdate, rhs.cameraUpdate) - } - - func hash(into hasher: inout Hasher) { - hasher.combine("PlatformCameraUpdate") - MessagesPigeonInternal.deepHash(value: cameraUpdate, hasher: &hasher) - } - - public var description: String { - return "PlatformCameraUpdate(cameraUpdate: \(String(describing: cameraUpdate)))" - } } /// Pigeon equivalent of NewCameraPosition /// /// Generated class from Pigeon that represents data sent in messages. -struct PlatformCameraUpdateNewCameraPosition: Hashable, CustomStringConvertible { +struct PlatformCameraUpdateNewCameraPosition: PlatformCameraUpdate { var cameraPosition: PlatformCameraPosition // swift-format-ignore: AlwaysUseLowerCamelCase @@ -370,7 +338,7 @@ struct PlatformCameraUpdateNewCameraPosition: Hashable, CustomStringConvertible /// Pigeon equivalent of NewLatLng /// /// Generated class from Pigeon that represents data sent in messages. -struct PlatformCameraUpdateNewLatLng: Hashable, CustomStringConvertible { +struct PlatformCameraUpdateNewLatLng: PlatformCameraUpdate { var latLng: PlatformLatLng // swift-format-ignore: AlwaysUseLowerCamelCase @@ -406,7 +374,7 @@ struct PlatformCameraUpdateNewLatLng: Hashable, CustomStringConvertible { /// Pigeon equivalent of NewLatLngBounds /// /// Generated class from Pigeon that represents data sent in messages. -struct PlatformCameraUpdateNewLatLngBounds: Hashable, CustomStringConvertible { +struct PlatformCameraUpdateNewLatLngBounds: PlatformCameraUpdate { var bounds: PlatformLatLngBounds var padding: Double @@ -451,7 +419,7 @@ struct PlatformCameraUpdateNewLatLngBounds: Hashable, CustomStringConvertible { /// Pigeon equivalent of NewLatLngZoom /// /// Generated class from Pigeon that represents data sent in messages. -struct PlatformCameraUpdateNewLatLngZoom: Hashable, CustomStringConvertible { +struct PlatformCameraUpdateNewLatLngZoom: PlatformCameraUpdate { var latLng: PlatformLatLng var zoom: Double @@ -496,7 +464,7 @@ struct PlatformCameraUpdateNewLatLngZoom: Hashable, CustomStringConvertible { /// Pigeon equivalent of ScrollBy /// /// Generated class from Pigeon that represents data sent in messages. -struct PlatformCameraUpdateScrollBy: Hashable, CustomStringConvertible { +struct PlatformCameraUpdateScrollBy: PlatformCameraUpdate { var dx: Double var dy: Double @@ -539,7 +507,7 @@ struct PlatformCameraUpdateScrollBy: Hashable, CustomStringConvertible { /// Pigeon equivalent of ZoomBy /// /// Generated class from Pigeon that represents data sent in messages. -struct PlatformCameraUpdateZoomBy: Hashable, CustomStringConvertible { +struct PlatformCameraUpdateZoomBy: PlatformCameraUpdate { var amount: Double var focus: PlatformPoint? = nil @@ -582,7 +550,7 @@ struct PlatformCameraUpdateZoomBy: Hashable, CustomStringConvertible { /// Pigeon equivalent of ZoomIn/ZoomOut /// /// Generated class from Pigeon that represents data sent in messages. -struct PlatformCameraUpdateZoom: Hashable, CustomStringConvertible { +struct PlatformCameraUpdateZoom: PlatformCameraUpdate { var out: Bool // swift-format-ignore: AlwaysUseLowerCamelCase @@ -618,7 +586,7 @@ struct PlatformCameraUpdateZoom: Hashable, CustomStringConvertible { /// Pigeon equivalent of ZoomTo /// /// Generated class from Pigeon that represents data sent in messages. -struct PlatformCameraUpdateZoomTo: Hashable, CustomStringConvertible { +struct PlatformCameraUpdateZoomTo: PlatformCameraUpdate { var zoom: Double // swift-format-ignore: AlwaysUseLowerCamelCase @@ -2693,88 +2661,86 @@ private class MessagesPigeonCodecReader: FlutterStandardReader { case 135: return PlatformCameraPosition.fromList(self.readValue() as! [Any?]) case 136: - return PlatformCameraUpdate.fromList(self.readValue() as! [Any?]) - case 137: return PlatformCameraUpdateNewCameraPosition.fromList(self.readValue() as! [Any?]) - case 138: + case 137: return PlatformCameraUpdateNewLatLng.fromList(self.readValue() as! [Any?]) - case 139: + case 138: return PlatformCameraUpdateNewLatLngBounds.fromList(self.readValue() as! [Any?]) - case 140: + case 139: return PlatformCameraUpdateNewLatLngZoom.fromList(self.readValue() as! [Any?]) - case 141: + case 140: return PlatformCameraUpdateScrollBy.fromList(self.readValue() as! [Any?]) - case 142: + case 141: return PlatformCameraUpdateZoomBy.fromList(self.readValue() as! [Any?]) - case 143: + case 142: return PlatformCameraUpdateZoom.fromList(self.readValue() as! [Any?]) - case 144: + case 143: return PlatformCameraUpdateZoomTo.fromList(self.readValue() as! [Any?]) - case 145: + case 144: return PlatformCircle.fromList(self.readValue() as! [Any?]) - case 146: + case 145: return PlatformHeatmap.fromList(self.readValue() as! [Any?]) - case 147: + case 146: return PlatformHeatmapGradient.fromList(self.readValue() as! [Any?]) - case 148: + case 147: return PlatformWeightedLatLng.fromList(self.readValue() as! [Any?]) - case 149: + case 148: return PlatformInfoWindow.fromList(self.readValue() as! [Any?]) - case 150: + case 149: return PlatformCluster.fromList(self.readValue() as! [Any?]) - case 151: + case 150: return PlatformClusterManager.fromList(self.readValue() as! [Any?]) - case 152: + case 151: return PlatformMarker.fromList(self.readValue() as! [Any?]) - case 153: + case 152: return PlatformPolygon.fromList(self.readValue() as! [Any?]) - case 154: + case 153: return PlatformPolyline.fromList(self.readValue() as! [Any?]) - case 155: + case 154: return PlatformPatternItem.fromList(self.readValue() as! [Any?]) - case 156: + case 155: return PlatformTile.fromList(self.readValue() as! [Any?]) - case 157: + case 156: return PlatformTileOverlay.fromList(self.readValue() as! [Any?]) - case 158: + case 157: return PlatformEdgeInsets.fromList(self.readValue() as! [Any?]) - case 159: + case 158: return PlatformLatLng.fromList(self.readValue() as! [Any?]) - case 160: + case 159: return PlatformLatLngBounds.fromList(self.readValue() as! [Any?]) - case 161: + case 160: return PlatformCameraTargetBounds.fromList(self.readValue() as! [Any?]) - case 162: + case 161: return PlatformGroundOverlay.fromList(self.readValue() as! [Any?]) - case 163: + case 162: return PlatformMapViewCreationParams.fromList(self.readValue() as! [Any?]) - case 164: + case 163: return PlatformMapConfiguration.fromList(self.readValue() as! [Any?]) - case 165: + case 164: return PlatformPoint.fromList(self.readValue() as! [Any?]) - case 166: + case 165: return PlatformSize.fromList(self.readValue() as! [Any?]) - case 167: + case 166: return PlatformColor.fromList(self.readValue() as! [Any?]) - case 168: + case 167: return PlatformTileLayer.fromList(self.readValue() as! [Any?]) - case 169: + case 168: return PlatformZoomRange.fromList(self.readValue() as! [Any?]) - case 170: + case 169: return PlatformBitmap.fromList(self.readValue() as! [Any?]) - case 171: + case 170: return PlatformBitmapDefaultMarker.fromList(self.readValue() as! [Any?]) - case 172: + case 171: return PlatformBitmapBytes.fromList(self.readValue() as! [Any?]) - case 173: + case 172: return PlatformBitmapAsset.fromList(self.readValue() as! [Any?]) - case 174: + case 173: return PlatformBitmapAssetImage.fromList(self.readValue() as! [Any?]) - case 175: + case 174: return PlatformBitmapAssetMap.fromList(self.readValue() as! [Any?]) - case 176: + case 175: return PlatformBitmapBytesMap.fromList(self.readValue() as! [Any?]) - case 177: + case 176: return PlatformBitmapPinConfig.fromList(self.readValue() as! [Any?]) default: return super.readValue(ofType: type) @@ -2805,131 +2771,128 @@ private class MessagesPigeonCodecWriter: FlutterStandardWriter { } else if let value = value as? PlatformCameraPosition { super.writeByte(135) super.writeValue(value.toList()) - } else if let value = value as? PlatformCameraUpdate { - super.writeByte(136) - super.writeValue(value.toList()) } else if let value = value as? PlatformCameraUpdateNewCameraPosition { - super.writeByte(137) + super.writeByte(136) super.writeValue(value.toList()) } else if let value = value as? PlatformCameraUpdateNewLatLng { - super.writeByte(138) + super.writeByte(137) super.writeValue(value.toList()) } else if let value = value as? PlatformCameraUpdateNewLatLngBounds { - super.writeByte(139) + super.writeByte(138) super.writeValue(value.toList()) } else if let value = value as? PlatformCameraUpdateNewLatLngZoom { - super.writeByte(140) + super.writeByte(139) super.writeValue(value.toList()) } else if let value = value as? PlatformCameraUpdateScrollBy { - super.writeByte(141) + super.writeByte(140) super.writeValue(value.toList()) } else if let value = value as? PlatformCameraUpdateZoomBy { - super.writeByte(142) + super.writeByte(141) super.writeValue(value.toList()) } else if let value = value as? PlatformCameraUpdateZoom { - super.writeByte(143) + super.writeByte(142) super.writeValue(value.toList()) } else if let value = value as? PlatformCameraUpdateZoomTo { - super.writeByte(144) + super.writeByte(143) super.writeValue(value.toList()) } else if let value = value as? PlatformCircle { - super.writeByte(145) + super.writeByte(144) super.writeValue(value.toList()) } else if let value = value as? PlatformHeatmap { - super.writeByte(146) + super.writeByte(145) super.writeValue(value.toList()) } else if let value = value as? PlatformHeatmapGradient { - super.writeByte(147) + super.writeByte(146) super.writeValue(value.toList()) } else if let value = value as? PlatformWeightedLatLng { - super.writeByte(148) + super.writeByte(147) super.writeValue(value.toList()) } else if let value = value as? PlatformInfoWindow { - super.writeByte(149) + super.writeByte(148) super.writeValue(value.toList()) } else if let value = value as? PlatformCluster { - super.writeByte(150) + super.writeByte(149) super.writeValue(value.toList()) } else if let value = value as? PlatformClusterManager { - super.writeByte(151) + super.writeByte(150) super.writeValue(value.toList()) } else if let value = value as? PlatformMarker { - super.writeByte(152) + super.writeByte(151) super.writeValue(value.toList()) } else if let value = value as? PlatformPolygon { - super.writeByte(153) + super.writeByte(152) super.writeValue(value.toList()) } else if let value = value as? PlatformPolyline { - super.writeByte(154) + super.writeByte(153) super.writeValue(value.toList()) } else if let value = value as? PlatformPatternItem { - super.writeByte(155) + super.writeByte(154) super.writeValue(value.toList()) } else if let value = value as? PlatformTile { - super.writeByte(156) + super.writeByte(155) super.writeValue(value.toList()) } else if let value = value as? PlatformTileOverlay { - super.writeByte(157) + super.writeByte(156) super.writeValue(value.toList()) } else if let value = value as? PlatformEdgeInsets { - super.writeByte(158) + super.writeByte(157) super.writeValue(value.toList()) } else if let value = value as? PlatformLatLng { - super.writeByte(159) + super.writeByte(158) super.writeValue(value.toList()) } else if let value = value as? PlatformLatLngBounds { - super.writeByte(160) + super.writeByte(159) super.writeValue(value.toList()) } else if let value = value as? PlatformCameraTargetBounds { - super.writeByte(161) + super.writeByte(160) super.writeValue(value.toList()) } else if let value = value as? PlatformGroundOverlay { - super.writeByte(162) + super.writeByte(161) super.writeValue(value.toList()) } else if let value = value as? PlatformMapViewCreationParams { - super.writeByte(163) + super.writeByte(162) super.writeValue(value.toList()) } else if let value = value as? PlatformMapConfiguration { - super.writeByte(164) + super.writeByte(163) super.writeValue(value.toList()) } else if let value = value as? PlatformPoint { - super.writeByte(165) + super.writeByte(164) super.writeValue(value.toList()) } else if let value = value as? PlatformSize { - super.writeByte(166) + super.writeByte(165) super.writeValue(value.toList()) } else if let value = value as? PlatformColor { - super.writeByte(167) + super.writeByte(166) super.writeValue(value.toList()) } else if let value = value as? PlatformTileLayer { - super.writeByte(168) + super.writeByte(167) super.writeValue(value.toList()) } else if let value = value as? PlatformZoomRange { - super.writeByte(169) + super.writeByte(168) super.writeValue(value.toList()) } else if let value = value as? PlatformBitmap { - super.writeByte(170) + super.writeByte(169) super.writeValue(value.toList()) } else if let value = value as? PlatformBitmapDefaultMarker { - super.writeByte(171) + super.writeByte(170) super.writeValue(value.toList()) } else if let value = value as? PlatformBitmapBytes { - super.writeByte(172) + super.writeByte(171) super.writeValue(value.toList()) } else if let value = value as? PlatformBitmapAsset { - super.writeByte(173) + super.writeByte(172) super.writeValue(value.toList()) } else if let value = value as? PlatformBitmapAssetImage { - super.writeByte(174) + super.writeByte(173) super.writeValue(value.toList()) } else if let value = value as? PlatformBitmapAssetMap { - super.writeByte(175) + super.writeByte(174) super.writeValue(value.toList()) } else if let value = value as? PlatformBitmapBytesMap { - super.writeByte(176) + super.writeByte(175) super.writeValue(value.toList()) } else if let value = value as? PlatformBitmapPinConfig { - super.writeByte(177) + super.writeByte(176) super.writeValue(value.toList()) } else { super.writeValue(value) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/lib/src/google_maps_flutter_ios.dart b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/lib/src/google_maps_flutter_ios.dart index c0c8db027c8d..bd98f7dee937 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/lib/src/google_maps_flutter_ios.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/lib/src/google_maps_flutter_ios.dart @@ -714,57 +714,43 @@ class GoogleMapsFlutterIOS extends GoogleMapsFlutterPlatform { switch (update.updateType) { case CameraUpdateType.newCameraPosition: update as CameraUpdateNewCameraPosition; - return PlatformCameraUpdate( - cameraUpdate: PlatformCameraUpdateNewCameraPosition( - cameraPosition: _platformCameraPositionFromCameraPosition(update.cameraPosition), - ), + return PlatformCameraUpdateNewCameraPosition( + cameraPosition: _platformCameraPositionFromCameraPosition(update.cameraPosition), ); case CameraUpdateType.newLatLng: update as CameraUpdateNewLatLng; - return PlatformCameraUpdate( - cameraUpdate: PlatformCameraUpdateNewLatLng( - latLng: _platformLatLngFromLatLng(update.latLng), - ), - ); + return PlatformCameraUpdateNewLatLng(latLng: _platformLatLngFromLatLng(update.latLng)); case CameraUpdateType.newLatLngZoom: update as CameraUpdateNewLatLngZoom; - return PlatformCameraUpdate( - cameraUpdate: PlatformCameraUpdateNewLatLngZoom( - latLng: _platformLatLngFromLatLng(update.latLng), - zoom: update.zoom, - ), + return PlatformCameraUpdateNewLatLngZoom( + latLng: _platformLatLngFromLatLng(update.latLng), + zoom: update.zoom, ); case CameraUpdateType.newLatLngBounds: update as CameraUpdateNewLatLngBounds; - return PlatformCameraUpdate( - cameraUpdate: PlatformCameraUpdateNewLatLngBounds( - bounds: _platformLatLngBoundsFromLatLngBounds(update.bounds)!, - padding: update.padding, - ), + return PlatformCameraUpdateNewLatLngBounds( + bounds: _platformLatLngBoundsFromLatLngBounds(update.bounds)!, + padding: update.padding, ); case CameraUpdateType.zoomTo: update as CameraUpdateZoomTo; - return PlatformCameraUpdate(cameraUpdate: PlatformCameraUpdateZoomTo(zoom: update.zoom)); + return PlatformCameraUpdateZoomTo(zoom: update.zoom); case CameraUpdateType.zoomBy: update as CameraUpdateZoomBy; final Offset? focus = update.focus; - return PlatformCameraUpdate( - cameraUpdate: PlatformCameraUpdateZoomBy( - amount: update.amount, - focus: focus == null ? null : _platformPointFromOffset(focus), - ), + return PlatformCameraUpdateZoomBy( + amount: update.amount, + focus: focus == null ? null : _platformPointFromOffset(focus), ); case CameraUpdateType.zoomIn: update as CameraUpdateZoomIn; - return PlatformCameraUpdate(cameraUpdate: PlatformCameraUpdateZoom(out: false)); + return PlatformCameraUpdateZoom(out: false); case CameraUpdateType.zoomOut: update as CameraUpdateZoomOut; - return PlatformCameraUpdate(cameraUpdate: PlatformCameraUpdateZoom(out: true)); + return PlatformCameraUpdateZoom(out: true); case CameraUpdateType.scrollBy: update as CameraUpdateScrollBy; - return PlatformCameraUpdate( - cameraUpdate: PlatformCameraUpdateScrollBy(dx: update.dx, dy: update.dy), - ); + return PlatformCameraUpdateScrollBy(dx: update.dx, dy: update.dy); } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/lib/src/messages.g.dart b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/lib/src/messages.g.dart index ee3002aa13ce..7e8b2cf84b2e 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/lib/src/messages.g.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/lib/src/messages.g.dart @@ -190,52 +190,10 @@ class PlatformCameraPosition { } /// Pigeon representation of a CameraUpdate. -class PlatformCameraUpdate { - PlatformCameraUpdate({required this.cameraUpdate}); - - /// This Object must be one of the classes below prefixed with - /// PlatformCameraUpdate. Each such class represents a different type of - /// camera update, and each holds a different set of data, preventing the - /// use of a single unified class. - Object cameraUpdate; - - List _toList() { - return [cameraUpdate]; - } - - Object encode() { - return _toList(); - } - - static PlatformCameraUpdate decode(Object result) { - result as List; - return PlatformCameraUpdate(cameraUpdate: result[0]!); - } - - @override - // ignore: avoid_equals_and_hash_code_on_mutable_classes - bool operator ==(Object other) { - if (other is! PlatformCameraUpdate || other.runtimeType != runtimeType) { - return false; - } - if (identical(this, other)) { - return true; - } - return _deepEquals(cameraUpdate, other.cameraUpdate); - } - - @override - // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => _deepHash([runtimeType, ..._toList()]); - - @override - String toString() { - return 'PlatformCameraUpdate(cameraUpdate: $cameraUpdate)'; - } -} +sealed class PlatformCameraUpdate {} /// Pigeon equivalent of NewCameraPosition -class PlatformCameraUpdateNewCameraPosition { +class PlatformCameraUpdateNewCameraPosition extends PlatformCameraUpdate { PlatformCameraUpdateNewCameraPosition({required this.cameraPosition}); PlatformCameraPosition cameraPosition; @@ -278,7 +236,7 @@ class PlatformCameraUpdateNewCameraPosition { } /// Pigeon equivalent of NewLatLng -class PlatformCameraUpdateNewLatLng { +class PlatformCameraUpdateNewLatLng extends PlatformCameraUpdate { PlatformCameraUpdateNewLatLng({required this.latLng}); PlatformLatLng latLng; @@ -319,7 +277,7 @@ class PlatformCameraUpdateNewLatLng { } /// Pigeon equivalent of NewLatLngBounds -class PlatformCameraUpdateNewLatLngBounds { +class PlatformCameraUpdateNewLatLngBounds extends PlatformCameraUpdate { PlatformCameraUpdateNewLatLngBounds({required this.bounds, required this.padding}); PlatformLatLngBounds bounds; @@ -365,7 +323,7 @@ class PlatformCameraUpdateNewLatLngBounds { } /// Pigeon equivalent of NewLatLngZoom -class PlatformCameraUpdateNewLatLngZoom { +class PlatformCameraUpdateNewLatLngZoom extends PlatformCameraUpdate { PlatformCameraUpdateNewLatLngZoom({required this.latLng, required this.zoom}); PlatformLatLng latLng; @@ -411,7 +369,7 @@ class PlatformCameraUpdateNewLatLngZoom { } /// Pigeon equivalent of ScrollBy -class PlatformCameraUpdateScrollBy { +class PlatformCameraUpdateScrollBy extends PlatformCameraUpdate { PlatformCameraUpdateScrollBy({required this.dx, required this.dy}); double dx; @@ -454,7 +412,7 @@ class PlatformCameraUpdateScrollBy { } /// Pigeon equivalent of ZoomBy -class PlatformCameraUpdateZoomBy { +class PlatformCameraUpdateZoomBy extends PlatformCameraUpdate { PlatformCameraUpdateZoomBy({required this.amount, this.focus}); double amount; @@ -500,7 +458,7 @@ class PlatformCameraUpdateZoomBy { } /// Pigeon equivalent of ZoomIn/ZoomOut -class PlatformCameraUpdateZoom { +class PlatformCameraUpdateZoom extends PlatformCameraUpdate { PlatformCameraUpdateZoom({required this.out}); bool out; @@ -541,7 +499,7 @@ class PlatformCameraUpdateZoom { } /// Pigeon equivalent of ZoomTo -class PlatformCameraUpdateZoomTo { +class PlatformCameraUpdateZoomTo extends PlatformCameraUpdate { PlatformCameraUpdateZoomTo({required this.zoom}); double zoom; @@ -2769,131 +2727,128 @@ class _PigeonCodec extends StandardMessageCodec { } else if (value is PlatformCameraPosition) { buffer.putUint8(135); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdate) { - buffer.putUint8(136); - writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateNewCameraPosition) { - buffer.putUint8(137); + buffer.putUint8(136); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateNewLatLng) { - buffer.putUint8(138); + buffer.putUint8(137); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateNewLatLngBounds) { - buffer.putUint8(139); + buffer.putUint8(138); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateNewLatLngZoom) { - buffer.putUint8(140); + buffer.putUint8(139); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateScrollBy) { - buffer.putUint8(141); + buffer.putUint8(140); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateZoomBy) { - buffer.putUint8(142); + buffer.putUint8(141); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateZoom) { - buffer.putUint8(143); + buffer.putUint8(142); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateZoomTo) { - buffer.putUint8(144); + buffer.putUint8(143); writeValue(buffer, value.encode()); } else if (value is PlatformCircle) { - buffer.putUint8(145); + buffer.putUint8(144); writeValue(buffer, value.encode()); } else if (value is PlatformHeatmap) { - buffer.putUint8(146); + buffer.putUint8(145); writeValue(buffer, value.encode()); } else if (value is PlatformHeatmapGradient) { - buffer.putUint8(147); + buffer.putUint8(146); writeValue(buffer, value.encode()); } else if (value is PlatformWeightedLatLng) { - buffer.putUint8(148); + buffer.putUint8(147); writeValue(buffer, value.encode()); } else if (value is PlatformInfoWindow) { - buffer.putUint8(149); + buffer.putUint8(148); writeValue(buffer, value.encode()); } else if (value is PlatformCluster) { - buffer.putUint8(150); + buffer.putUint8(149); writeValue(buffer, value.encode()); } else if (value is PlatformClusterManager) { - buffer.putUint8(151); + buffer.putUint8(150); writeValue(buffer, value.encode()); } else if (value is PlatformMarker) { - buffer.putUint8(152); + buffer.putUint8(151); writeValue(buffer, value.encode()); } else if (value is PlatformPolygon) { - buffer.putUint8(153); + buffer.putUint8(152); writeValue(buffer, value.encode()); } else if (value is PlatformPolyline) { - buffer.putUint8(154); + buffer.putUint8(153); writeValue(buffer, value.encode()); } else if (value is PlatformPatternItem) { - buffer.putUint8(155); + buffer.putUint8(154); writeValue(buffer, value.encode()); } else if (value is PlatformTile) { - buffer.putUint8(156); + buffer.putUint8(155); writeValue(buffer, value.encode()); } else if (value is PlatformTileOverlay) { - buffer.putUint8(157); + buffer.putUint8(156); writeValue(buffer, value.encode()); } else if (value is PlatformEdgeInsets) { - buffer.putUint8(158); + buffer.putUint8(157); writeValue(buffer, value.encode()); } else if (value is PlatformLatLng) { - buffer.putUint8(159); + buffer.putUint8(158); writeValue(buffer, value.encode()); } else if (value is PlatformLatLngBounds) { - buffer.putUint8(160); + buffer.putUint8(159); writeValue(buffer, value.encode()); } else if (value is PlatformCameraTargetBounds) { - buffer.putUint8(161); + buffer.putUint8(160); writeValue(buffer, value.encode()); } else if (value is PlatformGroundOverlay) { - buffer.putUint8(162); + buffer.putUint8(161); writeValue(buffer, value.encode()); } else if (value is PlatformMapViewCreationParams) { - buffer.putUint8(163); + buffer.putUint8(162); writeValue(buffer, value.encode()); } else if (value is PlatformMapConfiguration) { - buffer.putUint8(164); + buffer.putUint8(163); writeValue(buffer, value.encode()); } else if (value is PlatformPoint) { - buffer.putUint8(165); + buffer.putUint8(164); writeValue(buffer, value.encode()); } else if (value is PlatformSize) { - buffer.putUint8(166); + buffer.putUint8(165); writeValue(buffer, value.encode()); } else if (value is PlatformColor) { - buffer.putUint8(167); + buffer.putUint8(166); writeValue(buffer, value.encode()); } else if (value is PlatformTileLayer) { - buffer.putUint8(168); + buffer.putUint8(167); writeValue(buffer, value.encode()); } else if (value is PlatformZoomRange) { - buffer.putUint8(169); + buffer.putUint8(168); writeValue(buffer, value.encode()); } else if (value is PlatformBitmap) { - buffer.putUint8(170); + buffer.putUint8(169); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapDefaultMarker) { - buffer.putUint8(171); + buffer.putUint8(170); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapBytes) { - buffer.putUint8(172); + buffer.putUint8(171); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapAsset) { - buffer.putUint8(173); + buffer.putUint8(172); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapAssetImage) { - buffer.putUint8(174); + buffer.putUint8(173); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapAssetMap) { - buffer.putUint8(175); + buffer.putUint8(174); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapBytesMap) { - buffer.putUint8(176); + buffer.putUint8(175); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapPinConfig) { - buffer.putUint8(177); + buffer.putUint8(176); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); @@ -2924,88 +2879,86 @@ class _PigeonCodec extends StandardMessageCodec { case 135: return PlatformCameraPosition.decode(readValue(buffer)!); case 136: - return PlatformCameraUpdate.decode(readValue(buffer)!); - case 137: return PlatformCameraUpdateNewCameraPosition.decode(readValue(buffer)!); - case 138: + case 137: return PlatformCameraUpdateNewLatLng.decode(readValue(buffer)!); - case 139: + case 138: return PlatformCameraUpdateNewLatLngBounds.decode(readValue(buffer)!); - case 140: + case 139: return PlatformCameraUpdateNewLatLngZoom.decode(readValue(buffer)!); - case 141: + case 140: return PlatformCameraUpdateScrollBy.decode(readValue(buffer)!); - case 142: + case 141: return PlatformCameraUpdateZoomBy.decode(readValue(buffer)!); - case 143: + case 142: return PlatformCameraUpdateZoom.decode(readValue(buffer)!); - case 144: + case 143: return PlatformCameraUpdateZoomTo.decode(readValue(buffer)!); - case 145: + case 144: return PlatformCircle.decode(readValue(buffer)!); - case 146: + case 145: return PlatformHeatmap.decode(readValue(buffer)!); - case 147: + case 146: return PlatformHeatmapGradient.decode(readValue(buffer)!); - case 148: + case 147: return PlatformWeightedLatLng.decode(readValue(buffer)!); - case 149: + case 148: return PlatformInfoWindow.decode(readValue(buffer)!); - case 150: + case 149: return PlatformCluster.decode(readValue(buffer)!); - case 151: + case 150: return PlatformClusterManager.decode(readValue(buffer)!); - case 152: + case 151: return PlatformMarker.decode(readValue(buffer)!); - case 153: + case 152: return PlatformPolygon.decode(readValue(buffer)!); - case 154: + case 153: return PlatformPolyline.decode(readValue(buffer)!); - case 155: + case 154: return PlatformPatternItem.decode(readValue(buffer)!); - case 156: + case 155: return PlatformTile.decode(readValue(buffer)!); - case 157: + case 156: return PlatformTileOverlay.decode(readValue(buffer)!); - case 158: + case 157: return PlatformEdgeInsets.decode(readValue(buffer)!); - case 159: + case 158: return PlatformLatLng.decode(readValue(buffer)!); - case 160: + case 159: return PlatformLatLngBounds.decode(readValue(buffer)!); - case 161: + case 160: return PlatformCameraTargetBounds.decode(readValue(buffer)!); - case 162: + case 161: return PlatformGroundOverlay.decode(readValue(buffer)!); - case 163: + case 162: return PlatformMapViewCreationParams.decode(readValue(buffer)!); - case 164: + case 163: return PlatformMapConfiguration.decode(readValue(buffer)!); - case 165: + case 164: return PlatformPoint.decode(readValue(buffer)!); - case 166: + case 165: return PlatformSize.decode(readValue(buffer)!); - case 167: + case 166: return PlatformColor.decode(readValue(buffer)!); - case 168: + case 167: return PlatformTileLayer.decode(readValue(buffer)!); - case 169: + case 168: return PlatformZoomRange.decode(readValue(buffer)!); - case 170: + case 169: return PlatformBitmap.decode(readValue(buffer)!); - case 171: + case 170: return PlatformBitmapDefaultMarker.decode(readValue(buffer)!); - case 172: + case 171: return PlatformBitmapBytes.decode(readValue(buffer)!); - case 173: + case 172: return PlatformBitmapAsset.decode(readValue(buffer)!); - case 174: + case 173: return PlatformBitmapAssetImage.decode(readValue(buffer)!); - case 175: + case 174: return PlatformBitmapAssetMap.decode(readValue(buffer)!); - case 176: + case 175: return PlatformBitmapBytesMap.decode(readValue(buffer)!); - case 177: + case 176: return PlatformBitmapPinConfig.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/pigeons/messages.dart b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/pigeons/messages.dart index eee6b03f7fa6..781f4e088e70 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/pigeons/messages.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/pigeons/messages.dart @@ -34,66 +34,56 @@ class PlatformCameraPosition { } /// Pigeon representation of a CameraUpdate. -class PlatformCameraUpdate { - PlatformCameraUpdate(this.cameraUpdate); - - /// This Object must be one of the classes below prefixed with - /// PlatformCameraUpdate. Each such class represents a different type of - /// camera update, and each holds a different set of data, preventing the - /// use of a single unified class. - // Pigeon does not support inheritance, which prevents a more strict type - // bound. See https://github.com/flutter/flutter/issues/117819. - final Object cameraUpdate; -} +sealed class PlatformCameraUpdate {} /// Pigeon equivalent of NewCameraPosition -class PlatformCameraUpdateNewCameraPosition { +class PlatformCameraUpdateNewCameraPosition extends PlatformCameraUpdate { PlatformCameraUpdateNewCameraPosition(this.cameraPosition); final PlatformCameraPosition cameraPosition; } /// Pigeon equivalent of NewLatLng -class PlatformCameraUpdateNewLatLng { +class PlatformCameraUpdateNewLatLng extends PlatformCameraUpdate { PlatformCameraUpdateNewLatLng(this.latLng); final PlatformLatLng latLng; } /// Pigeon equivalent of NewLatLngBounds -class PlatformCameraUpdateNewLatLngBounds { +class PlatformCameraUpdateNewLatLngBounds extends PlatformCameraUpdate { PlatformCameraUpdateNewLatLngBounds(this.bounds, this.padding); final PlatformLatLngBounds bounds; final double padding; } /// Pigeon equivalent of NewLatLngZoom -class PlatformCameraUpdateNewLatLngZoom { +class PlatformCameraUpdateNewLatLngZoom extends PlatformCameraUpdate { PlatformCameraUpdateNewLatLngZoom(this.latLng, this.zoom); final PlatformLatLng latLng; final double zoom; } /// Pigeon equivalent of ScrollBy -class PlatformCameraUpdateScrollBy { +class PlatformCameraUpdateScrollBy extends PlatformCameraUpdate { PlatformCameraUpdateScrollBy(this.dx, this.dy); final double dx; final double dy; } /// Pigeon equivalent of ZoomBy -class PlatformCameraUpdateZoomBy { +class PlatformCameraUpdateZoomBy extends PlatformCameraUpdate { PlatformCameraUpdateZoomBy(this.amount, [this.focus]); final double amount; final PlatformPoint? focus; } /// Pigeon equivalent of ZoomIn/ZoomOut -class PlatformCameraUpdateZoom { +class PlatformCameraUpdateZoom extends PlatformCameraUpdate { PlatformCameraUpdateZoom(this.out); final bool out; } /// Pigeon equivalent of ZoomTo -class PlatformCameraUpdateZoomTo { +class PlatformCameraUpdateZoomTo extends PlatformCameraUpdate { PlatformCameraUpdateZoomTo(this.zoom); final double zoom; } From 33c5c36da59bffd22e18af5ad6344a5460086b99 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Wed, 2 Sep 2026 14:19:28 -0400 Subject: [PATCH 06/14] Remove ConcreteTileProvider in favor of an extension --- .../GoogleMapController.swift | 33 +++---------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapController.swift index 93d482d4bb24..524bd6383b69 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/GoogleMapController.swift @@ -16,6 +16,9 @@ protocol MapAnimationCATransactionProtocol { /// Add the AnyObject-required protocol to MapsCallbackApi to allow it to be passed to sub-controllers. extension MapsCallbackApi: MapEventDelegate {} +/// Add TileProviderDelegate to avoid needing to pass the entire API surface to TileOverlayController. +extension MapsCallbackApi: TileProviderDelegate {} + /// Non-test implementation of MapAnimationCATransactionProtocol. class DefaultMapAnimationCATransaction: MapAnimationCATransactionProtocol { func begin() { @@ -61,8 +64,6 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV let callHandler: MapCallHandler /// The inspector API implementation, separate to avoid lifetime extension. let inspector: MapInspector - /// A shim to pass tile requests to `dartCallbackHandler`. This is a separate object to avoid init ordering issues. - private let tileProvider: ConcreteTileProvider /// Whether to send notifications about camera position changes to Dart. var trackCameraPosition = false @@ -164,10 +165,9 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV eventDelegate: dartCallbackHandler ) heatmapsController = HeatmapsController(mapView: mapView) - tileProvider = ConcreteTileProvider(dartCallbackHandler: dartCallbackHandler) tileOverlaysController = TileOverlaysController( mapView: mapView, - tileProvider: tileProvider + tileProvider: dartCallbackHandler ) groundOverlaysController = GroundOverlaysController( mapView: mapView, @@ -471,31 +471,6 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV } } -// TODO(stuartmorgan): Remove this in favor of an extension to add TileProviderDelegate to -// the Pigeon Flutter API object once this plugin has switched to Swift Pigeon generation -// (adjusting the protocol to match the Swift version of the signature). -private class ConcreteTileProvider: TileProviderDelegate { - let handler: MapsCallbackApi - - init(dartCallbackHandler: MapsCallbackApi) { - handler = dartCallbackHandler - } - - public func tile( - withOverlayIdentifier tileOverlayId: String, - location: PlatformPoint, - zoom: Int64, - completion: @escaping (Result) -> Void - ) { - handler.tile( - withOverlayIdentifier: tileOverlayId, - location: location, - zoom: zoom, - completion: completion - ) - } -} - class MapCallHandler: MapsApi { weak var controller: GoogleMapController? let messenger: FlutterBinaryMessenger From 074b546827621ae9b5afec1d40eda281d2f9dbb3 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Thu, 3 Sep 2026 15:14:04 -0400 Subject: [PATCH 07/14] Clean up the bitmap subclassing --- .../ClusterManagersControllerTests.swift | 2 +- .../ExtractIconFromDataTests.swift | 53 +++------- .../GroundOverlayControllerTests.swift | 6 +- .../RunnerTests/MarkerControllerTests.swift | 2 +- .../ConversionUtils.swift | 2 +- .../ImageUtils.swift | 4 +- .../Messages.g.swift | 88 +++++------------ .../lib/src/google_maps_flutter_ios.dart | 96 ++++++++----------- .../lib/src/messages.g.dart | 96 +++++-------------- .../pigeons/messages.dart | 31 ++---- 10 files changed, 114 insertions(+), 266 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ClusterManagersControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ClusterManagersControllerTests.swift index f54527f823d1..3e60aba04ada 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ClusterManagersControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ClusterManagersControllerTests.swift @@ -48,7 +48,7 @@ import Testing let zeroPoint = PlatformPoint(x: 0, y: 0) let zeroLatLng = PlatformLatLng(latitude: 0, longitude: 0) - let bitmap = PlatformBitmap(bitmap: PlatformBitmapDefaultMarker(hue: 0)) + let bitmap = PlatformBitmapDefaultMarker(hue: 0) let infoWindow = PlatformInfoWindow( title: "Info", snippet: nil, diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ExtractIconFromDataTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ExtractIconFromDataTests.swift index 87b9dab3afc8..1f52c708e955 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ExtractIconFromDataTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/ExtractIconFromDataTests.swift @@ -24,10 +24,7 @@ import Testing let screenScale: CGFloat = 3.0 - let resultImage = PlatformBitmap(bitmap: bitmap).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = bitmap.createIcon(assetProvider: assetProvider, screenScale: screenScale) #expect(resultImage != nil) #expect(resultImage?.scale == 1.0) @@ -51,10 +48,7 @@ import Testing let screenScale: CGFloat = 3.0 - let resultImage = PlatformBitmap(bitmap: bitmap).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = bitmap.createIcon(assetProvider: assetProvider, screenScale: screenScale) #expect(resultImage != nil) #expect(resultImage?.scale == 10) @@ -80,10 +74,7 @@ import Testing let screenScale: CGFloat = 3.0 - let resultImage = PlatformBitmap(bitmap: bitmap).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = bitmap.createIcon(assetProvider: assetProvider, screenScale: screenScale) #expect(resultImage != nil) #expect(testImage.scale == 1.0) @@ -114,10 +105,7 @@ import Testing let screenScale: CGFloat = 3.0 - let resultImage = PlatformBitmap(bitmap: bitmap).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = bitmap.createIcon(assetProvider: assetProvider, screenScale: screenScale) #expect(resultImage != nil) #expect(resultImage?.scale == screenScale) #expect(resultImage?.size.width == width) @@ -140,10 +128,7 @@ import Testing let screenScale: CGFloat = 3.0 - let resultImage = PlatformBitmap(bitmap: bitmap).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = bitmap.createIcon(assetProvider: assetProvider, screenScale: screenScale) #expect(resultImage != nil) #expect(resultImage?.scale == 1.0) @@ -166,7 +151,7 @@ import Testing let screenScale: CGFloat = 3.0 - let resultImage = PlatformBitmap(bitmap: bitmap).createIcon( + let resultImage = bitmap.createIcon( assetProvider: TestAssetProvider(), screenScale: screenScale ) @@ -192,7 +177,7 @@ import Testing let screenScale: CGFloat = 3.0 - let resultImage = PlatformBitmap(bitmap: bitmap).createIcon( + let resultImage = bitmap.createIcon( assetProvider: TestAssetProvider(), screenScale: screenScale ) @@ -219,7 +204,7 @@ import Testing let screenScale: CGFloat = 3.0 - let resultImage = PlatformBitmap(bitmap: bitmap).createIcon( + let resultImage = bitmap.createIcon( assetProvider: TestAssetProvider(), screenScale: screenScale ) @@ -253,7 +238,7 @@ import Testing let screenScale: CGFloat = 3.0 - let resultImage = PlatformBitmap(bitmap: bitmap).createIcon( + let resultImage = bitmap.createIcon( assetProvider: TestAssetProvider(), screenScale: screenScale ) @@ -278,7 +263,7 @@ import Testing let screenScale: CGFloat = 3.0 - let resultImage = PlatformBitmap(bitmap: bitmap).createIcon( + let resultImage = bitmap.createIcon( assetProvider: TestAssetProvider(), screenScale: screenScale ) @@ -308,10 +293,7 @@ import Testing let screenScale: CGFloat = 3.0 - let resultImage = PlatformBitmap(bitmap: pinConfig).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = pinConfig.createIcon(assetProvider: assetProvider, screenScale: screenScale) // PinConfig may return nil on old Google Maps SDK versions (<=8.4.0). // Also, due to a Google Maps SDK issue (https://issuetracker.google.com/issues/370536110), @@ -336,10 +318,7 @@ import Testing let screenScale: CGFloat = 3.0 - let resultImage = PlatformBitmap(bitmap: pinConfig).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = pinConfig.createIcon(assetProvider: assetProvider, screenScale: screenScale) // PinConfig returns nil on iOS versions without GMSPinImageOptions support (< iOS 16.0). // On simulators, GMSPinImage may also return a zero-dimension image. Both cases are acceptable @@ -361,7 +340,6 @@ import Testing width: nil, height: nil ) - let glyphBitmap = PlatformBitmap(bitmap: assetBitmap) let backgroundColor = PlatformColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) let borderColor = PlatformColor(red: 0.0, green: 0.0, blue: 0.0, alpha: 1.0) @@ -372,15 +350,12 @@ import Testing glyphColor: nil, glyphTextColor: nil, glyphText: nil, - glyphBitmap: glyphBitmap + glyphBitmap: assetBitmap ) let screenScale: CGFloat = 3.0 - let resultImage = PlatformBitmap(bitmap: pinConfig).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = pinConfig.createIcon(assetProvider: assetProvider, screenScale: screenScale) // PinConfig returns nil on iOS versions without GMSPinImageOptions support (< iOS 16.0). // On simulators, GMSPinImage may also return a zero-dimension image. Both cases are acceptable diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GroundOverlayControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GroundOverlayControllerTests.swift index 8b56f666de34..f5f528e4eefd 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GroundOverlayControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/GroundOverlayControllerTests.swift @@ -77,7 +77,7 @@ import Testing let position = PlatformLatLng(latitude: 52.4816, longitude: 3.1791) - let bitmap = PlatformBitmap(bitmap: PlatformBitmapDefaultMarker(hue: 0)) + let bitmap = PlatformBitmapDefaultMarker(hue: 0) let platformGroundOverlay = PlatformGroundOverlay( groundOverlayId: "id_1", @@ -143,7 +143,7 @@ import Testing southwest: PlatformLatLng(latitude: 52.4816, longitude: 3.1791) ) - let bitmap = PlatformBitmap(bitmap: PlatformBitmapDefaultMarker(hue: 0)) + let bitmap = PlatformBitmapDefaultMarker(hue: 0) let platformGroundOverlay = PlatformGroundOverlay( groundOverlayId: "id_1", @@ -211,7 +211,7 @@ import Testing groundOverlay, from: PlatformGroundOverlay( groundOverlayId: "groundOverlay", - image: PlatformBitmap(bitmap: PlatformBitmapDefaultMarker(hue: 0)), + image: PlatformBitmapDefaultMarker(hue: 0), position: PlatformLatLng(latitude: 0, longitude: 0), bounds: PlatformLatLngBounds( northeast: PlatformLatLng(latitude: 54.4816, longitude: 5.1791), diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/MarkerControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/MarkerControllerTests.swift index 91b8e7304c8d..717407e2dbc5 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/MarkerControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/example/ios/RunnerTests/MarkerControllerTests.swift @@ -34,7 +34,7 @@ import Testing } func placeholderBitmap() -> PlatformBitmap { - return PlatformBitmap(bitmap: PlatformBitmapDefaultMarker(hue: 0)) + return PlatformBitmapDefaultMarker(hue: 0) } @Test func setsMarkerNumericProperties() throws { diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ConversionUtils.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ConversionUtils.swift index 927eb4152557..05d91b0bda0a 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ConversionUtils.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ConversionUtils.swift @@ -117,7 +117,7 @@ extension PlatformGroundOverlay { isCreatedWithBounds: Bool, zoomLevel: Double? ) -> PlatformGroundOverlay { - let placeholderImage = PlatformBitmap(bitmap: PlatformBitmapDefaultMarker(hue: nil)) + let placeholderImage = PlatformBitmapDefaultMarker(hue: nil) if isCreatedWithBounds, let bounds = groundOverlay.bounds { return PlatformGroundOverlay( groundOverlayId: overlayId, diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ImageUtils.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ImageUtils.swift index 5560d0eed5ef..de6a4797ce3f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ImageUtils.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/ImageUtils.swift @@ -16,9 +16,7 @@ extension PlatformBitmap { var image: UIImage? - // See comment in messages.dart for why this is so loosely typed. See also - // https://github.com/flutter/flutter/issues/117819. - switch bitmap { + switch self { case let bitmap as PlatformBitmapDefaultMarker: image = GMSMarker.markerImage( with: UIColor( diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/Messages.g.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/Messages.g.swift index db3ba0fced7d..76dd15c5e9e7 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/Messages.g.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/Messages.g.swift @@ -2215,55 +2215,18 @@ struct PlatformZoomRange: Hashable, CustomStringConvertible { } } -/// Pigeon equivalent of [BitmapDescriptor]. As there are multiple disjoint -/// types of [BitmapDescriptor], [PlatformBitmap] contains a single field which -/// may hold the pigeon equivalent type of any of them. +/// Pigeon equivalent of [BitmapDescriptor]. /// /// Generated class from Pigeon that represents data sent in messages. -struct PlatformBitmap: Hashable, CustomStringConvertible { - /// One of [PlatformBitmapAssetMap], [PlatformBitmapAsset], - /// [PlatformBitmapAssetImage], [PlatformBitmapBytesMap], - /// [PlatformBitmapBytes], or [PlatformBitmapDefaultMarker]. - /// As Pigeon does not currently support data class inheritance, this - /// approach allows for the different bitmap implementations to be valid - /// argument and return types of the API methods. See - /// https://github.com/flutter/flutter/issues/117819. - var bitmap: Any - - // swift-format-ignore: AlwaysUseLowerCamelCase - static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmap? { - let bitmap = pigeonVar_list[0]! - - return PlatformBitmap( - bitmap: bitmap - ) - } - func toList() -> [Any?] { - return [ - bitmap - ] - } - static func == (lhs: PlatformBitmap, rhs: PlatformBitmap) -> Bool { - if Swift.type(of: lhs) != Swift.type(of: rhs) { - return false - } - return MessagesPigeonInternal.deepEquals(lhs.bitmap, rhs.bitmap) - } - - func hash(into hasher: inout Hasher) { - hasher.combine("PlatformBitmap") - MessagesPigeonInternal.deepHash(value: bitmap, hasher: &hasher) - } +/// This protocol should not be extended by any user class outside of the generated file. +protocol PlatformBitmap { - public var description: String { - return "PlatformBitmap(bitmap: \(String(describing: bitmap)))" - } } /// Pigeon equivalent of [DefaultMarker]. /// /// Generated class from Pigeon that represents data sent in messages. -struct PlatformBitmapDefaultMarker: Hashable, CustomStringConvertible { +struct PlatformBitmapDefaultMarker: PlatformBitmap { var hue: Double? = nil // swift-format-ignore: AlwaysUseLowerCamelCase @@ -2299,7 +2262,7 @@ struct PlatformBitmapDefaultMarker: Hashable, CustomStringConvertible { /// Pigeon equivalent of [BytesBitmap]. /// /// Generated class from Pigeon that represents data sent in messages. -struct PlatformBitmapBytes: Hashable, CustomStringConvertible { +struct PlatformBitmapBytes: PlatformBitmap { var byteData: FlutterStandardTypedData var size: PlatformSize? = nil @@ -2342,7 +2305,7 @@ struct PlatformBitmapBytes: Hashable, CustomStringConvertible { /// Pigeon equivalent of [AssetBitmap]. /// /// Generated class from Pigeon that represents data sent in messages. -struct PlatformBitmapAsset: Hashable, CustomStringConvertible { +struct PlatformBitmapAsset: PlatformBitmap { var name: String var pkg: String? = nil @@ -2384,7 +2347,7 @@ struct PlatformBitmapAsset: Hashable, CustomStringConvertible { /// Pigeon equivalent of [AssetImageBitmap]. /// /// Generated class from Pigeon that represents data sent in messages. -struct PlatformBitmapAssetImage: Hashable, CustomStringConvertible { +struct PlatformBitmapAssetImage: PlatformBitmap { var name: String var scale: Double var size: PlatformSize? = nil @@ -2433,7 +2396,7 @@ struct PlatformBitmapAssetImage: Hashable, CustomStringConvertible { /// Pigeon equivalent of [AssetMapBitmap]. /// /// Generated class from Pigeon that represents data sent in messages. -struct PlatformBitmapAssetMap: Hashable, CustomStringConvertible { +struct PlatformBitmapAssetMap: PlatformBitmap { var assetName: String var bitmapScaling: PlatformMapBitmapScaling var imagePixelRatio: Double @@ -2494,7 +2457,7 @@ struct PlatformBitmapAssetMap: Hashable, CustomStringConvertible { /// Pigeon equivalent of [BytesMapBitmap]. /// /// Generated class from Pigeon that represents data sent in messages. -struct PlatformBitmapBytesMap: Hashable, CustomStringConvertible { +struct PlatformBitmapBytesMap: PlatformBitmap { var byteData: FlutterStandardTypedData var bitmapScaling: PlatformMapBitmapScaling var imagePixelRatio: Double @@ -2555,7 +2518,7 @@ struct PlatformBitmapBytesMap: Hashable, CustomStringConvertible { /// Pigeon equivalent of [PinConfig]. /// /// Generated class from Pigeon that represents data sent in messages. -struct PlatformBitmapPinConfig: Hashable, CustomStringConvertible { +struct PlatformBitmapPinConfig: PlatformBitmap { var backgroundColor: PlatformColor? = nil var borderColor: PlatformColor? = nil var glyphColor: PlatformColor? = nil @@ -2727,20 +2690,18 @@ private class MessagesPigeonCodecReader: FlutterStandardReader { case 168: return PlatformZoomRange.fromList(self.readValue() as! [Any?]) case 169: - return PlatformBitmap.fromList(self.readValue() as! [Any?]) - case 170: return PlatformBitmapDefaultMarker.fromList(self.readValue() as! [Any?]) - case 171: + case 170: return PlatformBitmapBytes.fromList(self.readValue() as! [Any?]) - case 172: + case 171: return PlatformBitmapAsset.fromList(self.readValue() as! [Any?]) - case 173: + case 172: return PlatformBitmapAssetImage.fromList(self.readValue() as! [Any?]) - case 174: + case 173: return PlatformBitmapAssetMap.fromList(self.readValue() as! [Any?]) - case 175: + case 174: return PlatformBitmapBytesMap.fromList(self.readValue() as! [Any?]) - case 176: + case 175: return PlatformBitmapPinConfig.fromList(self.readValue() as! [Any?]) default: return super.readValue(ofType: type) @@ -2870,29 +2831,26 @@ private class MessagesPigeonCodecWriter: FlutterStandardWriter { } else if let value = value as? PlatformZoomRange { super.writeByte(168) super.writeValue(value.toList()) - } else if let value = value as? PlatformBitmap { - super.writeByte(169) - super.writeValue(value.toList()) } else if let value = value as? PlatformBitmapDefaultMarker { - super.writeByte(170) + super.writeByte(169) super.writeValue(value.toList()) } else if let value = value as? PlatformBitmapBytes { - super.writeByte(171) + super.writeByte(170) super.writeValue(value.toList()) } else if let value = value as? PlatformBitmapAsset { - super.writeByte(172) + super.writeByte(171) super.writeValue(value.toList()) } else if let value = value as? PlatformBitmapAssetImage { - super.writeByte(173) + super.writeByte(172) super.writeValue(value.toList()) } else if let value = value as? PlatformBitmapAssetMap { - super.writeByte(174) + super.writeByte(173) super.writeValue(value.toList()) } else if let value = value as? PlatformBitmapBytesMap { - super.writeByte(175) + super.writeByte(174) super.writeValue(value.toList()) } else if let value = value as? PlatformBitmapPinConfig { - super.writeByte(176) + super.writeByte(175) super.writeValue(value.toList()) } else { super.writeValue(value) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/lib/src/google_maps_flutter_ios.dart b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/lib/src/google_maps_flutter_ios.dart index bd98f7dee937..11df18180a50 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/lib/src/google_maps_flutter_ios.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/lib/src/google_maps_flutter_ios.dart @@ -802,51 +802,41 @@ class GoogleMapsFlutterIOS extends GoogleMapsFlutterPlatform { static PlatformBitmap platformBitmapFromBitmapDescriptor(BitmapDescriptor bitmap) { switch (bitmap) { case final DefaultMarker marker: - return PlatformBitmap(bitmap: PlatformBitmapDefaultMarker(hue: marker.hue?.toDouble())); + return PlatformBitmapDefaultMarker(hue: marker.hue?.toDouble()); // Clients may still use this deprecated format, so it must be supported. // ignore: deprecated_member_use case final BytesBitmap bytes: final Size? size = bytes.size; - return PlatformBitmap( - bitmap: PlatformBitmapBytes( - byteData: bytes.byteData, - size: (size == null) ? null : _platformSizeFromSize(size), - ), + return PlatformBitmapBytes( + byteData: bytes.byteData, + size: (size == null) ? null : _platformSizeFromSize(size), ); case final AssetBitmap asset: - return PlatformBitmap( - bitmap: PlatformBitmapAsset(name: asset.name, pkg: asset.package), - ); + return PlatformBitmapAsset(name: asset.name, pkg: asset.package); // Clients may still use this deprecated format, so it must be supported. // ignore: deprecated_member_use case final AssetImageBitmap asset: final Size? size = asset.size; - return PlatformBitmap( - bitmap: PlatformBitmapAssetImage( - name: asset.name, - scale: asset.scale, - size: (size == null) ? null : _platformSizeFromSize(size), - ), + return PlatformBitmapAssetImage( + name: asset.name, + scale: asset.scale, + size: (size == null) ? null : _platformSizeFromSize(size), ); case final AssetMapBitmap asset: - return PlatformBitmap( - bitmap: PlatformBitmapAssetMap( - assetName: asset.assetName, - bitmapScaling: platformMapBitmapScalingFromScaling(asset.bitmapScaling), - imagePixelRatio: asset.imagePixelRatio, - width: asset.width, - height: asset.height, - ), + return PlatformBitmapAssetMap( + assetName: asset.assetName, + bitmapScaling: platformMapBitmapScalingFromScaling(asset.bitmapScaling), + imagePixelRatio: asset.imagePixelRatio, + width: asset.width, + height: asset.height, ); case final BytesMapBitmap bytes: - return PlatformBitmap( - bitmap: PlatformBitmapBytesMap( - byteData: bytes.byteData, - bitmapScaling: platformMapBitmapScalingFromScaling(bytes.bitmapScaling), - imagePixelRatio: bytes.imagePixelRatio, - width: bytes.width, - height: bytes.height, - ), + return PlatformBitmapBytesMap( + byteData: bytes.byteData, + bitmapScaling: platformMapBitmapScalingFromScaling(bytes.bitmapScaling), + imagePixelRatio: bytes.imagePixelRatio, + width: bytes.width, + height: bytes.height, ); case final PinConfig pinConfig: final PlatformColor? backgroundColor = pinConfig.backgroundColor != null @@ -857,38 +847,30 @@ class GoogleMapsFlutterIOS extends GoogleMapsFlutterPlatform { : null; switch (pinConfig.glyph) { case final CircleGlyph circleGlyph: - return PlatformBitmap( - bitmap: PlatformBitmapPinConfig( - backgroundColor: backgroundColor, - borderColor: borderColor, - glyphColor: _platformColorFromColor(circleGlyph.color), - ), + return PlatformBitmapPinConfig( + backgroundColor: backgroundColor, + borderColor: borderColor, + glyphColor: _platformColorFromColor(circleGlyph.color), ); case final TextGlyph textGlyph: - return PlatformBitmap( - bitmap: PlatformBitmapPinConfig( - backgroundColor: backgroundColor, - borderColor: borderColor, - glyphText: textGlyph.text, - glyphTextColor: textGlyph.textColor != null - ? _platformColorFromColor(textGlyph.textColor!) - : null, - ), + return PlatformBitmapPinConfig( + backgroundColor: backgroundColor, + borderColor: borderColor, + glyphText: textGlyph.text, + glyphTextColor: textGlyph.textColor != null + ? _platformColorFromColor(textGlyph.textColor!) + : null, ); case final BitmapGlyph bitmapGlyph: - return PlatformBitmap( - bitmap: PlatformBitmapPinConfig( - backgroundColor: backgroundColor, - borderColor: borderColor, - glyphBitmap: platformBitmapFromBitmapDescriptor(bitmapGlyph.bitmap), - ), + return PlatformBitmapPinConfig( + backgroundColor: backgroundColor, + borderColor: borderColor, + glyphBitmap: platformBitmapFromBitmapDescriptor(bitmapGlyph.bitmap), ); case null: - return PlatformBitmap( - bitmap: PlatformBitmapPinConfig( - backgroundColor: backgroundColor, - borderColor: borderColor, - ), + return PlatformBitmapPinConfig( + backgroundColor: backgroundColor, + borderColor: borderColor, ); } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/lib/src/messages.g.dart b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/lib/src/messages.g.dart index 7e8b2cf84b2e..0d4c1db5f19f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/lib/src/messages.g.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/lib/src/messages.g.dart @@ -2264,58 +2264,11 @@ class PlatformZoomRange { } } -/// Pigeon equivalent of [BitmapDescriptor]. As there are multiple disjoint -/// types of [BitmapDescriptor], [PlatformBitmap] contains a single field which -/// may hold the pigeon equivalent type of any of them. -class PlatformBitmap { - PlatformBitmap({required this.bitmap}); - - /// One of [PlatformBitmapAssetMap], [PlatformBitmapAsset], - /// [PlatformBitmapAssetImage], [PlatformBitmapBytesMap], - /// [PlatformBitmapBytes], or [PlatformBitmapDefaultMarker]. - /// As Pigeon does not currently support data class inheritance, this - /// approach allows for the different bitmap implementations to be valid - /// argument and return types of the API methods. See - /// https://github.com/flutter/flutter/issues/117819. - Object bitmap; - - List _toList() { - return [bitmap]; - } - - Object encode() { - return _toList(); - } - - static PlatformBitmap decode(Object result) { - result as List; - return PlatformBitmap(bitmap: result[0]!); - } - - @override - // ignore: avoid_equals_and_hash_code_on_mutable_classes - bool operator ==(Object other) { - if (other is! PlatformBitmap || other.runtimeType != runtimeType) { - return false; - } - if (identical(this, other)) { - return true; - } - return _deepEquals(bitmap, other.bitmap); - } - - @override - // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => _deepHash([runtimeType, ..._toList()]); - - @override - String toString() { - return 'PlatformBitmap(bitmap: $bitmap)'; - } -} +/// Pigeon equivalent of [BitmapDescriptor]. +sealed class PlatformBitmap {} /// Pigeon equivalent of [DefaultMarker]. -class PlatformBitmapDefaultMarker { +class PlatformBitmapDefaultMarker extends PlatformBitmap { PlatformBitmapDefaultMarker({this.hue}); double? hue; @@ -2356,7 +2309,7 @@ class PlatformBitmapDefaultMarker { } /// Pigeon equivalent of [BytesBitmap]. -class PlatformBitmapBytes { +class PlatformBitmapBytes extends PlatformBitmap { PlatformBitmapBytes({required this.byteData, this.size}); Uint8List byteData; @@ -2399,7 +2352,7 @@ class PlatformBitmapBytes { } /// Pigeon equivalent of [AssetBitmap]. -class PlatformBitmapAsset { +class PlatformBitmapAsset extends PlatformBitmap { PlatformBitmapAsset({required this.name, this.pkg}); String name; @@ -2442,7 +2395,7 @@ class PlatformBitmapAsset { } /// Pigeon equivalent of [AssetImageBitmap]. -class PlatformBitmapAssetImage { +class PlatformBitmapAssetImage extends PlatformBitmap { PlatformBitmapAssetImage({required this.name, required this.scale, this.size}); String name; @@ -2493,7 +2446,7 @@ class PlatformBitmapAssetImage { } /// Pigeon equivalent of [AssetMapBitmap]. -class PlatformBitmapAssetMap { +class PlatformBitmapAssetMap extends PlatformBitmap { PlatformBitmapAssetMap({ required this.assetName, required this.bitmapScaling, @@ -2558,7 +2511,7 @@ class PlatformBitmapAssetMap { } /// Pigeon equivalent of [BytesMapBitmap]. -class PlatformBitmapBytesMap { +class PlatformBitmapBytesMap extends PlatformBitmap { PlatformBitmapBytesMap({ required this.byteData, required this.bitmapScaling, @@ -2623,7 +2576,7 @@ class PlatformBitmapBytesMap { } /// Pigeon equivalent of [PinConfig]. -class PlatformBitmapPinConfig { +class PlatformBitmapPinConfig extends PlatformBitmap { PlatformBitmapPinConfig({ this.backgroundColor, this.borderColor, @@ -2826,29 +2779,26 @@ class _PigeonCodec extends StandardMessageCodec { } else if (value is PlatformZoomRange) { buffer.putUint8(168); writeValue(buffer, value.encode()); - } else if (value is PlatformBitmap) { - buffer.putUint8(169); - writeValue(buffer, value.encode()); } else if (value is PlatformBitmapDefaultMarker) { - buffer.putUint8(170); + buffer.putUint8(169); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapBytes) { - buffer.putUint8(171); + buffer.putUint8(170); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapAsset) { - buffer.putUint8(172); + buffer.putUint8(171); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapAssetImage) { - buffer.putUint8(173); + buffer.putUint8(172); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapAssetMap) { - buffer.putUint8(174); + buffer.putUint8(173); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapBytesMap) { - buffer.putUint8(175); + buffer.putUint8(174); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapPinConfig) { - buffer.putUint8(176); + buffer.putUint8(175); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); @@ -2945,20 +2895,18 @@ class _PigeonCodec extends StandardMessageCodec { case 168: return PlatformZoomRange.decode(readValue(buffer)!); case 169: - return PlatformBitmap.decode(readValue(buffer)!); - case 170: return PlatformBitmapDefaultMarker.decode(readValue(buffer)!); - case 171: + case 170: return PlatformBitmapBytes.decode(readValue(buffer)!); - case 172: + case 171: return PlatformBitmapAsset.decode(readValue(buffer)!); - case 173: + case 172: return PlatformBitmapAssetImage.decode(readValue(buffer)!); - case 174: + case 173: return PlatformBitmapAssetMap.decode(readValue(buffer)!); - case 175: + case 174: return PlatformBitmapBytesMap.decode(readValue(buffer)!); - case 176: + case 175: return PlatformBitmapPinConfig.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/pigeons/messages.dart b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/pigeons/messages.dart index 781f4e088e70..a9f2eae70806 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/pigeons/messages.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/pigeons/messages.dart @@ -525,31 +525,18 @@ class PlatformZoomRange { final double? max; } -/// Pigeon equivalent of [BitmapDescriptor]. As there are multiple disjoint -/// types of [BitmapDescriptor], [PlatformBitmap] contains a single field which -/// may hold the pigeon equivalent type of any of them. -class PlatformBitmap { - PlatformBitmap({required this.bitmap}); - - /// One of [PlatformBitmapAssetMap], [PlatformBitmapAsset], - /// [PlatformBitmapAssetImage], [PlatformBitmapBytesMap], - /// [PlatformBitmapBytes], or [PlatformBitmapDefaultMarker]. - /// As Pigeon does not currently support data class inheritance, this - /// approach allows for the different bitmap implementations to be valid - /// argument and return types of the API methods. See - /// https://github.com/flutter/flutter/issues/117819. - final Object bitmap; -} +/// Pigeon equivalent of [BitmapDescriptor]. +sealed class PlatformBitmap {} /// Pigeon equivalent of [DefaultMarker]. -class PlatformBitmapDefaultMarker { +class PlatformBitmapDefaultMarker extends PlatformBitmap { PlatformBitmapDefaultMarker({this.hue}); final double? hue; } /// Pigeon equivalent of [BytesBitmap]. -class PlatformBitmapBytes { +class PlatformBitmapBytes extends PlatformBitmap { PlatformBitmapBytes({required this.byteData, this.size}); final Uint8List byteData; @@ -557,7 +544,7 @@ class PlatformBitmapBytes { } /// Pigeon equivalent of [AssetBitmap]. -class PlatformBitmapAsset { +class PlatformBitmapAsset extends PlatformBitmap { PlatformBitmapAsset({required this.name, this.pkg}); final String name; @@ -565,7 +552,7 @@ class PlatformBitmapAsset { } /// Pigeon equivalent of [AssetImageBitmap]. -class PlatformBitmapAssetImage { +class PlatformBitmapAssetImage extends PlatformBitmap { PlatformBitmapAssetImage({required this.name, required this.scale, this.size}); final String name; final double scale; @@ -573,7 +560,7 @@ class PlatformBitmapAssetImage { } /// Pigeon equivalent of [AssetMapBitmap]. -class PlatformBitmapAssetMap { +class PlatformBitmapAssetMap extends PlatformBitmap { PlatformBitmapAssetMap({ required this.assetName, required this.bitmapScaling, @@ -589,7 +576,7 @@ class PlatformBitmapAssetMap { } /// Pigeon equivalent of [BytesMapBitmap]. -class PlatformBitmapBytesMap { +class PlatformBitmapBytesMap extends PlatformBitmap { PlatformBitmapBytesMap({ required this.byteData, required this.bitmapScaling, @@ -608,7 +595,7 @@ class PlatformBitmapBytesMap { enum PlatformMapBitmapScaling { auto, none } /// Pigeon equivalent of [PinConfig]. -class PlatformBitmapPinConfig { +class PlatformBitmapPinConfig extends PlatformBitmap { PlatformBitmapPinConfig({ required this.backgroundColor, required this.borderColor, From bbd143e60a067a17596905326ffa9c3454c65b1e Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Fri, 4 Sep 2026 20:23:28 -0400 Subject: [PATCH 08/14] Remove old TODO --- .../google_maps_flutter_ios_sdk9/TileOverlayController.swift | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/TileOverlayController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/TileOverlayController.swift index c68f00f6909d..3dc37d4314ae 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/TileOverlayController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9/Sources/google_maps_flutter_ios_sdk9/TileOverlayController.swift @@ -7,8 +7,6 @@ import GoogleMaps import UIKit /// Protocol for requesting tiles from the Dart side. -// TODO(stuartmorgan): Adjust this to match the Swift API once the Pigeon -// generation is switched to Swift. protocol TileProviderDelegate: AnyObject { func tile( withOverlayIdentifier tileOverlayId: String, From 707e76ac7b8aa2cee311f8cfb7ff168bb3967cb5 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Sat, 5 Sep 2026 11:04:32 -0400 Subject: [PATCH 09/14] Resync --- .../RunnerTests/CircleControllerTests.swift | 11 +- .../ClusterManagersControllerTests.swift | 41 +- .../RunnerTests/ConversionsUtilsTests.swift | 142 +- .../ExtractIconFromDataTests.swift | 136 +- .../ios/RunnerTests/GoogleMapsTests.swift | 48 +- .../GroundOverlayControllerTests.swift | 53 +- .../RunnerTests/HeatmapControllerTests.swift | 23 +- .../RunnerTests/MarkerControllerTests.swift | 97 +- .../RunnerTests/PolygonControllerTests.swift | 9 +- .../RunnerTests/PolylineControllerTests.swift | 27 +- .../TestUtils/TestMapEventHandler.swift | 109 +- .../TileOverlayControllerTests.swift | 5 +- .../TileProviderControllerTests.swift | 10 +- .../ios/google_maps_flutter_ios_sdk10.podspec | 3 +- .../Package.swift | 17 - .../CircleController.swift | 26 +- .../ClusterManagersController.swift | 23 +- .../ConversionUtils.swift | 139 +- .../GoogleMapController.swift | 494 +- .../GoogleMapFactory.swift | 8 +- .../GroundOverlayController.swift | 33 +- .../HeatmapController.swift | 36 +- .../ImageUtils.swift | 35 +- .../MapEventDelegate.swift | 53 +- .../MarkerController.swift | 85 +- .../Messages.g.swift | 4174 ++++++++++++++ .../PolygonController.swift | 26 +- .../PolylineController.swift | 26 +- .../TileOverlayController.swift | 53 +- .../google_maps_flutter_pigeon_messages.g.m | 4849 ----------------- .../google_maps_flutter_pigeon_messages.g.h | 991 ---- .../lib/src/google_maps_flutter_ios.dart | 142 +- .../lib/src/messages.g.dart | 293 +- .../pigeons/messages.dart | 157 +- .../tool/unshared_source_files.dart | 2 - .../ios/google_maps_flutter_ios_sdk9.podspec | 2 +- .../RunnerTests/CircleControllerTests.swift | 11 +- .../ClusterManagersControllerTests.swift | 41 +- .../RunnerTests/ConversionsUtilsTests.swift | 142 +- .../ExtractIconFromDataTests.swift | 136 +- .../ios/RunnerTests/GoogleMapsTests.swift | 48 +- .../GroundOverlayControllerTests.swift | 53 +- .../RunnerTests/HeatmapControllerTests.swift | 23 +- .../RunnerTests/MarkerControllerTests.swift | 97 +- .../RunnerTests/PolygonControllerTests.swift | 9 +- .../RunnerTests/PolylineControllerTests.swift | 27 +- .../TestUtils/TestMapEventHandler.swift | 109 +- .../TileOverlayControllerTests.swift | 5 +- .../TileProviderControllerTests.swift | 10 +- .../CircleController.swift | 26 +- .../ClusterManagersController.swift | 23 +- .../ConversionUtils.swift | 139 +- .../GoogleMapController.swift | 494 +- .../GoogleMapFactory.swift | 8 +- .../GroundOverlayController.swift | 33 +- .../HeatmapController.swift | 36 +- .../google_maps_flutter_ios/ImageUtils.swift | 35 +- .../MapEventDelegate.swift | 53 +- .../MarkerController.swift | 85 +- .../google_maps_flutter_ios/Messages.g.swift | 4174 ++++++++++++++ .../PolygonController.swift | 26 +- .../PolylineController.swift | 26 +- .../TileOverlayController.swift | 53 +- .../google_maps_flutter_pigeon_messages.g.m | 4849 ----------------- .../google_maps_flutter_pigeon_messages.g.h | 991 ---- .../lib/src/google_maps_flutter_ios.dart | 142 +- .../lib/src/messages.g.dart | 293 +- .../pigeons/messages.dart | 157 +- 68 files changed, 10244 insertions(+), 14488 deletions(-) create mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/Messages.g.swift delete mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/google_maps_flutter_pigeon_messages.g.m delete mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/google_maps_flutter_ios_sdk10_objc/google_maps_flutter_pigeon_messages.g.h create mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/Messages.g.swift delete mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/google_maps_flutter_pigeon_messages.g.m delete mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/include/google_maps_flutter_ios_objc/google_maps_flutter_pigeon_messages.g.h diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/CircleControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/CircleControllerTests.swift index 8276502818ca..9308378ace48 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/CircleControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/CircleControllerTests.swift @@ -4,7 +4,6 @@ import GoogleMaps import Testing -import google_maps_flutter_ios_sdk10_objc @testable import google_maps_flutter_ios_sdk10 @@ -14,14 +13,14 @@ import google_maps_flutter_ios_sdk10_objc let circle = PropertyOrderValidatingCircle() CircleController.update( circle, - from: FGMPlatformCircle.make( - withConsumeTapEvents: false, - fill: FGMPlatformColor.make(withRed: 0, green: 0, blue: 0, alpha: 0), - stroke: FGMPlatformColor.make(withRed: 0, green: 0, blue: 0, alpha: 0), + from: PlatformCircle( + consumeTapEvents: false, + fillColor: PlatformColor(red: 0, green: 0, blue: 0, alpha: 0), + strokeColor: PlatformColor(red: 0, green: 0, blue: 0, alpha: 0), visible: true, strokeWidth: 0, zIndex: 0, - center: FGMPlatformLatLng.make(withLatitude: 0, longitude: 0), + center: PlatformLatLng(latitude: 0, longitude: 0), radius: 10, circleId: "circle" ), diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/ClusterManagersControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/ClusterManagersControllerTests.swift index 797e78859ec3..9a7710fda215 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/ClusterManagersControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/ClusterManagersControllerTests.swift @@ -5,7 +5,6 @@ import Flutter import GoogleMaps import Testing -import google_maps_flutter_ios_sdk10_objc @testable import google_maps_flutter_ios_sdk10 @@ -36,7 +35,7 @@ import google_maps_flutter_ios_sdk10_objc // Add cluster managers. let clusterManagerId = "cm" - let clusterManagerToAdd = FGMPlatformClusterManager.make(withIdentifier: clusterManagerId) + let clusterManagerToAdd = PlatformClusterManager(identifier: clusterManagerId) clusterManagersController.add([clusterManagerToAdd]) // Verify that cluster managers are available @@ -47,18 +46,16 @@ import google_maps_flutter_ios_sdk10_objc let markerId1 = "m1" let markerId2 = "m2" - let zeroPoint = FGMPlatformPoint.makeWith(x: 0, y: 0) - let zeroLatLng = FGMPlatformLatLng.make(withLatitude: 0, longitude: 0) - let bitmap = FGMPlatformBitmap.make( - withBitmap: FGMPlatformBitmapDefaultMarker.make(withHue: 0) - ) - let infoWindow = FGMPlatformInfoWindow.make( - withTitle: "Info", + let zeroPoint = PlatformPoint(x: 0, y: 0) + let zeroLatLng = PlatformLatLng(latitude: 0, longitude: 0) + let bitmap = PlatformBitmapDefaultMarker(hue: 0) + let infoWindow = PlatformInfoWindow( + title: "Info", snippet: nil, anchor: zeroPoint ) - let marker1 = FGMPlatformMarker.make( - withAlpha: 1, + let marker1 = PlatformMarker( + alpha: 1, anchor: zeroPoint, consumeTapEvents: false, draggable: false, @@ -73,8 +70,8 @@ import google_maps_flutter_ios_sdk10_objc clusterManagerId: clusterManagerId, collisionBehavior: nil ) - let marker2 = FGMPlatformMarker.make( - withAlpha: 1, + let marker2 = PlatformMarker( + alpha: 1, anchor: zeroPoint, consumeTapEvents: false, draggable: false, @@ -96,11 +93,7 @@ import google_maps_flutter_ios_sdk10_objc clusterManagersController.invokeClusteringForEachClusterManager() // Verify that the markers were added to the cluster manager - var error: FlutterError? = nil - let clusters1 = try #require( - clusterManagersController.clusters(withIdentifier: clusterManagerId, error: &error) - ) - #expect(error == nil) + let clusters1 = try clusterManagersController.clusters(withIdentifier: clusterManagerId) let targetCluster = try #require( clusters1.first(where: { $0.clusterManagerId == clusterManagerId }) ) @@ -111,11 +104,7 @@ import google_maps_flutter_ios_sdk10_objc markersController.removeMarkers(withIdentifiers: [markerId2]) // Verify that the marker2 is removed from the clusterManager - error = nil - let clusters2 = try #require( - clusterManagersController.clusters(withIdentifier: clusterManagerId, error: &error) - ) - #expect(error == nil) + let clusters2 = try clusterManagersController.clusters(withIdentifier: clusterManagerId) let targetCluster2 = try #require( clusters2.first(where: { $0.clusterManagerId == clusterManagerId }) ) @@ -125,11 +114,7 @@ import google_maps_flutter_ios_sdk10_objc markersController.removeMarkers(withIdentifiers: [markerId1]) // Verify that all markers are removed from clusterManager - error = nil - let clusters3 = try #require( - clusterManagersController.clusters(withIdentifier: clusterManagerId, error: &error) - ) - #expect(error == nil) + let clusters3 = try clusterManagersController.clusters(withIdentifier: clusterManagerId) #expect(clusters3.count == 0) // Remove cluster manager diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/ConversionsUtilsTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/ConversionsUtilsTests.swift index c4e8cb3f6bc1..af42eef449ea 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/ConversionsUtilsTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/ConversionsUtilsTests.swift @@ -4,7 +4,6 @@ import GoogleMaps import Testing -import google_maps_flutter_ios_sdk10_objc @testable import google_maps_flutter_ios_sdk10 @@ -15,8 +14,8 @@ import google_maps_flutter_ios_sdk10_objc let platformGreen: CGFloat = 2 / 255.0 let platformBlue: CGFloat = 3 / 255.0 let platformAlpha: CGFloat = 4 / 255.0 - let color = FGMPlatformColor.make( - withRed: platformRed, + let color = PlatformColor( + red: platformRed, green: platformGreen, blue: platformBlue, alpha: platformAlpha @@ -39,7 +38,7 @@ import google_maps_flutter_ios_sdk10_objc let blue: CGFloat = 3 / 255.0 let alpha: CGFloat = 4 / 255.0 let color = UIColor(red: red, green: green, blue: blue, alpha: alpha) - let platformColor = FGMPlatformColor.make(from: color) + let platformColor = PlatformColor.make(from: color) #expect(abs(red - platformColor.red) <= CGFloat.ulpOfOne) #expect(abs(green - platformColor.green) <= CGFloat.ulpOfOne) #expect(abs(blue - platformColor.blue) <= CGFloat.ulpOfOne) @@ -47,7 +46,7 @@ import google_maps_flutter_ios_sdk10_objc } @Test func pointFromLatLong() { - let latlong = FGMPlatformLatLng.make(withLatitude: 1, longitude: 2) + let latlong = PlatformLatLng(latitude: 1, longitude: 2) let location = latlong.toCLLocationCoordinate2D() #expect(location.latitude == 1) #expect(location.longitude == 2) @@ -60,7 +59,7 @@ import google_maps_flutter_ios_sdk10_objc bearing: 3.0, viewingAngle: 75.0 ) - let pigeonPosition = FGMPlatformCameraPosition.make(from: position) + let pigeonPosition = PlatformCameraPosition.make(from: position) #expect(abs(pigeonPosition.target.latitude - position.target.latitude) <= Double.ulpOfOne) #expect(abs(pigeonPosition.target.longitude - position.target.longitude) <= Double.ulpOfOne) #expect(abs(Float(pigeonPosition.zoom) - position.zoom) <= Float.ulpOfOne) @@ -70,7 +69,7 @@ import google_maps_flutter_ios_sdk10_objc @Test func pigeonPointForGCPoint() { let point = CGPoint(x: 10, y: 20) - let pigeonPoint = FGMPlatformPoint.make(from: point) + let pigeonPoint = PlatformPoint.make(from: point) #expect(abs(pigeonPoint.x - Double(point.x)) <= Double.ulpOfOne) #expect(abs(pigeonPoint.y - Double(point.y)) <= Double.ulpOfOne) } @@ -80,7 +79,7 @@ import google_maps_flutter_ios_sdk10_objc coordinate: CLLocationCoordinate2D(latitude: 10, longitude: 20), coordinate: CLLocationCoordinate2D(latitude: 30, longitude: 40) ) - let pigeonBounds = FGMPlatformLatLngBounds.make(from: bounds) + let pigeonBounds = PlatformLatLngBounds.make(from: bounds) #expect(abs(pigeonBounds.southwest.latitude - bounds.southWest.latitude) <= Double.ulpOfOne) #expect(abs(pigeonBounds.southwest.longitude - bounds.southWest.longitude) <= Double.ulpOfOne) #expect(abs(pigeonBounds.northeast.latitude - bounds.northEast.latitude) <= Double.ulpOfOne) @@ -88,9 +87,9 @@ import google_maps_flutter_ios_sdk10_objc } @Test func getCameraPostionForPigeonCameraPosition() { - let pigeonCameraPosition = FGMPlatformCameraPosition.make( - withBearing: 1.0, - target: FGMPlatformLatLng.make(withLatitude: 2.0, longitude: 3.0), + let pigeonCameraPosition = PlatformCameraPosition( + bearing: 1.0, + target: PlatformLatLng(latitude: 2.0, longitude: 3.0), tilt: 4.0, zoom: 5.0 ) @@ -108,7 +107,7 @@ import google_maps_flutter_ios_sdk10_objc } @Test func cgPointForPigeonPoint() { - let pigeonPoint = FGMPlatformPoint.makeWith(x: 1.0, y: 2.0) + let pigeonPoint = PlatformPoint(x: 1.0, y: 2.0) let point = pigeonPoint.toCGPoint() @@ -117,9 +116,9 @@ import google_maps_flutter_ios_sdk10_objc } @Test func coordinateBoundsFromLatLongs() { - let pigeonBounds = FGMPlatformLatLngBounds.make( - withNortheast: FGMPlatformLatLng.make(withLatitude: 3, longitude: 4), - southwest: FGMPlatformLatLng.make(withLatitude: 1, longitude: 2) + let pigeonBounds = PlatformLatLngBounds( + northeast: PlatformLatLng(latitude: 3, longitude: 4), + southwest: PlatformLatLng(latitude: 1, longitude: 2) ) let bounds = pigeonBounds.toGMSCoordinateBounds() @@ -132,25 +131,25 @@ import google_maps_flutter_ios_sdk10_objc } @Test func mapViewTypeFromPigeonType() { - #expect(GMSMapViewType.normal == FGMPlatformMapType.normal.gmsMapViewType) - #expect(GMSMapViewType.satellite == FGMPlatformMapType.satellite.gmsMapViewType) - #expect(GMSMapViewType.terrain == FGMPlatformMapType.terrain.gmsMapViewType) - #expect(GMSMapViewType.hybrid == FGMPlatformMapType.hybrid.gmsMapViewType) - #expect(GMSMapViewType.none == FGMPlatformMapType.none.gmsMapViewType) + #expect(GMSMapViewType.normal == PlatformMapType.normal.gmsMapViewType) + #expect(GMSMapViewType.satellite == PlatformMapType.satellite.gmsMapViewType) + #expect(GMSMapViewType.terrain == PlatformMapType.terrain.gmsMapViewType) + #expect(GMSMapViewType.hybrid == PlatformMapType.hybrid.gmsMapViewType) + #expect(GMSMapViewType.none == PlatformMapType.none.gmsMapViewType) } @Test func cameraUpdateFromNewCameraPosition() { - let newPositionUpdate = FGMPlatformCameraUpdateNewCameraPosition.make( - with: FGMPlatformCameraPosition.make( - withBearing: 4, - target: FGMPlatformLatLng.make(withLatitude: 1, longitude: 2), + let platformUpdate = PlatformCameraUpdateNewCameraPosition( + cameraPosition: PlatformCameraPosition( + bearing: 4, + target: PlatformLatLng(latitude: 1, longitude: 2), tilt: 5, zoom: 3 ) ) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: newPositionUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @@ -158,32 +157,32 @@ import google_maps_flutter_ios_sdk10_objc @Test func cameraUpdateFromNewLatLong() { let lat: Double = 1 let lng: Double = 2 - let platformUpdate = FGMPlatformCameraUpdateNewLatLng.make( - with: FGMPlatformLatLng.make(withLatitude: lat, longitude: lng) + let platformUpdate = PlatformCameraUpdateNewLatLng( + latLng: PlatformLatLng(latitude: lat, longitude: lng) ) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @Test func cameraUpdateFromNewLatLngBounds() { - let pigeonBounds = FGMPlatformLatLngBounds.make( - withNortheast: FGMPlatformLatLng.make(withLatitude: 1, longitude: 2), - southwest: FGMPlatformLatLng.make(withLatitude: 3, longitude: 4) + let pigeonBounds = PlatformLatLngBounds( + northeast: PlatformLatLng(latitude: 1, longitude: 2), + southwest: PlatformLatLng(latitude: 3, longitude: 4) ) let bounds = pigeonBounds.toGMSCoordinateBounds() let padding: Double = 20 - let platformUpdate = FGMPlatformCameraUpdateNewLatLngBounds.make( - with: FGMPlatformLatLngBounds.make(from: bounds), + let platformUpdate = PlatformCameraUpdateNewLatLngBounds( + bounds: PlatformLatLngBounds.make(from: bounds), padding: padding ) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @@ -192,14 +191,14 @@ import google_maps_flutter_ios_sdk10_objc let lat: Double = 1 let lng: Double = 2 let zoom: Double = 3 - let platformUpdate = FGMPlatformCameraUpdateNewLatLngZoom.make( - with: FGMPlatformLatLng.make(withLatitude: lat, longitude: lng), + let platformUpdate = PlatformCameraUpdateNewLatLngZoom( + latLng: PlatformLatLng(latitude: lat, longitude: lng), zoom: zoom ) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @@ -207,22 +206,22 @@ import google_maps_flutter_ios_sdk10_objc @Test func cameraUpdateFromScrollBy() { let x: Double = 1 let y: Double = 2 - let platformUpdate = FGMPlatformCameraUpdateScrollBy.make(withDx: x, dy: y) + let platformUpdate = PlatformCameraUpdateScrollBy(dx: x, dy: y) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @Test func cameraUpdateFromZoomBy() { let zoom: Double = 1 - let platformUpdateNoPoint = FGMPlatformCameraUpdateZoomBy.make(withAmount: zoom, focus: nil) + let platformUpdateNoPoint = PlatformCameraUpdateZoomBy(amount: zoom, focus: nil) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdateNoPoint).toGMSCameraUpdate() + _ = platformUpdateNoPoint.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @@ -231,51 +230,48 @@ import google_maps_flutter_ios_sdk10_objc let zoom: Double = 1 let x: Double = 2 let y: Double = 3 - let platformUpdate = FGMPlatformCameraUpdateZoomBy.make( - withAmount: zoom, - focus: FGMPlatformPoint.makeWith(x: x, y: y) - ) + let platformUpdate = PlatformCameraUpdateZoomBy(amount: zoom, focus: PlatformPoint(x: x, y: y)) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @Test func cameraUpdateFromZoomIn() { - let platformUpdate = FGMPlatformCameraUpdateZoom.make(withOut: false) + let platformUpdate = PlatformCameraUpdateZoom(out: false) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @Test func cameraUpdateFromZoomOut() { - let platformUpdate = FGMPlatformCameraUpdateZoom.make(withOut: true) + let platformUpdate = PlatformCameraUpdateZoom(out: true) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @Test func cameraUpdateFromZoomTo() { let zoom: Double = 1 - let platformUpdate = FGMPlatformCameraUpdateZoomTo.make(withZoom: zoom) + let platformUpdate = PlatformCameraUpdateZoomTo(zoom: zoom) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @Test func strokeStyleFromPattern() { - let pattern = FGMPlatformPatternItem.make(with: .dash, length: 1) + let pattern = PlatformPatternItem(type: .dash, length: 1) let strokeColor = UIColor.red _ = pattern.gmsStrokeStyle(strokeColor: strokeColor) @@ -285,7 +281,7 @@ import google_maps_flutter_ios_sdk10_objc @Test func nonNullLengthFromPatternItem() { let length: Double = 6.4 - let pattern = FGMPlatformPatternItem.make(with: .gap, length: length as NSNumber) + let pattern = PlatformPatternItem(type: .gap, length: length) let spanLength = pattern.gmsStyleSpanLength() @@ -293,7 +289,7 @@ import google_maps_flutter_ios_sdk10_objc } @Test func nullLengthFromPatternItem() { - let pattern = FGMPlatformPatternItem.make(with: .dot, length: nil) + let pattern = PlatformPatternItem(type: .dot, length: nil) let spanLength = pattern.gmsStyleSpanLength() @@ -302,8 +298,8 @@ import google_maps_flutter_ios_sdk10_objc @Test func weightedLatLngFromPlatformWeightedLatLng() { let intensity: Double = 3.0 - let data = FGMPlatformWeightedLatLng.make( - withPoint: FGMPlatformLatLng.make(withLatitude: 10, longitude: 20), + let data = PlatformWeightedLatLng( + point: PlatformLatLng(latitude: 10, longitude: 20), weight: intensity ) @@ -318,17 +314,17 @@ import google_maps_flutter_ios_sdk10_objc let platformBlue: Double = 0.3 let platformAlpha: Double = 0.4 let colorMapSize: Int = 200 - let platformGradient = FGMPlatformHeatmapGradient.make( - with: [ - FGMPlatformColor.make( - withRed: platformRed, + let platformGradient = PlatformHeatmapGradient( + colors: [ + PlatformColor( + red: platformRed, green: platformGreen, blue: platformBlue, alpha: platformAlpha ) ], - startPoints: [startPoint as NSNumber], - colorMapSize: colorMapSize + startPoints: [startPoint], + colorMapSize: Int64(colorMapSize) ) let gradient = platformGradient.toGMUGradient() diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/ExtractIconFromDataTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/ExtractIconFromDataTests.swift index 7dd8c7d818e2..f13a6b714465 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/ExtractIconFromDataTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/ExtractIconFromDataTests.swift @@ -4,7 +4,6 @@ import Flutter import Testing -import google_maps_flutter_ios_sdk10_objc @testable import google_maps_flutter_ios_sdk10 @@ -15,8 +14,8 @@ import google_maps_flutter_ios_sdk10_objc let assetName = "fakeImageName" let assetProvider = TestAssetProvider(image: testImage, forAssetName: assetName, package: nil) - let bitmap = FGMPlatformBitmapAssetMap.make( - withAssetName: assetName, + let bitmap = PlatformBitmapAssetMap( + assetName: assetName, bitmapScaling: .auto, imagePixelRatio: 1, width: nil, @@ -25,10 +24,7 @@ import google_maps_flutter_ios_sdk10_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = bitmap.createIcon(assetProvider: assetProvider, screenScale: screenScale) #expect(resultImage != nil) #expect(resultImage?.scale == 1.0) @@ -42,8 +38,8 @@ import google_maps_flutter_ios_sdk10_objc let assetName = "fakeImageName" let assetProvider = TestAssetProvider(image: testImage, forAssetName: assetName, package: nil) - let bitmap = FGMPlatformBitmapAssetMap.make( - withAssetName: assetName, + let bitmap = PlatformBitmapAssetMap( + assetName: assetName, bitmapScaling: .auto, imagePixelRatio: 10, width: nil, @@ -52,10 +48,7 @@ import google_maps_flutter_ios_sdk10_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = bitmap.createIcon(assetProvider: assetProvider, screenScale: screenScale) #expect(resultImage != nil) #expect(resultImage?.scale == 10) @@ -71,20 +64,17 @@ import google_maps_flutter_ios_sdk10_objc let assetProvider = TestAssetProvider(image: testImage, forAssetName: assetName, package: nil) let width: CGFloat = 15.0 - let bitmap = FGMPlatformBitmapAssetMap.make( - withAssetName: assetName, + let bitmap = PlatformBitmapAssetMap( + assetName: assetName, bitmapScaling: .auto, imagePixelRatio: 1, - width: width as NSNumber, + width: width, height: nil ) let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = bitmap.createIcon(assetProvider: assetProvider, screenScale: screenScale) #expect(resultImage != nil) #expect(testImage.scale == 1.0) @@ -105,20 +95,17 @@ import google_maps_flutter_ios_sdk10_objc let width: CGFloat = 15.0 let height: CGFloat = 45.0 - let bitmap = FGMPlatformBitmapAssetMap.make( - withAssetName: assetName, + let bitmap = PlatformBitmapAssetMap( + assetName: assetName, bitmapScaling: .auto, imagePixelRatio: 1, - width: width as NSNumber, - height: height as NSNumber + width: width, + height: height ) let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = bitmap.createIcon(assetProvider: assetProvider, screenScale: screenScale) #expect(resultImage != nil) #expect(resultImage?.scale == screenScale) #expect(resultImage?.size.width == width) @@ -131,8 +118,8 @@ import google_maps_flutter_ios_sdk10_objc let assetName = "fakeImageName" let assetProvider = TestAssetProvider(image: testImage, forAssetName: assetName, package: nil) - let bitmap = FGMPlatformBitmapAssetMap.make( - withAssetName: assetName, + let bitmap = PlatformBitmapAssetMap( + assetName: assetName, bitmapScaling: .none, imagePixelRatio: 1, width: nil, @@ -141,10 +128,7 @@ import google_maps_flutter_ios_sdk10_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = bitmap.createIcon(assetProvider: assetProvider, screenScale: screenScale) #expect(resultImage != nil) #expect(resultImage?.scale == 1.0) @@ -157,8 +141,8 @@ import google_maps_flutter_ios_sdk10_objc let pngData = try #require(testImage.pngData()) let typedData = FlutterStandardTypedData(bytes: pngData) - let bitmap = FGMPlatformBitmapBytesMap.make( - withByteData: typedData, + let bitmap = PlatformBitmapBytesMap( + byteData: typedData, bitmapScaling: .auto, imagePixelRatio: 1, width: nil, @@ -167,7 +151,7 @@ import google_maps_flutter_ios_sdk10_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( + let resultImage = bitmap.createIcon( assetProvider: TestAssetProvider(), screenScale: screenScale ) @@ -183,8 +167,8 @@ import google_maps_flutter_ios_sdk10_objc let pngData = try #require(testImage.pngData()) let typedData = FlutterStandardTypedData(bytes: pngData) - let bitmap = FGMPlatformBitmapBytesMap.make( - withByteData: typedData, + let bitmap = PlatformBitmapBytesMap( + byteData: typedData, bitmapScaling: .auto, imagePixelRatio: 10, width: nil, @@ -193,7 +177,7 @@ import google_maps_flutter_ios_sdk10_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( + let resultImage = bitmap.createIcon( assetProvider: TestAssetProvider(), screenScale: screenScale ) @@ -210,17 +194,17 @@ import google_maps_flutter_ios_sdk10_objc let width: CGFloat = 15.0 let height: CGFloat = 15.0 let typedData = FlutterStandardTypedData(bytes: pngData) - let bitmap = FGMPlatformBitmapBytesMap.make( - withByteData: typedData, + let bitmap = PlatformBitmapBytesMap( + byteData: typedData, bitmapScaling: .auto, imagePixelRatio: 1, - width: width as NSNumber, - height: height as NSNumber + width: width, + height: height ) let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( + let resultImage = bitmap.createIcon( assetProvider: TestAssetProvider(), screenScale: screenScale ) @@ -244,17 +228,17 @@ import google_maps_flutter_ios_sdk10_objc let width: CGFloat = 15.0 let height: CGFloat = 45.0 let typedData = FlutterStandardTypedData(bytes: pngData) - let bitmap = FGMPlatformBitmapBytesMap.make( - withByteData: typedData, + let bitmap = PlatformBitmapBytesMap( + byteData: typedData, bitmapScaling: .auto, imagePixelRatio: 1, - width: width as NSNumber, - height: height as NSNumber + width: width, + height: height ) let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( + let resultImage = bitmap.createIcon( assetProvider: TestAssetProvider(), screenScale: screenScale ) @@ -269,8 +253,8 @@ import google_maps_flutter_ios_sdk10_objc let pngData = try #require(testImage.pngData()) let typedData = FlutterStandardTypedData(bytes: pngData) - let bitmap = FGMPlatformBitmapBytesMap.make( - withByteData: typedData, + let bitmap = PlatformBitmapBytesMap( + byteData: typedData, bitmapScaling: .none, imagePixelRatio: 1, width: nil, @@ -279,7 +263,7 @@ import google_maps_flutter_ios_sdk10_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( + let resultImage = bitmap.createIcon( assetProvider: TestAssetProvider(), screenScale: screenScale ) @@ -294,12 +278,12 @@ import google_maps_flutter_ios_sdk10_objc @Test func extractIconFromPinConfigWithGlyphColor() { let assetProvider = TestAssetProvider() - let backgroundColor = FGMPlatformColor.make(withRed: 0.0, green: 1.0, blue: 1.0, alpha: 1.0) - let borderColor = FGMPlatformColor.make(withRed: 1.0, green: 0.0, blue: 1.0, alpha: 1.0) - let glyphColor = FGMPlatformColor.make(withRed: 0.1, green: 0.2, blue: 0.3, alpha: 1.0) + let backgroundColor = PlatformColor(red: 0.0, green: 1.0, blue: 1.0, alpha: 1.0) + let borderColor = PlatformColor(red: 1.0, green: 0.0, blue: 1.0, alpha: 1.0) + let glyphColor = PlatformColor(red: 0.1, green: 0.2, blue: 0.3, alpha: 1.0) - let pinConfig = FGMPlatformBitmapPinConfig.make( - withBackgroundColor: backgroundColor, + let pinConfig = PlatformBitmapPinConfig( + backgroundColor: backgroundColor, borderColor: borderColor, glyphColor: glyphColor, glyphTextColor: nil, @@ -309,10 +293,7 @@ import google_maps_flutter_ios_sdk10_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: pinConfig).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = pinConfig.createIcon(assetProvider: assetProvider, screenScale: screenScale) // PinConfig may return nil on old Google Maps SDK versions (<=8.4.0). // Also, due to a Google Maps SDK issue (https://issuetracker.google.com/issues/370536110), @@ -324,10 +305,10 @@ import google_maps_flutter_ios_sdk10_objc @Test func extractIconFromPinConfigWithGlyphText() { let assetProvider = TestAssetProvider() - let glyphTextColor = FGMPlatformColor.make(withRed: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) + let glyphTextColor = PlatformColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) - let pinConfig = FGMPlatformBitmapPinConfig.make( - withBackgroundColor: nil, + let pinConfig = PlatformBitmapPinConfig( + backgroundColor: nil, borderColor: nil, glyphColor: nil, glyphTextColor: glyphTextColor, @@ -337,10 +318,7 @@ import google_maps_flutter_ios_sdk10_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: pinConfig).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = pinConfig.createIcon(assetProvider: assetProvider, screenScale: screenScale) // PinConfig returns nil on iOS versions without GMSPinImageOptions support (< iOS 16.0). // On simulators, GMSPinImage may also return a zero-dimension image. Both cases are acceptable @@ -355,33 +333,29 @@ import google_maps_flutter_ios_sdk10_objc let assetName = "fakeImageNameKey" let assetProvider = TestAssetProvider(image: testImage, forAssetName: assetName, package: nil) - let assetBitmap = FGMPlatformBitmapAssetMap.make( - withAssetName: assetName, + let assetBitmap = PlatformBitmapAssetMap( + assetName: assetName, bitmapScaling: .auto, imagePixelRatio: 1, width: nil, height: nil ) - let glyphBitmap = FGMPlatformBitmap.make(withBitmap: assetBitmap) - let backgroundColor = FGMPlatformColor.make(withRed: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) - let borderColor = FGMPlatformColor.make(withRed: 0.0, green: 0.0, blue: 0.0, alpha: 1.0) + let backgroundColor = PlatformColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) + let borderColor = PlatformColor(red: 0.0, green: 0.0, blue: 0.0, alpha: 1.0) - let pinConfig = FGMPlatformBitmapPinConfig.make( - withBackgroundColor: backgroundColor, + let pinConfig = PlatformBitmapPinConfig( + backgroundColor: backgroundColor, borderColor: borderColor, glyphColor: nil, glyphTextColor: nil, glyphText: nil, - glyphBitmap: glyphBitmap + glyphBitmap: assetBitmap ) let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: pinConfig).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = pinConfig.createIcon(assetProvider: assetProvider, screenScale: screenScale) // PinConfig returns nil on iOS versions without GMSPinImageOptions support (< iOS 16.0). // On simulators, GMSPinImage may also return a zero-dimension image. Both cases are acceptable diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/GoogleMapsTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/GoogleMapsTests.swift index d1c4d90ec1fc..2a0b6cebfa84 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/GoogleMapsTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/GoogleMapsTests.swift @@ -5,11 +5,10 @@ import Flutter import GoogleMaps import Testing -import google_maps_flutter_ios_sdk10_objc @testable import google_maps_flutter_ios_sdk10 -class MockCATransaction: NSObject, MapAnimationCATransactionProtocol { +class MockCATransaction: MapAnimationCATransactionProtocol { var beginCalled = false var commitCalled = false var animationDuration: CFTimeInterval = 0.0 @@ -129,12 +128,9 @@ class StubPluginRegistrar: NSObject, FlutterPluginRegistrar { let mockTransactionWrapper = MockCATransaction() controller.callHandler.transactionWrapper = mockTransactionWrapper - let zoomTo = FGMPlatformCameraUpdateZoomTo.make(withZoom: 10.0) - let cameraUpdate = FGMPlatformCameraUpdate.make(withCameraUpdate: zoomTo) - var error: FlutterError? = nil + let zoomTo = PlatformCameraUpdateZoomTo(zoom: 10.0) - controller.callHandler.animateCamera(with: cameraUpdate, duration: nil, error: &error) - #expect(error == nil) + try controller.callHandler.animateCamera(zoomTo, duration: nil) #expect(mapView.didAnimateCamera) #expect(!mockTransactionWrapper.beginCalled) #expect(!mockTransactionWrapper.commitCalled) @@ -161,21 +157,14 @@ class StubPluginRegistrar: NSObject, FlutterPluginRegistrar { let mockTransactionWrapper = MockCATransaction() controller.callHandler.transactionWrapper = mockTransactionWrapper - let zoomTo = FGMPlatformCameraUpdateZoomTo.make(withZoom: 10.0) - let cameraUpdate = FGMPlatformCameraUpdate.make(withCameraUpdate: zoomTo) - var error: FlutterError? = nil + let zoomTo = PlatformCameraUpdateZoomTo(zoom: 10.0) - let durationMilliseconds: NSNumber = 100 - controller.callHandler.animateCamera( - with: cameraUpdate, - duration: durationMilliseconds, - error: &error - ) - #expect(error == nil) + let durationMilliseconds: Int64 = 100 + try controller.callHandler.animateCamera(zoomTo, duration: durationMilliseconds) #expect(mapView.didAnimateCamera) #expect(mockTransactionWrapper.beginCalled) #expect(mockTransactionWrapper.commitCalled) - #expect(mockTransactionWrapper.animationDuration == durationMilliseconds.doubleValue / 1000) + #expect(mockTransactionWrapper.animationDuration == Double(durationMilliseconds) / 1000) } @Test func inspectorAPICameraPosition() throws { @@ -201,9 +190,7 @@ class StubPluginRegistrar: NSObject, FlutterPluginRegistrar { let inspector = MapInspector(messenger: binaryMessenger, pigeonSuffix: "0") inspector.controller = controller - var error: FlutterError? = nil - let cameraPosition = try #require(inspector.cameraPosition(&error)) - #expect(error == nil) + let cameraPosition = try inspector.cameraPosition() #expect(cameraPosition.target.latitude == initialCameraPosition.target.latitude) #expect(cameraPosition.target.longitude == initialCameraPosition.target.longitude) @@ -212,16 +199,16 @@ class StubPluginRegistrar: NSObject, FlutterPluginRegistrar { /// Creates an empty creation parameters object for tests where the values don't matter, just that /// there's a valid object to pass in. - private func emptyCreationParameters() -> FGMPlatformMapViewCreationParams { - return FGMPlatformMapViewCreationParams.make( - withInitialCameraPosition: FGMPlatformCameraPosition.make( - withBearing: 0.0, - target: FGMPlatformLatLng.make(withLatitude: 0.0, longitude: 0.0), + private func emptyCreationParameters() -> PlatformMapViewCreationParams { + return PlatformMapViewCreationParams( + initialCameraPosition: PlatformCameraPosition( + bearing: 0.0, + target: PlatformLatLng(latitude: 0.0, longitude: 0.0), tilt: 0.0, zoom: 0.0 ), - mapConfiguration: FGMPlatformMapConfiguration.make( - withCompassEnabled: nil, + mapConfiguration: PlatformMapConfiguration( + compassEnabled: nil, cameraTargetBounds: nil, mapType: nil, minMaxZoomPreference: nil, @@ -267,6 +254,7 @@ class StubPluginRegistrar: NSObject, FlutterPluginRegistrar { #expect(mapView.frameObserverCount == 1) + withExtendedLifetime(controller) {} // Deallocate the controller controller = nil @@ -288,8 +276,8 @@ class StubPluginRegistrar: NSObject, FlutterPluginRegistrar { #expect(controller.styleError != nil) // Update config without style - let config = FGMPlatformMapConfiguration.make( - withCompassEnabled: true, + let config = PlatformMapConfiguration( + compassEnabled: true, cameraTargetBounds: nil, mapType: nil, minMaxZoomPreference: nil, diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/GroundOverlayControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/GroundOverlayControllerTests.swift index 22180d018073..adf868e536ed 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/GroundOverlayControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/GroundOverlayControllerTests.swift @@ -4,7 +4,6 @@ import GoogleMaps import Testing -import google_maps_flutter_ios_sdk10_objc @testable import google_maps_flutter_ios_sdk10 @@ -76,18 +75,16 @@ import google_maps_flutter_ios_sdk10_objc let (groundOverlayController, mapView) = try GroundOverlayControllerTests.groundOverlayControllerWithPositionWithMockedMap() - let position = FGMPlatformLatLng.make(withLatitude: 52.4816, longitude: 3.1791) + let position = PlatformLatLng(latitude: 52.4816, longitude: 3.1791) - let bitmap = FGMPlatformBitmap.make( - withBitmap: FGMPlatformBitmapDefaultMarker.make(withHue: 0) - ) + let bitmap = PlatformBitmapDefaultMarker(hue: 0) - let platformGroundOverlay = FGMPlatformGroundOverlay.make( - withGroundOverlayId: "id_1", + let platformGroundOverlay = PlatformGroundOverlay( + groundOverlayId: "id_1", image: bitmap, position: position, bounds: nil, - anchor: FGMPlatformPoint.makeWith(x: 0.5, y: 0.5), + anchor: PlatformPoint(x: 0.5, y: 0.5), transparency: 0.5, bearing: 65.0, zIndex: 2, @@ -116,7 +113,7 @@ import google_maps_flutter_ios_sdk10_objc #expect(abs(groundOverlayController.groundOverlay.anchor.y - 0.5) <= Double.ulpOfOne) #expect(groundOverlayController.groundOverlay.zIndex == Int32(platformGroundOverlay.zIndex)) - let convertedPlatformGroundOverlay = FGMPlatformGroundOverlay.make( + let convertedPlatformGroundOverlay = PlatformGroundOverlay.make( from: groundOverlayController.groundOverlay, overlayId: "id_1", isCreatedWithBounds: false, @@ -128,7 +125,7 @@ import google_maps_flutter_ios_sdk10_objc #expect( abs(convertedPlatformGroundOverlay.position!.longitude - position.longitude) <= Double.ulpOfOne) - #expect(convertedPlatformGroundOverlay.zoomLevel!.doubleValue == 14.0) + #expect(convertedPlatformGroundOverlay.zoomLevel == 14.0) #expect(convertedPlatformGroundOverlay.transparency == platformGroundOverlay.transparency) #expect(convertedPlatformGroundOverlay.bearing == platformGroundOverlay.bearing) #expect(abs(convertedPlatformGroundOverlay.anchor!.x - 0.5) <= Double.ulpOfOne) @@ -141,21 +138,19 @@ import google_maps_flutter_ios_sdk10_objc let (groundOverlayController, mapView) = try GroundOverlayControllerTests.groundOverlayControllerWithBoundsWithMockedMap() - let bounds = FGMPlatformLatLngBounds.make( - withNortheast: FGMPlatformLatLng.make(withLatitude: 54.4816, longitude: 5.1791), - southwest: FGMPlatformLatLng.make(withLatitude: 52.4816, longitude: 3.1791) + let bounds = PlatformLatLngBounds( + northeast: PlatformLatLng(latitude: 54.4816, longitude: 5.1791), + southwest: PlatformLatLng(latitude: 52.4816, longitude: 3.1791) ) - let bitmap = FGMPlatformBitmap.make( - withBitmap: FGMPlatformBitmapDefaultMarker.make(withHue: 0) - ) + let bitmap = PlatformBitmapDefaultMarker(hue: 0) - let platformGroundOverlay = FGMPlatformGroundOverlay.make( - withGroundOverlayId: "id_1", + let platformGroundOverlay = PlatformGroundOverlay( + groundOverlayId: "id_1", image: bitmap, position: nil, bounds: bounds, - anchor: FGMPlatformPoint.makeWith(x: 0.5, y: 0.5), + anchor: PlatformPoint(x: 0.5, y: 0.5), transparency: 0.5, bearing: 65.0, zIndex: 2, @@ -183,7 +178,7 @@ import google_maps_flutter_ios_sdk10_objc #expect(abs(groundOverlayController.groundOverlay.anchor.y - 0.5) <= Double.ulpOfOne) #expect(groundOverlayController.groundOverlay.zIndex == Int32(platformGroundOverlay.zIndex)) - let convertedPlatformGroundOverlay = FGMPlatformGroundOverlay.make( + let convertedPlatformGroundOverlay = PlatformGroundOverlay.make( from: groundOverlayController.groundOverlay, overlayId: "id_1", isCreatedWithBounds: true, @@ -214,17 +209,15 @@ import google_maps_flutter_ios_sdk10_objc let groundOverlay = PropertyOrderValidatingGroundOverlay() GroundOverlayController.update( groundOverlay, - from: FGMPlatformGroundOverlay.make( - withGroundOverlayId: "groundOverlay", - image: FGMPlatformBitmap.make( - withBitmap: FGMPlatformBitmapDefaultMarker.make(withHue: 0) - ), - position: FGMPlatformLatLng.make(withLatitude: 0, longitude: 0), - bounds: FGMPlatformLatLngBounds.make( - withNortheast: FGMPlatformLatLng.make(withLatitude: 54.4816, longitude: 5.1791), - southwest: FGMPlatformLatLng.make(withLatitude: 52.4816, longitude: 3.1791) + from: PlatformGroundOverlay( + groundOverlayId: "groundOverlay", + image: PlatformBitmapDefaultMarker(hue: 0), + position: PlatformLatLng(latitude: 0, longitude: 0), + bounds: PlatformLatLngBounds( + northeast: PlatformLatLng(latitude: 54.4816, longitude: 5.1791), + southwest: PlatformLatLng(latitude: 52.4816, longitude: 3.1791) ), - anchor: FGMPlatformPoint.makeWith(x: 0.5, y: 0.5), + anchor: PlatformPoint(x: 0.5, y: 0.5), transparency: 0.5, bearing: 65.0, zIndex: 2, diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/HeatmapControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/HeatmapControllerTests.swift index cd37fc83c7ee..c716de3f63c4 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/HeatmapControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/HeatmapControllerTests.swift @@ -5,7 +5,6 @@ import GoogleMaps import GoogleMapsUtils import Testing -import google_maps_flutter_ios_sdk10_objc @testable import google_maps_flutter_ios_sdk10 @@ -13,25 +12,25 @@ import google_maps_flutter_ios_sdk10_objc @Test func updateHeatmapSetsVisibilityLast() { let heatmap = PropertyOrderValidatingHeatmap() - let gradient = FGMPlatformHeatmapGradient.make( - with: [ - FGMPlatformColor.make(withRed: 0, green: 0, blue: 0, alpha: 0), - FGMPlatformColor.make(withRed: 1.0, green: 1.0, blue: 1.0, alpha: 1.0), + let gradient = PlatformHeatmapGradient( + colors: [ + PlatformColor(red: 0, green: 0, blue: 0, alpha: 0), + PlatformColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0), ], - startPoints: [0 as NSNumber, 1 as NSNumber], + startPoints: [0, 1], colorMapSize: 256 ) HeatmapController.update( heatmap, - from: FGMPlatformHeatmap.make( - withHeatmapId: "heatmap", + from: PlatformHeatmap( + heatmapId: "heatmap", data: [ - FGMPlatformWeightedLatLng.make( - withPoint: FGMPlatformLatLng.make(withLatitude: 5.0, longitude: 5.0), + PlatformWeightedLatLng( + point: PlatformLatLng(latitude: 5.0, longitude: 5.0), weight: 0.5 ), - FGMPlatformWeightedLatLng.make( - withPoint: FGMPlatformLatLng.make(withLatitude: 10.0, longitude: 10.0), + PlatformWeightedLatLng( + point: PlatformLatLng(latitude: 10.0, longitude: 10.0), weight: 0.75 ), ], diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/MarkerControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/MarkerControllerTests.swift index fe219f617d41..f38e92e13dfc 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/MarkerControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/MarkerControllerTests.swift @@ -4,7 +4,6 @@ import GoogleMaps import Testing -import google_maps_flutter_ios_sdk10_objc @testable import google_maps_flutter_ios_sdk10 @@ -18,7 +17,7 @@ import google_maps_flutter_ios_sdk10_objc return PartiallyMockedMapView(options: mapViewOptions) } - /// Returns a FGMMarkersController instance instantiated with the given map view. + /// Returns a MarkersController instance instantiated with the given map view. /// /// The mapView should outlive the controller, as the controller keeps a weak reference to it. func markersController( @@ -34,8 +33,8 @@ import google_maps_flutter_ios_sdk10_objc ) } - func placeholderBitmap() -> FGMPlatformBitmap { - return FGMPlatformBitmap.make(withBitmap: FGMPlatformBitmapDefaultMarker.make(withHue: 0)) + func placeholderBitmap() -> PlatformBitmap { + return PlatformBitmapDefaultMarker(hue: 0) } @Test func setsMarkerNumericProperties() throws { @@ -48,23 +47,23 @@ import google_maps_flutter_ios_sdk10_objc let anchorY = 2.718 let alpha = 0.4 let rotation = 90.0 - let zIndex = 3 + let zIndex: Int64 = 3 let latitude = 10.0 let longitude = 20.0 controller.add([ - FGMPlatformMarker.make( - withAlpha: alpha, - anchor: FGMPlatformPoint.makeWith(x: anchorX, y: anchorY), + PlatformMarker( + alpha: alpha, + anchor: PlatformPoint(x: anchorX, y: anchorY), consumeTapEvents: true, draggable: true, flat: true, icon: placeholderBitmap(), - infoWindow: FGMPlatformInfoWindow.make( - withTitle: "info title", + infoWindow: PlatformInfoWindow( + title: "info title", snippet: "info snippet", - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0) + anchor: PlatformPoint(x: 0, y: 0) ), - position: FGMPlatformLatLng.make(withLatitude: latitude, longitude: longitude), + position: PlatformLatLng(latitude: latitude, longitude: longitude), rotation: rotation, visible: true, zIndex: zIndex, @@ -94,19 +93,19 @@ import google_maps_flutter_ios_sdk10_objc let markerIdentifier = "marker" controller.add([ - FGMPlatformMarker.make( - withAlpha: 1.0, - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0), + PlatformMarker( + alpha: 1.0, + anchor: PlatformPoint(x: 0, y: 0), consumeTapEvents: false, draggable: true, flat: false, icon: placeholderBitmap(), - infoWindow: FGMPlatformInfoWindow.make( - withTitle: "info title", + infoWindow: PlatformInfoWindow( + title: "info title", snippet: "info snippet", - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0) + anchor: PlatformPoint(x: 0, y: 0) ), - position: FGMPlatformLatLng.make(withLatitude: 0.0, longitude: 0.0), + position: PlatformLatLng(latitude: 0.0, longitude: 0.0), rotation: 0, visible: false, zIndex: 0, @@ -131,19 +130,19 @@ import google_maps_flutter_ios_sdk10_objc let markerIdentifier = "marker" controller.add([ - FGMPlatformMarker.make( - withAlpha: 1.0, - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0), + PlatformMarker( + alpha: 1.0, + anchor: PlatformPoint(x: 0, y: 0), consumeTapEvents: false, draggable: false, flat: true, icon: placeholderBitmap(), - infoWindow: FGMPlatformInfoWindow.make( - withTitle: "info title", + infoWindow: PlatformInfoWindow( + title: "info title", snippet: "info snippet", - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0) + anchor: PlatformPoint(x: 0, y: 0) ), - position: FGMPlatformLatLng.make(withLatitude: 0.0, longitude: 0.0), + position: PlatformLatLng(latitude: 0.0, longitude: 0.0), rotation: 0, visible: false, zIndex: 0, @@ -168,19 +167,19 @@ import google_maps_flutter_ios_sdk10_objc let markerIdentifier = "marker" controller.add([ - FGMPlatformMarker.make( - withAlpha: 1.0, - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0), + PlatformMarker( + alpha: 1.0, + anchor: PlatformPoint(x: 0, y: 0), consumeTapEvents: false, draggable: false, flat: false, icon: placeholderBitmap(), - infoWindow: FGMPlatformInfoWindow.make( - withTitle: "info title", + infoWindow: PlatformInfoWindow( + title: "info title", snippet: "info snippet", - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0) + anchor: PlatformPoint(x: 0, y: 0) ), - position: FGMPlatformLatLng.make(withLatitude: 0.0, longitude: 0.0), + position: PlatformLatLng(latitude: 0.0, longitude: 0.0), rotation: 0, visible: true, zIndex: 0, @@ -208,19 +207,19 @@ import google_maps_flutter_ios_sdk10_objc let anchorX = 3.14 let anchorY = 2.718 controller.add([ - FGMPlatformMarker.make( - withAlpha: 1.0, - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0), + PlatformMarker( + alpha: 1.0, + anchor: PlatformPoint(x: 0, y: 0), consumeTapEvents: true, draggable: true, flat: true, icon: placeholderBitmap(), - infoWindow: FGMPlatformInfoWindow.make( - withTitle: title, + infoWindow: PlatformInfoWindow( + title: title, snippet: snippet, - anchor: FGMPlatformPoint.makeWith(x: anchorX, y: anchorY) + anchor: PlatformPoint(x: anchorX, y: anchorY) ), - position: FGMPlatformLatLng.make(withLatitude: 0, longitude: 0), + position: PlatformLatLng(latitude: 0, longitude: 0), rotation: 0, visible: true, zIndex: 0, @@ -242,24 +241,22 @@ import google_maps_flutter_ios_sdk10_objc @Test func updateMarkerSetsVisibilityLast() { let marker = PropertyOrderValidatingAdvancedMarker() - let collisionBehavior = FGMPlatformMarkerCollisionBehaviorBox( - value: .requiredAndHidesOptional - ) + let collisionBehavior = PlatformMarkerCollisionBehavior.requiredAndHidesOptional MarkerController.update( marker, - from: FGMPlatformMarker.make( - withAlpha: 1.0, - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0), + from: PlatformMarker( + alpha: 1.0, + anchor: PlatformPoint(x: 0, y: 0), consumeTapEvents: true, draggable: true, flat: true, icon: placeholderBitmap(), - infoWindow: FGMPlatformInfoWindow.make( - withTitle: "info title", + infoWindow: PlatformInfoWindow( + title: "info title", snippet: "info snippet", - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0) + anchor: PlatformPoint(x: 0, y: 0) ), - position: FGMPlatformLatLng.make(withLatitude: 0, longitude: 0), + position: PlatformLatLng(latitude: 0, longitude: 0), rotation: 0, visible: true, zIndex: 0, diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/PolygonControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/PolygonControllerTests.swift index 0eef55ee3f07..d4dc3df2189a 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/PolygonControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/PolygonControllerTests.swift @@ -4,7 +4,6 @@ import GoogleMaps import Testing -import google_maps_flutter_ios_sdk10_objc @testable import google_maps_flutter_ios_sdk10 @@ -14,15 +13,15 @@ import google_maps_flutter_ios_sdk10_objc let polygon = PropertyOrderValidatingPolygon() PolygonController.update( polygon, - from: FGMPlatformPolygon.make( - withPolygonId: "polygon", + from: PlatformPolygon( + polygonId: "polygon", consumesTapEvents: false, - fill: FGMPlatformColor.make(withRed: 0, green: 0, blue: 0, alpha: 0), + fillColor: PlatformColor(red: 0, green: 0, blue: 0, alpha: 0), geodesic: false, points: [], holes: [], visible: true, - stroke: FGMPlatformColor.make(withRed: 0, green: 0, blue: 0, alpha: 0), + strokeColor: PlatformColor(red: 0, green: 0, blue: 0, alpha: 0), strokeWidth: 0, zIndex: 0 ), diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/PolylineControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/PolylineControllerTests.swift index c346ca4c1ada..4495d174e77c 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/PolylineControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/PolylineControllerTests.swift @@ -4,7 +4,6 @@ import GoogleMaps import Testing -import google_maps_flutter_ios_sdk10_objc @testable import google_maps_flutter_ios_sdk10 @@ -13,15 +12,15 @@ import google_maps_flutter_ios_sdk10_objc @Test func patternsSetSpans() { let mapView = PolylineControllerTests.mapView() - let polyline = FGMPlatformPolyline.make( - withPolylineId: "polyline_id_0", + let polyline = PlatformPolyline( + polylineId: "polyline_id_0", consumesTapEvents: false, - color: FGMPlatformColor.make(withRed: 0, green: 0, blue: 0, alpha: 0), + color: PlatformColor(red: 0, green: 0, blue: 0, alpha: 0), geodesic: false, jointType: .round, patterns: [ - FGMPlatformPatternItem.make(with: .dot, length: 10), - FGMPlatformPatternItem.make(with: .dash, length: 10), + PlatformPatternItem(type: .dot, length: 10), + PlatformPatternItem(type: .dash, length: 10), ], points: PolylineControllerTests.polylinePoints(), visible: true, @@ -46,10 +45,10 @@ import google_maps_flutter_ios_sdk10_objc let polyline = PropertyOrderValidatingPolyline() PolylineController.update( polyline, - from: FGMPlatformPolyline.make( - withPolylineId: "polyline", + from: PlatformPolyline( + polylineId: "polyline", consumesTapEvents: false, - color: FGMPlatformColor.make(withRed: 0, green: 0, blue: 0, alpha: 0), + color: PlatformColor(red: 0, green: 0, blue: 0, alpha: 0), geodesic: false, jointType: .round, patterns: [], @@ -72,12 +71,12 @@ import google_maps_flutter_ios_sdk10_objc } /// Returns a set of points to use for tests that need a valid but arbitrary line. - static func polylinePoints() -> [FGMPlatformLatLng] { + static func polylinePoints() -> [PlatformLatLng] { return [ - FGMPlatformLatLng.make(withLatitude: 52.4816, longitude: -3.1791), - FGMPlatformLatLng.make(withLatitude: 54.043, longitude: -2.9925), - FGMPlatformLatLng.make(withLatitude: 54.1396, longitude: -4.2739), - FGMPlatformLatLng.make(withLatitude: 53.4153, longitude: -4.0829), + PlatformLatLng(latitude: 52.4816, longitude: -3.1791), + PlatformLatLng(latitude: 54.043, longitude: -2.9925), + PlatformLatLng(latitude: 54.1396, longitude: -4.2739), + PlatformLatLng(latitude: 53.4153, longitude: -4.0829), ] } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift index 7407eacef820..e85abf9afd2a 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift @@ -3,41 +3,114 @@ // found in the LICENSE file. import Foundation -import google_maps_flutter_ios_sdk10_objc @testable import google_maps_flutter_ios_sdk10 -/// Fake implementation of FGMMapEventDelegate for unit tests. +/// Fake implementation of MapEventDelegate for unit tests. class TestMapEventHandler: MapEventDelegate { - func didStartCameraMove() {} - - func didMoveCamera(to cameraPosition: FGMPlatformCameraPosition) {} + func didStartCameraMove(completion: @escaping (Result) -> Void) {} + + func didMoveCamera( + to cameraPositionArg: PlatformCameraPosition, + completion: + @escaping ( + Result + ) -> Void + ) {} - func didIdleCamera() {} + func didIdleCamera(completion: @escaping (Result) -> Void) {} - func didTap(at position: FGMPlatformLatLng) {} + func didTap( + at positionArg: PlatformLatLng, + completion: + @escaping ( + Result + ) -> Void + ) {} - func didLongPress(at position: FGMPlatformLatLng) {} + func didLongPress( + at positionArg: PlatformLatLng, + completion: + @escaping ( + Result + ) -> Void + ) {} - func didTapMarker(withIdentifier markerId: String) {} + func didTapMarker( + withIdentifier markerIdArg: String, + completion: @escaping (Result) -> Void + ) {} func didStartDragForMarker( - withIdentifier markerId: String, at position: FGMPlatformLatLng + withIdentifier markerIdArg: String, + at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void ) {} - func didDragMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) {} + func didDragMarker( + withIdentifier markerIdArg: String, + at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void + ) {} - func didEndDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) {} + func didEndDragForMarker( + withIdentifier markerIdArg: String, + at positionArg: PlatformLatLng, + completion: + @escaping ( + Result + ) -> Void + ) {} - func didTapInfoWindowOfMarker(withIdentifier markerId: String) {} + func didTapInfoWindowOfMarker( + withIdentifier markerIdArg: String, + completion: + @escaping ( + Result + ) -> Void + ) {} - func didTapCircle(withIdentifier circleId: String) {} + func didTapCircle( + withIdentifier circleIdArg: String, + completion: @escaping (Result) -> Void + ) {} - func didTapCluster(_ cluster: FGMPlatformCluster) {} + func didTapCluster( + _ clusterArg: PlatformCluster, + completion: + @escaping ( + Result + ) -> Void + ) {} - func didTapPolygon(withIdentifier polygonId: String) {} + func didTapPolygon( + withIdentifier polygonIdArg: String, + completion: + @escaping ( + Result + ) -> Void + ) {} - func didTapPolyline(withIdentifier polylineId: String) {} + func didTapPolyline( + withIdentifier polylineIdArg: String, + completion: @escaping (Result) -> Void + ) {} - func didTapGroundOverlay(withIdentifier groundOverlayId: String) {} + func didTapGroundOverlay( + withIdentifier groundOverlayIdArg: String, + completion: + @escaping ( + Result + ) -> Void + ) {} + + func tile( + withOverlayIdentifier tileOverlayIdArg: String, + location locationArg: PlatformPoint, + zoom zoomArg: Int64, + completion: + @escaping ( + Result + ) -> Void + ) {} } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/TileOverlayControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/TileOverlayControllerTests.swift index 065ef5ace5df..45e984eba694 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/TileOverlayControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/TileOverlayControllerTests.swift @@ -4,7 +4,6 @@ import GoogleMaps import Testing -import google_maps_flutter_ios_sdk10_objc @testable import google_maps_flutter_ios_sdk10 @@ -14,8 +13,8 @@ import google_maps_flutter_ios_sdk10_objc let tileLayer = PropertyOrderValidatingTileLayer() TileOverlayController.update( tileLayer, - from: FGMPlatformTileOverlay.make( - withTileOverlayId: "overlay", + from: PlatformTileOverlay( + tileOverlayId: "overlay", fadeIn: false, transparency: 0.5, zIndex: 0, diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/TileProviderControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/TileProviderControllerTests.swift index 95d93c98ae17..438eaa6ed9f7 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/TileProviderControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/example/ios/RunnerTests/TileProviderControllerTests.swift @@ -5,7 +5,6 @@ import Flutter import GoogleMaps import Testing -import google_maps_flutter_ios_sdk10_objc @testable import google_maps_flutter_ios_sdk10 @@ -18,19 +17,18 @@ class StubTileReceiver: NSObject, GMSTileReceiver { // A tile provider that expects a single call to // tileWithOverlayIdentifier:location:zoom:completion: on the main thread, // and then confirms it. -class TestTileProvider: NSObject, TileProviderDelegate { +class TestTileProvider: TileProviderDelegate { var onTileCalled: () -> Void init(onTileCalled: @escaping () -> Void) { self.onTileCalled = onTileCalled - super.init() } func tile( withOverlayIdentifier tileOverlayId: String, - location: FGMPlatformPoint, - zoom: Int, - completion: @escaping (FGMPlatformTile?, FlutterError?) -> Void + location: PlatformPoint, + zoom: Int64, + completion: @escaping (Result) -> Void ) { #expect(Thread.isMainThread) onTileCalled() diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10.podspec b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10.podspec index f34887e3fe7e..7e42218eceef 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10.podspec +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10.podspec @@ -14,8 +14,7 @@ Downloaded by pub (not CocoaPods). s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_ios_sdk10' } s.documentation_url = 'https://pub.dev/packages/google_maps_flutter_ios_sdk10' - s.source_files = 'google_maps_flutter_ios_sdk10/Sources/**/*.{h,m,swift}' - s.public_header_files = 'google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/**/*.h' + s.source_files = 'google_maps_flutter_ios_sdk10/Sources/**/*.swift' s.dependency 'Flutter' s.dependency 'GoogleMaps', '~> 10.0' # 6.1.3 was the first version to support GoogleMaps 10.x. diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Package.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Package.swift index a4c1427e73c5..0b391c8a76fb 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Package.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Package.swift @@ -26,7 +26,6 @@ let package = Package( .target( name: "google_maps_flutter_ios_sdk10", dependencies: [ - "google_maps_flutter_ios_sdk10_objc", .product( name: "GoogleMapsUtils", package: "google-maps-ios-utils" @@ -43,21 +42,5 @@ let package = Package( .headerSearchPath("include/google_maps_flutter_ios_sdk10") ] ), - .target( - name: "google_maps_flutter_ios_sdk10_objc", - dependencies: [ - .product( - name: "GoogleMapsUtils", - package: "google-maps-ios-utils" - ), - .product( - name: "GoogleMaps", - package: "ios-maps-sdk" - ), - ], - cSettings: [ - .headerSearchPath("include/google_maps_flutter_ios_sdk10_objc") - ] - ), ] ) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/CircleController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/CircleController.swift index 91bcf7915191..f9870af7c0a7 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/CircleController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/CircleController.swift @@ -4,20 +4,15 @@ import GoogleMaps -#if canImport(google_maps_flutter_ios_sdk10_objc) - import google_maps_flutter_ios_sdk10_objc -#endif - /// Defines circle controllable by Flutter. -class CircleController: NSObject { +class CircleController { let circle: GMSCircle private weak var mapView: GMSMapView? - init(circle: FGMPlatformCircle, mapView: GMSMapView) { + init(circle: PlatformCircle, mapView: GMSMapView) { self.circle = GMSCircle() self.mapView = mapView self.circle.userData = [circle.circleId] - super.init() CircleController.update(self.circle, from: circle, with: mapView) } @@ -25,20 +20,20 @@ class CircleController: NSObject { circle.map = nil } - /// Updates the controller's circle with the properties from a FGMPlatformCircle. + /// Updates the controller's circle with the properties from a PlatformCircle. /// /// Setting the circle to visible will set its map to the given mapView. - func update(from platformCircle: FGMPlatformCircle) { + func update(from platformCircle: PlatformCircle) { if let mapView = mapView { CircleController.update(circle, from: platformCircle, with: mapView) } } - /// Updates the given GMSCircle with the properties from a FGMPlatformCircle. + /// Updates the given GMSCircle with the properties from a PlatformCircle. /// /// Setting the circle to visible will set its map to the given mapView. static func update( - _ circle: GMSCircle, from platformCircle: FGMPlatformCircle, with mapView: GMSMapView + _ circle: GMSCircle, from platformCircle: PlatformCircle, with mapView: GMSMapView ) { circle.isTappable = platformCircle.consumeTapEvents circle.zIndex = Int32(platformCircle.zIndex) @@ -53,7 +48,7 @@ class CircleController: NSObject { } } -class CirclesController: NSObject { +class CirclesController { private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? private var circleIdToController: [String: CircleController] = [:] @@ -61,17 +56,16 @@ class CirclesController: NSObject { init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate - super.init() } - func add(_ circles: [FGMPlatformCircle]) { + func add(_ circles: [PlatformCircle]) { guard let mapView = mapView else { return } for circle in circles { circleIdToController[circle.circleId] = CircleController(circle: circle, mapView: mapView) } } - func change(_ circles: [FGMPlatformCircle]) { + func change(_ circles: [PlatformCircle]) { for circle in circles { circleIdToController[circle.circleId]?.update(from: circle) } @@ -92,7 +86,7 @@ class CirclesController: NSObject { func didTapCircle(withIdentifier identifier: String) { if hasCircle(withIdentifier: identifier) { - eventDelegate?.didTapCircle(withIdentifier: identifier) + eventDelegate?.didTapCircle(withIdentifier: identifier) { _ in } } } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/ClusterManagersController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/ClusterManagersController.swift index 237c3f421f50..6c8bc4a417d7 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/ClusterManagersController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/ClusterManagersController.swift @@ -6,12 +6,8 @@ import Flutter import GoogleMaps import GoogleMapsUtils -#if canImport(google_maps_flutter_ios_sdk10_objc) - import google_maps_flutter_ios_sdk10_objc -#endif - /// A controller that manages all of the cluster managers on a map. -class ClusterManagersController: NSObject { +class ClusterManagersController { private var clusterManagerIdentifierToManagers: [String: GMUClusterManager] = [:] private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? @@ -19,10 +15,9 @@ class ClusterManagersController: NSObject { init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate - super.init() } - func add(_ clusterManagersToAdd: [FGMPlatformClusterManager]) { + func add(_ clusterManagersToAdd: [PlatformClusterManager]) { for clusterManager in clusterManagersToAdd { addClusterManager(clusterManager.identifier) } @@ -57,17 +52,13 @@ class ClusterManagersController: NSObject { clusterManagerIdentifierToManagers.values.forEach({ $0.cluster() }) } - func clusters( - withIdentifier identifier: String, - error: AutoreleasingUnsafeMutablePointer - ) -> [FGMPlatformCluster]? { + func clusters(withIdentifier identifier: String) throws -> [PlatformCluster] { guard let clusterManager = clusterManagerIdentifierToManagers[identifier] else { - error.pointee = FlutterError( + throw PigeonError( code: "Invalid clusterManagerId", message: "getClusters called with invalid clusterManagerId", details: "clusterManagerId was: '\(identifier)'" ) - return nil } guard let mapView = mapView else { return [] } @@ -75,14 +66,14 @@ class ClusterManagersController: NSObject { // https://github.com/googlemaps/google-maps-ios-utils/blob/0e7ed81f1bbd9d29e4529c40ae39b0791b0a0eb8/src/Clustering/GMUClusterManager.m#L94. let integralZoom = floorf(Float(mapView.camera.zoom) + 0.5) let clusters = clusterManager.algorithm.clusters(atZoom: integralZoom) - return clusters.map { FGMPlatformCluster.make(from: $0, clusterManagerIdentifier: identifier) } + return clusters.map { PlatformCluster.make(from: $0, clusterManagerIdentifier: identifier) } } func didTap(_ cluster: GMUStaticCluster) { guard let clusterManagerId = clusterManagerIdentifier(for: cluster) else { return } - let platformCluster = FGMPlatformCluster.make( + let platformCluster = PlatformCluster.make( from: cluster, clusterManagerIdentifier: clusterManagerId) - eventDelegate?.didTapCluster(platformCluster) + eventDelegate?.didTapCluster(platformCluster) { _ in } } /// Returns the cluster manager identifier for given cluster. diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/ConversionUtils.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/ConversionUtils.swift index 90eff0ad58c8..05d91b0bda0a 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/ConversionUtils.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/ConversionUtils.swift @@ -6,14 +6,10 @@ import Flutter import GoogleMaps import GoogleMapsUtils -#if canImport(google_maps_flutter_ios_sdk10_objc) - import google_maps_flutter_ios_sdk10_objc -#endif - -extension FGMPlatformPoint { +extension PlatformPoint { /// Converts a CGPoint to its Pigeon equivalent. - static func make(from point: CGPoint) -> FGMPlatformPoint { - return FGMPlatformPoint.makeWith(x: point.x, y: point.y) + static func make(from point: CGPoint) -> PlatformPoint { + return PlatformPoint(x: point.x, y: point.y) } /// Returns the equivalent CGPoint. @@ -22,11 +18,10 @@ extension FGMPlatformPoint { } } -extension FGMPlatformLatLng { +extension PlatformLatLng { /// Converts a CLLocationCoordinate2D to its Pigeon representation. - static func make(from coordinate: CLLocationCoordinate2D) -> FGMPlatformLatLng { - return FGMPlatformLatLng.make( - withLatitude: coordinate.latitude, longitude: coordinate.longitude) + static func make(from coordinate: CLLocationCoordinate2D) -> PlatformLatLng { + return PlatformLatLng(latitude: coordinate.latitude, longitude: coordinate.longitude) } /// Returns the equivalent CLLocationCoordinate2D. @@ -35,12 +30,12 @@ extension FGMPlatformLatLng { } } -extension FGMPlatformLatLngBounds { +extension PlatformLatLngBounds { /// Converts a GMSCoordinateBounds to its Pigeon representation. - static func make(from bounds: GMSCoordinateBounds) -> FGMPlatformLatLngBounds { - return FGMPlatformLatLngBounds.make( - withNortheast: FGMPlatformLatLng.make(from: bounds.northEast), - southwest: FGMPlatformLatLng.make(from: bounds.southWest) + static func make(from bounds: GMSCoordinateBounds) -> PlatformLatLngBounds { + return PlatformLatLngBounds( + northeast: PlatformLatLng.make(from: bounds.northEast), + southwest: PlatformLatLng.make(from: bounds.southWest) ) } @@ -53,12 +48,12 @@ extension FGMPlatformLatLngBounds { } } -extension FGMPlatformCameraPosition { +extension PlatformCameraPosition { /// Converts a GMSCameraPosition to its Pigeon representation. - static func make(from position: GMSCameraPosition) -> FGMPlatformCameraPosition { - return FGMPlatformCameraPosition.make( - withBearing: position.bearing, - target: FGMPlatformLatLng.make(from: position.target), + static func make(from position: GMSCameraPosition) -> PlatformCameraPosition { + return PlatformCameraPosition( + bearing: position.bearing, + target: PlatformLatLng.make(from: position.target), tilt: position.viewingAngle, zoom: Double(position.zoom) ) @@ -84,7 +79,7 @@ func makePath(from points: [CLLocationCoordinate2D]) -> GMSMutablePath { return path } -extension FGMPlatformMapType { +extension PlatformMapType { /// The corresponding GMSMapViewType. var gmsMapViewType: GMSMapViewType { switch self { @@ -98,7 +93,7 @@ extension FGMPlatformMapType { } } -extension FGMPlatformMarkerCollisionBehavior { +extension PlatformMarkerCollisionBehavior { /// The corresponding GMSCollisionBehavior. var gmsCollisionBehavior: GMSCollisionBehavior { switch self { @@ -114,40 +109,39 @@ extension FGMPlatformMarkerCollisionBehavior { } } -extension FGMPlatformGroundOverlay { +extension PlatformGroundOverlay { /// Converts a GMSGroundOverlay to its Pigeon representation. static func make( from groundOverlay: GMSGroundOverlay, overlayId: String, isCreatedWithBounds: Bool, - zoomLevel: NSNumber? - ) -> FGMPlatformGroundOverlay { - let placeholderImage = FGMPlatformBitmap.make( - withBitmap: FGMPlatformBitmapDefaultMarker.make(withHue: nil)) + zoomLevel: Double? + ) -> PlatformGroundOverlay { + let placeholderImage = PlatformBitmapDefaultMarker(hue: nil) if isCreatedWithBounds, let bounds = groundOverlay.bounds { - return FGMPlatformGroundOverlay.make( - withGroundOverlayId: overlayId, + return PlatformGroundOverlay( + groundOverlayId: overlayId, image: placeholderImage, position: nil, - bounds: FGMPlatformLatLngBounds.make(from: bounds), - anchor: FGMPlatformPoint.make(from: groundOverlay.anchor), + bounds: PlatformLatLngBounds.make(from: bounds), + anchor: PlatformPoint.make(from: groundOverlay.anchor), transparency: 1.0 - Double(groundOverlay.opacity), bearing: groundOverlay.bearing, - zIndex: Int(groundOverlay.zIndex), + zIndex: Int64(groundOverlay.zIndex), visible: groundOverlay.map != nil, clickable: groundOverlay.isTappable, zoomLevel: zoomLevel ) } else { - return FGMPlatformGroundOverlay.make( - withGroundOverlayId: overlayId, + return PlatformGroundOverlay( + groundOverlayId: overlayId, image: placeholderImage, - position: FGMPlatformLatLng.make(from: groundOverlay.position), + position: PlatformLatLng.make(from: groundOverlay.position), bounds: nil, - anchor: FGMPlatformPoint.make(from: groundOverlay.anchor), + anchor: PlatformPoint.make(from: groundOverlay.anchor), transparency: 1.0 - Double(groundOverlay.opacity), bearing: groundOverlay.bearing, - zIndex: Int(groundOverlay.zIndex), + zIndex: Int64(groundOverlay.zIndex), visible: groundOverlay.map != nil, clickable: groundOverlay.isTappable, zoomLevel: zoomLevel @@ -156,14 +150,14 @@ extension FGMPlatformGroundOverlay { } } -extension FGMPlatformHeatmapGradient { +extension PlatformHeatmapGradient { /// Converts a GMUGradient to its Pigeon representation. - static func make(from gradient: GMUGradient) -> FGMPlatformHeatmapGradient { - let colors = gradient.colors.map { FGMPlatformColor.make(from: $0) } - return FGMPlatformHeatmapGradient.make( - with: colors, - startPoints: gradient.startPoints, - colorMapSize: Int(gradient.mapSize) + static func make(from gradient: GMUGradient) -> PlatformHeatmapGradient { + let colors = gradient.colors.map { PlatformColor.make(from: $0) } + return PlatformHeatmapGradient( + colors: colors, + startPoints: gradient.startPoints.map({ $0.doubleValue }), + colorMapSize: Int64(gradient.mapSize) ) } @@ -172,18 +166,18 @@ extension FGMPlatformHeatmapGradient { let colors = colors.map { $0.toUIColor() } return GMUGradient( colors: colors, - startPoints: startPoints, + startPoints: startPoints.map({ $0 as NSNumber }), colorMapSize: UInt(colorMapSize) ) } } -extension FGMPlatformWeightedLatLng { +extension PlatformWeightedLatLng { /// Converts a GMUWeightedLatLng to its Pigeon representation. - static func make(from weightedLatLng: GMUWeightedLatLng) -> FGMPlatformWeightedLatLng { + static func make(from weightedLatLng: GMUWeightedLatLng) -> PlatformWeightedLatLng { let point = GMSMapPoint(x: weightedLatLng.point().x, y: weightedLatLng.point().y) - return FGMPlatformWeightedLatLng.make( - withPoint: FGMPlatformLatLng.make(from: GMSUnproject(point)), + return PlatformWeightedLatLng( + point: PlatformLatLng.make(from: GMSUnproject(point)), weight: Double(weightedLatLng.intensity) ) } @@ -194,36 +188,35 @@ extension FGMPlatformWeightedLatLng { } } -extension FGMPlatformCameraUpdate { +extension PlatformCameraUpdate { /// Creates a GMSCameraUpdate from its Pigeon equivalent. func toGMSCameraUpdate() -> GMSCameraUpdate? { - // See note in messages.dart for why this is so loosely typed. - switch cameraUpdate { - case let newCameraPosition as FGMPlatformCameraUpdateNewCameraPosition: + switch self { + case let newCameraPosition as PlatformCameraUpdateNewCameraPosition: return GMSCameraUpdate.setCamera(newCameraPosition.cameraPosition.toGMSCameraPosition()) - case let newLatLng as FGMPlatformCameraUpdateNewLatLng: + case let newLatLng as PlatformCameraUpdateNewLatLng: return GMSCameraUpdate.setTarget(newLatLng.latLng.toCLLocationCoordinate2D()) - case let newLatLngBounds as FGMPlatformCameraUpdateNewLatLngBounds: + case let newLatLngBounds as PlatformCameraUpdateNewLatLngBounds: return GMSCameraUpdate.fit( newLatLngBounds.bounds.toGMSCoordinateBounds(), withPadding: CGFloat(newLatLngBounds.padding) ) - case let newLatLngZoom as FGMPlatformCameraUpdateNewLatLngZoom: + case let newLatLngZoom as PlatformCameraUpdateNewLatLngZoom: return GMSCameraUpdate.setTarget( newLatLngZoom.latLng.toCLLocationCoordinate2D(), zoom: Float(newLatLngZoom.zoom) ) - case let scrollBy as FGMPlatformCameraUpdateScrollBy: + case let scrollBy as PlatformCameraUpdateScrollBy: return GMSCameraUpdate.scrollBy(x: scrollBy.dx, y: scrollBy.dy) - case let zoomBy as FGMPlatformCameraUpdateZoomBy: + case let zoomBy as PlatformCameraUpdateZoomBy: if let focus = zoomBy.focus { return GMSCameraUpdate.zoom(by: Float(zoomBy.amount), at: focus.toCGPoint()) } else { return GMSCameraUpdate.zoom(by: Float(zoomBy.amount)) } - case let zoom as FGMPlatformCameraUpdateZoom: + case let zoom as PlatformCameraUpdateZoom: return zoom.out ? GMSCameraUpdate.zoomOut() : GMSCameraUpdate.zoomIn() - case let zoomTo as FGMPlatformCameraUpdateZoomTo: + case let zoomTo as PlatformCameraUpdateZoomTo: return GMSCameraUpdate.zoom(to: Float(zoomTo.zoom)) default: return nil @@ -231,16 +224,16 @@ extension FGMPlatformCameraUpdate { } } -extension FGMPlatformColor { +extension PlatformColor { /// Converts a UIColor to its Pigeon representation. - static func make(from color: UIColor) -> FGMPlatformColor { + static func make(from color: UIColor) -> PlatformColor { var red: CGFloat = 0 var green: CGFloat = 0 var blue: CGFloat = 0 var alpha: CGFloat = 0 color.getRed(&red, green: &green, blue: &blue, alpha: &alpha) - return FGMPlatformColor.make( - withRed: Double(red), green: Double(green), blue: Double(blue), alpha: Double(alpha)) + return PlatformColor( + red: Double(red), green: Double(green), blue: Double(blue), alpha: Double(alpha)) } /// Returns the equivalent UIColor. @@ -249,7 +242,7 @@ extension FGMPlatformColor { } } -extension FGMPlatformPatternItem { +extension PlatformPatternItem { /// The GMSStrokeStyle expression of this pattern, using the given stroke color. func gmsStrokeStyle(strokeColor: UIColor) -> GMSStrokeStyle { let color = type == .gap ? UIColor.clear : strokeColor @@ -258,16 +251,16 @@ extension FGMPlatformPatternItem { /// The span length for this pattern, in the form expected by GMSStyleSpans. func gmsStyleSpanLength() -> NSNumber { - return length ?? 0 + return (length ?? 0) as NSNumber } } -extension FGMPlatformCluster { +extension PlatformCluster { /// Converts a GMUCluster to its Pigeon representation. static func make( from cluster: GMUCluster, clusterManagerIdentifier: String - ) -> FGMPlatformCluster { + ) -> PlatformCluster { var bounds = GMSCoordinateBounds() for item in cluster.items { bounds = bounds.includingCoordinate(item.position) @@ -277,10 +270,10 @@ extension FGMPlatformCluster { markerIdentifierFromMarker($0) } - return FGMPlatformCluster.make( - withClusterManagerId: clusterManagerIdentifier, - position: FGMPlatformLatLng.make(from: cluster.position), - bounds: FGMPlatformLatLngBounds.make(from: bounds), + return PlatformCluster( + clusterManagerId: clusterManagerIdentifier, + position: PlatformLatLng.make(from: cluster.position), + bounds: PlatformLatLngBounds.make(from: bounds), markerIds: markerIds ) } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/GoogleMapController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/GoogleMapController.swift index 4ab341a8a7bc..524bd6383b69 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/GoogleMapController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/GoogleMapController.swift @@ -6,10 +6,6 @@ import Flutter import GoogleMaps import GoogleMapsUtils -#if canImport(google_maps_flutter_ios_sdk10_objc) - import google_maps_flutter_ios_sdk10_objc -#endif - /// Protocol for CATransaction to allow mocking in tests. protocol MapAnimationCATransactionProtocol { func begin() @@ -17,6 +13,12 @@ protocol MapAnimationCATransactionProtocol { func setAnimationDuration(_ duration: CFTimeInterval) } +/// Add the AnyObject-required protocol to MapsCallbackApi to allow it to be passed to sub-controllers. +extension MapsCallbackApi: MapEventDelegate {} + +/// Add TileProviderDelegate to avoid needing to pass the entire API surface to TileOverlayController. +extension MapsCallbackApi: TileProviderDelegate {} + /// Non-test implementation of MapAnimationCATransactionProtocol. class DefaultMapAnimationCATransaction: MapAnimationCATransactionProtocol { func begin() { @@ -53,90 +55,15 @@ class DefaultAssetProvider: AssetProvider { } } -/// Non-test implementation of MapEventDelegate, wrapping a FGMMapsCallbackApi instance. -class DefaultMapEventHandler: MapEventDelegate { - let callbackHandler: FGMMapsCallbackApi - - init(callbackHandler: FGMMapsCallbackApi) { - self.callbackHandler = callbackHandler - } - - func didStartCameraMove() { - callbackHandler.didStartCameraMove { _ in } - } - - func didMoveCamera(to cameraPosition: FGMPlatformCameraPosition) { - callbackHandler.didMoveCamera(to: cameraPosition) { _ in } - } - - func didIdleCamera() { - callbackHandler.didIdleCamera { _ in } - } - - func didTap(at position: FGMPlatformLatLng) { - callbackHandler.didTap(atPosition: position) { _ in } - } - - func didLongPress(at position: FGMPlatformLatLng) { - callbackHandler.didLongPress(atPosition: position) { _ in } - } - - func didTapMarker(withIdentifier markerId: String) { - callbackHandler.didTapMarker(withIdentifier: markerId) { _ in } - } - - func didStartDragForMarker( - withIdentifier markerId: String, at position: FGMPlatformLatLng - ) { - callbackHandler.didStartDragForMarker(withIdentifier: markerId, atPosition: position) { _ in } - } - - func didDragMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) { - callbackHandler.didDragMarker(withIdentifier: markerId, atPosition: position) { _ in } - } - - func didEndDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) { - callbackHandler.didEndDragForMarker(withIdentifier: markerId, atPosition: position) { _ in } - } - - func didTapInfoWindowOfMarker(withIdentifier markerId: String) { - callbackHandler.didTapInfoWindowOfMarker(withIdentifier: markerId) { _ in } - } - - func didTapCircle(withIdentifier circleId: String) { - callbackHandler.didTapCircle(withIdentifier: circleId) { _ in } - } - - func didTapCluster(_ cluster: FGMPlatformCluster) { - callbackHandler.didTap(cluster) { _ in } - } - - func didTapPolygon(withIdentifier polygonId: String) { - callbackHandler.didTapPolygon(withIdentifier: polygonId) { _ in } - } - - func didTapPolyline(withIdentifier polylineId: String) { - callbackHandler.didTapPolyline(withIdentifier: polylineId) { _ in } - } - - func didTapGroundOverlay(withIdentifier groundOverlayId: String) { - callbackHandler.didTapGroundOverlay(withIdentifier: groundOverlayId) { _ in } - } -} - public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformView { /// The Google Maps SDK map view managed by this controller. let mapView: GMSMapView /// The Pigeon callback API implementation, used to send events to the Dart side. - let dartCallbackHandler: FGMMapsCallbackApi - /// The map SDK event handler, which routes events to the Dart callback handler. - let mapEventHandler: DefaultMapEventHandler + let dartCallbackHandler: MapsCallbackApi /// The main Pigeon API implementation, separate to avoid lifetime extension. let callHandler: MapCallHandler /// The inspector API implementation, separate to avoid lifetime extension. let inspector: MapInspector - /// A shim to pass tile requests to `dartCallbackHandler`. This is a separate object to avoid init ordering issues. - private let tileProvider: ConcreteTileProvider /// Whether to send notifications about camera position changes to Dart. var trackCameraPosition = false @@ -159,10 +86,10 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV /// that the observer is removed before the controller is deallocated. private var isObservingFrame = false - public convenience init( + convenience init( frame: CGRect, viewIdentifier viewId: Int64, - creationParameters: FGMPlatformMapViewCreationParams, + creationParameters: PlatformMapViewCreationParams, registrar: FlutterPluginRegistrar ) { let camera = creationParameters.initialCameraPosition.toGMSCameraPosition() @@ -186,7 +113,7 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV init( mapView: GMSMapView, viewIdentifier viewId: Int64, - creationParameters: FGMPlatformMapViewCreationParams, + creationParameters: PlatformMapViewCreationParams, assetProvider: AssetProvider, binaryMessenger: FlutterBinaryMessenger ) { @@ -202,52 +129,49 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV styleError = errorString } if let trackCameraPosition = creationParameters.mapConfiguration.trackCameraPosition { - self.trackCameraPosition = trackCameraPosition.boolValue + self.trackCameraPosition = trackCameraPosition } // End duplicate code. let pigeonSuffix = String(format: "%lld", viewId) - dartCallbackHandler = FGMMapsCallbackApi( + dartCallbackHandler = MapsCallbackApi( binaryMessenger: binaryMessenger, messageChannelSuffix: pigeonSuffix ) - mapEventHandler = DefaultMapEventHandler(callbackHandler: dartCallbackHandler) - let markerType = creationParameters.mapConfiguration.markerType clusterManagersController = ClusterManagersController( mapView: mapView, - eventDelegate: mapEventHandler + eventDelegate: dartCallbackHandler ) markersController = MarkersController( mapView: mapView, - eventDelegate: mapEventHandler, + eventDelegate: dartCallbackHandler, clusterManagersController: clusterManagersController, assetProvider: assetProvider, markerType: markerType ) polygonsController = PolygonsController( mapView: mapView, - eventDelegate: mapEventHandler + eventDelegate: dartCallbackHandler ) polylinesController = PolylinesController( mapView: mapView, - eventDelegate: mapEventHandler + eventDelegate: dartCallbackHandler ) circlesController = CirclesController( mapView: mapView, - eventDelegate: mapEventHandler + eventDelegate: dartCallbackHandler ) heatmapsController = HeatmapsController(mapView: mapView) - tileProvider = ConcreteTileProvider(dartCallbackHandler: dartCallbackHandler) tileOverlaysController = TileOverlaysController( mapView: mapView, - tileProvider: tileProvider + tileProvider: dartCallbackHandler ) groundOverlaysController = GroundOverlaysController( mapView: mapView, - eventDelegate: mapEventHandler, + eventDelegate: dartCallbackHandler, assetProvider: assetProvider ) @@ -272,9 +196,17 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV super.init() callHandler.controller = self - SetUpFGMMapsApiWithSuffix(binaryMessenger, callHandler, pigeonSuffix) + MapsApiSetup.setUp( + binaryMessenger: binaryMessenger, + api: callHandler, + messageChannelSuffix: pigeonSuffix + ) inspector.controller = self - SetUpFGMMapsInspectorApiWithSuffix(binaryMessenger, inspector, pigeonSuffix) + MapsInspectorApiSetup.setUp( + binaryMessenger: binaryMessenger, + api: inspector, + messageChannelSuffix: pigeonSuffix + ) mapView.delegate = self isObservingFrame = true @@ -288,8 +220,15 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV if isObservingFrame { mapView.removeObserver(self, forKeyPath: "frame") } - SetUpFGMMapsApiWithSuffix(callHandler.messenger, nil, callHandler.pigeonSuffix) - SetUpFGMMapsInspectorApiWithSuffix(inspector.messenger, nil, inspector.pigeonSuffix) + MapsApiSetup.setUp( + binaryMessenger: callHandler.messenger, + api: nil, + messageChannelSuffix: callHandler.pigeonSuffix + ) + MapsInspectorApiSetup.setUp( + binaryMessenger: inspector.messenger, + api: nil, + messageChannelSuffix: inspector.pigeonSuffix) } public func view() -> UIView { @@ -374,17 +313,17 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV // MARK: - GMSMapViewDelegate methods public func mapView(_ mapView: GMSMapView, willMove gesture: Bool) { - mapEventHandler.didStartCameraMove() + dartCallbackHandler.didStartCameraMove { _ in } } public func mapView(_ mapView: GMSMapView, didChange position: GMSCameraPosition) { if trackCameraPosition { - mapEventHandler.didMoveCamera(to: FGMPlatformCameraPosition.make(from: position)) + dartCallbackHandler.didMoveCamera(to: PlatformCameraPosition.make(from: position)) { _ in } } } public func mapView(_ mapView: GMSMapView, idleAt position: GMSCameraPosition) { - mapEventHandler.didIdleCamera() + dartCallbackHandler.didIdleCamera { _ in } } public func mapView(_ mapView: GMSMapView, didTap marker: GMSMarker) -> Bool { @@ -440,14 +379,14 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV } public func mapView(_ mapView: GMSMapView, didTapAt coordinate: CLLocationCoordinate2D) { - mapEventHandler.didTap(at: FGMPlatformLatLng.make(from: coordinate)) + dartCallbackHandler.didTap(at: PlatformLatLng.make(from: coordinate)) { _ in } } public func mapView(_ mapView: GMSMapView, didLongPressAt coordinate: CLLocationCoordinate2D) { - mapEventHandler.didLongPress(at: FGMPlatformLatLng.make(from: coordinate)) + dartCallbackHandler.didLongPress(at: PlatformLatLng.make(from: coordinate)) { _ in } } - func interpretMapConfiguration(_ config: FGMPlatformMapConfiguration) { + func interpretMapConfiguration(_ config: PlatformMapConfiguration) { // Any changes here must also be made to the `init` method above. See the comment there for // details. let (styleUpdateAttempted, errorString) = GoogleMapController.updateMapView( @@ -456,7 +395,7 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV styleError = errorString } if let trackCameraPosition = config.trackCameraPosition { - self.trackCameraPosition = trackCameraPosition.boolValue + self.trackCameraPosition = trackCameraPosition } } @@ -466,7 +405,7 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV /// describing any error interpreting the style in `config`. If the boolean is true, the error /// string should be stored in `styleError` for later access. static func updateMapView( - _ mapView: GMSMapView, fromConfiguration config: FGMPlatformMapConfiguration + _ mapView: GMSMapView, fromConfiguration config: PlatformMapConfiguration ) -> (Bool, String?) { if let cameraTargetBounds = config.cameraTargetBounds { if let bounds = cameraTargetBounds.bounds { @@ -476,23 +415,23 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV } } if let compassEnabled = config.compassEnabled { - mapView.settings.compassButton = compassEnabled.boolValue + mapView.settings.compassButton = compassEnabled } if let indoorEnabled = config.indoorViewEnabled { - mapView.isIndoorEnabled = indoorEnabled.boolValue + mapView.isIndoorEnabled = indoorEnabled } if let trafficEnabled = config.trafficEnabled { - mapView.isTrafficEnabled = trafficEnabled.boolValue + mapView.isTrafficEnabled = trafficEnabled } if let buildingsEnabled = config.buildingsEnabled { - mapView.isBuildingsEnabled = buildingsEnabled.boolValue + mapView.isBuildingsEnabled = buildingsEnabled } if let mapType = config.mapType { - mapView.mapType = mapType.value.gmsMapViewType + mapView.mapType = mapType.gmsMapViewType } if let zoomData = config.minMaxZoomPreference { - let minZoom = zoomData.min?.floatValue ?? kGMSMinZoomLevel - let maxZoom = zoomData.max?.floatValue ?? kGMSMaxZoomLevel + let minZoom = zoomData.min.map({ Float($0) }) ?? kGMSMinZoomLevel + let maxZoom = zoomData.max.map({ Float($0) }) ?? kGMSMaxZoomLevel mapView.setMinZoom(minZoom, maxZoom: maxZoom) } if let padding = config.padding { @@ -504,22 +443,22 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV ) } if let rotateGesturesEnabled = config.rotateGesturesEnabled { - mapView.settings.rotateGestures = rotateGesturesEnabled.boolValue + mapView.settings.rotateGestures = rotateGesturesEnabled } if let scrollGesturesEnabled = config.scrollGesturesEnabled { - mapView.settings.scrollGestures = scrollGesturesEnabled.boolValue + mapView.settings.scrollGestures = scrollGesturesEnabled } if let tiltGesturesEnabled = config.tiltGesturesEnabled { - mapView.settings.tiltGestures = tiltGesturesEnabled.boolValue + mapView.settings.tiltGestures = tiltGesturesEnabled } if let zoomGesturesEnabled = config.zoomGesturesEnabled { - mapView.settings.zoomGestures = zoomGesturesEnabled.boolValue + mapView.settings.zoomGestures = zoomGesturesEnabled } if let myLocationEnabled = config.myLocationEnabled { - mapView.isMyLocationEnabled = myLocationEnabled.boolValue + mapView.isMyLocationEnabled = myLocationEnabled } if let myLocationButtonEnabled = config.myLocationButtonEnabled { - mapView.settings.myLocationButton = myLocationButtonEnabled.boolValue + mapView.settings.myLocationButton = myLocationButtonEnabled } if let mapStyle = config.style { let (style, errorString) = GoogleMapController.parseMapStyle(mapStyle) @@ -532,32 +471,7 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV } } -// TODO(stuartmorgan): Remove this in favor of an extension to add FGMTileProviderDelegate to -// the Pigeon Flutter API object once this plugin has switched to Swift Pigeon generation -// (adjusting the protocol to match the Swift version of the signature). -private class ConcreteTileProvider: NSObject, TileProviderDelegate { - let handler: FGMMapsCallbackApi - - init(dartCallbackHandler: FGMMapsCallbackApi) { - handler = dartCallbackHandler - } - - public func tile( - withOverlayIdentifier tileOverlayId: String, - location: FGMPlatformPoint, - zoom: Int, - completion: @escaping (FGMPlatformTile?, FlutterError?) -> Void - ) { - handler.tile( - withOverlayIdentifier: tileOverlayId, - location: location, - zoom: zoom, - completion: completion - ) - } -} - -class MapCallHandler: NSObject, FGMMapsApi { +class MapCallHandler: MapsApi { weak var controller: GoogleMapController? let messenger: FlutterBinaryMessenger let pigeonSuffix: String @@ -570,16 +484,16 @@ class MapCallHandler: NSObject, FGMMapsApi { self.messenger = messenger self.pigeonSuffix = suffix self.transactionWrapper = DefaultMapAnimationCATransaction() - super.init() } - func waitForMapWithError(_ error: AutoreleasingUnsafeMutablePointer) { + func waitForMap() { // No-op; this call just ensures synchronization with the platform thread. } func updateCircles( - byAdding toAdd: [FGMPlatformCircle], changing toChange: [FGMPlatformCircle], - removing idsToRemove: [String], error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformCircle], + changing toChange: [PlatformCircle], + removing idsToRemove: [String] ) { controller?.circlesController.add(toAdd) controller?.circlesController.change(toChange) @@ -587,24 +501,23 @@ class MapCallHandler: NSObject, FGMMapsApi { } func updateHeatmaps( - byAdding toAdd: [FGMPlatformHeatmap], changing toChange: [FGMPlatformHeatmap], - removing idsToRemove: [String], error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformHeatmap], + changing toChange: [PlatformHeatmap], + removing idsToRemove: [String] ) { controller?.heatmapsController.add(toAdd) controller?.heatmapsController.change(toChange) controller?.heatmapsController.removeHeatmaps(withIdentifiers: idsToRemove) } - func update( - with configuration: FGMPlatformMapConfiguration, - error: AutoreleasingUnsafeMutablePointer - ) { + func updateWithMapConfiguration(_ configuration: PlatformMapConfiguration) { controller?.interpretMapConfiguration(configuration) } func updateMarkers( - byAdding toAdd: [FGMPlatformMarker], changing toChange: [FGMPlatformMarker], - removing idsToRemove: [String], error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformMarker], + changing toChange: [PlatformMarker], + removing idsToRemove: [String] ) { controller?.markersController.add(toAdd) controller?.markersController.change(toChange) @@ -614,16 +527,17 @@ class MapCallHandler: NSObject, FGMMapsApi { } func updateClusterManagers( - byAdding toAdd: [FGMPlatformClusterManager], removing idsToRemove: [String], - error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformClusterManager], + removing idsToRemove: [String] ) { controller?.clusterManagersController.add(toAdd) controller?.clusterManagersController.removeClusterManagers(withIdentifiers: idsToRemove) } func updatePolygons( - byAdding toAdd: [FGMPlatformPolygon], changing toChange: [FGMPlatformPolygon], - removing idsToRemove: [String], error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformPolygon], + changing toChange: [PlatformPolygon], + removing idsToRemove: [String] ) { controller?.polygonsController.add(toAdd) controller?.polygonsController.change(toChange) @@ -631,8 +545,9 @@ class MapCallHandler: NSObject, FGMMapsApi { } func updatePolylines( - byAdding toAdd: [FGMPlatformPolyline], changing toChange: [FGMPlatformPolyline], - removing idsToRemove: [String], error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformPolyline], + changing toChange: [PlatformPolyline], + removing idsToRemove: [String] ) { controller?.polylinesController.add(toAdd) controller?.polylinesController.change(toChange) @@ -640,8 +555,9 @@ class MapCallHandler: NSObject, FGMMapsApi { } func updateTileOverlays( - byAdding toAdd: [FGMPlatformTileOverlay], changing toChange: [FGMPlatformTileOverlay], - removing idsToRemove: [String], error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformTileOverlay], + changing toChange: [PlatformTileOverlay], + removing idsToRemove: [String] ) { controller?.tileOverlaysController.add(toAdd) controller?.tileOverlaysController.change(toChange) @@ -649,150 +565,128 @@ class MapCallHandler: NSObject, FGMMapsApi { } func updateGroundOverlays( - byAdding toAdd: [FGMPlatformGroundOverlay], changing toChange: [FGMPlatformGroundOverlay], - removing idsToRemove: [String], error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformGroundOverlay], + changing toChange: [PlatformGroundOverlay], + removing idsToRemove: [String] ) { controller?.groundOverlaysController.add(toAdd) controller?.groundOverlaysController.change(toChange) controller?.groundOverlaysController.removeGroundOverlays(withIdentifiers: idsToRemove) } - func latLng( - forScreenCoordinate screenCoordinate: FGMPlatformPoint, - error: AutoreleasingUnsafeMutablePointer - ) -> FGMPlatformLatLng? { + func latLng(for screenCoordinate: PlatformPoint) throws -> PlatformLatLng { guard let mapView = controller?.mapView else { - error.pointee = FlutterError( + throw PigeonError( code: "GoogleMap uninitialized", message: "getLatLng called prior to map initialization", details: nil ) - return nil } let point = screenCoordinate.toCGPoint() let latlng = mapView.projection.coordinate(for: point) - return FGMPlatformLatLng.make(from: latlng) + return PlatformLatLng.make(from: latlng) } - func screenCoordinates( - for latLng: FGMPlatformLatLng, error: AutoreleasingUnsafeMutablePointer - ) -> FGMPlatformPoint? { + func screenCoordinates(for latLng: PlatformLatLng) throws -> PlatformPoint { guard let mapView = controller?.mapView else { - error.pointee = FlutterError( + throw PigeonError( code: "GoogleMap uninitialized", message: "getScreenCoordinate called prior to map initialization", details: nil ) - return nil } let location = latLng.toCLLocationCoordinate2D() let point = mapView.projection.point(for: location) - return FGMPlatformPoint.make(from: point) + return PlatformPoint.make(from: point) } - func visibleMapRegion(_ error: AutoreleasingUnsafeMutablePointer) - -> FGMPlatformLatLngBounds? - { + func visibleMapRegion() throws -> PlatformLatLngBounds { guard let mapView = controller?.mapView else { - error.pointee = FlutterError( + throw PigeonError( code: "GoogleMap uninitialized", message: "getVisibleRegion called prior to map initialization", details: nil ) - return nil } let visibleRegion = mapView.projection.visibleRegion() let bounds = GMSCoordinateBounds(region: visibleRegion) - return FGMPlatformLatLngBounds.make(from: bounds) + return PlatformLatLngBounds.make(from: bounds) } - func moveCamera( - with cameraUpdate: FGMPlatformCameraUpdate, - error: AutoreleasingUnsafeMutablePointer - ) { + func moveCamera(_ cameraUpdate: PlatformCameraUpdate) throws { guard let update = cameraUpdate.toGMSCameraUpdate() else { - error.pointee = FlutterError( + throw PigeonError( code: "Invalid update", message: "Unrecognized camera update", details: nil ) - return } controller?.mapView.moveCamera(update) } func animateCamera( - with cameraUpdate: FGMPlatformCameraUpdate, duration durationMilliseconds: NSNumber?, - error: AutoreleasingUnsafeMutablePointer - ) { + _ cameraUpdate: PlatformCameraUpdate, + duration durationMilliseconds: Int64? + ) throws { guard let update = cameraUpdate.toGMSCameraUpdate() else { - error.pointee = FlutterError( + throw PigeonError( code: "Invalid update", message: "Unrecognized camera update", details: nil ) - return } let transaction = durationMilliseconds != nil ? transactionWrapper : nil transaction?.begin() if let duration = durationMilliseconds { - transaction?.setAnimationDuration(duration.doubleValue / 1000.0) + transaction?.setAnimationDuration(Double(duration) / 1000.0) } controller?.mapView.animate(with: update) transaction?.commit() } - func currentZoomLevel(_ error: AutoreleasingUnsafeMutablePointer) -> NSNumber? { + func zoomLevel() throws -> Double { guard let mapView = controller?.mapView else { - return nil + throw PigeonError( + code: "GoogleMap uninitialized", + message: "getZoomLevel called prior to map initialization", + details: nil + ) } - return NSNumber(value: mapView.camera.zoom) + return Double(mapView.camera.zoom) } - func showInfoWindowForMarker( - withIdentifier markerId: String, error: AutoreleasingUnsafeMutablePointer - ) { - controller?.markersController.showMarkerInfoWindow(withIdentifier: markerId, error: error) + func showInfoWindowForMarker(withIdentifier markerId: String) throws { + try controller?.markersController.showMarkerInfoWindow(withIdentifier: markerId) } - func hideInfoWindowForMarker( - withIdentifier markerId: String, error: AutoreleasingUnsafeMutablePointer - ) { - controller?.markersController.hideMarkerInfoWindow(withIdentifier: markerId, error: error) + func hideInfoWindowForMarker(withIdentifier markerId: String) throws { + try controller?.markersController.hideMarkerInfoWindow(withIdentifier: markerId) } - func isShowingInfoWindowForMarker( - withIdentifier markerId: String, error: AutoreleasingUnsafeMutablePointer - ) -> NSNumber? { - return controller?.markersController.isInfoWindowShownForMarker( - withIdentifier: markerId, error: error) + func isShowingInfoWindowForMarker(withIdentifier markerId: String) throws -> Bool { + return try controller?.markersController.isInfoWindowShownForMarker(withIdentifier: markerId) + ?? false } - func setStyle(_ style: String, error: AutoreleasingUnsafeMutablePointer) -> String? - { + func setStyle(_ style: String) -> String? { return controller?.setMapStyle(style) } - func lastStyleError(_ error: AutoreleasingUnsafeMutablePointer) -> String? { + func lastStyleError() -> String? { return controller?.styleError } - func clearTileCacheForOverlay( - withIdentifier tileOverlayId: String, error: AutoreleasingUnsafeMutablePointer - ) { + func clearTileCacheForOverlay(withIdentifier tileOverlayId: String) { controller?.tileOverlaysController.clearTileCache(withIdentifier: tileOverlayId) } - func takeSnapshotWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> FlutterStandardTypedData? - { + func takeSnapshot() throws -> FlutterStandardTypedData? { guard let mapView = controller?.mapView else { - error.pointee = FlutterError( + throw PigeonError( code: "GoogleMap uninitialized", message: "takeSnapshot called prior to map initialization", details: nil ) - return nil } let renderer = UIGraphicsImageRenderer(size: mapView.bounds.size) let image = renderer.image { context in @@ -804,17 +698,12 @@ class MapCallHandler: NSObject, FGMMapsApi { return nil } - func isAdvancedMarkersAvailable(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return false - } - return NSNumber(value: mapView.mapCapabilities.contains(.advancedMarkers)) + func isAdvancedMarkersAvailable() -> Bool { + return controller?.mapView.mapCapabilities.contains(.advancedMarkers) ?? false } } -class MapInspector: NSObject, FGMMapsInspectorApi { +class MapInspector: MapsInspectorApi { weak var controller: GoogleMapController? let messenger: FlutterBinaryMessenger let pigeonSuffix: String @@ -825,134 +714,87 @@ class MapInspector: NSObject, FGMMapsInspectorApi { ) { self.messenger = messenger self.pigeonSuffix = suffix - super.init() } - func areBuildingsEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.isBuildingsEnabled) + func areBuildingsEnabled() -> Bool { + return controller?.mapView.isBuildingsEnabled ?? false } - func areRotateGesturesEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.settings.rotateGestures) + func areRotateGesturesEnabled() -> Bool { + return controller?.mapView.settings.rotateGestures ?? false } - func areScrollGesturesEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.settings.scrollGestures) + func areScrollGesturesEnabled() -> Bool { + return controller?.mapView.settings.scrollGestures ?? false } - func areTiltGesturesEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.settings.tiltGestures) + func areTiltGesturesEnabled() -> Bool { + return controller?.mapView.settings.tiltGestures ?? false } - func areZoomGesturesEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.settings.zoomGestures) + func areZoomGesturesEnabled() -> Bool { + return controller?.mapView.settings.zoomGestures ?? false } - func tileOverlay( - withIdentifier tileOverlayId: String, error: AutoreleasingUnsafeMutablePointer - ) -> FGMPlatformTileLayer? { + func isCompassEnabled() -> Bool { + return controller?.mapView.settings.compassButton ?? false + } + + func isMyLocationButtonEnabled() -> Bool { + return controller?.mapView.settings.myLocationButton ?? false + } + + func isTrafficEnabled() -> Bool { + return controller?.mapView.isTrafficEnabled ?? false + } + + func tileOverlay(withIdentifier tileOverlayId: String) -> PlatformTileLayer? { guard let controller = controller, let layer = controller.tileOverlaysController.tileOverlay(withIdentifier: tileOverlayId)? .layer else { return nil } - return FGMPlatformTileLayer.make( - withVisible: layer.map != nil, + return PlatformTileLayer( + visible: layer.map != nil, fadeIn: layer.fadeIn, opacity: Double(layer.opacity), - zIndex: Int(layer.zIndex) + zIndex: Int64(layer.zIndex) ) } - func heatmap( - withIdentifier heatmapId: String, error: AutoreleasingUnsafeMutablePointer - ) -> FGMPlatformHeatmap? { + func heatmap(withIdentifier heatmapId: String) -> PlatformHeatmap? { return controller?.heatmapsController.heatmap(withIdentifier: heatmapId) } - func clusters( - withIdentifier clusterManagerId: String, error: AutoreleasingUnsafeMutablePointer - ) -> [FGMPlatformCluster]? { - return controller?.clusterManagersController.clusters( - withIdentifier: clusterManagerId, error: error) - } - - func isCompassEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.settings.compassButton) - } - - func isMyLocationButtonEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.settings.myLocationButton) - } - - func isTrafficEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.isTrafficEnabled) + func clusters(withIdentifier clusterManagerId: String) throws -> [PlatformCluster] { + return try controller?.clusterManagersController.clusters(withIdentifier: clusterManagerId) + ?? [] } - func zoomRange(_ error: AutoreleasingUnsafeMutablePointer) -> FGMPlatformZoomRange? - { + func zoomRange() throws -> PlatformZoomRange { guard let mapView = controller?.mapView else { - return nil + throw PigeonError( + code: "GoogleMap uninitialized", + message: "zoomRange called prior to map initialization", + details: nil + ) } - return FGMPlatformZoomRange.make( - withMin: NSNumber(value: mapView.minZoom), - max: NSNumber(value: mapView.maxZoom) - ) + return PlatformZoomRange(min: Double(mapView.minZoom), max: Double(mapView.maxZoom)) } - func groundOverlay( - withIdentifier groundOverlayId: String, error: AutoreleasingUnsafeMutablePointer - ) -> FGMPlatformGroundOverlay? { + func groundOverlay(withIdentifier groundOverlayId: String) -> PlatformGroundOverlay? { return controller?.groundOverlaysController.groundOverlay(withIdentifier: groundOverlayId) } - func cameraPosition(_ error: AutoreleasingUnsafeMutablePointer) - -> FGMPlatformCameraPosition? - { + func cameraPosition() throws -> PlatformCameraPosition { guard let mapView = controller?.mapView else { - return nil + throw PigeonError( + code: "GoogleMap uninitialized", + message: "cameraPosition called prior to map initialization", + details: nil + ) } - return FGMPlatformCameraPosition.make(from: mapView.camera) + return PlatformCameraPosition.make(from: mapView.camera) } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/GoogleMapFactory.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/GoogleMapFactory.swift index aa7bcf54430e..5e263d2cff79 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/GoogleMapFactory.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/GoogleMapFactory.swift @@ -5,10 +5,6 @@ import Flutter import GoogleMaps -#if canImport(google_maps_flutter_ios_sdk10_objc) - import google_maps_flutter_ios_sdk10_objc -#endif - class GoogleMapFactory: NSObject, FlutterPlatformViewFactory { weak var registrar: FlutterPluginRegistrar? static var sharedMapServices = GMSServices.sharedServices() @@ -25,10 +21,10 @@ class GoogleMapFactory: NSObject, FlutterPlatformViewFactory { return GoogleMapController( frame: frame, viewIdentifier: viewId, - creationParameters: args as! FGMPlatformMapViewCreationParams, registrar: registrar!) + creationParameters: args as! PlatformMapViewCreationParams, registrar: registrar!) } func createArgsCodec() -> any FlutterMessageCodec & NSObjectProtocol { - return FGMGetGoogleMapsFlutterPigeonMessagesCodec() + return MessagesPigeonCodec.shared } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/GroundOverlayController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/GroundOverlayController.swift index 602f805ced06..58fc2830a383 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/GroundOverlayController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/GroundOverlayController.swift @@ -6,16 +6,12 @@ import GoogleMaps import GoogleMapsUtils import UIKit -#if canImport(google_maps_flutter_ios_sdk10_objc) - import google_maps_flutter_ios_sdk10_objc -#endif - /// Controller of a single ground overlay on the map. -class GroundOverlayController: NSObject { +class GroundOverlayController { let groundOverlay: GMSGroundOverlay private weak var mapView: GMSMapView? let createdWithBounds: Bool - var zoomLevel: NSNumber? + var zoomLevel: Double? init( groundOverlay: GMSGroundOverlay, identifier: String, mapView: GMSMapView, @@ -25,18 +21,18 @@ class GroundOverlayController: NSObject { self.mapView = mapView self.groundOverlay.userData = [identifier] self.createdWithBounds = isCreatedWithBounds - super.init() } func removeGroundOverlay() { groundOverlay.map = nil } - /// Updates the controller's ground overlay with the properties from a FGMPlatformGroundOverlay. + /// Updates the controller's ground overlay with the properties from a PlatformGroundOverlay. /// /// Setting the ground overlay to visible will set its map to the controller's mapView. func update( - from platformGroundOverlay: FGMPlatformGroundOverlay, assetProvider: AssetProvider, + from platformGroundOverlay: PlatformGroundOverlay, + assetProvider: AssetProvider, screenScale: CGFloat ) { if let mapView = mapView { @@ -51,12 +47,12 @@ class GroundOverlayController: NSObject { } } - /// Updates the given GMSGroundOverlay with the properties from a FGMPlatformGroundOverlay. + /// Updates the given GMSGroundOverlay with the properties from a PlatformGroundOverlay. /// /// Setting the ground overlay to visible will set its map to the given mapView. static func update( _ groundOverlay: GMSGroundOverlay, - from platformGroundOverlay: FGMPlatformGroundOverlay, + from platformGroundOverlay: PlatformGroundOverlay, mapView: GMSMapView, assetProvider: AssetProvider, screenScale: CGFloat, @@ -101,7 +97,7 @@ class GroundOverlayController: NSObject { } /// Controller of multiple ground overlays on the map. -class GroundOverlaysController: NSObject { +class GroundOverlaysController { private var groundOverlayControllerByIdentifier: [String: GroundOverlayController] = [:] private weak var eventDelegate: MapEventDelegate? private let assetProvider: AssetProvider @@ -111,10 +107,9 @@ class GroundOverlaysController: NSObject { self.mapView = mapView self.eventDelegate = eventDelegate self.assetProvider = assetProvider - super.init() } - func add(_ groundOverlaysToAdd: [FGMPlatformGroundOverlay]) { + func add(_ groundOverlaysToAdd: [PlatformGroundOverlay]) { guard let mapView = mapView else { return } let screenScale = getScreenScale() for groundOverlay in groundOverlaysToAdd { @@ -136,7 +131,7 @@ class GroundOverlaysController: NSObject { ), // The actual icon will be set in the update() call below. icon: nil, - zoomLevel: CGFloat(zoomLevel.doubleValue) + zoomLevel: CGFloat(zoomLevel) ) } else { isCreatedWithBounds = true @@ -179,7 +174,7 @@ class GroundOverlaysController: NSObject { } } - func change(_ groundOverlaysToChange: [FGMPlatformGroundOverlay]) { + func change(_ groundOverlaysToChange: [PlatformGroundOverlay]) { let screenScale = getScreenScale() for groundOverlay in groundOverlaysToChange { let identifier = groundOverlay.groundOverlayId @@ -202,7 +197,7 @@ class GroundOverlaysController: NSObject { func didTapGroundOverlay(withIdentifier identifier: String) { if hasGroundOverlays(withIdentifier: identifier) { - eventDelegate?.didTapGroundOverlay(withIdentifier: identifier) + eventDelegate?.didTapGroundOverlay(withIdentifier: identifier) { _ in } } } @@ -220,11 +215,11 @@ class GroundOverlaysController: NSObject { return mapView?.traitCollection.displayScale ?? 1.0 } - func groundOverlay(withIdentifier identifier: String) -> FGMPlatformGroundOverlay? { + func groundOverlay(withIdentifier identifier: String) -> PlatformGroundOverlay? { guard let controller = groundOverlayControllerByIdentifier[identifier] else { return nil } - return FGMPlatformGroundOverlay.make( + return PlatformGroundOverlay.make( from: controller.groundOverlay, overlayId: identifier, isCreatedWithBounds: controller.createdWithBounds, diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/HeatmapController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/HeatmapController.swift index e28805d887b1..bda3a2199e9e 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/HeatmapController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/HeatmapController.swift @@ -5,19 +5,14 @@ import GoogleMaps import GoogleMapsUtils -#if canImport(google_maps_flutter_ios_sdk10_objc) - import google_maps_flutter_ios_sdk10_objc -#endif - /// Controller of a single Heatmap on the map. -class HeatmapController: NSObject { +class HeatmapController { let heatmapTileLayer: GMUHeatmapTileLayer private weak var mapView: GMSMapView? - init(heatmap: FGMPlatformHeatmap, tileLayer: GMUHeatmapTileLayer, mapView: GMSMapView) { + init(heatmap: PlatformHeatmap, tileLayer: GMUHeatmapTileLayer, mapView: GMSMapView) { self.heatmapTileLayer = tileLayer self.mapView = mapView - super.init() HeatmapController.update(tileLayer, from: heatmap, mapView: mapView) } @@ -29,7 +24,7 @@ class HeatmapController: NSObject { heatmapTileLayer.clearTileCache() } - func update(from platformHeatmap: FGMPlatformHeatmap) { + func update(from platformHeatmap: PlatformHeatmap) { if let mapView = mapView { HeatmapController.update(heatmapTileLayer, from: platformHeatmap, mapView: mapView) } @@ -40,7 +35,7 @@ class HeatmapController: NSObject { /// Setting the heatmap to visible will set its map to the given mapView. static func update( _ heatmapTileLayer: GMUHeatmapTileLayer, - from platformHeatmap: FGMPlatformHeatmap, + from platformHeatmap: PlatformHeatmap, mapView: GMSMapView ) { heatmapTileLayer.weightedData = platformHeatmap.data.map({ $0.toGMUWeightedLatLng() }) @@ -59,16 +54,15 @@ class HeatmapController: NSObject { } /// Controller of multiple Heatmaps on the map. -class HeatmapsController: NSObject { +class HeatmapsController { private var heatmapIdToController: [String: HeatmapController] = [:] private weak var mapView: GMSMapView? init(mapView: GMSMapView) { self.mapView = mapView - super.init() } - func add(_ heatmapsToAdd: [FGMPlatformHeatmap]) { + func add(_ heatmapsToAdd: [PlatformHeatmap]) { guard let mapView = mapView else { return } for heatmap in heatmapsToAdd { let heatmapTileLayer = GMUHeatmapTileLayer() @@ -81,7 +75,7 @@ class HeatmapsController: NSObject { } } - func change(_ heatmapsToChange: [FGMPlatformHeatmap]) { + func change(_ heatmapsToChange: [PlatformHeatmap]) { for heatmap in heatmapsToChange { if let controller = heatmapIdToController[heatmap.heatmapId] { controller.update(from: heatmap) @@ -103,17 +97,17 @@ class HeatmapsController: NSObject { return heatmapIdToController[identifier] != nil } - func heatmap(withIdentifier identifier: String) -> FGMPlatformHeatmap? { + func heatmap(withIdentifier identifier: String) -> PlatformHeatmap? { guard let controller = heatmapIdToController[identifier] else { return nil } let heatmap = controller.heatmapTileLayer - return FGMPlatformHeatmap.make( - withHeatmapId: identifier, - data: heatmap.weightedData.map { FGMPlatformWeightedLatLng.make(from: $0) }, - gradient: FGMPlatformHeatmapGradient.make(from: heatmap.gradient), + return PlatformHeatmap( + heatmapId: identifier, + data: heatmap.weightedData.map { PlatformWeightedLatLng.make(from: $0) }, + gradient: PlatformHeatmapGradient.make(from: heatmap.gradient), opacity: Double(heatmap.opacity), - radius: Int(heatmap.radius), - minimumZoomIntensity: Int(heatmap.minimumZoomIntensity), - maximumZoomIntensity: Int(heatmap.maximumZoomIntensity) + radius: Int64(heatmap.radius), + minimumZoomIntensity: Int64(heatmap.minimumZoomIntensity), + maximumZoomIntensity: Int64(heatmap.maximumZoomIntensity) ) } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/ImageUtils.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/ImageUtils.swift index 9ed4b0c46307..de6a4797ce3f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/ImageUtils.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/ImageUtils.swift @@ -6,11 +6,7 @@ import Flutter import GoogleMaps import UIKit -#if canImport(google_maps_flutter_ios_sdk10_objc) - import google_maps_flutter_ios_sdk10_objc -#endif - -extension FGMPlatformBitmap { +extension PlatformBitmap { /// Creates a UIImage from the Pigeon bitmap representation, suitable for use as a marker icon. func createIcon( assetProvider: AssetProvider, @@ -20,18 +16,15 @@ extension FGMPlatformBitmap { var image: UIImage? - // See comment in messages.dart for why this is so loosely typed. See also - // https://github.com/flutter/flutter/issues/117819. - switch bitmap { - case let bitmap as FGMPlatformBitmapDefaultMarker: - let hue = bitmap.hue?.doubleValue ?? 0 + switch self { + case let bitmap as PlatformBitmapDefaultMarker: image = GMSMarker.markerImage( with: UIColor( - hue: CGFloat(hue) / 360.0, + hue: CGFloat(bitmap.hue ?? 0) / 360.0, saturation: 1.0, brightness: 0.7, alpha: 1.0)) - case let bitmap as FGMPlatformBitmapAsset: + case let bitmap as PlatformBitmapAsset: // Deprecated: This message handling for 'fromAsset' has been replaced by 'asset'. // Refer to the flutter google_maps_flutter_platform_interface package for details. if let pkg = bitmap.pkg { @@ -43,7 +36,7 @@ extension FGMPlatformBitmap { image = assetProvider.imageNamed(key) } } - case let bitmap as FGMPlatformBitmapAssetImage: + case let bitmap as PlatformBitmapAssetImage: // Deprecated: This message handling for 'fromAssetImage' has been replaced by 'asset'. // Refer to the flutter google_maps_flutter_platform_interface package for details. if let key = assetProvider.lookupKey(forAsset: bitmap.name) { @@ -51,11 +44,11 @@ extension FGMPlatformBitmap { image = scaledImage(assetImage, scale: bitmap.scale) } } - case let bitmap as FGMPlatformBitmapBytes: + case let bitmap as PlatformBitmapBytes: // Deprecated: This message handling for 'fromBytes' has been replaced by 'bytes'. // Refer to the flutter google_maps_flutter_platform_interface package for details. image = UIImage(data: bitmap.byteData.data, scale: screenScale) - case let bitmap as FGMPlatformBitmapAssetMap: + case let bitmap as PlatformBitmapAssetMap: if let key = assetProvider.lookupKey(forAsset: bitmap.assetName) { image = assetProvider.imageNamed(key) } @@ -69,7 +62,7 @@ extension FGMPlatformBitmap { image = scaledImage(currentImage, scale: CGFloat(bitmap.imagePixelRatio)) } } - case let bitmap as FGMPlatformBitmapBytesMap: + case let bitmap as PlatformBitmapBytesMap: let bytes = bitmap.byteData image = UIImage(data: bytes.data, scale: screenScale) if let currentImage = image { @@ -88,7 +81,7 @@ extension FGMPlatformBitmap { image = UIImage(data: bytes.data) } } - case let bitmap as FGMPlatformBitmapPinConfig: + case let bitmap as PlatformBitmapPinConfig: let options = GMSPinImageOptions() if let backgroundColor = bitmap.backgroundColor { options.backgroundColor = backgroundColor.toUIColor() @@ -209,16 +202,16 @@ private func scaledImage(_ image: UIImage, to size: CGSize) -> UIImage { /// widht and height are not given. private func scaledImage( _ image: UIImage, - width: NSNumber?, - height: NSNumber?, + width: Double?, + height: Double?, screenScale: CGFloat ) -> UIImage { if width == nil && height == nil { return image } - let targetWidth = width == nil ? image.size.width : CGFloat(width!.doubleValue) - let targetHeight = height == nil ? image.size.height : CGFloat(height!.doubleValue) + let targetWidth = width ?? image.size.width + let targetHeight = height ?? image.size.height var calculatedWidth = targetWidth var calculatedHeight = targetHeight diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/MapEventDelegate.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/MapEventDelegate.swift index 43c1e81a1168..164a8b624ce0 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/MapEventDelegate.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/MapEventDelegate.swift @@ -6,54 +6,7 @@ import google_maps_flutter_ios_sdk10_objc #endif -/// Delegate for map event notifications. +/// Delegate for map callbacks that need Dart handling. /// -/// This is abstraction of the map event portions of FGMMapsCallbackApi, to -/// avoid coupling all the individual controllers to the Pigeon implementation -/// of event handling, and to allow for mocks/fakes in unit tests. -protocol MapEventDelegate: AnyObject { - /// Called when the map camera starts moving. - func didStartCameraMove() - - /// Called when the map camera moves. - func didMoveCamera(to cameraPosition: FGMPlatformCameraPosition) - - /// Called when the map camera stops moving. - func didIdleCamera() - - /// Called when the map, not a specifc map object, is tapped. - func didTap(at position: FGMPlatformLatLng) - - /// Called when the map, not a specifc map object, is long pressed. - func didLongPress(at position: FGMPlatformLatLng) - - /// Called when a marker is tapped. - func didTapMarker(withIdentifier markerId: String) - - /// Called when a marker drag starts. - func didStartDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) - - /// Called when a marker drag updates. - func didDragMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) - - /// Called when a marker drag ends. - func didEndDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) - - /// Called when a marker's info window is tapped. - func didTapInfoWindowOfMarker(withIdentifier markerId: String) - - /// Called when a circle is tapped. - func didTapCircle(withIdentifier circleId: String) - - /// Called when a marker cluster is tapped. - func didTapCluster(_ cluster: FGMPlatformCluster) - - /// Called when a polygon is tapped. - func didTapPolygon(withIdentifier polygonId: String) - - /// Called when a polyline is tapped. - func didTapPolyline(withIdentifier polylineId: String) - - /// Called when a ground overlay is tapped. - func didTapGroundOverlay(withIdentifier groundOverlayId: String) -} +/// This exists to add AnyObject to the requirements, so that references to it can be weak. +protocol MapEventDelegate: AnyObject, MapsCallbackApiProtocol {} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/MarkerController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/MarkerController.swift index 45763017cfe3..8ca280bc2a29 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/MarkerController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/MarkerController.swift @@ -6,12 +6,8 @@ import Flutter import GoogleMaps import UIKit -#if canImport(google_maps_flutter_ios_sdk10_objc) - import google_maps_flutter_ios_sdk10_objc -#endif - /// Defines marker controllable by Flutter. -class MarkerController: NSObject { +class MarkerController { let marker: GMSMarker private weak var mapView: GMSMapView? private(set) var consumeTapEvents: Bool = false @@ -22,7 +18,6 @@ class MarkerController: NSObject { self.marker = marker self.markerIdentifier = markerIdentifier self.mapView = mapView - super.init() } func showInfoWindow() { @@ -43,11 +38,11 @@ class MarkerController: NSObject { marker.map = nil } - /// Updates the controller's marker with the properties from a FGMPlatformMarker. + /// Updates the controller's marker with the properties from a PlatformMarker. /// /// Setting the marker to visible will set its map to the controller's mapView. func update( - from platformMarker: FGMPlatformMarker, + from platformMarker: PlatformMarker, assetProvider: AssetProvider, screenScale: CGFloat ) { @@ -71,12 +66,12 @@ class MarkerController: NSObject { ) } - /// Updates the given GMSMarker with the properties from a FGMPlatformMarker. + /// Updates the given GMSMarker with the properties from a PlatformMarker. /// /// Setting the marker to visible will set its map to the given mapView. static func update( _ marker: GMSMarker, - from platformMarker: FGMPlatformMarker, + from platformMarker: PlatformMarker, mapView: GMSMapView?, assetProvider: AssetProvider, screenScale: CGFloat, @@ -102,7 +97,7 @@ class MarkerController: NSObject { if let advancedMarker = marker as? GMSAdvancedMarker, let collisionBehaviorValue = platformMarker.collisionBehavior { - advancedMarker.collisionBehavior = collisionBehaviorValue.value.gmsCollisionBehavior + advancedMarker.collisionBehavior = collisionBehaviorValue.gmsCollisionBehavior } // This must be done last, to avoid visual flickers of default property values. @@ -116,36 +111,35 @@ class MarkerController: NSObject { } /// Controller of multiple markers on the map. -class MarkersController: NSObject { +class MarkersController { private(set) var markerIdentifierToController: [String: MarkerController] = [:] private weak var eventDelegate: MapEventDelegate? private weak var clusterManagersController: ClusterManagersController? private let assetProvider: AssetProvider private weak var mapView: GMSMapView? - private let markerType: FGMPlatformMarkerType + private let markerType: PlatformMarkerType init( mapView: GMSMapView, eventDelegate: MapEventDelegate, clusterManagersController: ClusterManagersController?, assetProvider: AssetProvider, - markerType: FGMPlatformMarkerType + markerType: PlatformMarkerType ) { self.mapView = mapView self.eventDelegate = eventDelegate self.clusterManagersController = clusterManagersController self.assetProvider = assetProvider self.markerType = markerType - super.init() } - func add(_ markersToAdd: [FGMPlatformMarker]) { + func add(_ markersToAdd: [PlatformMarker]) { for marker in markersToAdd { addMarker(marker) } } - private func addMarker(_ markerToAdd: FGMPlatformMarker) { + private func addMarker(_ markerToAdd: PlatformMarker) { guard let mapView = mapView else { return } let position = markerToAdd.position.toCLLocationCoordinate2D() let markerIdentifier = markerToAdd.markerId @@ -175,13 +169,13 @@ class MarkersController: NSObject { markerIdentifierToController[markerIdentifier] = controller } - func change(_ markersToChange: [FGMPlatformMarker]) { + func change(_ markersToChange: [PlatformMarker]) { for marker in markersToChange { changeMarker(marker) } } - private func changeMarker(_ markerToChange: FGMPlatformMarker) { + private func changeMarker(_ markerToChange: PlatformMarker) { let markerIdentifier = markerToChange.markerId guard let controller = markerIdentifierToController[markerIdentifier] else { return } @@ -223,7 +217,7 @@ class MarkersController: NSObject { func didTapMarker(withIdentifier identifier: String) -> Bool { guard let controller = markerIdentifierToController[identifier] else { return false } - eventDelegate?.didTapMarker(withIdentifier: identifier) + eventDelegate?.didTapMarker(withIdentifier: identifier) { _ in } return controller.consumeTapEvents } @@ -231,76 +225,63 @@ class MarkersController: NSObject { guard markerIdentifierToController[identifier] != nil else { return } eventDelegate?.didStartDragForMarker( withIdentifier: identifier, - at: FGMPlatformLatLng.make(from: location) - ) + at: PlatformLatLng.make(from: location) + ) { _ in } } func didDragMarker(withIdentifier identifier: String, location: CLLocationCoordinate2D) { guard markerIdentifierToController[identifier] != nil else { return } eventDelegate?.didDragMarker( withIdentifier: identifier, - at: FGMPlatformLatLng.make(from: location) - ) + at: PlatformLatLng.make(from: location) + ) { _ in } } func didEndDraggingMarker(withIdentifier identifier: String, location: CLLocationCoordinate2D) { guard markerIdentifierToController[identifier] != nil else { return } eventDelegate?.didEndDragForMarker( withIdentifier: identifier, - at: FGMPlatformLatLng.make(from: location) - ) + at: PlatformLatLng.make(from: location) + ) { _ in } } func didTapInfoWindowOfMarker(withIdentifier identifier: String) { if markerIdentifierToController[identifier] != nil { - eventDelegate?.didTapInfoWindowOfMarker(withIdentifier: identifier) + eventDelegate?.didTapInfoWindowOfMarker(withIdentifier: identifier) { _ in } } } - func showMarkerInfoWindow( - withIdentifier identifier: String, - error: AutoreleasingUnsafeMutablePointer - ) { - if let controller = markerIdentifierToController[identifier] { - controller.showInfoWindow() - } else { - error.pointee = FlutterError( + func showMarkerInfoWindow(withIdentifier identifier: String) throws { + guard let controller = markerIdentifierToController[identifier] else { + throw PigeonError( code: "Invalid markerId", message: "showInfoWindow called with invalid markerId", details: nil ) } + controller.showInfoWindow() } - func hideMarkerInfoWindow( - withIdentifier identifier: String, - error: AutoreleasingUnsafeMutablePointer - ) { - if let controller = markerIdentifierToController[identifier] { - controller.hideInfoWindow() - } else { - error.pointee = FlutterError( + func hideMarkerInfoWindow(withIdentifier identifier: String) throws { + guard let controller = markerIdentifierToController[identifier] else { + throw PigeonError( code: "Invalid markerId", message: "hideInfoWindow called with invalid markerId", details: nil ) } + controller.hideInfoWindow() } - func isInfoWindowShownForMarker( - withIdentifier identifier: String, - error: AutoreleasingUnsafeMutablePointer - ) -> NSNumber? { - if let controller = markerIdentifierToController[identifier] { - return NSNumber(value: controller.isInfoWindowShown()) - } else { - error.pointee = FlutterError( + func isInfoWindowShownForMarker(withIdentifier identifier: String) throws -> Bool { + guard let controller = markerIdentifierToController[identifier] else { + throw PigeonError( code: "Invalid markerId", message: "isInfoWindowShown called with invalid markerId", details: nil ) - return nil } + return controller.isInfoWindowShown() } func getScreenScale() -> CGFloat { diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/Messages.g.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/Messages.g.swift new file mode 100644 index 000000000000..76dd15c5e9e7 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/Messages.g.swift @@ -0,0 +1,4174 @@ +// Copyright 2013 The Flutter Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// Autogenerated from Pigeon (v27.3.2), do not edit directly. +// See also: https://pub.dev/packages/pigeon + +import Foundation + +#if os(iOS) + import Flutter +#elseif os(macOS) + import FlutterMacOS +#else + #error("Unsupported platform.") +#endif + +/// Error class for passing custom error details to Dart side. +final class PigeonError: Error { + let code: String + let message: String? + let details: Sendable? + + init(code: String, message: String?, details: Sendable?) { + self.code = code + self.message = message + self.details = details + } + + var localizedDescription: String { + return + "PigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" + } +} + +private func wrapResult(_ result: Any?) -> [Any?] { + return [result] +} + +private func wrapError(_ error: Any) -> [Any?] { + if let pigeonError = error as? PigeonError { + return [ + pigeonError.code, + pigeonError.message, + pigeonError.details, + ] + } + if let flutterError = error as? FlutterError { + return [ + flutterError.code, + flutterError.message, + flutterError.details, + ] + } + return [ + "\(error)", + "\(Swift.type(of: error))", + "Stacktrace: \(Thread.callStackSymbols)", + ] +} + +private func createConnectionError(withChannelName channelName: String) -> PigeonError { + return PigeonError( + code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", + details: "") +} + +enum MessagesPigeonInternal { + static func isNullish(_ value: Any?) -> Bool { + guard let innerValue = value else { + return true + } + + if case Optional.some(Optional.none) = value { + return true + } + + return innerValue is NSNull + } + static func doubleEquals(_ lhs: Double, _ rhs: Double) -> Bool { + return (lhs.isNaN && rhs.isNaN) || lhs == rhs + } + + static func doubleHash(_ value: Double, _ hasher: inout Hasher) { + if value.isNaN { + hasher.combine(0x7FF8_0000_0000_0000) + } else { + // Normalize -0.0 to 0.0 + hasher.combine(value == 0 ? 0 : value) + } + } + + static func deepEquals(_ lhs: Any?, _ rhs: Any?) -> Bool { + let cleanLhs = nilOrValue(lhs) as Any? + let cleanRhs = nilOrValue(rhs) as Any? + switch (cleanLhs, cleanRhs) { + case (nil, nil): + return true + + case (nil, _), (_, nil): + return false + + case (let lhs as AnyObject, let rhs as AnyObject) where lhs === rhs: + return true + + case is (Void, Void): + return true + + case (let lhsArray, let rhsArray) as ([Any?], [Any?]): + guard lhsArray.count == rhsArray.count else { return false } + for (index, element) in lhsArray.enumerated() { + if !deepEquals(element, rhsArray[index]) { + return false + } + } + return true + + case (let lhsArray, let rhsArray) as ([Double], [Double]): + guard lhsArray.count == rhsArray.count else { return false } + for (index, element) in lhsArray.enumerated() { + if !doubleEquals(element, rhsArray[index]) { + return false + } + } + return true + + case (let lhsDictionary, let rhsDictionary) as ([AnyHashable: Any?], [AnyHashable: Any?]): + guard lhsDictionary.count == rhsDictionary.count else { return false } + for (lhsKey, lhsValue) in lhsDictionary { + var found = false + for (rhsKey, rhsValue) in rhsDictionary { + if deepEquals(lhsKey, rhsKey) { + if deepEquals(lhsValue, rhsValue) { + found = true + break + } else { + return false + } + } + } + if !found { return false } + } + return true + + case (let lhs as Double, let rhs as Double): + return doubleEquals(lhs, rhs) + + case (let lhsHashable, let rhsHashable) as (AnyHashable, AnyHashable): + return lhsHashable == rhsHashable + + default: + return false + } + } + + static func deepHash(value: Any?, hasher: inout Hasher) { + let cleanValue = nilOrValue(value) as Any? + if let cleanValue = cleanValue { + if let doubleValue = cleanValue as? Double { + doubleHash(doubleValue, &hasher) + } else if let valueList = cleanValue as? [Any?] { + for item in valueList { + deepHash(value: item, hasher: &hasher) + } + } else if let valueList = cleanValue as? [Double] { + for item in valueList { + doubleHash(item, &hasher) + } + } else if let valueDict = cleanValue as? [AnyHashable: Any?] { + var result = 0 + for (key, value) in valueDict { + var entryKeyHasher = Hasher() + deepHash(value: key, hasher: &entryKeyHasher) + var entryValueHasher = Hasher() + deepHash(value: value, hasher: &entryValueHasher) + result = result &+ ((entryKeyHasher.finalize() &* 31) ^ entryValueHasher.finalize()) + } + hasher.combine(result) + } else if let hashableValue = cleanValue as? AnyHashable { + hasher.combine(hashableValue) + } else { + hasher.combine(String(describing: cleanValue)) + } + } else { + hasher.combine(0) + } + } + +} + +private func nilOrValue(_ value: Any?) -> T? { + if value is NSNull { return nil } + return value as! T? +} + +/// Pigeon equivalent of MapType +enum PlatformMapType: Int, CaseIterable { + case none = 0 + case normal = 1 + case satellite = 2 + case terrain = 3 + case hybrid = 4 +} + +/// Pigeon equivalent of the MarkerCollisionBehavior enum. +enum PlatformMarkerCollisionBehavior: Int, CaseIterable { + case requiredDisplay = 0 + case optionalAndHidesLowerPriority = 1 + case requiredAndHidesOptional = 2 +} + +/// Join types for polyline joints. +enum PlatformJointType: Int, CaseIterable { + case mitered = 0 + case bevel = 1 + case round = 2 +} + +/// Enumeration of possible types for PatternItem. +enum PlatformPatternItemType: Int, CaseIterable { + case dot = 0 + case dash = 1 + case gap = 2 +} + +enum PlatformMarkerType: Int, CaseIterable { + case marker = 0 + case advancedMarker = 1 +} + +/// Pigeon equivalent of [MapBitmapScaling]. +enum PlatformMapBitmapScaling: Int, CaseIterable { + case auto = 0 + case none = 1 +} + +/// Pigeon representatation of a CameraPosition. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraPosition: Hashable, CustomStringConvertible { + var bearing: Double + var target: PlatformLatLng + var tilt: Double + var zoom: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraPosition? { + let bearing = pigeonVar_list[0] as! Double + let target = pigeonVar_list[1] as! PlatformLatLng + let tilt = pigeonVar_list[2] as! Double + let zoom = pigeonVar_list[3] as! Double + + return PlatformCameraPosition( + bearing: bearing, + target: target, + tilt: tilt, + zoom: zoom + ) + } + func toList() -> [Any?] { + return [ + bearing, + target, + tilt, + zoom, + ] + } + static func == (lhs: PlatformCameraPosition, rhs: PlatformCameraPosition) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.bearing, rhs.bearing) + && MessagesPigeonInternal.deepEquals(lhs.target, rhs.target) + && MessagesPigeonInternal.deepEquals(lhs.tilt, rhs.tilt) + && MessagesPigeonInternal.deepEquals(lhs.zoom, rhs.zoom) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraPosition") + MessagesPigeonInternal.deepHash(value: bearing, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: target, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: tilt, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zoom, hasher: &hasher) + } + + public var description: String { + return + "PlatformCameraPosition(bearing: \(String(describing: bearing)), target: \(String(describing: target)), tilt: \(String(describing: tilt)), zoom: \(String(describing: zoom)))" + } +} + +/// Pigeon representation of a CameraUpdate. +/// +/// Generated class from Pigeon that represents data sent in messages. +/// This protocol should not be extended by any user class outside of the generated file. +protocol PlatformCameraUpdate { + +} + +/// Pigeon equivalent of NewCameraPosition +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateNewCameraPosition: PlatformCameraUpdate { + var cameraPosition: PlatformCameraPosition + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateNewCameraPosition? { + let cameraPosition = pigeonVar_list[0] as! PlatformCameraPosition + + return PlatformCameraUpdateNewCameraPosition( + cameraPosition: cameraPosition + ) + } + func toList() -> [Any?] { + return [ + cameraPosition + ] + } + static func == ( + lhs: PlatformCameraUpdateNewCameraPosition, rhs: PlatformCameraUpdateNewCameraPosition + ) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.cameraPosition, rhs.cameraPosition) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateNewCameraPosition") + MessagesPigeonInternal.deepHash(value: cameraPosition, hasher: &hasher) + } + + public var description: String { + return + "PlatformCameraUpdateNewCameraPosition(cameraPosition: \(String(describing: cameraPosition)))" + } +} + +/// Pigeon equivalent of NewLatLng +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateNewLatLng: PlatformCameraUpdate { + var latLng: PlatformLatLng + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateNewLatLng? { + let latLng = pigeonVar_list[0] as! PlatformLatLng + + return PlatformCameraUpdateNewLatLng( + latLng: latLng + ) + } + func toList() -> [Any?] { + return [ + latLng + ] + } + static func == (lhs: PlatformCameraUpdateNewLatLng, rhs: PlatformCameraUpdateNewLatLng) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.latLng, rhs.latLng) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateNewLatLng") + MessagesPigeonInternal.deepHash(value: latLng, hasher: &hasher) + } + + public var description: String { + return "PlatformCameraUpdateNewLatLng(latLng: \(String(describing: latLng)))" + } +} + +/// Pigeon equivalent of NewLatLngBounds +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateNewLatLngBounds: PlatformCameraUpdate { + var bounds: PlatformLatLngBounds + var padding: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateNewLatLngBounds? { + let bounds = pigeonVar_list[0] as! PlatformLatLngBounds + let padding = pigeonVar_list[1] as! Double + + return PlatformCameraUpdateNewLatLngBounds( + bounds: bounds, + padding: padding + ) + } + func toList() -> [Any?] { + return [ + bounds, + padding, + ] + } + static func == ( + lhs: PlatformCameraUpdateNewLatLngBounds, rhs: PlatformCameraUpdateNewLatLngBounds + ) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.bounds, rhs.bounds) + && MessagesPigeonInternal.deepEquals(lhs.padding, rhs.padding) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateNewLatLngBounds") + MessagesPigeonInternal.deepHash(value: bounds, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: padding, hasher: &hasher) + } + + public var description: String { + return + "PlatformCameraUpdateNewLatLngBounds(bounds: \(String(describing: bounds)), padding: \(String(describing: padding)))" + } +} + +/// Pigeon equivalent of NewLatLngZoom +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateNewLatLngZoom: PlatformCameraUpdate { + var latLng: PlatformLatLng + var zoom: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateNewLatLngZoom? { + let latLng = pigeonVar_list[0] as! PlatformLatLng + let zoom = pigeonVar_list[1] as! Double + + return PlatformCameraUpdateNewLatLngZoom( + latLng: latLng, + zoom: zoom + ) + } + func toList() -> [Any?] { + return [ + latLng, + zoom, + ] + } + static func == (lhs: PlatformCameraUpdateNewLatLngZoom, rhs: PlatformCameraUpdateNewLatLngZoom) + -> Bool + { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.latLng, rhs.latLng) + && MessagesPigeonInternal.deepEquals(lhs.zoom, rhs.zoom) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateNewLatLngZoom") + MessagesPigeonInternal.deepHash(value: latLng, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zoom, hasher: &hasher) + } + + public var description: String { + return + "PlatformCameraUpdateNewLatLngZoom(latLng: \(String(describing: latLng)), zoom: \(String(describing: zoom)))" + } +} + +/// Pigeon equivalent of ScrollBy +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateScrollBy: PlatformCameraUpdate { + var dx: Double + var dy: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateScrollBy? { + let dx = pigeonVar_list[0] as! Double + let dy = pigeonVar_list[1] as! Double + + return PlatformCameraUpdateScrollBy( + dx: dx, + dy: dy + ) + } + func toList() -> [Any?] { + return [ + dx, + dy, + ] + } + static func == (lhs: PlatformCameraUpdateScrollBy, rhs: PlatformCameraUpdateScrollBy) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.dx, rhs.dx) + && MessagesPigeonInternal.deepEquals(lhs.dy, rhs.dy) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateScrollBy") + MessagesPigeonInternal.deepHash(value: dx, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: dy, hasher: &hasher) + } + + public var description: String { + return + "PlatformCameraUpdateScrollBy(dx: \(String(describing: dx)), dy: \(String(describing: dy)))" + } +} + +/// Pigeon equivalent of ZoomBy +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateZoomBy: PlatformCameraUpdate { + var amount: Double + var focus: PlatformPoint? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateZoomBy? { + let amount = pigeonVar_list[0] as! Double + let focus: PlatformPoint? = nilOrValue(pigeonVar_list[1]) + + return PlatformCameraUpdateZoomBy( + amount: amount, + focus: focus + ) + } + func toList() -> [Any?] { + return [ + amount, + focus, + ] + } + static func == (lhs: PlatformCameraUpdateZoomBy, rhs: PlatformCameraUpdateZoomBy) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.amount, rhs.amount) + && MessagesPigeonInternal.deepEquals(lhs.focus, rhs.focus) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateZoomBy") + MessagesPigeonInternal.deepHash(value: amount, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: focus, hasher: &hasher) + } + + public var description: String { + return + "PlatformCameraUpdateZoomBy(amount: \(String(describing: amount)), focus: \(String(describing: focus)))" + } +} + +/// Pigeon equivalent of ZoomIn/ZoomOut +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateZoom: PlatformCameraUpdate { + var out: Bool + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateZoom? { + let out = pigeonVar_list[0] as! Bool + + return PlatformCameraUpdateZoom( + out: out + ) + } + func toList() -> [Any?] { + return [ + out + ] + } + static func == (lhs: PlatformCameraUpdateZoom, rhs: PlatformCameraUpdateZoom) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.out, rhs.out) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateZoom") + MessagesPigeonInternal.deepHash(value: out, hasher: &hasher) + } + + public var description: String { + return "PlatformCameraUpdateZoom(out: \(String(describing: out)))" + } +} + +/// Pigeon equivalent of ZoomTo +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateZoomTo: PlatformCameraUpdate { + var zoom: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateZoomTo? { + let zoom = pigeonVar_list[0] as! Double + + return PlatformCameraUpdateZoomTo( + zoom: zoom + ) + } + func toList() -> [Any?] { + return [ + zoom + ] + } + static func == (lhs: PlatformCameraUpdateZoomTo, rhs: PlatformCameraUpdateZoomTo) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.zoom, rhs.zoom) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateZoomTo") + MessagesPigeonInternal.deepHash(value: zoom, hasher: &hasher) + } + + public var description: String { + return "PlatformCameraUpdateZoomTo(zoom: \(String(describing: zoom)))" + } +} + +/// Pigeon equivalent of the Circle class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCircle: Hashable, CustomStringConvertible { + var consumeTapEvents: Bool + var fillColor: PlatformColor + var strokeColor: PlatformColor + var visible: Bool + var strokeWidth: Int64 + var zIndex: Double + var center: PlatformLatLng + var radius: Double + var circleId: String + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCircle? { + let consumeTapEvents = pigeonVar_list[0] as! Bool + let fillColor = pigeonVar_list[1] as! PlatformColor + let strokeColor = pigeonVar_list[2] as! PlatformColor + let visible = pigeonVar_list[3] as! Bool + let strokeWidth = pigeonVar_list[4] as! Int64 + let zIndex = pigeonVar_list[5] as! Double + let center = pigeonVar_list[6] as! PlatformLatLng + let radius = pigeonVar_list[7] as! Double + let circleId = pigeonVar_list[8] as! String + + return PlatformCircle( + consumeTapEvents: consumeTapEvents, + fillColor: fillColor, + strokeColor: strokeColor, + visible: visible, + strokeWidth: strokeWidth, + zIndex: zIndex, + center: center, + radius: radius, + circleId: circleId + ) + } + func toList() -> [Any?] { + return [ + consumeTapEvents, + fillColor, + strokeColor, + visible, + strokeWidth, + zIndex, + center, + radius, + circleId, + ] + } + static func == (lhs: PlatformCircle, rhs: PlatformCircle) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.consumeTapEvents, rhs.consumeTapEvents) + && MessagesPigeonInternal.deepEquals(lhs.fillColor, rhs.fillColor) + && MessagesPigeonInternal.deepEquals(lhs.strokeColor, rhs.strokeColor) + && MessagesPigeonInternal.deepEquals(lhs.visible, rhs.visible) + && MessagesPigeonInternal.deepEquals(lhs.strokeWidth, rhs.strokeWidth) + && MessagesPigeonInternal.deepEquals(lhs.zIndex, rhs.zIndex) + && MessagesPigeonInternal.deepEquals(lhs.center, rhs.center) + && MessagesPigeonInternal.deepEquals(lhs.radius, rhs.radius) + && MessagesPigeonInternal.deepEquals(lhs.circleId, rhs.circleId) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCircle") + MessagesPigeonInternal.deepHash(value: consumeTapEvents, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: fillColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: strokeColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: visible, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: strokeWidth, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zIndex, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: center, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: radius, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: circleId, hasher: &hasher) + } + + public var description: String { + return + "PlatformCircle(consumeTapEvents: \(String(describing: consumeTapEvents)), fillColor: \(String(describing: fillColor)), strokeColor: \(String(describing: strokeColor)), visible: \(String(describing: visible)), strokeWidth: \(String(describing: strokeWidth)), zIndex: \(String(describing: zIndex)), center: \(String(describing: center)), radius: \(String(describing: radius)), circleId: \(String(describing: circleId)))" + } +} + +/// Pigeon equivalent of the Heatmap class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformHeatmap: Hashable, CustomStringConvertible { + var heatmapId: String + var data: [PlatformWeightedLatLng] + var gradient: PlatformHeatmapGradient? = nil + var opacity: Double + var radius: Int64 + var minimumZoomIntensity: Int64 + var maximumZoomIntensity: Int64 + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformHeatmap? { + let heatmapId = pigeonVar_list[0] as! String + let data = pigeonVar_list[1] as! [PlatformWeightedLatLng] + let gradient: PlatformHeatmapGradient? = nilOrValue(pigeonVar_list[2]) + let opacity = pigeonVar_list[3] as! Double + let radius = pigeonVar_list[4] as! Int64 + let minimumZoomIntensity = pigeonVar_list[5] as! Int64 + let maximumZoomIntensity = pigeonVar_list[6] as! Int64 + + return PlatformHeatmap( + heatmapId: heatmapId, + data: data, + gradient: gradient, + opacity: opacity, + radius: radius, + minimumZoomIntensity: minimumZoomIntensity, + maximumZoomIntensity: maximumZoomIntensity + ) + } + func toList() -> [Any?] { + return [ + heatmapId, + data, + gradient, + opacity, + radius, + minimumZoomIntensity, + maximumZoomIntensity, + ] + } + static func == (lhs: PlatformHeatmap, rhs: PlatformHeatmap) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.heatmapId, rhs.heatmapId) + && MessagesPigeonInternal.deepEquals(lhs.data, rhs.data) + && MessagesPigeonInternal.deepEquals(lhs.gradient, rhs.gradient) + && MessagesPigeonInternal.deepEquals(lhs.opacity, rhs.opacity) + && MessagesPigeonInternal.deepEquals(lhs.radius, rhs.radius) + && MessagesPigeonInternal.deepEquals(lhs.minimumZoomIntensity, rhs.minimumZoomIntensity) + && MessagesPigeonInternal.deepEquals(lhs.maximumZoomIntensity, rhs.maximumZoomIntensity) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformHeatmap") + MessagesPigeonInternal.deepHash(value: heatmapId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: data, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: gradient, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: opacity, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: radius, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: minimumZoomIntensity, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: maximumZoomIntensity, hasher: &hasher) + } + + public var description: String { + return + "PlatformHeatmap(heatmapId: \(String(describing: heatmapId)), data: \(String(describing: data)), gradient: \(String(describing: gradient)), opacity: \(String(describing: opacity)), radius: \(String(describing: radius)), minimumZoomIntensity: \(String(describing: minimumZoomIntensity)), maximumZoomIntensity: \(String(describing: maximumZoomIntensity)))" + } +} + +/// Pigeon equivalent of the HeatmapGradient class. +/// +/// The GMUGradient structure is slightly different from HeatmapGradient, so +/// this matches the iOS API so that conversion can be done on the Dart side +/// where the structures are easier to work with. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformHeatmapGradient: Hashable, CustomStringConvertible { + var colors: [PlatformColor] + var startPoints: [Double] + var colorMapSize: Int64 + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformHeatmapGradient? { + let colors = pigeonVar_list[0] as! [PlatformColor] + let startPoints = pigeonVar_list[1] as! [Double] + let colorMapSize = pigeonVar_list[2] as! Int64 + + return PlatformHeatmapGradient( + colors: colors, + startPoints: startPoints, + colorMapSize: colorMapSize + ) + } + func toList() -> [Any?] { + return [ + colors, + startPoints, + colorMapSize, + ] + } + static func == (lhs: PlatformHeatmapGradient, rhs: PlatformHeatmapGradient) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.colors, rhs.colors) + && MessagesPigeonInternal.deepEquals(lhs.startPoints, rhs.startPoints) + && MessagesPigeonInternal.deepEquals(lhs.colorMapSize, rhs.colorMapSize) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformHeatmapGradient") + MessagesPigeonInternal.deepHash(value: colors, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: startPoints, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: colorMapSize, hasher: &hasher) + } + + public var description: String { + return + "PlatformHeatmapGradient(colors: \(String(describing: colors)), startPoints: \(String(describing: startPoints)), colorMapSize: \(String(describing: colorMapSize)))" + } +} + +/// Pigeon equivalent of the WeightedLatLng class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformWeightedLatLng: Hashable, CustomStringConvertible { + var point: PlatformLatLng + var weight: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformWeightedLatLng? { + let point = pigeonVar_list[0] as! PlatformLatLng + let weight = pigeonVar_list[1] as! Double + + return PlatformWeightedLatLng( + point: point, + weight: weight + ) + } + func toList() -> [Any?] { + return [ + point, + weight, + ] + } + static func == (lhs: PlatformWeightedLatLng, rhs: PlatformWeightedLatLng) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.point, rhs.point) + && MessagesPigeonInternal.deepEquals(lhs.weight, rhs.weight) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformWeightedLatLng") + MessagesPigeonInternal.deepHash(value: point, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: weight, hasher: &hasher) + } + + public var description: String { + return + "PlatformWeightedLatLng(point: \(String(describing: point)), weight: \(String(describing: weight)))" + } +} + +/// Pigeon equivalent of the InfoWindow class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformInfoWindow: Hashable, CustomStringConvertible { + var title: String? = nil + var snippet: String? = nil + var anchor: PlatformPoint + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformInfoWindow? { + let title: String? = nilOrValue(pigeonVar_list[0]) + let snippet: String? = nilOrValue(pigeonVar_list[1]) + let anchor = pigeonVar_list[2] as! PlatformPoint + + return PlatformInfoWindow( + title: title, + snippet: snippet, + anchor: anchor + ) + } + func toList() -> [Any?] { + return [ + title, + snippet, + anchor, + ] + } + static func == (lhs: PlatformInfoWindow, rhs: PlatformInfoWindow) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.title, rhs.title) + && MessagesPigeonInternal.deepEquals(lhs.snippet, rhs.snippet) + && MessagesPigeonInternal.deepEquals(lhs.anchor, rhs.anchor) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformInfoWindow") + MessagesPigeonInternal.deepHash(value: title, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: snippet, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: anchor, hasher: &hasher) + } + + public var description: String { + return + "PlatformInfoWindow(title: \(String(describing: title)), snippet: \(String(describing: snippet)), anchor: \(String(describing: anchor)))" + } +} + +/// Pigeon equivalent of Cluster. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCluster: Hashable, CustomStringConvertible { + var clusterManagerId: String + var position: PlatformLatLng + var bounds: PlatformLatLngBounds + var markerIds: [String] + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCluster? { + let clusterManagerId = pigeonVar_list[0] as! String + let position = pigeonVar_list[1] as! PlatformLatLng + let bounds = pigeonVar_list[2] as! PlatformLatLngBounds + let markerIds = pigeonVar_list[3] as! [String] + + return PlatformCluster( + clusterManagerId: clusterManagerId, + position: position, + bounds: bounds, + markerIds: markerIds + ) + } + func toList() -> [Any?] { + return [ + clusterManagerId, + position, + bounds, + markerIds, + ] + } + static func == (lhs: PlatformCluster, rhs: PlatformCluster) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.clusterManagerId, rhs.clusterManagerId) + && MessagesPigeonInternal.deepEquals(lhs.position, rhs.position) + && MessagesPigeonInternal.deepEquals(lhs.bounds, rhs.bounds) + && MessagesPigeonInternal.deepEquals(lhs.markerIds, rhs.markerIds) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCluster") + MessagesPigeonInternal.deepHash(value: clusterManagerId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: position, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: bounds, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: markerIds, hasher: &hasher) + } + + public var description: String { + return + "PlatformCluster(clusterManagerId: \(String(describing: clusterManagerId)), position: \(String(describing: position)), bounds: \(String(describing: bounds)), markerIds: \(String(describing: markerIds)))" + } +} + +/// Pigeon equivalent of the ClusterManager class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformClusterManager: Hashable, CustomStringConvertible { + var identifier: String + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformClusterManager? { + let identifier = pigeonVar_list[0] as! String + + return PlatformClusterManager( + identifier: identifier + ) + } + func toList() -> [Any?] { + return [ + identifier + ] + } + static func == (lhs: PlatformClusterManager, rhs: PlatformClusterManager) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.identifier, rhs.identifier) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformClusterManager") + MessagesPigeonInternal.deepHash(value: identifier, hasher: &hasher) + } + + public var description: String { + return "PlatformClusterManager(identifier: \(String(describing: identifier)))" + } +} + +/// Pigeon equivalent of the Marker class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformMarker: Hashable, CustomStringConvertible { + var alpha: Double + var anchor: PlatformPoint + var consumeTapEvents: Bool + var draggable: Bool + var flat: Bool + var icon: PlatformBitmap + var infoWindow: PlatformInfoWindow + var position: PlatformLatLng + var rotation: Double + var visible: Bool + var zIndex: Int64 + var markerId: String + var clusterManagerId: String? = nil + var collisionBehavior: PlatformMarkerCollisionBehavior? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformMarker? { + let alpha = pigeonVar_list[0] as! Double + let anchor = pigeonVar_list[1] as! PlatformPoint + let consumeTapEvents = pigeonVar_list[2] as! Bool + let draggable = pigeonVar_list[3] as! Bool + let flat = pigeonVar_list[4] as! Bool + let icon = pigeonVar_list[5] as! PlatformBitmap + let infoWindow = pigeonVar_list[6] as! PlatformInfoWindow + let position = pigeonVar_list[7] as! PlatformLatLng + let rotation = pigeonVar_list[8] as! Double + let visible = pigeonVar_list[9] as! Bool + let zIndex = pigeonVar_list[10] as! Int64 + let markerId = pigeonVar_list[11] as! String + let clusterManagerId: String? = nilOrValue(pigeonVar_list[12]) + let collisionBehavior: PlatformMarkerCollisionBehavior? = nilOrValue(pigeonVar_list[13]) + + return PlatformMarker( + alpha: alpha, + anchor: anchor, + consumeTapEvents: consumeTapEvents, + draggable: draggable, + flat: flat, + icon: icon, + infoWindow: infoWindow, + position: position, + rotation: rotation, + visible: visible, + zIndex: zIndex, + markerId: markerId, + clusterManagerId: clusterManagerId, + collisionBehavior: collisionBehavior + ) + } + func toList() -> [Any?] { + return [ + alpha, + anchor, + consumeTapEvents, + draggable, + flat, + icon, + infoWindow, + position, + rotation, + visible, + zIndex, + markerId, + clusterManagerId, + collisionBehavior, + ] + } + static func == (lhs: PlatformMarker, rhs: PlatformMarker) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.alpha, rhs.alpha) + && MessagesPigeonInternal.deepEquals(lhs.anchor, rhs.anchor) + && MessagesPigeonInternal.deepEquals(lhs.consumeTapEvents, rhs.consumeTapEvents) + && MessagesPigeonInternal.deepEquals(lhs.draggable, rhs.draggable) + && MessagesPigeonInternal.deepEquals(lhs.flat, rhs.flat) + && MessagesPigeonInternal.deepEquals(lhs.icon, rhs.icon) + && MessagesPigeonInternal.deepEquals(lhs.infoWindow, rhs.infoWindow) + && MessagesPigeonInternal.deepEquals(lhs.position, rhs.position) + && MessagesPigeonInternal.deepEquals(lhs.rotation, rhs.rotation) + && MessagesPigeonInternal.deepEquals(lhs.visible, rhs.visible) + && MessagesPigeonInternal.deepEquals(lhs.zIndex, rhs.zIndex) + && MessagesPigeonInternal.deepEquals(lhs.markerId, rhs.markerId) + && MessagesPigeonInternal.deepEquals(lhs.clusterManagerId, rhs.clusterManagerId) + && MessagesPigeonInternal.deepEquals(lhs.collisionBehavior, rhs.collisionBehavior) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformMarker") + MessagesPigeonInternal.deepHash(value: alpha, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: anchor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: consumeTapEvents, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: draggable, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: flat, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: icon, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: infoWindow, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: position, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: rotation, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: visible, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zIndex, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: markerId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: clusterManagerId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: collisionBehavior, hasher: &hasher) + } + + public var description: String { + return + "PlatformMarker(alpha: \(String(describing: alpha)), anchor: \(String(describing: anchor)), consumeTapEvents: \(String(describing: consumeTapEvents)), draggable: \(String(describing: draggable)), flat: \(String(describing: flat)), icon: \(String(describing: icon)), infoWindow: \(String(describing: infoWindow)), position: \(String(describing: position)), rotation: \(String(describing: rotation)), visible: \(String(describing: visible)), zIndex: \(String(describing: zIndex)), markerId: \(String(describing: markerId)), clusterManagerId: \(String(describing: clusterManagerId)), collisionBehavior: \(String(describing: collisionBehavior)))" + } +} + +/// Pigeon equivalent of the Polygon class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformPolygon: Hashable, CustomStringConvertible { + var polygonId: String + var consumesTapEvents: Bool + var fillColor: PlatformColor + var geodesic: Bool + var points: [PlatformLatLng] + var holes: [[PlatformLatLng]] + var visible: Bool + var strokeColor: PlatformColor + var strokeWidth: Int64 + var zIndex: Int64 + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformPolygon? { + let polygonId = pigeonVar_list[0] as! String + let consumesTapEvents = pigeonVar_list[1] as! Bool + let fillColor = pigeonVar_list[2] as! PlatformColor + let geodesic = pigeonVar_list[3] as! Bool + let points = pigeonVar_list[4] as! [PlatformLatLng] + let holes = pigeonVar_list[5] as! [[PlatformLatLng]] + let visible = pigeonVar_list[6] as! Bool + let strokeColor = pigeonVar_list[7] as! PlatformColor + let strokeWidth = pigeonVar_list[8] as! Int64 + let zIndex = pigeonVar_list[9] as! Int64 + + return PlatformPolygon( + polygonId: polygonId, + consumesTapEvents: consumesTapEvents, + fillColor: fillColor, + geodesic: geodesic, + points: points, + holes: holes, + visible: visible, + strokeColor: strokeColor, + strokeWidth: strokeWidth, + zIndex: zIndex + ) + } + func toList() -> [Any?] { + return [ + polygonId, + consumesTapEvents, + fillColor, + geodesic, + points, + holes, + visible, + strokeColor, + strokeWidth, + zIndex, + ] + } + static func == (lhs: PlatformPolygon, rhs: PlatformPolygon) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.polygonId, rhs.polygonId) + && MessagesPigeonInternal.deepEquals(lhs.consumesTapEvents, rhs.consumesTapEvents) + && MessagesPigeonInternal.deepEquals(lhs.fillColor, rhs.fillColor) + && MessagesPigeonInternal.deepEquals(lhs.geodesic, rhs.geodesic) + && MessagesPigeonInternal.deepEquals(lhs.points, rhs.points) + && MessagesPigeonInternal.deepEquals(lhs.holes, rhs.holes) + && MessagesPigeonInternal.deepEquals(lhs.visible, rhs.visible) + && MessagesPigeonInternal.deepEquals(lhs.strokeColor, rhs.strokeColor) + && MessagesPigeonInternal.deepEquals(lhs.strokeWidth, rhs.strokeWidth) + && MessagesPigeonInternal.deepEquals(lhs.zIndex, rhs.zIndex) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformPolygon") + MessagesPigeonInternal.deepHash(value: polygonId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: consumesTapEvents, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: fillColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: geodesic, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: points, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: holes, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: visible, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: strokeColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: strokeWidth, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zIndex, hasher: &hasher) + } + + public var description: String { + return + "PlatformPolygon(polygonId: \(String(describing: polygonId)), consumesTapEvents: \(String(describing: consumesTapEvents)), fillColor: \(String(describing: fillColor)), geodesic: \(String(describing: geodesic)), points: \(String(describing: points)), holes: \(String(describing: holes)), visible: \(String(describing: visible)), strokeColor: \(String(describing: strokeColor)), strokeWidth: \(String(describing: strokeWidth)), zIndex: \(String(describing: zIndex)))" + } +} + +/// Pigeon equivalent of the Polyline class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformPolyline: Hashable, CustomStringConvertible { + var polylineId: String + var consumesTapEvents: Bool + var color: PlatformColor + var geodesic: Bool + /// The joint type. + var jointType: PlatformJointType + /// The pattern data, as a list of pattern items. + var patterns: [PlatformPatternItem] + var points: [PlatformLatLng] + var visible: Bool + var width: Int64 + var zIndex: Int64 + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformPolyline? { + let polylineId = pigeonVar_list[0] as! String + let consumesTapEvents = pigeonVar_list[1] as! Bool + let color = pigeonVar_list[2] as! PlatformColor + let geodesic = pigeonVar_list[3] as! Bool + let jointType = pigeonVar_list[4] as! PlatformJointType + let patterns = pigeonVar_list[5] as! [PlatformPatternItem] + let points = pigeonVar_list[6] as! [PlatformLatLng] + let visible = pigeonVar_list[7] as! Bool + let width = pigeonVar_list[8] as! Int64 + let zIndex = pigeonVar_list[9] as! Int64 + + return PlatformPolyline( + polylineId: polylineId, + consumesTapEvents: consumesTapEvents, + color: color, + geodesic: geodesic, + jointType: jointType, + patterns: patterns, + points: points, + visible: visible, + width: width, + zIndex: zIndex + ) + } + func toList() -> [Any?] { + return [ + polylineId, + consumesTapEvents, + color, + geodesic, + jointType, + patterns, + points, + visible, + width, + zIndex, + ] + } + static func == (lhs: PlatformPolyline, rhs: PlatformPolyline) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.polylineId, rhs.polylineId) + && MessagesPigeonInternal.deepEquals(lhs.consumesTapEvents, rhs.consumesTapEvents) + && MessagesPigeonInternal.deepEquals(lhs.color, rhs.color) + && MessagesPigeonInternal.deepEquals(lhs.geodesic, rhs.geodesic) + && MessagesPigeonInternal.deepEquals(lhs.jointType, rhs.jointType) + && MessagesPigeonInternal.deepEquals(lhs.patterns, rhs.patterns) + && MessagesPigeonInternal.deepEquals(lhs.points, rhs.points) + && MessagesPigeonInternal.deepEquals(lhs.visible, rhs.visible) + && MessagesPigeonInternal.deepEquals(lhs.width, rhs.width) + && MessagesPigeonInternal.deepEquals(lhs.zIndex, rhs.zIndex) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformPolyline") + MessagesPigeonInternal.deepHash(value: polylineId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: consumesTapEvents, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: color, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: geodesic, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: jointType, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: patterns, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: points, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: visible, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: width, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zIndex, hasher: &hasher) + } + + public var description: String { + return + "PlatformPolyline(polylineId: \(String(describing: polylineId)), consumesTapEvents: \(String(describing: consumesTapEvents)), color: \(String(describing: color)), geodesic: \(String(describing: geodesic)), jointType: \(String(describing: jointType)), patterns: \(String(describing: patterns)), points: \(String(describing: points)), visible: \(String(describing: visible)), width: \(String(describing: width)), zIndex: \(String(describing: zIndex)))" + } +} + +/// Pigeon equivalent of the PatternItem class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformPatternItem: Hashable, CustomStringConvertible { + var type: PlatformPatternItemType + var length: Double? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformPatternItem? { + let type = pigeonVar_list[0] as! PlatformPatternItemType + let length: Double? = nilOrValue(pigeonVar_list[1]) + + return PlatformPatternItem( + type: type, + length: length + ) + } + func toList() -> [Any?] { + return [ + type, + length, + ] + } + static func == (lhs: PlatformPatternItem, rhs: PlatformPatternItem) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.type, rhs.type) + && MessagesPigeonInternal.deepEquals(lhs.length, rhs.length) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformPatternItem") + MessagesPigeonInternal.deepHash(value: type, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: length, hasher: &hasher) + } + + public var description: String { + return + "PlatformPatternItem(type: \(String(describing: type)), length: \(String(describing: length)))" + } +} + +/// Pigeon equivalent of the Tile class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformTile: Hashable, CustomStringConvertible { + var width: Int64 + var height: Int64 + var data: FlutterStandardTypedData? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformTile? { + let width = pigeonVar_list[0] as! Int64 + let height = pigeonVar_list[1] as! Int64 + let data: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[2]) + + return PlatformTile( + width: width, + height: height, + data: data + ) + } + func toList() -> [Any?] { + return [ + width, + height, + data, + ] + } + static func == (lhs: PlatformTile, rhs: PlatformTile) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.width, rhs.width) + && MessagesPigeonInternal.deepEquals(lhs.height, rhs.height) + && MessagesPigeonInternal.deepEquals(lhs.data, rhs.data) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformTile") + MessagesPigeonInternal.deepHash(value: width, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: height, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: data, hasher: &hasher) + } + + public var description: String { + return + "PlatformTile(width: \(String(describing: width)), height: \(String(describing: height)), data: \(String(describing: data)))" + } +} + +/// Pigeon equivalent of the TileOverlay class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformTileOverlay: Hashable, CustomStringConvertible { + var tileOverlayId: String + var fadeIn: Bool + var transparency: Double + var zIndex: Int64 + var visible: Bool + var tileSize: Int64 + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformTileOverlay? { + let tileOverlayId = pigeonVar_list[0] as! String + let fadeIn = pigeonVar_list[1] as! Bool + let transparency = pigeonVar_list[2] as! Double + let zIndex = pigeonVar_list[3] as! Int64 + let visible = pigeonVar_list[4] as! Bool + let tileSize = pigeonVar_list[5] as! Int64 + + return PlatformTileOverlay( + tileOverlayId: tileOverlayId, + fadeIn: fadeIn, + transparency: transparency, + zIndex: zIndex, + visible: visible, + tileSize: tileSize + ) + } + func toList() -> [Any?] { + return [ + tileOverlayId, + fadeIn, + transparency, + zIndex, + visible, + tileSize, + ] + } + static func == (lhs: PlatformTileOverlay, rhs: PlatformTileOverlay) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.tileOverlayId, rhs.tileOverlayId) + && MessagesPigeonInternal.deepEquals(lhs.fadeIn, rhs.fadeIn) + && MessagesPigeonInternal.deepEquals(lhs.transparency, rhs.transparency) + && MessagesPigeonInternal.deepEquals(lhs.zIndex, rhs.zIndex) + && MessagesPigeonInternal.deepEquals(lhs.visible, rhs.visible) + && MessagesPigeonInternal.deepEquals(lhs.tileSize, rhs.tileSize) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformTileOverlay") + MessagesPigeonInternal.deepHash(value: tileOverlayId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: fadeIn, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: transparency, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zIndex, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: visible, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: tileSize, hasher: &hasher) + } + + public var description: String { + return + "PlatformTileOverlay(tileOverlayId: \(String(describing: tileOverlayId)), fadeIn: \(String(describing: fadeIn)), transparency: \(String(describing: transparency)), zIndex: \(String(describing: zIndex)), visible: \(String(describing: visible)), tileSize: \(String(describing: tileSize)))" + } +} + +/// Pigeon equivalent of Flutter's EdgeInsets. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformEdgeInsets: Hashable, CustomStringConvertible { + var top: Double + var bottom: Double + var left: Double + var right: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformEdgeInsets? { + let top = pigeonVar_list[0] as! Double + let bottom = pigeonVar_list[1] as! Double + let left = pigeonVar_list[2] as! Double + let right = pigeonVar_list[3] as! Double + + return PlatformEdgeInsets( + top: top, + bottom: bottom, + left: left, + right: right + ) + } + func toList() -> [Any?] { + return [ + top, + bottom, + left, + right, + ] + } + static func == (lhs: PlatformEdgeInsets, rhs: PlatformEdgeInsets) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.top, rhs.top) + && MessagesPigeonInternal.deepEquals(lhs.bottom, rhs.bottom) + && MessagesPigeonInternal.deepEquals(lhs.left, rhs.left) + && MessagesPigeonInternal.deepEquals(lhs.right, rhs.right) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformEdgeInsets") + MessagesPigeonInternal.deepHash(value: top, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: bottom, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: left, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: right, hasher: &hasher) + } + + public var description: String { + return + "PlatformEdgeInsets(top: \(String(describing: top)), bottom: \(String(describing: bottom)), left: \(String(describing: left)), right: \(String(describing: right)))" + } +} + +/// Pigeon equivalent of LatLng. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformLatLng: Hashable, CustomStringConvertible { + var latitude: Double + var longitude: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformLatLng? { + let latitude = pigeonVar_list[0] as! Double + let longitude = pigeonVar_list[1] as! Double + + return PlatformLatLng( + latitude: latitude, + longitude: longitude + ) + } + func toList() -> [Any?] { + return [ + latitude, + longitude, + ] + } + static func == (lhs: PlatformLatLng, rhs: PlatformLatLng) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.latitude, rhs.latitude) + && MessagesPigeonInternal.deepEquals(lhs.longitude, rhs.longitude) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformLatLng") + MessagesPigeonInternal.deepHash(value: latitude, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: longitude, hasher: &hasher) + } + + public var description: String { + return + "PlatformLatLng(latitude: \(String(describing: latitude)), longitude: \(String(describing: longitude)))" + } +} + +/// Pigeon equivalent of LatLngBounds. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformLatLngBounds: Hashable, CustomStringConvertible { + var northeast: PlatformLatLng + var southwest: PlatformLatLng + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformLatLngBounds? { + let northeast = pigeonVar_list[0] as! PlatformLatLng + let southwest = pigeonVar_list[1] as! PlatformLatLng + + return PlatformLatLngBounds( + northeast: northeast, + southwest: southwest + ) + } + func toList() -> [Any?] { + return [ + northeast, + southwest, + ] + } + static func == (lhs: PlatformLatLngBounds, rhs: PlatformLatLngBounds) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.northeast, rhs.northeast) + && MessagesPigeonInternal.deepEquals(lhs.southwest, rhs.southwest) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformLatLngBounds") + MessagesPigeonInternal.deepHash(value: northeast, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: southwest, hasher: &hasher) + } + + public var description: String { + return + "PlatformLatLngBounds(northeast: \(String(describing: northeast)), southwest: \(String(describing: southwest)))" + } +} + +/// Pigeon equivalent of CameraTargetBounds. +/// +/// As with the Dart version, it exists to distinguish between not setting a +/// a target, and having an explicitly unbounded target (null [bounds]). +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraTargetBounds: Hashable, CustomStringConvertible { + var bounds: PlatformLatLngBounds? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraTargetBounds? { + let bounds: PlatformLatLngBounds? = nilOrValue(pigeonVar_list[0]) + + return PlatformCameraTargetBounds( + bounds: bounds + ) + } + func toList() -> [Any?] { + return [ + bounds + ] + } + static func == (lhs: PlatformCameraTargetBounds, rhs: PlatformCameraTargetBounds) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.bounds, rhs.bounds) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraTargetBounds") + MessagesPigeonInternal.deepHash(value: bounds, hasher: &hasher) + } + + public var description: String { + return "PlatformCameraTargetBounds(bounds: \(String(describing: bounds)))" + } +} + +/// Pigeon equivalent of the GroundOverlay class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformGroundOverlay: Hashable, CustomStringConvertible { + var groundOverlayId: String + var image: PlatformBitmap + var position: PlatformLatLng? = nil + var bounds: PlatformLatLngBounds? = nil + var anchor: PlatformPoint? = nil + var transparency: Double + var bearing: Double + var zIndex: Int64 + var visible: Bool + var clickable: Bool + var zoomLevel: Double? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformGroundOverlay? { + let groundOverlayId = pigeonVar_list[0] as! String + let image = pigeonVar_list[1] as! PlatformBitmap + let position: PlatformLatLng? = nilOrValue(pigeonVar_list[2]) + let bounds: PlatformLatLngBounds? = nilOrValue(pigeonVar_list[3]) + let anchor: PlatformPoint? = nilOrValue(pigeonVar_list[4]) + let transparency = pigeonVar_list[5] as! Double + let bearing = pigeonVar_list[6] as! Double + let zIndex = pigeonVar_list[7] as! Int64 + let visible = pigeonVar_list[8] as! Bool + let clickable = pigeonVar_list[9] as! Bool + let zoomLevel: Double? = nilOrValue(pigeonVar_list[10]) + + return PlatformGroundOverlay( + groundOverlayId: groundOverlayId, + image: image, + position: position, + bounds: bounds, + anchor: anchor, + transparency: transparency, + bearing: bearing, + zIndex: zIndex, + visible: visible, + clickable: clickable, + zoomLevel: zoomLevel + ) + } + func toList() -> [Any?] { + return [ + groundOverlayId, + image, + position, + bounds, + anchor, + transparency, + bearing, + zIndex, + visible, + clickable, + zoomLevel, + ] + } + static func == (lhs: PlatformGroundOverlay, rhs: PlatformGroundOverlay) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.groundOverlayId, rhs.groundOverlayId) + && MessagesPigeonInternal.deepEquals(lhs.image, rhs.image) + && MessagesPigeonInternal.deepEquals(lhs.position, rhs.position) + && MessagesPigeonInternal.deepEquals(lhs.bounds, rhs.bounds) + && MessagesPigeonInternal.deepEquals(lhs.anchor, rhs.anchor) + && MessagesPigeonInternal.deepEquals(lhs.transparency, rhs.transparency) + && MessagesPigeonInternal.deepEquals(lhs.bearing, rhs.bearing) + && MessagesPigeonInternal.deepEquals(lhs.zIndex, rhs.zIndex) + && MessagesPigeonInternal.deepEquals(lhs.visible, rhs.visible) + && MessagesPigeonInternal.deepEquals(lhs.clickable, rhs.clickable) + && MessagesPigeonInternal.deepEquals(lhs.zoomLevel, rhs.zoomLevel) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformGroundOverlay") + MessagesPigeonInternal.deepHash(value: groundOverlayId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: image, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: position, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: bounds, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: anchor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: transparency, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: bearing, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zIndex, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: visible, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: clickable, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zoomLevel, hasher: &hasher) + } + + public var description: String { + return + "PlatformGroundOverlay(groundOverlayId: \(String(describing: groundOverlayId)), image: \(String(describing: image)), position: \(String(describing: position)), bounds: \(String(describing: bounds)), anchor: \(String(describing: anchor)), transparency: \(String(describing: transparency)), bearing: \(String(describing: bearing)), zIndex: \(String(describing: zIndex)), visible: \(String(describing: visible)), clickable: \(String(describing: clickable)), zoomLevel: \(String(describing: zoomLevel)))" + } +} + +/// Information passed to the platform view creation. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformMapViewCreationParams: Hashable, CustomStringConvertible { + var initialCameraPosition: PlatformCameraPosition + var mapConfiguration: PlatformMapConfiguration + var initialCircles: [PlatformCircle] + var initialMarkers: [PlatformMarker] + var initialPolygons: [PlatformPolygon] + var initialPolylines: [PlatformPolyline] + var initialHeatmaps: [PlatformHeatmap] + var initialTileOverlays: [PlatformTileOverlay] + var initialClusterManagers: [PlatformClusterManager] + var initialGroundOverlays: [PlatformGroundOverlay] + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformMapViewCreationParams? { + let initialCameraPosition = pigeonVar_list[0] as! PlatformCameraPosition + let mapConfiguration = pigeonVar_list[1] as! PlatformMapConfiguration + let initialCircles = pigeonVar_list[2] as! [PlatformCircle] + let initialMarkers = pigeonVar_list[3] as! [PlatformMarker] + let initialPolygons = pigeonVar_list[4] as! [PlatformPolygon] + let initialPolylines = pigeonVar_list[5] as! [PlatformPolyline] + let initialHeatmaps = pigeonVar_list[6] as! [PlatformHeatmap] + let initialTileOverlays = pigeonVar_list[7] as! [PlatformTileOverlay] + let initialClusterManagers = pigeonVar_list[8] as! [PlatformClusterManager] + let initialGroundOverlays = pigeonVar_list[9] as! [PlatformGroundOverlay] + + return PlatformMapViewCreationParams( + initialCameraPosition: initialCameraPosition, + mapConfiguration: mapConfiguration, + initialCircles: initialCircles, + initialMarkers: initialMarkers, + initialPolygons: initialPolygons, + initialPolylines: initialPolylines, + initialHeatmaps: initialHeatmaps, + initialTileOverlays: initialTileOverlays, + initialClusterManagers: initialClusterManagers, + initialGroundOverlays: initialGroundOverlays + ) + } + func toList() -> [Any?] { + return [ + initialCameraPosition, + mapConfiguration, + initialCircles, + initialMarkers, + initialPolygons, + initialPolylines, + initialHeatmaps, + initialTileOverlays, + initialClusterManagers, + initialGroundOverlays, + ] + } + static func == (lhs: PlatformMapViewCreationParams, rhs: PlatformMapViewCreationParams) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.initialCameraPosition, rhs.initialCameraPosition) + && MessagesPigeonInternal.deepEquals(lhs.mapConfiguration, rhs.mapConfiguration) + && MessagesPigeonInternal.deepEquals(lhs.initialCircles, rhs.initialCircles) + && MessagesPigeonInternal.deepEquals(lhs.initialMarkers, rhs.initialMarkers) + && MessagesPigeonInternal.deepEquals(lhs.initialPolygons, rhs.initialPolygons) + && MessagesPigeonInternal.deepEquals(lhs.initialPolylines, rhs.initialPolylines) + && MessagesPigeonInternal.deepEquals(lhs.initialHeatmaps, rhs.initialHeatmaps) + && MessagesPigeonInternal.deepEquals(lhs.initialTileOverlays, rhs.initialTileOverlays) + && MessagesPigeonInternal.deepEquals(lhs.initialClusterManagers, rhs.initialClusterManagers) + && MessagesPigeonInternal.deepEquals(lhs.initialGroundOverlays, rhs.initialGroundOverlays) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformMapViewCreationParams") + MessagesPigeonInternal.deepHash(value: initialCameraPosition, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: mapConfiguration, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialCircles, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialMarkers, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialPolygons, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialPolylines, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialHeatmaps, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialTileOverlays, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialClusterManagers, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialGroundOverlays, hasher: &hasher) + } + + public var description: String { + return + "PlatformMapViewCreationParams(initialCameraPosition: \(String(describing: initialCameraPosition)), mapConfiguration: \(String(describing: mapConfiguration)), initialCircles: \(String(describing: initialCircles)), initialMarkers: \(String(describing: initialMarkers)), initialPolygons: \(String(describing: initialPolygons)), initialPolylines: \(String(describing: initialPolylines)), initialHeatmaps: \(String(describing: initialHeatmaps)), initialTileOverlays: \(String(describing: initialTileOverlays)), initialClusterManagers: \(String(describing: initialClusterManagers)), initialGroundOverlays: \(String(describing: initialGroundOverlays)))" + } +} + +/// Pigeon equivalent of MapConfiguration. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformMapConfiguration: Hashable, CustomStringConvertible { + var compassEnabled: Bool? = nil + var cameraTargetBounds: PlatformCameraTargetBounds? = nil + var mapType: PlatformMapType? = nil + var minMaxZoomPreference: PlatformZoomRange? = nil + var rotateGesturesEnabled: Bool? = nil + var scrollGesturesEnabled: Bool? = nil + var tiltGesturesEnabled: Bool? = nil + var trackCameraPosition: Bool? = nil + var zoomGesturesEnabled: Bool? = nil + var myLocationEnabled: Bool? = nil + var myLocationButtonEnabled: Bool? = nil + var padding: PlatformEdgeInsets? = nil + var indoorViewEnabled: Bool? = nil + var trafficEnabled: Bool? = nil + var buildingsEnabled: Bool? = nil + var markerType: PlatformMarkerType + var mapId: String? = nil + var style: String? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformMapConfiguration? { + let compassEnabled: Bool? = nilOrValue(pigeonVar_list[0]) + let cameraTargetBounds: PlatformCameraTargetBounds? = nilOrValue(pigeonVar_list[1]) + let mapType: PlatformMapType? = nilOrValue(pigeonVar_list[2]) + let minMaxZoomPreference: PlatformZoomRange? = nilOrValue(pigeonVar_list[3]) + let rotateGesturesEnabled: Bool? = nilOrValue(pigeonVar_list[4]) + let scrollGesturesEnabled: Bool? = nilOrValue(pigeonVar_list[5]) + let tiltGesturesEnabled: Bool? = nilOrValue(pigeonVar_list[6]) + let trackCameraPosition: Bool? = nilOrValue(pigeonVar_list[7]) + let zoomGesturesEnabled: Bool? = nilOrValue(pigeonVar_list[8]) + let myLocationEnabled: Bool? = nilOrValue(pigeonVar_list[9]) + let myLocationButtonEnabled: Bool? = nilOrValue(pigeonVar_list[10]) + let padding: PlatformEdgeInsets? = nilOrValue(pigeonVar_list[11]) + let indoorViewEnabled: Bool? = nilOrValue(pigeonVar_list[12]) + let trafficEnabled: Bool? = nilOrValue(pigeonVar_list[13]) + let buildingsEnabled: Bool? = nilOrValue(pigeonVar_list[14]) + let markerType = pigeonVar_list[15] as! PlatformMarkerType + let mapId: String? = nilOrValue(pigeonVar_list[16]) + let style: String? = nilOrValue(pigeonVar_list[17]) + + return PlatformMapConfiguration( + compassEnabled: compassEnabled, + cameraTargetBounds: cameraTargetBounds, + mapType: mapType, + minMaxZoomPreference: minMaxZoomPreference, + rotateGesturesEnabled: rotateGesturesEnabled, + scrollGesturesEnabled: scrollGesturesEnabled, + tiltGesturesEnabled: tiltGesturesEnabled, + trackCameraPosition: trackCameraPosition, + zoomGesturesEnabled: zoomGesturesEnabled, + myLocationEnabled: myLocationEnabled, + myLocationButtonEnabled: myLocationButtonEnabled, + padding: padding, + indoorViewEnabled: indoorViewEnabled, + trafficEnabled: trafficEnabled, + buildingsEnabled: buildingsEnabled, + markerType: markerType, + mapId: mapId, + style: style + ) + } + func toList() -> [Any?] { + return [ + compassEnabled, + cameraTargetBounds, + mapType, + minMaxZoomPreference, + rotateGesturesEnabled, + scrollGesturesEnabled, + tiltGesturesEnabled, + trackCameraPosition, + zoomGesturesEnabled, + myLocationEnabled, + myLocationButtonEnabled, + padding, + indoorViewEnabled, + trafficEnabled, + buildingsEnabled, + markerType, + mapId, + style, + ] + } + static func == (lhs: PlatformMapConfiguration, rhs: PlatformMapConfiguration) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.compassEnabled, rhs.compassEnabled) + && MessagesPigeonInternal.deepEquals(lhs.cameraTargetBounds, rhs.cameraTargetBounds) + && MessagesPigeonInternal.deepEquals(lhs.mapType, rhs.mapType) + && MessagesPigeonInternal.deepEquals(lhs.minMaxZoomPreference, rhs.minMaxZoomPreference) + && MessagesPigeonInternal.deepEquals(lhs.rotateGesturesEnabled, rhs.rotateGesturesEnabled) + && MessagesPigeonInternal.deepEquals(lhs.scrollGesturesEnabled, rhs.scrollGesturesEnabled) + && MessagesPigeonInternal.deepEquals(lhs.tiltGesturesEnabled, rhs.tiltGesturesEnabled) + && MessagesPigeonInternal.deepEquals(lhs.trackCameraPosition, rhs.trackCameraPosition) + && MessagesPigeonInternal.deepEquals(lhs.zoomGesturesEnabled, rhs.zoomGesturesEnabled) + && MessagesPigeonInternal.deepEquals(lhs.myLocationEnabled, rhs.myLocationEnabled) + && MessagesPigeonInternal.deepEquals(lhs.myLocationButtonEnabled, rhs.myLocationButtonEnabled) + && MessagesPigeonInternal.deepEquals(lhs.padding, rhs.padding) + && MessagesPigeonInternal.deepEquals(lhs.indoorViewEnabled, rhs.indoorViewEnabled) + && MessagesPigeonInternal.deepEquals(lhs.trafficEnabled, rhs.trafficEnabled) + && MessagesPigeonInternal.deepEquals(lhs.buildingsEnabled, rhs.buildingsEnabled) + && MessagesPigeonInternal.deepEquals(lhs.markerType, rhs.markerType) + && MessagesPigeonInternal.deepEquals(lhs.mapId, rhs.mapId) + && MessagesPigeonInternal.deepEquals(lhs.style, rhs.style) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformMapConfiguration") + MessagesPigeonInternal.deepHash(value: compassEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: cameraTargetBounds, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: mapType, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: minMaxZoomPreference, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: rotateGesturesEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: scrollGesturesEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: tiltGesturesEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: trackCameraPosition, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zoomGesturesEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: myLocationEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: myLocationButtonEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: padding, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: indoorViewEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: trafficEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: buildingsEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: markerType, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: mapId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: style, hasher: &hasher) + } + + public var description: String { + return + "PlatformMapConfiguration(compassEnabled: \(String(describing: compassEnabled)), cameraTargetBounds: \(String(describing: cameraTargetBounds)), mapType: \(String(describing: mapType)), minMaxZoomPreference: \(String(describing: minMaxZoomPreference)), rotateGesturesEnabled: \(String(describing: rotateGesturesEnabled)), scrollGesturesEnabled: \(String(describing: scrollGesturesEnabled)), tiltGesturesEnabled: \(String(describing: tiltGesturesEnabled)), trackCameraPosition: \(String(describing: trackCameraPosition)), zoomGesturesEnabled: \(String(describing: zoomGesturesEnabled)), myLocationEnabled: \(String(describing: myLocationEnabled)), myLocationButtonEnabled: \(String(describing: myLocationButtonEnabled)), padding: \(String(describing: padding)), indoorViewEnabled: \(String(describing: indoorViewEnabled)), trafficEnabled: \(String(describing: trafficEnabled)), buildingsEnabled: \(String(describing: buildingsEnabled)), markerType: \(String(describing: markerType)), mapId: \(String(describing: mapId)), style: \(String(describing: style)))" + } +} + +/// Pigeon representation of an x,y coordinate. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformPoint: Hashable, CustomStringConvertible { + var x: Double + var y: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformPoint? { + let x = pigeonVar_list[0] as! Double + let y = pigeonVar_list[1] as! Double + + return PlatformPoint( + x: x, + y: y + ) + } + func toList() -> [Any?] { + return [ + x, + y, + ] + } + static func == (lhs: PlatformPoint, rhs: PlatformPoint) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.x, rhs.x) + && MessagesPigeonInternal.deepEquals(lhs.y, rhs.y) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformPoint") + MessagesPigeonInternal.deepHash(value: x, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: y, hasher: &hasher) + } + + public var description: String { + return "PlatformPoint(x: \(String(describing: x)), y: \(String(describing: y)))" + } +} + +/// Pigeon representation of a size. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformSize: Hashable, CustomStringConvertible { + var width: Double + var height: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformSize? { + let width = pigeonVar_list[0] as! Double + let height = pigeonVar_list[1] as! Double + + return PlatformSize( + width: width, + height: height + ) + } + func toList() -> [Any?] { + return [ + width, + height, + ] + } + static func == (lhs: PlatformSize, rhs: PlatformSize) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.width, rhs.width) + && MessagesPigeonInternal.deepEquals(lhs.height, rhs.height) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformSize") + MessagesPigeonInternal.deepHash(value: width, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: height, hasher: &hasher) + } + + public var description: String { + return + "PlatformSize(width: \(String(describing: width)), height: \(String(describing: height)))" + } +} + +/// Pigeon representation of a color. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformColor: Hashable, CustomStringConvertible { + var red: Double + var green: Double + var blue: Double + var alpha: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformColor? { + let red = pigeonVar_list[0] as! Double + let green = pigeonVar_list[1] as! Double + let blue = pigeonVar_list[2] as! Double + let alpha = pigeonVar_list[3] as! Double + + return PlatformColor( + red: red, + green: green, + blue: blue, + alpha: alpha + ) + } + func toList() -> [Any?] { + return [ + red, + green, + blue, + alpha, + ] + } + static func == (lhs: PlatformColor, rhs: PlatformColor) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.red, rhs.red) + && MessagesPigeonInternal.deepEquals(lhs.green, rhs.green) + && MessagesPigeonInternal.deepEquals(lhs.blue, rhs.blue) + && MessagesPigeonInternal.deepEquals(lhs.alpha, rhs.alpha) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformColor") + MessagesPigeonInternal.deepHash(value: red, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: green, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: blue, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: alpha, hasher: &hasher) + } + + public var description: String { + return + "PlatformColor(red: \(String(describing: red)), green: \(String(describing: green)), blue: \(String(describing: blue)), alpha: \(String(describing: alpha)))" + } +} + +/// Pigeon equivalent of GMSTileLayer properties. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformTileLayer: Hashable, CustomStringConvertible { + var visible: Bool + var fadeIn: Bool + var opacity: Double + var zIndex: Int64 + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformTileLayer? { + let visible = pigeonVar_list[0] as! Bool + let fadeIn = pigeonVar_list[1] as! Bool + let opacity = pigeonVar_list[2] as! Double + let zIndex = pigeonVar_list[3] as! Int64 + + return PlatformTileLayer( + visible: visible, + fadeIn: fadeIn, + opacity: opacity, + zIndex: zIndex + ) + } + func toList() -> [Any?] { + return [ + visible, + fadeIn, + opacity, + zIndex, + ] + } + static func == (lhs: PlatformTileLayer, rhs: PlatformTileLayer) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.visible, rhs.visible) + && MessagesPigeonInternal.deepEquals(lhs.fadeIn, rhs.fadeIn) + && MessagesPigeonInternal.deepEquals(lhs.opacity, rhs.opacity) + && MessagesPigeonInternal.deepEquals(lhs.zIndex, rhs.zIndex) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformTileLayer") + MessagesPigeonInternal.deepHash(value: visible, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: fadeIn, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: opacity, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zIndex, hasher: &hasher) + } + + public var description: String { + return + "PlatformTileLayer(visible: \(String(describing: visible)), fadeIn: \(String(describing: fadeIn)), opacity: \(String(describing: opacity)), zIndex: \(String(describing: zIndex)))" + } +} + +/// Pigeon equivalent of MinMaxZoomPreference. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformZoomRange: Hashable, CustomStringConvertible { + var min: Double? = nil + var max: Double? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformZoomRange? { + let min: Double? = nilOrValue(pigeonVar_list[0]) + let max: Double? = nilOrValue(pigeonVar_list[1]) + + return PlatformZoomRange( + min: min, + max: max + ) + } + func toList() -> [Any?] { + return [ + min, + max, + ] + } + static func == (lhs: PlatformZoomRange, rhs: PlatformZoomRange) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.min, rhs.min) + && MessagesPigeonInternal.deepEquals(lhs.max, rhs.max) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformZoomRange") + MessagesPigeonInternal.deepHash(value: min, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: max, hasher: &hasher) + } + + public var description: String { + return "PlatformZoomRange(min: \(String(describing: min)), max: \(String(describing: max)))" + } +} + +/// Pigeon equivalent of [BitmapDescriptor]. +/// +/// Generated class from Pigeon that represents data sent in messages. +/// This protocol should not be extended by any user class outside of the generated file. +protocol PlatformBitmap { + +} + +/// Pigeon equivalent of [DefaultMarker]. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformBitmapDefaultMarker: PlatformBitmap { + var hue: Double? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmapDefaultMarker? { + let hue: Double? = nilOrValue(pigeonVar_list[0]) + + return PlatformBitmapDefaultMarker( + hue: hue + ) + } + func toList() -> [Any?] { + return [ + hue + ] + } + static func == (lhs: PlatformBitmapDefaultMarker, rhs: PlatformBitmapDefaultMarker) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.hue, rhs.hue) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformBitmapDefaultMarker") + MessagesPigeonInternal.deepHash(value: hue, hasher: &hasher) + } + + public var description: String { + return "PlatformBitmapDefaultMarker(hue: \(String(describing: hue)))" + } +} + +/// Pigeon equivalent of [BytesBitmap]. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformBitmapBytes: PlatformBitmap { + var byteData: FlutterStandardTypedData + var size: PlatformSize? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmapBytes? { + let byteData = pigeonVar_list[0] as! FlutterStandardTypedData + let size: PlatformSize? = nilOrValue(pigeonVar_list[1]) + + return PlatformBitmapBytes( + byteData: byteData, + size: size + ) + } + func toList() -> [Any?] { + return [ + byteData, + size, + ] + } + static func == (lhs: PlatformBitmapBytes, rhs: PlatformBitmapBytes) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.byteData, rhs.byteData) + && MessagesPigeonInternal.deepEquals(lhs.size, rhs.size) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformBitmapBytes") + MessagesPigeonInternal.deepHash(value: byteData, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: size, hasher: &hasher) + } + + public var description: String { + return + "PlatformBitmapBytes(byteData: \(String(describing: byteData)), size: \(String(describing: size)))" + } +} + +/// Pigeon equivalent of [AssetBitmap]. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformBitmapAsset: PlatformBitmap { + var name: String + var pkg: String? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmapAsset? { + let name = pigeonVar_list[0] as! String + let pkg: String? = nilOrValue(pigeonVar_list[1]) + + return PlatformBitmapAsset( + name: name, + pkg: pkg + ) + } + func toList() -> [Any?] { + return [ + name, + pkg, + ] + } + static func == (lhs: PlatformBitmapAsset, rhs: PlatformBitmapAsset) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.name, rhs.name) + && MessagesPigeonInternal.deepEquals(lhs.pkg, rhs.pkg) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformBitmapAsset") + MessagesPigeonInternal.deepHash(value: name, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: pkg, hasher: &hasher) + } + + public var description: String { + return "PlatformBitmapAsset(name: \(String(describing: name)), pkg: \(String(describing: pkg)))" + } +} + +/// Pigeon equivalent of [AssetImageBitmap]. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformBitmapAssetImage: PlatformBitmap { + var name: String + var scale: Double + var size: PlatformSize? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmapAssetImage? { + let name = pigeonVar_list[0] as! String + let scale = pigeonVar_list[1] as! Double + let size: PlatformSize? = nilOrValue(pigeonVar_list[2]) + + return PlatformBitmapAssetImage( + name: name, + scale: scale, + size: size + ) + } + func toList() -> [Any?] { + return [ + name, + scale, + size, + ] + } + static func == (lhs: PlatformBitmapAssetImage, rhs: PlatformBitmapAssetImage) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.name, rhs.name) + && MessagesPigeonInternal.deepEquals(lhs.scale, rhs.scale) + && MessagesPigeonInternal.deepEquals(lhs.size, rhs.size) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformBitmapAssetImage") + MessagesPigeonInternal.deepHash(value: name, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: scale, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: size, hasher: &hasher) + } + + public var description: String { + return + "PlatformBitmapAssetImage(name: \(String(describing: name)), scale: \(String(describing: scale)), size: \(String(describing: size)))" + } +} + +/// Pigeon equivalent of [AssetMapBitmap]. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformBitmapAssetMap: PlatformBitmap { + var assetName: String + var bitmapScaling: PlatformMapBitmapScaling + var imagePixelRatio: Double + var width: Double? = nil + var height: Double? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmapAssetMap? { + let assetName = pigeonVar_list[0] as! String + let bitmapScaling = pigeonVar_list[1] as! PlatformMapBitmapScaling + let imagePixelRatio = pigeonVar_list[2] as! Double + let width: Double? = nilOrValue(pigeonVar_list[3]) + let height: Double? = nilOrValue(pigeonVar_list[4]) + + return PlatformBitmapAssetMap( + assetName: assetName, + bitmapScaling: bitmapScaling, + imagePixelRatio: imagePixelRatio, + width: width, + height: height + ) + } + func toList() -> [Any?] { + return [ + assetName, + bitmapScaling, + imagePixelRatio, + width, + height, + ] + } + static func == (lhs: PlatformBitmapAssetMap, rhs: PlatformBitmapAssetMap) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.assetName, rhs.assetName) + && MessagesPigeonInternal.deepEquals(lhs.bitmapScaling, rhs.bitmapScaling) + && MessagesPigeonInternal.deepEquals(lhs.imagePixelRatio, rhs.imagePixelRatio) + && MessagesPigeonInternal.deepEquals(lhs.width, rhs.width) + && MessagesPigeonInternal.deepEquals(lhs.height, rhs.height) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformBitmapAssetMap") + MessagesPigeonInternal.deepHash(value: assetName, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: bitmapScaling, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: imagePixelRatio, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: width, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: height, hasher: &hasher) + } + + public var description: String { + return + "PlatformBitmapAssetMap(assetName: \(String(describing: assetName)), bitmapScaling: \(String(describing: bitmapScaling)), imagePixelRatio: \(String(describing: imagePixelRatio)), width: \(String(describing: width)), height: \(String(describing: height)))" + } +} + +/// Pigeon equivalent of [BytesMapBitmap]. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformBitmapBytesMap: PlatformBitmap { + var byteData: FlutterStandardTypedData + var bitmapScaling: PlatformMapBitmapScaling + var imagePixelRatio: Double + var width: Double? = nil + var height: Double? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmapBytesMap? { + let byteData = pigeonVar_list[0] as! FlutterStandardTypedData + let bitmapScaling = pigeonVar_list[1] as! PlatformMapBitmapScaling + let imagePixelRatio = pigeonVar_list[2] as! Double + let width: Double? = nilOrValue(pigeonVar_list[3]) + let height: Double? = nilOrValue(pigeonVar_list[4]) + + return PlatformBitmapBytesMap( + byteData: byteData, + bitmapScaling: bitmapScaling, + imagePixelRatio: imagePixelRatio, + width: width, + height: height + ) + } + func toList() -> [Any?] { + return [ + byteData, + bitmapScaling, + imagePixelRatio, + width, + height, + ] + } + static func == (lhs: PlatformBitmapBytesMap, rhs: PlatformBitmapBytesMap) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.byteData, rhs.byteData) + && MessagesPigeonInternal.deepEquals(lhs.bitmapScaling, rhs.bitmapScaling) + && MessagesPigeonInternal.deepEquals(lhs.imagePixelRatio, rhs.imagePixelRatio) + && MessagesPigeonInternal.deepEquals(lhs.width, rhs.width) + && MessagesPigeonInternal.deepEquals(lhs.height, rhs.height) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformBitmapBytesMap") + MessagesPigeonInternal.deepHash(value: byteData, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: bitmapScaling, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: imagePixelRatio, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: width, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: height, hasher: &hasher) + } + + public var description: String { + return + "PlatformBitmapBytesMap(byteData: \(String(describing: byteData)), bitmapScaling: \(String(describing: bitmapScaling)), imagePixelRatio: \(String(describing: imagePixelRatio)), width: \(String(describing: width)), height: \(String(describing: height)))" + } +} + +/// Pigeon equivalent of [PinConfig]. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformBitmapPinConfig: PlatformBitmap { + var backgroundColor: PlatformColor? = nil + var borderColor: PlatformColor? = nil + var glyphColor: PlatformColor? = nil + var glyphTextColor: PlatformColor? = nil + var glyphText: String? = nil + var glyphBitmap: PlatformBitmap? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmapPinConfig? { + let backgroundColor: PlatformColor? = nilOrValue(pigeonVar_list[0]) + let borderColor: PlatformColor? = nilOrValue(pigeonVar_list[1]) + let glyphColor: PlatformColor? = nilOrValue(pigeonVar_list[2]) + let glyphTextColor: PlatformColor? = nilOrValue(pigeonVar_list[3]) + let glyphText: String? = nilOrValue(pigeonVar_list[4]) + let glyphBitmap: PlatformBitmap? = nilOrValue(pigeonVar_list[5]) + + return PlatformBitmapPinConfig( + backgroundColor: backgroundColor, + borderColor: borderColor, + glyphColor: glyphColor, + glyphTextColor: glyphTextColor, + glyphText: glyphText, + glyphBitmap: glyphBitmap + ) + } + func toList() -> [Any?] { + return [ + backgroundColor, + borderColor, + glyphColor, + glyphTextColor, + glyphText, + glyphBitmap, + ] + } + static func == (lhs: PlatformBitmapPinConfig, rhs: PlatformBitmapPinConfig) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.backgroundColor, rhs.backgroundColor) + && MessagesPigeonInternal.deepEquals(lhs.borderColor, rhs.borderColor) + && MessagesPigeonInternal.deepEquals(lhs.glyphColor, rhs.glyphColor) + && MessagesPigeonInternal.deepEquals(lhs.glyphTextColor, rhs.glyphTextColor) + && MessagesPigeonInternal.deepEquals(lhs.glyphText, rhs.glyphText) + && MessagesPigeonInternal.deepEquals(lhs.glyphBitmap, rhs.glyphBitmap) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformBitmapPinConfig") + MessagesPigeonInternal.deepHash(value: backgroundColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: borderColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: glyphColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: glyphTextColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: glyphText, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: glyphBitmap, hasher: &hasher) + } + + public var description: String { + return + "PlatformBitmapPinConfig(backgroundColor: \(String(describing: backgroundColor)), borderColor: \(String(describing: borderColor)), glyphColor: \(String(describing: glyphColor)), glyphTextColor: \(String(describing: glyphTextColor)), glyphText: \(String(describing: glyphText)), glyphBitmap: \(String(describing: glyphBitmap)))" + } +} + +private class MessagesPigeonCodecReader: FlutterStandardReader { + override func readValue(ofType type: UInt8) -> Any? { + switch type { + case 129: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return PlatformMapType(rawValue: enumResultAsInt) + } + return nil + case 130: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return PlatformMarkerCollisionBehavior(rawValue: enumResultAsInt) + } + return nil + case 131: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return PlatformJointType(rawValue: enumResultAsInt) + } + return nil + case 132: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return PlatformPatternItemType(rawValue: enumResultAsInt) + } + return nil + case 133: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return PlatformMarkerType(rawValue: enumResultAsInt) + } + return nil + case 134: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return PlatformMapBitmapScaling(rawValue: enumResultAsInt) + } + return nil + case 135: + return PlatformCameraPosition.fromList(self.readValue() as! [Any?]) + case 136: + return PlatformCameraUpdateNewCameraPosition.fromList(self.readValue() as! [Any?]) + case 137: + return PlatformCameraUpdateNewLatLng.fromList(self.readValue() as! [Any?]) + case 138: + return PlatformCameraUpdateNewLatLngBounds.fromList(self.readValue() as! [Any?]) + case 139: + return PlatformCameraUpdateNewLatLngZoom.fromList(self.readValue() as! [Any?]) + case 140: + return PlatformCameraUpdateScrollBy.fromList(self.readValue() as! [Any?]) + case 141: + return PlatformCameraUpdateZoomBy.fromList(self.readValue() as! [Any?]) + case 142: + return PlatformCameraUpdateZoom.fromList(self.readValue() as! [Any?]) + case 143: + return PlatformCameraUpdateZoomTo.fromList(self.readValue() as! [Any?]) + case 144: + return PlatformCircle.fromList(self.readValue() as! [Any?]) + case 145: + return PlatformHeatmap.fromList(self.readValue() as! [Any?]) + case 146: + return PlatformHeatmapGradient.fromList(self.readValue() as! [Any?]) + case 147: + return PlatformWeightedLatLng.fromList(self.readValue() as! [Any?]) + case 148: + return PlatformInfoWindow.fromList(self.readValue() as! [Any?]) + case 149: + return PlatformCluster.fromList(self.readValue() as! [Any?]) + case 150: + return PlatformClusterManager.fromList(self.readValue() as! [Any?]) + case 151: + return PlatformMarker.fromList(self.readValue() as! [Any?]) + case 152: + return PlatformPolygon.fromList(self.readValue() as! [Any?]) + case 153: + return PlatformPolyline.fromList(self.readValue() as! [Any?]) + case 154: + return PlatformPatternItem.fromList(self.readValue() as! [Any?]) + case 155: + return PlatformTile.fromList(self.readValue() as! [Any?]) + case 156: + return PlatformTileOverlay.fromList(self.readValue() as! [Any?]) + case 157: + return PlatformEdgeInsets.fromList(self.readValue() as! [Any?]) + case 158: + return PlatformLatLng.fromList(self.readValue() as! [Any?]) + case 159: + return PlatformLatLngBounds.fromList(self.readValue() as! [Any?]) + case 160: + return PlatformCameraTargetBounds.fromList(self.readValue() as! [Any?]) + case 161: + return PlatformGroundOverlay.fromList(self.readValue() as! [Any?]) + case 162: + return PlatformMapViewCreationParams.fromList(self.readValue() as! [Any?]) + case 163: + return PlatformMapConfiguration.fromList(self.readValue() as! [Any?]) + case 164: + return PlatformPoint.fromList(self.readValue() as! [Any?]) + case 165: + return PlatformSize.fromList(self.readValue() as! [Any?]) + case 166: + return PlatformColor.fromList(self.readValue() as! [Any?]) + case 167: + return PlatformTileLayer.fromList(self.readValue() as! [Any?]) + case 168: + return PlatformZoomRange.fromList(self.readValue() as! [Any?]) + case 169: + return PlatformBitmapDefaultMarker.fromList(self.readValue() as! [Any?]) + case 170: + return PlatformBitmapBytes.fromList(self.readValue() as! [Any?]) + case 171: + return PlatformBitmapAsset.fromList(self.readValue() as! [Any?]) + case 172: + return PlatformBitmapAssetImage.fromList(self.readValue() as! [Any?]) + case 173: + return PlatformBitmapAssetMap.fromList(self.readValue() as! [Any?]) + case 174: + return PlatformBitmapBytesMap.fromList(self.readValue() as! [Any?]) + case 175: + return PlatformBitmapPinConfig.fromList(self.readValue() as! [Any?]) + default: + return super.readValue(ofType: type) + } + } +} + +private class MessagesPigeonCodecWriter: FlutterStandardWriter { + override func writeValue(_ value: Any) { + if let value = value as? PlatformMapType { + super.writeByte(129) + super.writeValue(value.rawValue) + } else if let value = value as? PlatformMarkerCollisionBehavior { + super.writeByte(130) + super.writeValue(value.rawValue) + } else if let value = value as? PlatformJointType { + super.writeByte(131) + super.writeValue(value.rawValue) + } else if let value = value as? PlatformPatternItemType { + super.writeByte(132) + super.writeValue(value.rawValue) + } else if let value = value as? PlatformMarkerType { + super.writeByte(133) + super.writeValue(value.rawValue) + } else if let value = value as? PlatformMapBitmapScaling { + super.writeByte(134) + super.writeValue(value.rawValue) + } else if let value = value as? PlatformCameraPosition { + super.writeByte(135) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateNewCameraPosition { + super.writeByte(136) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateNewLatLng { + super.writeByte(137) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateNewLatLngBounds { + super.writeByte(138) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateNewLatLngZoom { + super.writeByte(139) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateScrollBy { + super.writeByte(140) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateZoomBy { + super.writeByte(141) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateZoom { + super.writeByte(142) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateZoomTo { + super.writeByte(143) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCircle { + super.writeByte(144) + super.writeValue(value.toList()) + } else if let value = value as? PlatformHeatmap { + super.writeByte(145) + super.writeValue(value.toList()) + } else if let value = value as? PlatformHeatmapGradient { + super.writeByte(146) + super.writeValue(value.toList()) + } else if let value = value as? PlatformWeightedLatLng { + super.writeByte(147) + super.writeValue(value.toList()) + } else if let value = value as? PlatformInfoWindow { + super.writeByte(148) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCluster { + super.writeByte(149) + super.writeValue(value.toList()) + } else if let value = value as? PlatformClusterManager { + super.writeByte(150) + super.writeValue(value.toList()) + } else if let value = value as? PlatformMarker { + super.writeByte(151) + super.writeValue(value.toList()) + } else if let value = value as? PlatformPolygon { + super.writeByte(152) + super.writeValue(value.toList()) + } else if let value = value as? PlatformPolyline { + super.writeByte(153) + super.writeValue(value.toList()) + } else if let value = value as? PlatformPatternItem { + super.writeByte(154) + super.writeValue(value.toList()) + } else if let value = value as? PlatformTile { + super.writeByte(155) + super.writeValue(value.toList()) + } else if let value = value as? PlatformTileOverlay { + super.writeByte(156) + super.writeValue(value.toList()) + } else if let value = value as? PlatformEdgeInsets { + super.writeByte(157) + super.writeValue(value.toList()) + } else if let value = value as? PlatformLatLng { + super.writeByte(158) + super.writeValue(value.toList()) + } else if let value = value as? PlatformLatLngBounds { + super.writeByte(159) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraTargetBounds { + super.writeByte(160) + super.writeValue(value.toList()) + } else if let value = value as? PlatformGroundOverlay { + super.writeByte(161) + super.writeValue(value.toList()) + } else if let value = value as? PlatformMapViewCreationParams { + super.writeByte(162) + super.writeValue(value.toList()) + } else if let value = value as? PlatformMapConfiguration { + super.writeByte(163) + super.writeValue(value.toList()) + } else if let value = value as? PlatformPoint { + super.writeByte(164) + super.writeValue(value.toList()) + } else if let value = value as? PlatformSize { + super.writeByte(165) + super.writeValue(value.toList()) + } else if let value = value as? PlatformColor { + super.writeByte(166) + super.writeValue(value.toList()) + } else if let value = value as? PlatformTileLayer { + super.writeByte(167) + super.writeValue(value.toList()) + } else if let value = value as? PlatformZoomRange { + super.writeByte(168) + super.writeValue(value.toList()) + } else if let value = value as? PlatformBitmapDefaultMarker { + super.writeByte(169) + super.writeValue(value.toList()) + } else if let value = value as? PlatformBitmapBytes { + super.writeByte(170) + super.writeValue(value.toList()) + } else if let value = value as? PlatformBitmapAsset { + super.writeByte(171) + super.writeValue(value.toList()) + } else if let value = value as? PlatformBitmapAssetImage { + super.writeByte(172) + super.writeValue(value.toList()) + } else if let value = value as? PlatformBitmapAssetMap { + super.writeByte(173) + super.writeValue(value.toList()) + } else if let value = value as? PlatformBitmapBytesMap { + super.writeByte(174) + super.writeValue(value.toList()) + } else if let value = value as? PlatformBitmapPinConfig { + super.writeByte(175) + super.writeValue(value.toList()) + } else { + super.writeValue(value) + } + } +} + +private class MessagesPigeonCodecReaderWriter: FlutterStandardReaderWriter { + override func reader(with data: Data) -> FlutterStandardReader { + return MessagesPigeonCodecReader(data: data) + } + + override func writer(with data: NSMutableData) -> FlutterStandardWriter { + return MessagesPigeonCodecWriter(data: data) + } +} + +class MessagesPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { + static let shared = MessagesPigeonCodec(readerWriter: MessagesPigeonCodecReaderWriter()) +} + +/// Interface for non-test interactions with the native SDK. +/// +/// For test-only state queries, see [MapsInspectorApi]. +/// +/// Generated protocol from Pigeon that represents a handler of messages from Flutter. +protocol MapsApi { + /// Returns once the map instance is available. + func waitForMap() throws + /// Updates the map's configuration options. + /// + /// Only non-null configuration values will result in updates; options with + /// null values will remain unchanged. + func updateWithMapConfiguration(_ configuration: PlatformMapConfiguration) throws + /// Updates the set of circles on the map. + func updateCircles( + adding toAdd: [PlatformCircle], changing toChange: [PlatformCircle], + removing idsToRemove: [String]) throws + /// Updates the set of heatmaps on the map. + func updateHeatmaps( + adding toAdd: [PlatformHeatmap], changing toChange: [PlatformHeatmap], + removing idsToRemove: [String]) throws + /// Updates the set of custer managers for clusters on the map. + func updateClusterManagers(adding toAdd: [PlatformClusterManager], removing idsToRemove: [String]) + throws + /// Updates the set of markers on the map. + func updateMarkers( + adding toAdd: [PlatformMarker], changing toChange: [PlatformMarker], + removing idsToRemove: [String]) throws + /// Updates the set of polygonss on the map. + func updatePolygons( + adding toAdd: [PlatformPolygon], changing toChange: [PlatformPolygon], + removing idsToRemove: [String]) throws + /// Updates the set of polylines on the map. + func updatePolylines( + adding toAdd: [PlatformPolyline], changing toChange: [PlatformPolyline], + removing idsToRemove: [String]) throws + /// Updates the set of tile overlays on the map. + func updateTileOverlays( + adding toAdd: [PlatformTileOverlay], changing toChange: [PlatformTileOverlay], + removing idsToRemove: [String]) throws + /// Updates the set of ground overlays on the map. + func updateGroundOverlays( + adding toAdd: [PlatformGroundOverlay], changing toChange: [PlatformGroundOverlay], + removing idsToRemove: [String]) throws + /// Gets the screen coordinate for the given map location. + func screenCoordinates(for latLng: PlatformLatLng) throws -> PlatformPoint + /// Gets the map location for the given screen coordinate. + func latLng(for screenCoordinate: PlatformPoint) throws -> PlatformLatLng + /// Gets the map region currently displayed on the map. + func visibleMapRegion() throws -> PlatformLatLngBounds + /// Moves the camera according to [cameraUpdate] immediately, with no + /// animation. + func moveCamera(_ cameraUpdate: PlatformCameraUpdate) throws + /// Moves the camera according to [cameraUpdate], animating the update using a + /// duration in milliseconds if provided. + func animateCamera(_ cameraUpdate: PlatformCameraUpdate, duration durationMilliseconds: Int64?) + throws + /// Gets the current map zoom level. + func zoomLevel() throws -> Double + /// Show the info window for the marker with the given ID. + func showInfoWindowForMarker(withIdentifier markerId: String) throws + /// Hide the info window for the marker with the given ID. + func hideInfoWindowForMarker(withIdentifier markerId: String) throws + /// Returns true if the marker with the given ID is currently displaying its + /// info window. + func isShowingInfoWindowForMarker(withIdentifier markerId: String) throws -> Bool + /// Sets the style to the given map style string, where an empty string + /// indicates that the style should be cleared. + /// + /// If there was an error setting the style, such as an invalid style string, + /// returns the error message. + func setStyle(_ style: String) throws -> String? + /// Returns the error string from the last attempt to set the map style, if + /// any. + /// + /// This allows checking asynchronously for initial style failures, as there + /// is no way to return failures from map initialization. + func lastStyleError() throws -> String? + /// Clears the cache of tiles previously requseted from the tile provider. + func clearTileCacheForOverlay(withIdentifier tileOverlayId: String) throws + /// Takes a snapshot of the map and returns its image data. + func takeSnapshot() throws -> FlutterStandardTypedData? + /// Returns true if the map supports advanced markers. + func isAdvancedMarkersAvailable() throws -> Bool +} + +/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. +class MapsApiSetup { + static var codec: FlutterStandardMessageCodec { MessagesPigeonCodec.shared } + /// Sets up an instance of `MapsApi` to handle messages through the `binaryMessenger`. + static func setUp( + binaryMessenger: FlutterBinaryMessenger, api: MapsApi?, messageChannelSuffix: String = "" + ) { + let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + /// Returns once the map instance is available. + let waitForMapChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.waitForMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + waitForMapChannel.setMessageHandler { _, reply in + do { + try api.waitForMap() + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + waitForMapChannel.setMessageHandler(nil) + } + /// Updates the map's configuration options. + /// + /// Only non-null configuration values will result in updates; options with + /// null values will remain unchanged. + let updateMapConfigurationChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateMapConfiguration\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateMapConfigurationChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let configurationArg = args[0] as! PlatformMapConfiguration + do { + try api.updateWithMapConfiguration(configurationArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updateMapConfigurationChannel.setMessageHandler(nil) + } + /// Updates the set of circles on the map. + let updateCirclesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateCircles\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateCirclesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformCircle] + let toChangeArg = args[1] as! [PlatformCircle] + let idsToRemoveArg = args[2] as! [String] + do { + try api.updateCircles(adding: toAddArg, changing: toChangeArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updateCirclesChannel.setMessageHandler(nil) + } + /// Updates the set of heatmaps on the map. + let updateHeatmapsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateHeatmaps\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateHeatmapsChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformHeatmap] + let toChangeArg = args[1] as! [PlatformHeatmap] + let idsToRemoveArg = args[2] as! [String] + do { + try api.updateHeatmaps(adding: toAddArg, changing: toChangeArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updateHeatmapsChannel.setMessageHandler(nil) + } + /// Updates the set of custer managers for clusters on the map. + let updateClusterManagersChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateClusterManagers\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateClusterManagersChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformClusterManager] + let idsToRemoveArg = args[1] as! [String] + do { + try api.updateClusterManagers(adding: toAddArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updateClusterManagersChannel.setMessageHandler(nil) + } + /// Updates the set of markers on the map. + let updateMarkersChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateMarkers\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateMarkersChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformMarker] + let toChangeArg = args[1] as! [PlatformMarker] + let idsToRemoveArg = args[2] as! [String] + do { + try api.updateMarkers(adding: toAddArg, changing: toChangeArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updateMarkersChannel.setMessageHandler(nil) + } + /// Updates the set of polygonss on the map. + let updatePolygonsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updatePolygons\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updatePolygonsChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformPolygon] + let toChangeArg = args[1] as! [PlatformPolygon] + let idsToRemoveArg = args[2] as! [String] + do { + try api.updatePolygons(adding: toAddArg, changing: toChangeArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updatePolygonsChannel.setMessageHandler(nil) + } + /// Updates the set of polylines on the map. + let updatePolylinesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updatePolylines\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updatePolylinesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformPolyline] + let toChangeArg = args[1] as! [PlatformPolyline] + let idsToRemoveArg = args[2] as! [String] + do { + try api.updatePolylines(adding: toAddArg, changing: toChangeArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updatePolylinesChannel.setMessageHandler(nil) + } + /// Updates the set of tile overlays on the map. + let updateTileOverlaysChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateTileOverlays\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateTileOverlaysChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformTileOverlay] + let toChangeArg = args[1] as! [PlatformTileOverlay] + let idsToRemoveArg = args[2] as! [String] + do { + try api.updateTileOverlays( + adding: toAddArg, changing: toChangeArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updateTileOverlaysChannel.setMessageHandler(nil) + } + /// Updates the set of ground overlays on the map. + let updateGroundOverlaysChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateGroundOverlays\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateGroundOverlaysChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformGroundOverlay] + let toChangeArg = args[1] as! [PlatformGroundOverlay] + let idsToRemoveArg = args[2] as! [String] + do { + try api.updateGroundOverlays( + adding: toAddArg, changing: toChangeArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updateGroundOverlaysChannel.setMessageHandler(nil) + } + /// Gets the screen coordinate for the given map location. + let getScreenCoordinateChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getScreenCoordinate\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getScreenCoordinateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let latLngArg = args[0] as! PlatformLatLng + do { + let result = try api.screenCoordinates(for: latLngArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getScreenCoordinateChannel.setMessageHandler(nil) + } + /// Gets the map location for the given screen coordinate. + let getLatLngChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getLatLng\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getLatLngChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let screenCoordinateArg = args[0] as! PlatformPoint + do { + let result = try api.latLng(for: screenCoordinateArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getLatLngChannel.setMessageHandler(nil) + } + /// Gets the map region currently displayed on the map. + let getVisibleRegionChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getVisibleRegion\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getVisibleRegionChannel.setMessageHandler { _, reply in + do { + let result = try api.visibleMapRegion() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getVisibleRegionChannel.setMessageHandler(nil) + } + /// Moves the camera according to [cameraUpdate] immediately, with no + /// animation. + let moveCameraChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.moveCamera\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + moveCameraChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let cameraUpdateArg = args[0] as! PlatformCameraUpdate + do { + try api.moveCamera(cameraUpdateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + moveCameraChannel.setMessageHandler(nil) + } + /// Moves the camera according to [cameraUpdate], animating the update using a + /// duration in milliseconds if provided. + let animateCameraChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.animateCamera\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + animateCameraChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let cameraUpdateArg = args[0] as! PlatformCameraUpdate + let durationMillisecondsArg: Int64? = nilOrValue(args[1]) + do { + try api.animateCamera(cameraUpdateArg, duration: durationMillisecondsArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + animateCameraChannel.setMessageHandler(nil) + } + /// Gets the current map zoom level. + let getZoomLevelChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getZoomLevel\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getZoomLevelChannel.setMessageHandler { _, reply in + do { + let result = try api.zoomLevel() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getZoomLevelChannel.setMessageHandler(nil) + } + /// Show the info window for the marker with the given ID. + let showInfoWindowChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.showInfoWindow\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + showInfoWindowChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let markerIdArg = args[0] as! String + do { + try api.showInfoWindowForMarker(withIdentifier: markerIdArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + showInfoWindowChannel.setMessageHandler(nil) + } + /// Hide the info window for the marker with the given ID. + let hideInfoWindowChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.hideInfoWindow\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + hideInfoWindowChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let markerIdArg = args[0] as! String + do { + try api.hideInfoWindowForMarker(withIdentifier: markerIdArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + hideInfoWindowChannel.setMessageHandler(nil) + } + /// Returns true if the marker with the given ID is currently displaying its + /// info window. + let isInfoWindowShownChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.isInfoWindowShown\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + isInfoWindowShownChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let markerIdArg = args[0] as! String + do { + let result = try api.isShowingInfoWindowForMarker(withIdentifier: markerIdArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + isInfoWindowShownChannel.setMessageHandler(nil) + } + /// Sets the style to the given map style string, where an empty string + /// indicates that the style should be cleared. + /// + /// If there was an error setting the style, such as an invalid style string, + /// returns the error message. + let setStyleChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.setStyle\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setStyleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let styleArg = args[0] as! String + do { + let result = try api.setStyle(styleArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + setStyleChannel.setMessageHandler(nil) + } + /// Returns the error string from the last attempt to set the map style, if + /// any. + /// + /// This allows checking asynchronously for initial style failures, as there + /// is no way to return failures from map initialization. + let getLastStyleErrorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getLastStyleError\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getLastStyleErrorChannel.setMessageHandler { _, reply in + do { + let result = try api.lastStyleError() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getLastStyleErrorChannel.setMessageHandler(nil) + } + /// Clears the cache of tiles previously requseted from the tile provider. + let clearTileCacheChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.clearTileCache\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + clearTileCacheChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let tileOverlayIdArg = args[0] as! String + do { + try api.clearTileCacheForOverlay(withIdentifier: tileOverlayIdArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + clearTileCacheChannel.setMessageHandler(nil) + } + /// Takes a snapshot of the map and returns its image data. + let takeSnapshotChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.takeSnapshot\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + takeSnapshotChannel.setMessageHandler { _, reply in + do { + let result = try api.takeSnapshot() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + takeSnapshotChannel.setMessageHandler(nil) + } + /// Returns true if the map supports advanced markers. + let isAdvancedMarkersAvailableChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.isAdvancedMarkersAvailable\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + isAdvancedMarkersAvailableChannel.setMessageHandler { _, reply in + do { + let result = try api.isAdvancedMarkersAvailable() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + isAdvancedMarkersAvailableChannel.setMessageHandler(nil) + } + } +} + +/// Interface for calls from the native SDK to Dart. +/// +/// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift. +protocol MapsCallbackApiProtocol { + /// Called when the map camera starts moving. + func didStartCameraMove(completion: @escaping (Result) -> Void) + /// Called when the map camera moves. + func didMoveCamera( + to cameraPositionArg: PlatformCameraPosition, + completion: @escaping (Result) -> Void) + /// Called when the map camera stops moving. + func didIdleCamera(completion: @escaping (Result) -> Void) + /// Called when the map, not a specifc map object, is tapped. + func didTap( + at positionArg: PlatformLatLng, completion: @escaping (Result) -> Void) + /// Called when the map, not a specifc map object, is long pressed. + func didLongPress( + at positionArg: PlatformLatLng, completion: @escaping (Result) -> Void) + /// Called when a marker is tapped. + func didTapMarker( + withIdentifier markerIdArg: String, completion: @escaping (Result) -> Void) + /// Called when a marker drag starts. + func didStartDragForMarker( + withIdentifier markerIdArg: String, at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void) + /// Called when a marker drag updates. + func didDragMarker( + withIdentifier markerIdArg: String, at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void) + /// Called when a marker drag ends. + func didEndDragForMarker( + withIdentifier markerIdArg: String, at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void) + /// Called when a marker's info window is tapped. + func didTapInfoWindowOfMarker( + withIdentifier markerIdArg: String, completion: @escaping (Result) -> Void) + /// Called when a circle is tapped. + func didTapCircle( + withIdentifier circleIdArg: String, completion: @escaping (Result) -> Void) + /// Called when a marker cluster is tapped. + func didTapCluster( + _ clusterArg: PlatformCluster, completion: @escaping (Result) -> Void) + /// Called when a polygon is tapped. + func didTapPolygon( + withIdentifier polygonIdArg: String, completion: @escaping (Result) -> Void) + /// Called when a polyline is tapped. + func didTapPolyline( + withIdentifier polylineIdArg: String, completion: @escaping (Result) -> Void) + /// Called when a ground overlay is tapped. + func didTapGroundOverlay( + withIdentifier groundOverlayIdArg: String, + completion: @escaping (Result) -> Void) + /// Called to get data for a map tile. + func tile( + withOverlayIdentifier tileOverlayIdArg: String, location locationArg: PlatformPoint, + zoom zoomArg: Int64, completion: @escaping (Result) -> Void) +} +class MapsCallbackApi: MapsCallbackApiProtocol { + private let binaryMessenger: FlutterBinaryMessenger + private let messageChannelSuffix: String + init(binaryMessenger: FlutterBinaryMessenger, messageChannelSuffix: String = "") { + self.binaryMessenger = binaryMessenger + self.messageChannelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + } + var codec: MessagesPigeonCodec { + return MessagesPigeonCodec.shared + } + /// Called when the map camera starts moving. + func didStartCameraMove(completion: @escaping (Result) -> Void) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCameraMoveStarted\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage(nil) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when the map camera moves. + func didMoveCamera( + to cameraPositionArg: PlatformCameraPosition, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCameraMove\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([cameraPositionArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when the map camera stops moving. + func didIdleCamera(completion: @escaping (Result) -> Void) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCameraIdle\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage(nil) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when the map, not a specifc map object, is tapped. + func didTap( + at positionArg: PlatformLatLng, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([positionArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when the map, not a specifc map object, is long pressed. + func didLongPress( + at positionArg: PlatformLatLng, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onLongPress\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([positionArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a marker is tapped. + func didTapMarker( + withIdentifier markerIdArg: String, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([markerIdArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a marker drag starts. + func didStartDragForMarker( + withIdentifier markerIdArg: String, at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDragStart\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([markerIdArg, positionArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a marker drag updates. + func didDragMarker( + withIdentifier markerIdArg: String, at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDrag\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([markerIdArg, positionArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a marker drag ends. + func didEndDragForMarker( + withIdentifier markerIdArg: String, at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDragEnd\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([markerIdArg, positionArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a marker's info window is tapped. + func didTapInfoWindowOfMarker( + withIdentifier markerIdArg: String, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onInfoWindowTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([markerIdArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a circle is tapped. + func didTapCircle( + withIdentifier circleIdArg: String, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCircleTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([circleIdArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a marker cluster is tapped. + func didTapCluster( + _ clusterArg: PlatformCluster, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onClusterTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([clusterArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a polygon is tapped. + func didTapPolygon( + withIdentifier polygonIdArg: String, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onPolygonTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([polygonIdArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a polyline is tapped. + func didTapPolyline( + withIdentifier polylineIdArg: String, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onPolylineTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([polylineIdArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a ground overlay is tapped. + func didTapGroundOverlay( + withIdentifier groundOverlayIdArg: String, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onGroundOverlayTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([groundOverlayIdArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called to get data for a map tile. + func tile( + withOverlayIdentifier tileOverlayIdArg: String, location locationArg: PlatformPoint, + zoom zoomArg: Int64, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.getTileOverlayTile\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([tileOverlayIdArg, locationArg, zoomArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! PlatformTile + completion(.success(result)) + } + } + } +} +/// Dummy interface to force generation of the platform view creation params, +/// which are not used in any Pigeon calls, only the platform view creation +/// call made internally by Flutter. +/// +/// Generated protocol from Pigeon that represents a handler of messages from Flutter. +protocol MapsPlatformViewApi { + func createView(type: PlatformMapViewCreationParams?) throws +} + +/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. +class MapsPlatformViewApiSetup { + static var codec: FlutterStandardMessageCodec { MessagesPigeonCodec.shared } + /// Sets up an instance of `MapsPlatformViewApi` to handle messages through the `binaryMessenger`. + static func setUp( + binaryMessenger: FlutterBinaryMessenger, api: MapsPlatformViewApi?, + messageChannelSuffix: String = "" + ) { + let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + let createViewChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsPlatformViewApi.createView\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + createViewChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let typeArg: PlatformMapViewCreationParams? = nilOrValue(args[0]) + do { + try api.createView(type: typeArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + createViewChannel.setMessageHandler(nil) + } + } +} +/// Inspector API only intended for use in integration tests. +/// +/// Generated protocol from Pigeon that represents a handler of messages from Flutter. +protocol MapsInspectorApi { + func areBuildingsEnabled() throws -> Bool + func areRotateGesturesEnabled() throws -> Bool + func areScrollGesturesEnabled() throws -> Bool + func areTiltGesturesEnabled() throws -> Bool + func areZoomGesturesEnabled() throws -> Bool + func isCompassEnabled() throws -> Bool + func isMyLocationButtonEnabled() throws -> Bool + func isTrafficEnabled() throws -> Bool + func tileOverlay(withIdentifier tileOverlayId: String) throws -> PlatformTileLayer? + func groundOverlay(withIdentifier groundOverlayId: String) throws -> PlatformGroundOverlay? + func heatmap(withIdentifier heatmapId: String) throws -> PlatformHeatmap? + func zoomRange() throws -> PlatformZoomRange + func clusters(withIdentifier clusterManagerId: String) throws -> [PlatformCluster] + func cameraPosition() throws -> PlatformCameraPosition +} + +/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. +class MapsInspectorApiSetup { + static var codec: FlutterStandardMessageCodec { MessagesPigeonCodec.shared } + /// Sets up an instance of `MapsInspectorApi` to handle messages through the `binaryMessenger`. + static func setUp( + binaryMessenger: FlutterBinaryMessenger, api: MapsInspectorApi?, + messageChannelSuffix: String = "" + ) { + let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + let areBuildingsEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areBuildingsEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + areBuildingsEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.areBuildingsEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + areBuildingsEnabledChannel.setMessageHandler(nil) + } + let areRotateGesturesEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areRotateGesturesEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + areRotateGesturesEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.areRotateGesturesEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + areRotateGesturesEnabledChannel.setMessageHandler(nil) + } + let areScrollGesturesEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areScrollGesturesEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + areScrollGesturesEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.areScrollGesturesEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + areScrollGesturesEnabledChannel.setMessageHandler(nil) + } + let areTiltGesturesEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areTiltGesturesEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + areTiltGesturesEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.areTiltGesturesEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + areTiltGesturesEnabledChannel.setMessageHandler(nil) + } + let areZoomGesturesEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areZoomGesturesEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + areZoomGesturesEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.areZoomGesturesEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + areZoomGesturesEnabledChannel.setMessageHandler(nil) + } + let isCompassEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.isCompassEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + isCompassEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.isCompassEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + isCompassEnabledChannel.setMessageHandler(nil) + } + let isMyLocationButtonEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.isMyLocationButtonEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + isMyLocationButtonEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.isMyLocationButtonEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + isMyLocationButtonEnabledChannel.setMessageHandler(nil) + } + let isTrafficEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.isTrafficEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + isTrafficEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.isTrafficEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + isTrafficEnabledChannel.setMessageHandler(nil) + } + let getTileOverlayInfoChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getTileOverlayInfo\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getTileOverlayInfoChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let tileOverlayIdArg = args[0] as! String + do { + let result = try api.tileOverlay(withIdentifier: tileOverlayIdArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getTileOverlayInfoChannel.setMessageHandler(nil) + } + let getGroundOverlayInfoChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getGroundOverlayInfo\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getGroundOverlayInfoChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let groundOverlayIdArg = args[0] as! String + do { + let result = try api.groundOverlay(withIdentifier: groundOverlayIdArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getGroundOverlayInfoChannel.setMessageHandler(nil) + } + let getHeatmapInfoChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getHeatmapInfo\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getHeatmapInfoChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let heatmapIdArg = args[0] as! String + do { + let result = try api.heatmap(withIdentifier: heatmapIdArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getHeatmapInfoChannel.setMessageHandler(nil) + } + let getZoomRangeChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getZoomRange\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getZoomRangeChannel.setMessageHandler { _, reply in + do { + let result = try api.zoomRange() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getZoomRangeChannel.setMessageHandler(nil) + } + let getClustersChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getClusters\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getClustersChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let clusterManagerIdArg = args[0] as! String + do { + let result = try api.clusters(withIdentifier: clusterManagerIdArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getClustersChannel.setMessageHandler(nil) + } + let getCameraPositionChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getCameraPosition\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getCameraPositionChannel.setMessageHandler { _, reply in + do { + let result = try api.cameraPosition() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getCameraPositionChannel.setMessageHandler(nil) + } + } +} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/PolygonController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/PolygonController.swift index afda2e016909..40d771fbbea5 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/PolygonController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/PolygonController.swift @@ -4,12 +4,8 @@ import GoogleMaps -#if canImport(google_maps_flutter_ios_sdk10_objc) - import google_maps_flutter_ios_sdk10_objc -#endif - /// Defines polygon controllable by Flutter. -class PolygonController: NSObject { +class PolygonController { let polygon: GMSPolygon private weak var mapView: GMSMapView? @@ -17,27 +13,28 @@ class PolygonController: NSObject { self.polygon = GMSPolygon() self.mapView = mapView self.polygon.userData = [identifier] - super.init() } func removePolygon() { polygon.map = nil } - /// Updates the controller's polygon with the properties from a FGMPlatformPolygon. + /// Updates the controller's polygon with the properties from a PlatformPolygon. /// /// Setting the polygon to visible will set its map to the controller's mapView. - func update(from platformPolygon: FGMPlatformPolygon) { + func update(from platformPolygon: PlatformPolygon) { if let mapView = mapView { PolygonController.update(polygon, from: platformPolygon, with: mapView) } } - /// Updates the given GMSPolygon with the properties from a FGMPlatformPolygon. + /// Updates the given GMSPolygon with the properties from a PlatformPolygon. /// /// Setting the polygon to visible will set its map to the given mapView. static func update( - _ polygon: GMSPolygon, from platformPolygon: FGMPlatformPolygon, with mapView: GMSMapView + _ polygon: GMSPolygon, + from platformPolygon: PlatformPolygon, + with mapView: GMSMapView ) { polygon.isTappable = platformPolygon.consumesTapEvents polygon.zIndex = Int32(platformPolygon.zIndex) @@ -54,7 +51,7 @@ class PolygonController: NSObject { } } -class PolygonsController: NSObject { +class PolygonsController { private var polygonIdentifierToController: [String: PolygonController] = [:] private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? @@ -62,10 +59,9 @@ class PolygonsController: NSObject { init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate - super.init() } - func add(_ polygons: [FGMPlatformPolygon]) { + func add(_ polygons: [PlatformPolygon]) { guard let mapView = mapView else { return } for polygon in polygons { let identifier = polygon.polygonId @@ -77,7 +73,7 @@ class PolygonsController: NSObject { } } - func change(_ polygons: [FGMPlatformPolygon]) { + func change(_ polygons: [PlatformPolygon]) { for polygon in polygons { let identifier = polygon.polygonId polygonIdentifierToController[identifier]?.update(from: polygon) @@ -95,7 +91,7 @@ class PolygonsController: NSObject { func didTapPolygon(withIdentifier identifier: String) { if hasPolygon(withIdentifier: identifier) { - eventDelegate?.didTapPolygon(withIdentifier: identifier) + eventDelegate?.didTapPolygon(withIdentifier: identifier) { _ in } } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/PolylineController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/PolylineController.swift index 4994c7526f39..9b00b37f34ee 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/PolylineController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/PolylineController.swift @@ -4,12 +4,8 @@ import GoogleMaps -#if canImport(google_maps_flutter_ios_sdk10_objc) - import google_maps_flutter_ios_sdk10_objc -#endif - /// Defines polyline controllable by Flutter. -class PolylineController: NSObject { +class PolylineController { let polyline: GMSPolyline private weak var mapView: GMSMapView? @@ -17,27 +13,28 @@ class PolylineController: NSObject { self.polyline = GMSPolyline() self.mapView = mapView self.polyline.userData = [identifier] - super.init() } func removePolyline() { polyline.map = nil } - /// Updates the controller's polyline with the properties from a FGMPlatformPolyline. + /// Updates the controller's polyline with the properties from a PlatformPolyline. /// /// Setting the polyline to visible will set its map to the controller's mapView. - func update(from platformPolyline: FGMPlatformPolyline) { + func update(from platformPolyline: PlatformPolyline) { if let mapView = mapView { PolylineController.update(polyline, from: platformPolyline, with: mapView) } } - /// Updates the given GMSPolyline with the properties from a FGMPlatformPolyline. + /// Updates the given GMSPolyline with the properties from a PlatformPolyline. /// /// Setting the polyline to visible will set its map to the given mapView. static func update( - _ polyline: GMSPolyline, from platformPolyline: FGMPlatformPolyline, with mapView: GMSMapView + _ polyline: GMSPolyline, + from platformPolyline: PlatformPolyline, + with mapView: GMSMapView ) { polyline.isTappable = platformPolyline.consumesTapEvents polyline.zIndex = Int32(platformPolyline.zIndex) @@ -59,7 +56,7 @@ class PolylineController: NSObject { } } -class PolylinesController: NSObject { +class PolylinesController { private var polylineIdentifierToController: [String: PolylineController] = [:] private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? @@ -67,10 +64,9 @@ class PolylinesController: NSObject { init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate - super.init() } - func add(_ polylines: [FGMPlatformPolyline]) { + func add(_ polylines: [PlatformPolyline]) { guard let mapView = mapView else { return } for polyline in polylines { let identifier = polyline.polylineId @@ -82,7 +78,7 @@ class PolylinesController: NSObject { } } - func change(_ polylines: [FGMPlatformPolyline]) { + func change(_ polylines: [PlatformPolyline]) { for polyline in polylines { let identifier = polyline.polylineId polylineIdentifierToController[identifier]?.update(from: polyline) @@ -100,7 +96,7 @@ class PolylinesController: NSObject { func didTapPolyline(withIdentifier identifier: String) { if hasPolyline(withIdentifier: identifier) { - eventDelegate?.didTapPolyline(withIdentifier: identifier) + eventDelegate?.didTapPolyline(withIdentifier: identifier) { _ in } } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/TileOverlayController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/TileOverlayController.swift index 11f159e472d3..3dc37d4314ae 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/TileOverlayController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/TileOverlayController.swift @@ -6,31 +6,24 @@ import Flutter import GoogleMaps import UIKit -#if canImport(google_maps_flutter_ios_sdk10_objc) - import google_maps_flutter_ios_sdk10_objc -#endif - /// Protocol for requesting tiles from the Dart side. -// TODO(stuartmorgan): Adjust this to match the Swift API once the Pigeon -// generation is switched to Swift. protocol TileProviderDelegate: AnyObject { func tile( withOverlayIdentifier tileOverlayId: String, - location: FGMPlatformPoint, - zoom: Int, - completion: @escaping (FGMPlatformTile?, FlutterError?) -> Void + location: PlatformPoint, + zoom: Int64, + completion: @escaping (Result) -> Void ) } /// Controller of a single tile overlay on the map. -class TileOverlayController: NSObject { +class TileOverlayController { let layer: GMSTileLayer private weak var mapView: GMSMapView? - init(tileOverlay: FGMPlatformTileOverlay, tileLayer: GMSTileLayer, mapView: GMSMapView) { + init(tileOverlay: PlatformTileOverlay, tileLayer: GMSTileLayer, mapView: GMSMapView) { self.layer = tileLayer self.mapView = mapView - super.init() TileOverlayController.update(tileLayer, from: tileOverlay, with: mapView) } @@ -42,21 +35,21 @@ class TileOverlayController: NSObject { layer.clearTileCache() } - /// Updates the controller's tile overlay with the properties from a FGMPlatformTileOverlay. + /// Updates the controller's tile overlay with the properties from a PlatformTileOverlay. /// /// Setting the tile overlay to visible will set its map to the controller's mapView. - func update(from overlay: FGMPlatformTileOverlay) { + func update(from overlay: PlatformTileOverlay) { if let mapView = mapView { TileOverlayController.update(layer, from: overlay, with: mapView) } } - /// Updates the given GMSTileLayer with the properties from a FGMPlatformTileOverlay. + /// Updates the given GMSTileLayer with the properties from a PlatformTileOverlay. /// /// Setting the tile overlay to visible will set its map to the given mapView. static func update( _ tileLayer: GMSTileLayer, - from platformOverlay: FGMPlatformTileOverlay, + from platformOverlay: PlatformTileOverlay, with mapView: GMSMapView ) { tileLayer.opacity = Float(1.0 - platformOverlay.transparency) @@ -121,21 +114,20 @@ class TileProviderController: GMSTileLayer { } tileProviderDelegate.tile( withOverlayIdentifier: self.tileOverlayIdentifier, - location: FGMPlatformPoint.makeWith(x: Double(x), y: Double(y)), - zoom: Int(zoom) - ) { [weak self] tile, error in + location: PlatformPoint(x: Double(x), y: Double(y)), + zoom: Int64(zoom) + ) { [weak self] result in guard let self = self else { receiver.receiveTileWith(x: x, y: y, zoom: zoom, image: kGMSTileLayerNoTile) return } - let typedData = tile?.data - let tileImage: UIImage - if let data = typedData?.data { - tileImage = self.handleResultTile(UIImage(data: data)) ?? kGMSTileLayerNoTile - } else { - tileImage = kGMSTileLayerNoTile - } - if let error = error { + var tileImage = kGMSTileLayerNoTile + switch result { + case .success(let tile): + if let data = tile.data?.data { + tileImage = self.handleResultTile(UIImage(data: data)) ?? kGMSTileLayerNoTile + } + case .failure(let error): NSLog( "Can't get tile: errorCode = \(error.code), errorMessage = \(error.message ?? "nil"), details = \(error.details ?? "nil")" ) @@ -147,7 +139,7 @@ class TileProviderController: GMSTileLayer { } /// Controller of multiple tile overlays on the map. -class TileOverlaysController: NSObject { +class TileOverlaysController { private var tileOverlayIdentifierToController: [String: TileOverlayController] = [:] private weak var tileProviderDelegate: TileProviderDelegate? private weak var mapView: GMSMapView? @@ -155,10 +147,9 @@ class TileOverlaysController: NSObject { init(mapView: GMSMapView, tileProvider: TileProviderDelegate) { self.mapView = mapView self.tileProviderDelegate = tileProvider - super.init() } - func add(_ tileOverlaysToAdd: [FGMPlatformTileOverlay]) { + func add(_ tileOverlaysToAdd: [PlatformTileOverlay]) { guard let mapView = mapView, let tileProviderDelegate = tileProviderDelegate else { return } for tileOverlay in tileOverlaysToAdd { let identifier = tileOverlay.tileOverlayId @@ -175,7 +166,7 @@ class TileOverlaysController: NSObject { } } - func change(_ tileOverlaysToChange: [FGMPlatformTileOverlay]) { + func change(_ tileOverlaysToChange: [PlatformTileOverlay]) { for tileOverlay in tileOverlaysToChange { let identifier = tileOverlay.tileOverlayId tileOverlayIdentifierToController[identifier]?.update(from: tileOverlay) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/google_maps_flutter_pigeon_messages.g.m b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/google_maps_flutter_pigeon_messages.g.m deleted file mode 100644 index 205bc2a3ccad..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/google_maps_flutter_pigeon_messages.g.m +++ /dev/null @@ -1,4849 +0,0 @@ -// Copyright 2013 The Flutter Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// Autogenerated from Pigeon (v27.3.2), do not edit directly. -// See also: https://pub.dev/packages/pigeon - -#import "google_maps_flutter_pigeon_messages.g.h" - -#if TARGET_OS_OSX -@import FlutterMacOS; -#else -@import Flutter; -#endif - -static BOOL __attribute__((unused)) FLTPigeonDeepEquals(id _Nullable a, id _Nullable b) { - if (a == b) { - return YES; - } - if (a == nil) { - return b == [NSNull null]; - } - if (b == nil) { - return a == [NSNull null]; - } - if ([a isKindOfClass:[NSNumber class]] && [b isKindOfClass:[NSNumber class]]) { - return - [a isEqual:b] || (isnan([(NSNumber *)a doubleValue]) && isnan([(NSNumber *)b doubleValue])); - } - if ([a isKindOfClass:[NSArray class]] && [b isKindOfClass:[NSArray class]]) { - NSArray *arrayA = (NSArray *)a; - NSArray *arrayB = (NSArray *)b; - if (arrayA.count != arrayB.count) { - return NO; - } - for (NSUInteger i = 0; i < arrayA.count; i++) { - if (!FLTPigeonDeepEquals(arrayA[i], arrayB[i])) { - return NO; - } - } - return YES; - } - if ([a isKindOfClass:[NSDictionary class]] && [b isKindOfClass:[NSDictionary class]]) { - NSDictionary *dictA = (NSDictionary *)a; - NSDictionary *dictB = (NSDictionary *)b; - if (dictA.count != dictB.count) { - return NO; - } - for (id keyA in dictA) { - id valueA = dictA[keyA]; - BOOL found = NO; - for (id keyB in dictB) { - if (FLTPigeonDeepEquals(keyA, keyB)) { - id valueB = dictB[keyB]; - if (FLTPigeonDeepEquals(valueA, valueB)) { - found = YES; - break; - } else { - return NO; - } - } - } - if (!found) { - return NO; - } - } - return YES; - } - return [a isEqual:b]; -} - -static NSUInteger __attribute__((unused)) FLTPigeonDeepHash(id _Nullable value) { - if (value == nil || value == (id)[NSNull null]) { - return 0; - } - if ([value isKindOfClass:[NSNumber class]]) { - NSNumber *n = (NSNumber *)value; - double d = n.doubleValue; - if (isnan(d)) { - // Normalize NaN to a consistent hash. - return (NSUInteger)0x7FF8000000000000; - } - if (d == 0.0) { - // Normalize -0.0 to 0.0 so they have the same hash code. - d = 0.0; - } - return @(d).hash; - } - if ([value isKindOfClass:[NSArray class]]) { - NSUInteger result = 1; - for (id item in (NSArray *)value) { - result = result * 31 + FLTPigeonDeepHash(item); - } - return result; - } - if ([value isKindOfClass:[NSDictionary class]]) { - NSUInteger result = 0; - NSDictionary *dict = (NSDictionary *)value; - for (id key in dict) { - result += ((FLTPigeonDeepHash(key) * 31) ^ FLTPigeonDeepHash(dict[key])); - } - return result; - } - return [value hash]; -} - -static NSArray *wrapResult(id result, FlutterError *error) { - if (error) { - return @[ - error.code ?: [NSNull null], error.message ?: [NSNull null], error.details ?: [NSNull null] - ]; - } - return @[ result ?: [NSNull null] ]; -} - -static FlutterError *createConnectionError(NSString *channelName) { - return [FlutterError - errorWithCode:@"channel-error" - message:[NSString stringWithFormat:@"%@/%@/%@", - @"Unable to establish connection on channel: '", - channelName, @"'."] - details:@""]; -} - -static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { - id result = array[key]; - return (result == [NSNull null]) ? nil : result; -} - -/// Pigeon equivalent of MapType -@implementation FGMPlatformMapTypeBox -- (instancetype)initWithValue:(FGMPlatformMapType)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Pigeon equivalent of the MarkerCollisionBehavior enum. -@implementation FGMPlatformMarkerCollisionBehaviorBox -- (instancetype)initWithValue:(FGMPlatformMarkerCollisionBehavior)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Join types for polyline joints. -@implementation FGMPlatformJointTypeBox -- (instancetype)initWithValue:(FGMPlatformJointType)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Enumeration of possible types for PatternItem. -@implementation FGMPlatformPatternItemTypeBox -- (instancetype)initWithValue:(FGMPlatformPatternItemType)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -@implementation FGMPlatformMarkerTypeBox -- (instancetype)initWithValue:(FGMPlatformMarkerType)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Pigeon equivalent of [MapBitmapScaling]. -@implementation FGMPlatformMapBitmapScalingBox -- (instancetype)initWithValue:(FGMPlatformMapBitmapScaling)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -@interface FGMPlatformCameraPosition () -+ (FGMPlatformCameraPosition *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraPosition *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdate () -+ (FGMPlatformCameraUpdate *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdate *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateNewCameraPosition () -+ (FGMPlatformCameraUpdateNewCameraPosition *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateNewCameraPosition *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateNewLatLng () -+ (FGMPlatformCameraUpdateNewLatLng *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateNewLatLng *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateNewLatLngBounds () -+ (FGMPlatformCameraUpdateNewLatLngBounds *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateNewLatLngBounds *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateNewLatLngZoom () -+ (FGMPlatformCameraUpdateNewLatLngZoom *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateNewLatLngZoom *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateScrollBy () -+ (FGMPlatformCameraUpdateScrollBy *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateScrollBy *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateZoomBy () -+ (FGMPlatformCameraUpdateZoomBy *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateZoomBy *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateZoom () -+ (FGMPlatformCameraUpdateZoom *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateZoom *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateZoomTo () -+ (FGMPlatformCameraUpdateZoomTo *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateZoomTo *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCircle () -+ (FGMPlatformCircle *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCircle *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformHeatmap () -+ (FGMPlatformHeatmap *)fromList:(NSArray *)list; -+ (nullable FGMPlatformHeatmap *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformHeatmapGradient () -+ (FGMPlatformHeatmapGradient *)fromList:(NSArray *)list; -+ (nullable FGMPlatformHeatmapGradient *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformWeightedLatLng () -+ (FGMPlatformWeightedLatLng *)fromList:(NSArray *)list; -+ (nullable FGMPlatformWeightedLatLng *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformInfoWindow () -+ (FGMPlatformInfoWindow *)fromList:(NSArray *)list; -+ (nullable FGMPlatformInfoWindow *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCluster () -+ (FGMPlatformCluster *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCluster *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformClusterManager () -+ (FGMPlatformClusterManager *)fromList:(NSArray *)list; -+ (nullable FGMPlatformClusterManager *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformMarker () -+ (FGMPlatformMarker *)fromList:(NSArray *)list; -+ (nullable FGMPlatformMarker *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformPolygon () -+ (FGMPlatformPolygon *)fromList:(NSArray *)list; -+ (nullable FGMPlatformPolygon *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformPolyline () -+ (FGMPlatformPolyline *)fromList:(NSArray *)list; -+ (nullable FGMPlatformPolyline *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformPatternItem () -+ (FGMPlatformPatternItem *)fromList:(NSArray *)list; -+ (nullable FGMPlatformPatternItem *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformTile () -+ (FGMPlatformTile *)fromList:(NSArray *)list; -+ (nullable FGMPlatformTile *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformTileOverlay () -+ (FGMPlatformTileOverlay *)fromList:(NSArray *)list; -+ (nullable FGMPlatformTileOverlay *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformEdgeInsets () -+ (FGMPlatformEdgeInsets *)fromList:(NSArray *)list; -+ (nullable FGMPlatformEdgeInsets *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformLatLng () -+ (FGMPlatformLatLng *)fromList:(NSArray *)list; -+ (nullable FGMPlatformLatLng *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformLatLngBounds () -+ (FGMPlatformLatLngBounds *)fromList:(NSArray *)list; -+ (nullable FGMPlatformLatLngBounds *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraTargetBounds () -+ (FGMPlatformCameraTargetBounds *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraTargetBounds *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformGroundOverlay () -+ (FGMPlatformGroundOverlay *)fromList:(NSArray *)list; -+ (nullable FGMPlatformGroundOverlay *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformMapViewCreationParams () -+ (FGMPlatformMapViewCreationParams *)fromList:(NSArray *)list; -+ (nullable FGMPlatformMapViewCreationParams *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformMapConfiguration () -+ (FGMPlatformMapConfiguration *)fromList:(NSArray *)list; -+ (nullable FGMPlatformMapConfiguration *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformPoint () -+ (FGMPlatformPoint *)fromList:(NSArray *)list; -+ (nullable FGMPlatformPoint *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformSize () -+ (FGMPlatformSize *)fromList:(NSArray *)list; -+ (nullable FGMPlatformSize *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformColor () -+ (FGMPlatformColor *)fromList:(NSArray *)list; -+ (nullable FGMPlatformColor *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformTileLayer () -+ (FGMPlatformTileLayer *)fromList:(NSArray *)list; -+ (nullable FGMPlatformTileLayer *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformZoomRange () -+ (FGMPlatformZoomRange *)fromList:(NSArray *)list; -+ (nullable FGMPlatformZoomRange *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmap () -+ (FGMPlatformBitmap *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmap *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmapDefaultMarker () -+ (FGMPlatformBitmapDefaultMarker *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmapDefaultMarker *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmapBytes () -+ (FGMPlatformBitmapBytes *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmapBytes *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmapAsset () -+ (FGMPlatformBitmapAsset *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmapAsset *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmapAssetImage () -+ (FGMPlatformBitmapAssetImage *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmapAssetImage *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmapAssetMap () -+ (FGMPlatformBitmapAssetMap *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmapAssetMap *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmapBytesMap () -+ (FGMPlatformBitmapBytesMap *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmapBytesMap *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmapPinConfig () -+ (FGMPlatformBitmapPinConfig *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmapPinConfig *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@implementation FGMPlatformCameraPosition -+ (instancetype)makeWithBearing:(double)bearing - target:(FGMPlatformLatLng *)target - tilt:(double)tilt - zoom:(double)zoom { - FGMPlatformCameraPosition *pigeonResult = [[FGMPlatformCameraPosition alloc] init]; - pigeonResult.bearing = bearing; - pigeonResult.target = target; - pigeonResult.tilt = tilt; - pigeonResult.zoom = zoom; - return pigeonResult; -} -+ (FGMPlatformCameraPosition *)fromList:(NSArray *)list { - FGMPlatformCameraPosition *pigeonResult = [[FGMPlatformCameraPosition alloc] init]; - pigeonResult.bearing = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.target = GetNullableObjectAtIndex(list, 1); - pigeonResult.tilt = [GetNullableObjectAtIndex(list, 2) doubleValue]; - pigeonResult.zoom = [GetNullableObjectAtIndex(list, 3) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformCameraPosition *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraPosition fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.bearing), - self.target ?: [NSNull null], - @(self.tilt), - @(self.zoom), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraPosition *other = (FGMPlatformCameraPosition *)object; - return (self.bearing == other.bearing || (isnan(self.bearing) && isnan(other.bearing))) && - FLTPigeonDeepEquals(self.target, other.target) && - (self.tilt == other.tilt || (isnan(self.tilt) && isnan(other.tilt))) && - (self.zoom == other.zoom || (isnan(self.zoom) && isnan(other.zoom))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = - result * 31 + (isnan(self.bearing) ? (NSUInteger)0x7FF8000000000000 : @(self.bearing).hash); - result = result * 31 + FLTPigeonDeepHash(self.target); - result = result * 31 + (isnan(self.tilt) ? (NSUInteger)0x7FF8000000000000 : @(self.tilt).hash); - result = result * 31 + (isnan(self.zoom) ? (NSUInteger)0x7FF8000000000000 : @(self.zoom).hash); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformCameraPosition(bearing: %f, target: %@, tilt: %f, zoom: %f)", - self.bearing, self.target, self.tilt, self.zoom]; -} -@end - -@implementation FGMPlatformCameraUpdate -+ (instancetype)makeWithCameraUpdate:(id)cameraUpdate { - FGMPlatformCameraUpdate *pigeonResult = [[FGMPlatformCameraUpdate alloc] init]; - pigeonResult.cameraUpdate = cameraUpdate; - return pigeonResult; -} -+ (FGMPlatformCameraUpdate *)fromList:(NSArray *)list { - FGMPlatformCameraUpdate *pigeonResult = [[FGMPlatformCameraUpdate alloc] init]; - pigeonResult.cameraUpdate = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdate *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdate fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.cameraUpdate ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdate *other = (FGMPlatformCameraUpdate *)object; - return FLTPigeonDeepEquals(self.cameraUpdate, other.cameraUpdate); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.cameraUpdate); - return result; -} -- (NSString *)description { - return - [NSString stringWithFormat:@"FGMPlatformCameraUpdate(cameraUpdate: %@)", self.cameraUpdate]; -} -@end - -@implementation FGMPlatformCameraUpdateNewCameraPosition -+ (instancetype)makeWithCameraPosition:(FGMPlatformCameraPosition *)cameraPosition { - FGMPlatformCameraUpdateNewCameraPosition *pigeonResult = - [[FGMPlatformCameraUpdateNewCameraPosition alloc] init]; - pigeonResult.cameraPosition = cameraPosition; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateNewCameraPosition *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateNewCameraPosition *pigeonResult = - [[FGMPlatformCameraUpdateNewCameraPosition alloc] init]; - pigeonResult.cameraPosition = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateNewCameraPosition *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateNewCameraPosition fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.cameraPosition ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateNewCameraPosition *other = - (FGMPlatformCameraUpdateNewCameraPosition *)object; - return FLTPigeonDeepEquals(self.cameraPosition, other.cameraPosition); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.cameraPosition); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformCameraUpdateNewCameraPosition(cameraPosition: %@)", - self.cameraPosition]; -} -@end - -@implementation FGMPlatformCameraUpdateNewLatLng -+ (instancetype)makeWithLatLng:(FGMPlatformLatLng *)latLng { - FGMPlatformCameraUpdateNewLatLng *pigeonResult = [[FGMPlatformCameraUpdateNewLatLng alloc] init]; - pigeonResult.latLng = latLng; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateNewLatLng *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateNewLatLng *pigeonResult = [[FGMPlatformCameraUpdateNewLatLng alloc] init]; - pigeonResult.latLng = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateNewLatLng *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateNewLatLng fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.latLng ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateNewLatLng *other = (FGMPlatformCameraUpdateNewLatLng *)object; - return FLTPigeonDeepEquals(self.latLng, other.latLng); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.latLng); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformCameraUpdateNewLatLng(latLng: %@)", self.latLng]; -} -@end - -@implementation FGMPlatformCameraUpdateNewLatLngBounds -+ (instancetype)makeWithBounds:(FGMPlatformLatLngBounds *)bounds padding:(double)padding { - FGMPlatformCameraUpdateNewLatLngBounds *pigeonResult = - [[FGMPlatformCameraUpdateNewLatLngBounds alloc] init]; - pigeonResult.bounds = bounds; - pigeonResult.padding = padding; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateNewLatLngBounds *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateNewLatLngBounds *pigeonResult = - [[FGMPlatformCameraUpdateNewLatLngBounds alloc] init]; - pigeonResult.bounds = GetNullableObjectAtIndex(list, 0); - pigeonResult.padding = [GetNullableObjectAtIndex(list, 1) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateNewLatLngBounds *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateNewLatLngBounds fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.bounds ?: [NSNull null], - @(self.padding), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateNewLatLngBounds *other = (FGMPlatformCameraUpdateNewLatLngBounds *)object; - return FLTPigeonDeepEquals(self.bounds, other.bounds) && - (self.padding == other.padding || (isnan(self.padding) && isnan(other.padding))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.bounds); - result = - result * 31 + (isnan(self.padding) ? (NSUInteger)0x7FF8000000000000 : @(self.padding).hash); - return result; -} -- (NSString *)description { - return - [NSString stringWithFormat:@"FGMPlatformCameraUpdateNewLatLngBounds(bounds: %@, padding: %f)", - self.bounds, self.padding]; -} -@end - -@implementation FGMPlatformCameraUpdateNewLatLngZoom -+ (instancetype)makeWithLatLng:(FGMPlatformLatLng *)latLng zoom:(double)zoom { - FGMPlatformCameraUpdateNewLatLngZoom *pigeonResult = - [[FGMPlatformCameraUpdateNewLatLngZoom alloc] init]; - pigeonResult.latLng = latLng; - pigeonResult.zoom = zoom; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateNewLatLngZoom *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateNewLatLngZoom *pigeonResult = - [[FGMPlatformCameraUpdateNewLatLngZoom alloc] init]; - pigeonResult.latLng = GetNullableObjectAtIndex(list, 0); - pigeonResult.zoom = [GetNullableObjectAtIndex(list, 1) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateNewLatLngZoom *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateNewLatLngZoom fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.latLng ?: [NSNull null], - @(self.zoom), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateNewLatLngZoom *other = (FGMPlatformCameraUpdateNewLatLngZoom *)object; - return FLTPigeonDeepEquals(self.latLng, other.latLng) && - (self.zoom == other.zoom || (isnan(self.zoom) && isnan(other.zoom))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.latLng); - result = result * 31 + (isnan(self.zoom) ? (NSUInteger)0x7FF8000000000000 : @(self.zoom).hash); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformCameraUpdateNewLatLngZoom(latLng: %@, zoom: %f)", - self.latLng, self.zoom]; -} -@end - -@implementation FGMPlatformCameraUpdateScrollBy -+ (instancetype)makeWithDx:(double)dx dy:(double)dy { - FGMPlatformCameraUpdateScrollBy *pigeonResult = [[FGMPlatformCameraUpdateScrollBy alloc] init]; - pigeonResult.dx = dx; - pigeonResult.dy = dy; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateScrollBy *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateScrollBy *pigeonResult = [[FGMPlatformCameraUpdateScrollBy alloc] init]; - pigeonResult.dx = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.dy = [GetNullableObjectAtIndex(list, 1) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateScrollBy *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateScrollBy fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.dx), - @(self.dy), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateScrollBy *other = (FGMPlatformCameraUpdateScrollBy *)object; - return (self.dx == other.dx || (isnan(self.dx) && isnan(other.dx))) && - (self.dy == other.dy || (isnan(self.dy) && isnan(other.dy))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + (isnan(self.dx) ? (NSUInteger)0x7FF8000000000000 : @(self.dx).hash); - result = result * 31 + (isnan(self.dy) ? (NSUInteger)0x7FF8000000000000 : @(self.dy).hash); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformCameraUpdateScrollBy(dx: %f, dy: %f)", self.dx, self.dy]; -} -@end - -@implementation FGMPlatformCameraUpdateZoomBy -+ (instancetype)makeWithAmount:(double)amount focus:(nullable FGMPlatformPoint *)focus { - FGMPlatformCameraUpdateZoomBy *pigeonResult = [[FGMPlatformCameraUpdateZoomBy alloc] init]; - pigeonResult.amount = amount; - pigeonResult.focus = focus; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateZoomBy *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateZoomBy *pigeonResult = [[FGMPlatformCameraUpdateZoomBy alloc] init]; - pigeonResult.amount = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.focus = GetNullableObjectAtIndex(list, 1); - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateZoomBy *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateZoomBy fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.amount), - self.focus ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateZoomBy *other = (FGMPlatformCameraUpdateZoomBy *)object; - return (self.amount == other.amount || (isnan(self.amount) && isnan(other.amount))) && - FLTPigeonDeepEquals(self.focus, other.focus); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = - result * 31 + (isnan(self.amount) ? (NSUInteger)0x7FF8000000000000 : @(self.amount).hash); - result = result * 31 + FLTPigeonDeepHash(self.focus); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformCameraUpdateZoomBy(amount: %f, focus: %@)", - self.amount, self.focus]; -} -@end - -@implementation FGMPlatformCameraUpdateZoom -+ (instancetype)makeWithOut:(BOOL)out { - FGMPlatformCameraUpdateZoom *pigeonResult = [[FGMPlatformCameraUpdateZoom alloc] init]; - pigeonResult.out = out; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateZoom *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateZoom *pigeonResult = [[FGMPlatformCameraUpdateZoom alloc] init]; - pigeonResult.out = [GetNullableObjectAtIndex(list, 0) boolValue]; - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateZoom *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateZoom fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.out), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateZoom *other = (FGMPlatformCameraUpdateZoom *)object; - return self.out == other.out; -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + @(self.out).hash; - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformCameraUpdateZoom(out: %@)", self.out ? @"true" : @"false"]; -} -@end - -@implementation FGMPlatformCameraUpdateZoomTo -+ (instancetype)makeWithZoom:(double)zoom { - FGMPlatformCameraUpdateZoomTo *pigeonResult = [[FGMPlatformCameraUpdateZoomTo alloc] init]; - pigeonResult.zoom = zoom; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateZoomTo *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateZoomTo *pigeonResult = [[FGMPlatformCameraUpdateZoomTo alloc] init]; - pigeonResult.zoom = [GetNullableObjectAtIndex(list, 0) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateZoomTo *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateZoomTo fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.zoom), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateZoomTo *other = (FGMPlatformCameraUpdateZoomTo *)object; - return (self.zoom == other.zoom || (isnan(self.zoom) && isnan(other.zoom))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + (isnan(self.zoom) ? (NSUInteger)0x7FF8000000000000 : @(self.zoom).hash); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformCameraUpdateZoomTo(zoom: %f)", self.zoom]; -} -@end - -@implementation FGMPlatformCircle -+ (instancetype)makeWithConsumeTapEvents:(BOOL)consumeTapEvents - fillColor:(FGMPlatformColor *)fillColor - strokeColor:(FGMPlatformColor *)strokeColor - visible:(BOOL)visible - strokeWidth:(NSInteger)strokeWidth - zIndex:(double)zIndex - center:(FGMPlatformLatLng *)center - radius:(double)radius - circleId:(NSString *)circleId { - FGMPlatformCircle *pigeonResult = [[FGMPlatformCircle alloc] init]; - pigeonResult.consumeTapEvents = consumeTapEvents; - pigeonResult.fillColor = fillColor; - pigeonResult.strokeColor = strokeColor; - pigeonResult.visible = visible; - pigeonResult.strokeWidth = strokeWidth; - pigeonResult.zIndex = zIndex; - pigeonResult.center = center; - pigeonResult.radius = radius; - pigeonResult.circleId = circleId; - return pigeonResult; -} -+ (FGMPlatformCircle *)fromList:(NSArray *)list { - FGMPlatformCircle *pigeonResult = [[FGMPlatformCircle alloc] init]; - pigeonResult.consumeTapEvents = [GetNullableObjectAtIndex(list, 0) boolValue]; - pigeonResult.fillColor = GetNullableObjectAtIndex(list, 1); - pigeonResult.strokeColor = GetNullableObjectAtIndex(list, 2); - pigeonResult.visible = [GetNullableObjectAtIndex(list, 3) boolValue]; - pigeonResult.strokeWidth = [GetNullableObjectAtIndex(list, 4) integerValue]; - pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 5) doubleValue]; - pigeonResult.center = GetNullableObjectAtIndex(list, 6); - pigeonResult.radius = [GetNullableObjectAtIndex(list, 7) doubleValue]; - pigeonResult.circleId = GetNullableObjectAtIndex(list, 8); - return pigeonResult; -} -+ (nullable FGMPlatformCircle *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCircle fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.consumeTapEvents), - self.fillColor ?: [NSNull null], - self.strokeColor ?: [NSNull null], - @(self.visible), - @(self.strokeWidth), - @(self.zIndex), - self.center ?: [NSNull null], - @(self.radius), - self.circleId ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCircle *other = (FGMPlatformCircle *)object; - return self.consumeTapEvents == other.consumeTapEvents && - FLTPigeonDeepEquals(self.fillColor, other.fillColor) && - FLTPigeonDeepEquals(self.strokeColor, other.strokeColor) && - self.visible == other.visible && self.strokeWidth == other.strokeWidth && - (self.zIndex == other.zIndex || (isnan(self.zIndex) && isnan(other.zIndex))) && - FLTPigeonDeepEquals(self.center, other.center) && - (self.radius == other.radius || (isnan(self.radius) && isnan(other.radius))) && - FLTPigeonDeepEquals(self.circleId, other.circleId); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + @(self.consumeTapEvents).hash; - result = result * 31 + FLTPigeonDeepHash(self.fillColor); - result = result * 31 + FLTPigeonDeepHash(self.strokeColor); - result = result * 31 + @(self.visible).hash; - result = result * 31 + @(self.strokeWidth).hash; - result = - result * 31 + (isnan(self.zIndex) ? (NSUInteger)0x7FF8000000000000 : @(self.zIndex).hash); - result = result * 31 + FLTPigeonDeepHash(self.center); - result = - result * 31 + (isnan(self.radius) ? (NSUInteger)0x7FF8000000000000 : @(self.radius).hash); - result = result * 31 + FLTPigeonDeepHash(self.circleId); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat: - @"FGMPlatformCircle(consumeTapEvents: %@, fillColor: %@, strokeColor: %@, visible: %@, " - @"strokeWidth: %ld, zIndex: %f, center: %@, radius: %f, circleId: %@)", - self.consumeTapEvents ? @"true" : @"false", self.fillColor, self.strokeColor, - self.visible ? @"true" : @"false", (long)self.strokeWidth, self.zIndex, self.center, - self.radius, self.circleId]; -} -@end - -@implementation FGMPlatformHeatmap -+ (instancetype)makeWithHeatmapId:(NSString *)heatmapId - data:(NSArray *)data - gradient:(nullable FGMPlatformHeatmapGradient *)gradient - opacity:(double)opacity - radius:(NSInteger)radius - minimumZoomIntensity:(NSInteger)minimumZoomIntensity - maximumZoomIntensity:(NSInteger)maximumZoomIntensity { - FGMPlatformHeatmap *pigeonResult = [[FGMPlatformHeatmap alloc] init]; - pigeonResult.heatmapId = heatmapId; - pigeonResult.data = data; - pigeonResult.gradient = gradient; - pigeonResult.opacity = opacity; - pigeonResult.radius = radius; - pigeonResult.minimumZoomIntensity = minimumZoomIntensity; - pigeonResult.maximumZoomIntensity = maximumZoomIntensity; - return pigeonResult; -} -+ (FGMPlatformHeatmap *)fromList:(NSArray *)list { - FGMPlatformHeatmap *pigeonResult = [[FGMPlatformHeatmap alloc] init]; - pigeonResult.heatmapId = GetNullableObjectAtIndex(list, 0); - pigeonResult.data = GetNullableObjectAtIndex(list, 1); - pigeonResult.gradient = GetNullableObjectAtIndex(list, 2); - pigeonResult.opacity = [GetNullableObjectAtIndex(list, 3) doubleValue]; - pigeonResult.radius = [GetNullableObjectAtIndex(list, 4) integerValue]; - pigeonResult.minimumZoomIntensity = [GetNullableObjectAtIndex(list, 5) integerValue]; - pigeonResult.maximumZoomIntensity = [GetNullableObjectAtIndex(list, 6) integerValue]; - return pigeonResult; -} -+ (nullable FGMPlatformHeatmap *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformHeatmap fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.heatmapId ?: [NSNull null], - self.data ?: [NSNull null], - self.gradient ?: [NSNull null], - @(self.opacity), - @(self.radius), - @(self.minimumZoomIntensity), - @(self.maximumZoomIntensity), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformHeatmap *other = (FGMPlatformHeatmap *)object; - return FLTPigeonDeepEquals(self.heatmapId, other.heatmapId) && - FLTPigeonDeepEquals(self.data, other.data) && - FLTPigeonDeepEquals(self.gradient, other.gradient) && - (self.opacity == other.opacity || (isnan(self.opacity) && isnan(other.opacity))) && - self.radius == other.radius && self.minimumZoomIntensity == other.minimumZoomIntensity && - self.maximumZoomIntensity == other.maximumZoomIntensity; -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.heatmapId); - result = result * 31 + FLTPigeonDeepHash(self.data); - result = result * 31 + FLTPigeonDeepHash(self.gradient); - result = - result * 31 + (isnan(self.opacity) ? (NSUInteger)0x7FF8000000000000 : @(self.opacity).hash); - result = result * 31 + @(self.radius).hash; - result = result * 31 + @(self.minimumZoomIntensity).hash; - result = result * 31 + @(self.maximumZoomIntensity).hash; - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformHeatmap(heatmapId: %@, data: %@, gradient: %@, opacity: %f, " - @"radius: %ld, minimumZoomIntensity: %ld, maximumZoomIntensity: %ld)", - self.heatmapId, self.data, self.gradient, self.opacity, (long)self.radius, - (long)self.minimumZoomIntensity, (long)self.maximumZoomIntensity]; -} -@end - -@implementation FGMPlatformHeatmapGradient -+ (instancetype)makeWithColors:(NSArray *)colors - startPoints:(NSArray *)startPoints - colorMapSize:(NSInteger)colorMapSize { - FGMPlatformHeatmapGradient *pigeonResult = [[FGMPlatformHeatmapGradient alloc] init]; - pigeonResult.colors = colors; - pigeonResult.startPoints = startPoints; - pigeonResult.colorMapSize = colorMapSize; - return pigeonResult; -} -+ (FGMPlatformHeatmapGradient *)fromList:(NSArray *)list { - FGMPlatformHeatmapGradient *pigeonResult = [[FGMPlatformHeatmapGradient alloc] init]; - pigeonResult.colors = GetNullableObjectAtIndex(list, 0); - pigeonResult.startPoints = GetNullableObjectAtIndex(list, 1); - pigeonResult.colorMapSize = [GetNullableObjectAtIndex(list, 2) integerValue]; - return pigeonResult; -} -+ (nullable FGMPlatformHeatmapGradient *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformHeatmapGradient fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.colors ?: [NSNull null], - self.startPoints ?: [NSNull null], - @(self.colorMapSize), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformHeatmapGradient *other = (FGMPlatformHeatmapGradient *)object; - return FLTPigeonDeepEquals(self.colors, other.colors) && - FLTPigeonDeepEquals(self.startPoints, other.startPoints) && - self.colorMapSize == other.colorMapSize; -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.colors); - result = result * 31 + FLTPigeonDeepHash(self.startPoints); - result = result * 31 + @(self.colorMapSize).hash; - return result; -} -- (NSString *)description { - return - [NSString stringWithFormat: - @"FGMPlatformHeatmapGradient(colors: %@, startPoints: %@, colorMapSize: %ld)", - self.colors, self.startPoints, (long)self.colorMapSize]; -} -@end - -@implementation FGMPlatformWeightedLatLng -+ (instancetype)makeWithPoint:(FGMPlatformLatLng *)point weight:(double)weight { - FGMPlatformWeightedLatLng *pigeonResult = [[FGMPlatformWeightedLatLng alloc] init]; - pigeonResult.point = point; - pigeonResult.weight = weight; - return pigeonResult; -} -+ (FGMPlatformWeightedLatLng *)fromList:(NSArray *)list { - FGMPlatformWeightedLatLng *pigeonResult = [[FGMPlatformWeightedLatLng alloc] init]; - pigeonResult.point = GetNullableObjectAtIndex(list, 0); - pigeonResult.weight = [GetNullableObjectAtIndex(list, 1) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformWeightedLatLng *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformWeightedLatLng fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.point ?: [NSNull null], - @(self.weight), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformWeightedLatLng *other = (FGMPlatformWeightedLatLng *)object; - return FLTPigeonDeepEquals(self.point, other.point) && - (self.weight == other.weight || (isnan(self.weight) && isnan(other.weight))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.point); - result = - result * 31 + (isnan(self.weight) ? (NSUInteger)0x7FF8000000000000 : @(self.weight).hash); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformWeightedLatLng(point: %@, weight: %f)", self.point, - self.weight]; -} -@end - -@implementation FGMPlatformInfoWindow -+ (instancetype)makeWithTitle:(nullable NSString *)title - snippet:(nullable NSString *)snippet - anchor:(FGMPlatformPoint *)anchor { - FGMPlatformInfoWindow *pigeonResult = [[FGMPlatformInfoWindow alloc] init]; - pigeonResult.title = title; - pigeonResult.snippet = snippet; - pigeonResult.anchor = anchor; - return pigeonResult; -} -+ (FGMPlatformInfoWindow *)fromList:(NSArray *)list { - FGMPlatformInfoWindow *pigeonResult = [[FGMPlatformInfoWindow alloc] init]; - pigeonResult.title = GetNullableObjectAtIndex(list, 0); - pigeonResult.snippet = GetNullableObjectAtIndex(list, 1); - pigeonResult.anchor = GetNullableObjectAtIndex(list, 2); - return pigeonResult; -} -+ (nullable FGMPlatformInfoWindow *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformInfoWindow fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.title ?: [NSNull null], - self.snippet ?: [NSNull null], - self.anchor ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformInfoWindow *other = (FGMPlatformInfoWindow *)object; - return FLTPigeonDeepEquals(self.title, other.title) && - FLTPigeonDeepEquals(self.snippet, other.snippet) && - FLTPigeonDeepEquals(self.anchor, other.anchor); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.title); - result = result * 31 + FLTPigeonDeepHash(self.snippet); - result = result * 31 + FLTPigeonDeepHash(self.anchor); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformInfoWindow(title: %@, snippet: %@, anchor: %@)", - self.title, self.snippet, self.anchor]; -} -@end - -@implementation FGMPlatformCluster -+ (instancetype)makeWithClusterManagerId:(NSString *)clusterManagerId - position:(FGMPlatformLatLng *)position - bounds:(FGMPlatformLatLngBounds *)bounds - markerIds:(NSArray *)markerIds { - FGMPlatformCluster *pigeonResult = [[FGMPlatformCluster alloc] init]; - pigeonResult.clusterManagerId = clusterManagerId; - pigeonResult.position = position; - pigeonResult.bounds = bounds; - pigeonResult.markerIds = markerIds; - return pigeonResult; -} -+ (FGMPlatformCluster *)fromList:(NSArray *)list { - FGMPlatformCluster *pigeonResult = [[FGMPlatformCluster alloc] init]; - pigeonResult.clusterManagerId = GetNullableObjectAtIndex(list, 0); - pigeonResult.position = GetNullableObjectAtIndex(list, 1); - pigeonResult.bounds = GetNullableObjectAtIndex(list, 2); - pigeonResult.markerIds = GetNullableObjectAtIndex(list, 3); - return pigeonResult; -} -+ (nullable FGMPlatformCluster *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCluster fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.clusterManagerId ?: [NSNull null], - self.position ?: [NSNull null], - self.bounds ?: [NSNull null], - self.markerIds ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCluster *other = (FGMPlatformCluster *)object; - return FLTPigeonDeepEquals(self.clusterManagerId, other.clusterManagerId) && - FLTPigeonDeepEquals(self.position, other.position) && - FLTPigeonDeepEquals(self.bounds, other.bounds) && - FLTPigeonDeepEquals(self.markerIds, other.markerIds); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.clusterManagerId); - result = result * 31 + FLTPigeonDeepHash(self.position); - result = result * 31 + FLTPigeonDeepHash(self.bounds); - result = result * 31 + FLTPigeonDeepHash(self.markerIds); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat: - @"FGMPlatformCluster(clusterManagerId: %@, position: %@, bounds: %@, markerIds: %@)", - self.clusterManagerId, self.position, self.bounds, self.markerIds]; -} -@end - -@implementation FGMPlatformClusterManager -+ (instancetype)makeWithIdentifier:(NSString *)identifier { - FGMPlatformClusterManager *pigeonResult = [[FGMPlatformClusterManager alloc] init]; - pigeonResult.identifier = identifier; - return pigeonResult; -} -+ (FGMPlatformClusterManager *)fromList:(NSArray *)list { - FGMPlatformClusterManager *pigeonResult = [[FGMPlatformClusterManager alloc] init]; - pigeonResult.identifier = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FGMPlatformClusterManager *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformClusterManager fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.identifier ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformClusterManager *other = (FGMPlatformClusterManager *)object; - return FLTPigeonDeepEquals(self.identifier, other.identifier); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.identifier); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformClusterManager(identifier: %@)", self.identifier]; -} -@end - -@implementation FGMPlatformMarker -+ (instancetype)makeWithAlpha:(double)alpha - anchor:(FGMPlatformPoint *)anchor - consumeTapEvents:(BOOL)consumeTapEvents - draggable:(BOOL)draggable - flat:(BOOL)flat - icon:(FGMPlatformBitmap *)icon - infoWindow:(FGMPlatformInfoWindow *)infoWindow - position:(FGMPlatformLatLng *)position - rotation:(double)rotation - visible:(BOOL)visible - zIndex:(NSInteger)zIndex - markerId:(NSString *)markerId - clusterManagerId:(nullable NSString *)clusterManagerId - collisionBehavior:(nullable FGMPlatformMarkerCollisionBehaviorBox *)collisionBehavior { - FGMPlatformMarker *pigeonResult = [[FGMPlatformMarker alloc] init]; - pigeonResult.alpha = alpha; - pigeonResult.anchor = anchor; - pigeonResult.consumeTapEvents = consumeTapEvents; - pigeonResult.draggable = draggable; - pigeonResult.flat = flat; - pigeonResult.icon = icon; - pigeonResult.infoWindow = infoWindow; - pigeonResult.position = position; - pigeonResult.rotation = rotation; - pigeonResult.visible = visible; - pigeonResult.zIndex = zIndex; - pigeonResult.markerId = markerId; - pigeonResult.clusterManagerId = clusterManagerId; - pigeonResult.collisionBehavior = collisionBehavior; - return pigeonResult; -} -+ (FGMPlatformMarker *)fromList:(NSArray *)list { - FGMPlatformMarker *pigeonResult = [[FGMPlatformMarker alloc] init]; - pigeonResult.alpha = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.anchor = GetNullableObjectAtIndex(list, 1); - pigeonResult.consumeTapEvents = [GetNullableObjectAtIndex(list, 2) boolValue]; - pigeonResult.draggable = [GetNullableObjectAtIndex(list, 3) boolValue]; - pigeonResult.flat = [GetNullableObjectAtIndex(list, 4) boolValue]; - pigeonResult.icon = GetNullableObjectAtIndex(list, 5); - pigeonResult.infoWindow = GetNullableObjectAtIndex(list, 6); - pigeonResult.position = GetNullableObjectAtIndex(list, 7); - pigeonResult.rotation = [GetNullableObjectAtIndex(list, 8) doubleValue]; - pigeonResult.visible = [GetNullableObjectAtIndex(list, 9) boolValue]; - pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 10) integerValue]; - pigeonResult.markerId = GetNullableObjectAtIndex(list, 11); - pigeonResult.clusterManagerId = GetNullableObjectAtIndex(list, 12); - pigeonResult.collisionBehavior = GetNullableObjectAtIndex(list, 13); - return pigeonResult; -} -+ (nullable FGMPlatformMarker *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformMarker fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.alpha), - self.anchor ?: [NSNull null], - @(self.consumeTapEvents), - @(self.draggable), - @(self.flat), - self.icon ?: [NSNull null], - self.infoWindow ?: [NSNull null], - self.position ?: [NSNull null], - @(self.rotation), - @(self.visible), - @(self.zIndex), - self.markerId ?: [NSNull null], - self.clusterManagerId ?: [NSNull null], - self.collisionBehavior ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformMarker *other = (FGMPlatformMarker *)object; - return (self.alpha == other.alpha || (isnan(self.alpha) && isnan(other.alpha))) && - FLTPigeonDeepEquals(self.anchor, other.anchor) && - self.consumeTapEvents == other.consumeTapEvents && self.draggable == other.draggable && - self.flat == other.flat && FLTPigeonDeepEquals(self.icon, other.icon) && - FLTPigeonDeepEquals(self.infoWindow, other.infoWindow) && - FLTPigeonDeepEquals(self.position, other.position) && - (self.rotation == other.rotation || (isnan(self.rotation) && isnan(other.rotation))) && - self.visible == other.visible && self.zIndex == other.zIndex && - FLTPigeonDeepEquals(self.markerId, other.markerId) && - FLTPigeonDeepEquals(self.clusterManagerId, other.clusterManagerId) && - FLTPigeonDeepEquals(self.collisionBehavior, other.collisionBehavior); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + (isnan(self.alpha) ? (NSUInteger)0x7FF8000000000000 : @(self.alpha).hash); - result = result * 31 + FLTPigeonDeepHash(self.anchor); - result = result * 31 + @(self.consumeTapEvents).hash; - result = result * 31 + @(self.draggable).hash; - result = result * 31 + @(self.flat).hash; - result = result * 31 + FLTPigeonDeepHash(self.icon); - result = result * 31 + FLTPigeonDeepHash(self.infoWindow); - result = result * 31 + FLTPigeonDeepHash(self.position); - result = - result * 31 + (isnan(self.rotation) ? (NSUInteger)0x7FF8000000000000 : @(self.rotation).hash); - result = result * 31 + @(self.visible).hash; - result = result * 31 + @(self.zIndex).hash; - result = result * 31 + FLTPigeonDeepHash(self.markerId); - result = result * 31 + FLTPigeonDeepHash(self.clusterManagerId); - result = result * 31 + FLTPigeonDeepHash(self.collisionBehavior); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat: - @"FGMPlatformMarker(alpha: %f, anchor: %@, consumeTapEvents: %@, draggable: %@, flat: " - @"%@, icon: %@, infoWindow: %@, position: %@, rotation: %f, visible: %@, zIndex: %ld, " - @"markerId: %@, clusterManagerId: %@, collisionBehavior: %@)", - self.alpha, self.anchor, self.consumeTapEvents ? @"true" : @"false", - self.draggable ? @"true" : @"false", self.flat ? @"true" : @"false", self.icon, - self.infoWindow, self.position, self.rotation, self.visible ? @"true" : @"false", - (long)self.zIndex, self.markerId, self.clusterManagerId, self.collisionBehavior]; -} -@end - -@implementation FGMPlatformPolygon -+ (instancetype)makeWithPolygonId:(NSString *)polygonId - consumesTapEvents:(BOOL)consumesTapEvents - fillColor:(FGMPlatformColor *)fillColor - geodesic:(BOOL)geodesic - points:(NSArray *)points - holes:(NSArray *> *)holes - visible:(BOOL)visible - strokeColor:(FGMPlatformColor *)strokeColor - strokeWidth:(NSInteger)strokeWidth - zIndex:(NSInteger)zIndex { - FGMPlatformPolygon *pigeonResult = [[FGMPlatformPolygon alloc] init]; - pigeonResult.polygonId = polygonId; - pigeonResult.consumesTapEvents = consumesTapEvents; - pigeonResult.fillColor = fillColor; - pigeonResult.geodesic = geodesic; - pigeonResult.points = points; - pigeonResult.holes = holes; - pigeonResult.visible = visible; - pigeonResult.strokeColor = strokeColor; - pigeonResult.strokeWidth = strokeWidth; - pigeonResult.zIndex = zIndex; - return pigeonResult; -} -+ (FGMPlatformPolygon *)fromList:(NSArray *)list { - FGMPlatformPolygon *pigeonResult = [[FGMPlatformPolygon alloc] init]; - pigeonResult.polygonId = GetNullableObjectAtIndex(list, 0); - pigeonResult.consumesTapEvents = [GetNullableObjectAtIndex(list, 1) boolValue]; - pigeonResult.fillColor = GetNullableObjectAtIndex(list, 2); - pigeonResult.geodesic = [GetNullableObjectAtIndex(list, 3) boolValue]; - pigeonResult.points = GetNullableObjectAtIndex(list, 4); - pigeonResult.holes = GetNullableObjectAtIndex(list, 5); - pigeonResult.visible = [GetNullableObjectAtIndex(list, 6) boolValue]; - pigeonResult.strokeColor = GetNullableObjectAtIndex(list, 7); - pigeonResult.strokeWidth = [GetNullableObjectAtIndex(list, 8) integerValue]; - pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 9) integerValue]; - return pigeonResult; -} -+ (nullable FGMPlatformPolygon *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformPolygon fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.polygonId ?: [NSNull null], - @(self.consumesTapEvents), - self.fillColor ?: [NSNull null], - @(self.geodesic), - self.points ?: [NSNull null], - self.holes ?: [NSNull null], - @(self.visible), - self.strokeColor ?: [NSNull null], - @(self.strokeWidth), - @(self.zIndex), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformPolygon *other = (FGMPlatformPolygon *)object; - return FLTPigeonDeepEquals(self.polygonId, other.polygonId) && - self.consumesTapEvents == other.consumesTapEvents && - FLTPigeonDeepEquals(self.fillColor, other.fillColor) && self.geodesic == other.geodesic && - FLTPigeonDeepEquals(self.points, other.points) && - FLTPigeonDeepEquals(self.holes, other.holes) && self.visible == other.visible && - FLTPigeonDeepEquals(self.strokeColor, other.strokeColor) && - self.strokeWidth == other.strokeWidth && self.zIndex == other.zIndex; -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.polygonId); - result = result * 31 + @(self.consumesTapEvents).hash; - result = result * 31 + FLTPigeonDeepHash(self.fillColor); - result = result * 31 + @(self.geodesic).hash; - result = result * 31 + FLTPigeonDeepHash(self.points); - result = result * 31 + FLTPigeonDeepHash(self.holes); - result = result * 31 + @(self.visible).hash; - result = result * 31 + FLTPigeonDeepHash(self.strokeColor); - result = result * 31 + @(self.strokeWidth).hash; - result = result * 31 + @(self.zIndex).hash; - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat: - @"FGMPlatformPolygon(polygonId: %@, consumesTapEvents: %@, fillColor: %@, geodesic: %@, " - @"points: %@, holes: %@, visible: %@, strokeColor: %@, strokeWidth: %ld, zIndex: %ld)", - self.polygonId, self.consumesTapEvents ? @"true" : @"false", self.fillColor, - self.geodesic ? @"true" : @"false", self.points, self.holes, - self.visible ? @"true" : @"false", self.strokeColor, (long)self.strokeWidth, - (long)self.zIndex]; -} -@end - -@implementation FGMPlatformPolyline -+ (instancetype)makeWithPolylineId:(NSString *)polylineId - consumesTapEvents:(BOOL)consumesTapEvents - color:(FGMPlatformColor *)color - geodesic:(BOOL)geodesic - jointType:(FGMPlatformJointType)jointType - patterns:(NSArray *)patterns - points:(NSArray *)points - visible:(BOOL)visible - width:(NSInteger)width - zIndex:(NSInteger)zIndex { - FGMPlatformPolyline *pigeonResult = [[FGMPlatformPolyline alloc] init]; - pigeonResult.polylineId = polylineId; - pigeonResult.consumesTapEvents = consumesTapEvents; - pigeonResult.color = color; - pigeonResult.geodesic = geodesic; - pigeonResult.jointType = jointType; - pigeonResult.patterns = patterns; - pigeonResult.points = points; - pigeonResult.visible = visible; - pigeonResult.width = width; - pigeonResult.zIndex = zIndex; - return pigeonResult; -} -+ (FGMPlatformPolyline *)fromList:(NSArray *)list { - FGMPlatformPolyline *pigeonResult = [[FGMPlatformPolyline alloc] init]; - pigeonResult.polylineId = GetNullableObjectAtIndex(list, 0); - pigeonResult.consumesTapEvents = [GetNullableObjectAtIndex(list, 1) boolValue]; - pigeonResult.color = GetNullableObjectAtIndex(list, 2); - pigeonResult.geodesic = [GetNullableObjectAtIndex(list, 3) boolValue]; - FGMPlatformJointTypeBox *boxedFGMPlatformJointType = GetNullableObjectAtIndex(list, 4); - pigeonResult.jointType = boxedFGMPlatformJointType.value; - pigeonResult.patterns = GetNullableObjectAtIndex(list, 5); - pigeonResult.points = GetNullableObjectAtIndex(list, 6); - pigeonResult.visible = [GetNullableObjectAtIndex(list, 7) boolValue]; - pigeonResult.width = [GetNullableObjectAtIndex(list, 8) integerValue]; - pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 9) integerValue]; - return pigeonResult; -} -+ (nullable FGMPlatformPolyline *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformPolyline fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.polylineId ?: [NSNull null], - @(self.consumesTapEvents), - self.color ?: [NSNull null], - @(self.geodesic), - [[FGMPlatformJointTypeBox alloc] initWithValue:self.jointType], - self.patterns ?: [NSNull null], - self.points ?: [NSNull null], - @(self.visible), - @(self.width), - @(self.zIndex), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformPolyline *other = (FGMPlatformPolyline *)object; - return FLTPigeonDeepEquals(self.polylineId, other.polylineId) && - self.consumesTapEvents == other.consumesTapEvents && - FLTPigeonDeepEquals(self.color, other.color) && self.geodesic == other.geodesic && - self.jointType == other.jointType && FLTPigeonDeepEquals(self.patterns, other.patterns) && - FLTPigeonDeepEquals(self.points, other.points) && self.visible == other.visible && - self.width == other.width && self.zIndex == other.zIndex; -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.polylineId); - result = result * 31 + @(self.consumesTapEvents).hash; - result = result * 31 + FLTPigeonDeepHash(self.color); - result = result * 31 + @(self.geodesic).hash; - result = result * 31 + @(self.jointType).hash; - result = result * 31 + FLTPigeonDeepHash(self.patterns); - result = result * 31 + FLTPigeonDeepHash(self.points); - result = result * 31 + @(self.visible).hash; - result = result * 31 + @(self.width).hash; - result = result * 31 + @(self.zIndex).hash; - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat: - @"FGMPlatformPolyline(polylineId: %@, consumesTapEvents: %@, color: %@, geodesic: %@, " - @"jointType: %ld, patterns: %@, points: %@, visible: %@, width: %ld, zIndex: %ld)", - self.polylineId, self.consumesTapEvents ? @"true" : @"false", self.color, - self.geodesic ? @"true" : @"false", (long)self.jointType, self.patterns, self.points, - self.visible ? @"true" : @"false", (long)self.width, (long)self.zIndex]; -} -@end - -@implementation FGMPlatformPatternItem -+ (instancetype)makeWithType:(FGMPlatformPatternItemType)type length:(nullable NSNumber *)length { - FGMPlatformPatternItem *pigeonResult = [[FGMPlatformPatternItem alloc] init]; - pigeonResult.type = type; - pigeonResult.length = length; - return pigeonResult; -} -+ (FGMPlatformPatternItem *)fromList:(NSArray *)list { - FGMPlatformPatternItem *pigeonResult = [[FGMPlatformPatternItem alloc] init]; - FGMPlatformPatternItemTypeBox *boxedFGMPlatformPatternItemType = - GetNullableObjectAtIndex(list, 0); - pigeonResult.type = boxedFGMPlatformPatternItemType.value; - pigeonResult.length = GetNullableObjectAtIndex(list, 1); - return pigeonResult; -} -+ (nullable FGMPlatformPatternItem *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformPatternItem fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - [[FGMPlatformPatternItemTypeBox alloc] initWithValue:self.type], - self.length ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformPatternItem *other = (FGMPlatformPatternItem *)object; - return self.type == other.type && FLTPigeonDeepEquals(self.length, other.length); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + @(self.type).hash; - result = result * 31 + FLTPigeonDeepHash(self.length); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformPatternItem(type: %ld, length: %@)", - (long)self.type, self.length]; -} -@end - -@implementation FGMPlatformTile -+ (instancetype)makeWithWidth:(NSInteger)width - height:(NSInteger)height - data:(nullable FlutterStandardTypedData *)data { - FGMPlatformTile *pigeonResult = [[FGMPlatformTile alloc] init]; - pigeonResult.width = width; - pigeonResult.height = height; - pigeonResult.data = data; - return pigeonResult; -} -+ (FGMPlatformTile *)fromList:(NSArray *)list { - FGMPlatformTile *pigeonResult = [[FGMPlatformTile alloc] init]; - pigeonResult.width = [GetNullableObjectAtIndex(list, 0) integerValue]; - pigeonResult.height = [GetNullableObjectAtIndex(list, 1) integerValue]; - pigeonResult.data = GetNullableObjectAtIndex(list, 2); - return pigeonResult; -} -+ (nullable FGMPlatformTile *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformTile fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.width), - @(self.height), - self.data ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformTile *other = (FGMPlatformTile *)object; - return self.width == other.width && self.height == other.height && - FLTPigeonDeepEquals(self.data, other.data); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + @(self.width).hash; - result = result * 31 + @(self.height).hash; - result = result * 31 + FLTPigeonDeepHash(self.data); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformTile(width: %ld, height: %ld, data: %@)", - (long)self.width, (long)self.height, self.data]; -} -@end - -@implementation FGMPlatformTileOverlay -+ (instancetype)makeWithTileOverlayId:(NSString *)tileOverlayId - fadeIn:(BOOL)fadeIn - transparency:(double)transparency - zIndex:(NSInteger)zIndex - visible:(BOOL)visible - tileSize:(NSInteger)tileSize { - FGMPlatformTileOverlay *pigeonResult = [[FGMPlatformTileOverlay alloc] init]; - pigeonResult.tileOverlayId = tileOverlayId; - pigeonResult.fadeIn = fadeIn; - pigeonResult.transparency = transparency; - pigeonResult.zIndex = zIndex; - pigeonResult.visible = visible; - pigeonResult.tileSize = tileSize; - return pigeonResult; -} -+ (FGMPlatformTileOverlay *)fromList:(NSArray *)list { - FGMPlatformTileOverlay *pigeonResult = [[FGMPlatformTileOverlay alloc] init]; - pigeonResult.tileOverlayId = GetNullableObjectAtIndex(list, 0); - pigeonResult.fadeIn = [GetNullableObjectAtIndex(list, 1) boolValue]; - pigeonResult.transparency = [GetNullableObjectAtIndex(list, 2) doubleValue]; - pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 3) integerValue]; - pigeonResult.visible = [GetNullableObjectAtIndex(list, 4) boolValue]; - pigeonResult.tileSize = [GetNullableObjectAtIndex(list, 5) integerValue]; - return pigeonResult; -} -+ (nullable FGMPlatformTileOverlay *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformTileOverlay fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.tileOverlayId ?: [NSNull null], - @(self.fadeIn), - @(self.transparency), - @(self.zIndex), - @(self.visible), - @(self.tileSize), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformTileOverlay *other = (FGMPlatformTileOverlay *)object; - return FLTPigeonDeepEquals(self.tileOverlayId, other.tileOverlayId) && - self.fadeIn == other.fadeIn && - (self.transparency == other.transparency || - (isnan(self.transparency) && isnan(other.transparency))) && - self.zIndex == other.zIndex && self.visible == other.visible && - self.tileSize == other.tileSize; -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.tileOverlayId); - result = result * 31 + @(self.fadeIn).hash; - result = result * 31 + - (isnan(self.transparency) ? (NSUInteger)0x7FF8000000000000 : @(self.transparency).hash); - result = result * 31 + @(self.zIndex).hash; - result = result * 31 + @(self.visible).hash; - result = result * 31 + @(self.tileSize).hash; - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformTileOverlay(tileOverlayId: %@, fadeIn: %@, " - @"transparency: %f, zIndex: %ld, visible: %@, tileSize: %ld)", - self.tileOverlayId, self.fadeIn ? @"true" : @"false", - self.transparency, (long)self.zIndex, - self.visible ? @"true" : @"false", (long)self.tileSize]; -} -@end - -@implementation FGMPlatformEdgeInsets -+ (instancetype)makeWithTop:(double)top - bottom:(double)bottom - left:(double)left - right:(double)right { - FGMPlatformEdgeInsets *pigeonResult = [[FGMPlatformEdgeInsets alloc] init]; - pigeonResult.top = top; - pigeonResult.bottom = bottom; - pigeonResult.left = left; - pigeonResult.right = right; - return pigeonResult; -} -+ (FGMPlatformEdgeInsets *)fromList:(NSArray *)list { - FGMPlatformEdgeInsets *pigeonResult = [[FGMPlatformEdgeInsets alloc] init]; - pigeonResult.top = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.bottom = [GetNullableObjectAtIndex(list, 1) doubleValue]; - pigeonResult.left = [GetNullableObjectAtIndex(list, 2) doubleValue]; - pigeonResult.right = [GetNullableObjectAtIndex(list, 3) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformEdgeInsets *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformEdgeInsets fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.top), - @(self.bottom), - @(self.left), - @(self.right), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformEdgeInsets *other = (FGMPlatformEdgeInsets *)object; - return (self.top == other.top || (isnan(self.top) && isnan(other.top))) && - (self.bottom == other.bottom || (isnan(self.bottom) && isnan(other.bottom))) && - (self.left == other.left || (isnan(self.left) && isnan(other.left))) && - (self.right == other.right || (isnan(self.right) && isnan(other.right))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + (isnan(self.top) ? (NSUInteger)0x7FF8000000000000 : @(self.top).hash); - result = - result * 31 + (isnan(self.bottom) ? (NSUInteger)0x7FF8000000000000 : @(self.bottom).hash); - result = result * 31 + (isnan(self.left) ? (NSUInteger)0x7FF8000000000000 : @(self.left).hash); - result = result * 31 + (isnan(self.right) ? (NSUInteger)0x7FF8000000000000 : @(self.right).hash); - return result; -} -- (NSString *)description { - return - [NSString stringWithFormat:@"FGMPlatformEdgeInsets(top: %f, bottom: %f, left: %f, right: %f)", - self.top, self.bottom, self.left, self.right]; -} -@end - -@implementation FGMPlatformLatLng -+ (instancetype)makeWithLatitude:(double)latitude longitude:(double)longitude { - FGMPlatformLatLng *pigeonResult = [[FGMPlatformLatLng alloc] init]; - pigeonResult.latitude = latitude; - pigeonResult.longitude = longitude; - return pigeonResult; -} -+ (FGMPlatformLatLng *)fromList:(NSArray *)list { - FGMPlatformLatLng *pigeonResult = [[FGMPlatformLatLng alloc] init]; - pigeonResult.latitude = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.longitude = [GetNullableObjectAtIndex(list, 1) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformLatLng *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformLatLng fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.latitude), - @(self.longitude), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformLatLng *other = (FGMPlatformLatLng *)object; - return (self.latitude == other.latitude || (isnan(self.latitude) && isnan(other.latitude))) && - (self.longitude == other.longitude || (isnan(self.longitude) && isnan(other.longitude))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = - result * 31 + (isnan(self.latitude) ? (NSUInteger)0x7FF8000000000000 : @(self.latitude).hash); - result = result * 31 + - (isnan(self.longitude) ? (NSUInteger)0x7FF8000000000000 : @(self.longitude).hash); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformLatLng(latitude: %f, longitude: %f)", - self.latitude, self.longitude]; -} -@end - -@implementation FGMPlatformLatLngBounds -+ (instancetype)makeWithNortheast:(FGMPlatformLatLng *)northeast - southwest:(FGMPlatformLatLng *)southwest { - FGMPlatformLatLngBounds *pigeonResult = [[FGMPlatformLatLngBounds alloc] init]; - pigeonResult.northeast = northeast; - pigeonResult.southwest = southwest; - return pigeonResult; -} -+ (FGMPlatformLatLngBounds *)fromList:(NSArray *)list { - FGMPlatformLatLngBounds *pigeonResult = [[FGMPlatformLatLngBounds alloc] init]; - pigeonResult.northeast = GetNullableObjectAtIndex(list, 0); - pigeonResult.southwest = GetNullableObjectAtIndex(list, 1); - return pigeonResult; -} -+ (nullable FGMPlatformLatLngBounds *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformLatLngBounds fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.northeast ?: [NSNull null], - self.southwest ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformLatLngBounds *other = (FGMPlatformLatLngBounds *)object; - return FLTPigeonDeepEquals(self.northeast, other.northeast) && - FLTPigeonDeepEquals(self.southwest, other.southwest); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.northeast); - result = result * 31 + FLTPigeonDeepHash(self.southwest); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformLatLngBounds(northeast: %@, southwest: %@)", - self.northeast, self.southwest]; -} -@end - -@implementation FGMPlatformCameraTargetBounds -+ (instancetype)makeWithBounds:(nullable FGMPlatformLatLngBounds *)bounds { - FGMPlatformCameraTargetBounds *pigeonResult = [[FGMPlatformCameraTargetBounds alloc] init]; - pigeonResult.bounds = bounds; - return pigeonResult; -} -+ (FGMPlatformCameraTargetBounds *)fromList:(NSArray *)list { - FGMPlatformCameraTargetBounds *pigeonResult = [[FGMPlatformCameraTargetBounds alloc] init]; - pigeonResult.bounds = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FGMPlatformCameraTargetBounds *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraTargetBounds fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.bounds ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraTargetBounds *other = (FGMPlatformCameraTargetBounds *)object; - return FLTPigeonDeepEquals(self.bounds, other.bounds); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.bounds); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformCameraTargetBounds(bounds: %@)", self.bounds]; -} -@end - -@implementation FGMPlatformGroundOverlay -+ (instancetype)makeWithGroundOverlayId:(NSString *)groundOverlayId - image:(FGMPlatformBitmap *)image - position:(nullable FGMPlatformLatLng *)position - bounds:(nullable FGMPlatformLatLngBounds *)bounds - anchor:(nullable FGMPlatformPoint *)anchor - transparency:(double)transparency - bearing:(double)bearing - zIndex:(NSInteger)zIndex - visible:(BOOL)visible - clickable:(BOOL)clickable - zoomLevel:(nullable NSNumber *)zoomLevel { - FGMPlatformGroundOverlay *pigeonResult = [[FGMPlatformGroundOverlay alloc] init]; - pigeonResult.groundOverlayId = groundOverlayId; - pigeonResult.image = image; - pigeonResult.position = position; - pigeonResult.bounds = bounds; - pigeonResult.anchor = anchor; - pigeonResult.transparency = transparency; - pigeonResult.bearing = bearing; - pigeonResult.zIndex = zIndex; - pigeonResult.visible = visible; - pigeonResult.clickable = clickable; - pigeonResult.zoomLevel = zoomLevel; - return pigeonResult; -} -+ (FGMPlatformGroundOverlay *)fromList:(NSArray *)list { - FGMPlatformGroundOverlay *pigeonResult = [[FGMPlatformGroundOverlay alloc] init]; - pigeonResult.groundOverlayId = GetNullableObjectAtIndex(list, 0); - pigeonResult.image = GetNullableObjectAtIndex(list, 1); - pigeonResult.position = GetNullableObjectAtIndex(list, 2); - pigeonResult.bounds = GetNullableObjectAtIndex(list, 3); - pigeonResult.anchor = GetNullableObjectAtIndex(list, 4); - pigeonResult.transparency = [GetNullableObjectAtIndex(list, 5) doubleValue]; - pigeonResult.bearing = [GetNullableObjectAtIndex(list, 6) doubleValue]; - pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 7) integerValue]; - pigeonResult.visible = [GetNullableObjectAtIndex(list, 8) boolValue]; - pigeonResult.clickable = [GetNullableObjectAtIndex(list, 9) boolValue]; - pigeonResult.zoomLevel = GetNullableObjectAtIndex(list, 10); - return pigeonResult; -} -+ (nullable FGMPlatformGroundOverlay *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformGroundOverlay fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.groundOverlayId ?: [NSNull null], - self.image ?: [NSNull null], - self.position ?: [NSNull null], - self.bounds ?: [NSNull null], - self.anchor ?: [NSNull null], - @(self.transparency), - @(self.bearing), - @(self.zIndex), - @(self.visible), - @(self.clickable), - self.zoomLevel ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformGroundOverlay *other = (FGMPlatformGroundOverlay *)object; - return FLTPigeonDeepEquals(self.groundOverlayId, other.groundOverlayId) && - FLTPigeonDeepEquals(self.image, other.image) && - FLTPigeonDeepEquals(self.position, other.position) && - FLTPigeonDeepEquals(self.bounds, other.bounds) && - FLTPigeonDeepEquals(self.anchor, other.anchor) && - (self.transparency == other.transparency || - (isnan(self.transparency) && isnan(other.transparency))) && - (self.bearing == other.bearing || (isnan(self.bearing) && isnan(other.bearing))) && - self.zIndex == other.zIndex && self.visible == other.visible && - self.clickable == other.clickable && FLTPigeonDeepEquals(self.zoomLevel, other.zoomLevel); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.groundOverlayId); - result = result * 31 + FLTPigeonDeepHash(self.image); - result = result * 31 + FLTPigeonDeepHash(self.position); - result = result * 31 + FLTPigeonDeepHash(self.bounds); - result = result * 31 + FLTPigeonDeepHash(self.anchor); - result = result * 31 + - (isnan(self.transparency) ? (NSUInteger)0x7FF8000000000000 : @(self.transparency).hash); - result = - result * 31 + (isnan(self.bearing) ? (NSUInteger)0x7FF8000000000000 : @(self.bearing).hash); - result = result * 31 + @(self.zIndex).hash; - result = result * 31 + @(self.visible).hash; - result = result * 31 + @(self.clickable).hash; - result = result * 31 + FLTPigeonDeepHash(self.zoomLevel); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformGroundOverlay(groundOverlayId: %@, image: %@, position: %@, " - @"bounds: %@, anchor: %@, transparency: %f, bearing: %f, zIndex: %ld, " - @"visible: %@, clickable: %@, zoomLevel: %@)", - self.groundOverlayId, self.image, self.position, self.bounds, self.anchor, - self.transparency, self.bearing, (long)self.zIndex, - self.visible ? @"true" : @"false", self.clickable ? @"true" : @"false", - self.zoomLevel]; -} -@end - -@implementation FGMPlatformMapViewCreationParams -+ (instancetype) - makeWithInitialCameraPosition:(FGMPlatformCameraPosition *)initialCameraPosition - mapConfiguration:(FGMPlatformMapConfiguration *)mapConfiguration - initialCircles:(NSArray *)initialCircles - initialMarkers:(NSArray *)initialMarkers - initialPolygons:(NSArray *)initialPolygons - initialPolylines:(NSArray *)initialPolylines - initialHeatmaps:(NSArray *)initialHeatmaps - initialTileOverlays:(NSArray *)initialTileOverlays - initialClusterManagers:(NSArray *)initialClusterManagers - initialGroundOverlays:(NSArray *)initialGroundOverlays { - FGMPlatformMapViewCreationParams *pigeonResult = [[FGMPlatformMapViewCreationParams alloc] init]; - pigeonResult.initialCameraPosition = initialCameraPosition; - pigeonResult.mapConfiguration = mapConfiguration; - pigeonResult.initialCircles = initialCircles; - pigeonResult.initialMarkers = initialMarkers; - pigeonResult.initialPolygons = initialPolygons; - pigeonResult.initialPolylines = initialPolylines; - pigeonResult.initialHeatmaps = initialHeatmaps; - pigeonResult.initialTileOverlays = initialTileOverlays; - pigeonResult.initialClusterManagers = initialClusterManagers; - pigeonResult.initialGroundOverlays = initialGroundOverlays; - return pigeonResult; -} -+ (FGMPlatformMapViewCreationParams *)fromList:(NSArray *)list { - FGMPlatformMapViewCreationParams *pigeonResult = [[FGMPlatformMapViewCreationParams alloc] init]; - pigeonResult.initialCameraPosition = GetNullableObjectAtIndex(list, 0); - pigeonResult.mapConfiguration = GetNullableObjectAtIndex(list, 1); - pigeonResult.initialCircles = GetNullableObjectAtIndex(list, 2); - pigeonResult.initialMarkers = GetNullableObjectAtIndex(list, 3); - pigeonResult.initialPolygons = GetNullableObjectAtIndex(list, 4); - pigeonResult.initialPolylines = GetNullableObjectAtIndex(list, 5); - pigeonResult.initialHeatmaps = GetNullableObjectAtIndex(list, 6); - pigeonResult.initialTileOverlays = GetNullableObjectAtIndex(list, 7); - pigeonResult.initialClusterManagers = GetNullableObjectAtIndex(list, 8); - pigeonResult.initialGroundOverlays = GetNullableObjectAtIndex(list, 9); - return pigeonResult; -} -+ (nullable FGMPlatformMapViewCreationParams *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformMapViewCreationParams fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.initialCameraPosition ?: [NSNull null], - self.mapConfiguration ?: [NSNull null], - self.initialCircles ?: [NSNull null], - self.initialMarkers ?: [NSNull null], - self.initialPolygons ?: [NSNull null], - self.initialPolylines ?: [NSNull null], - self.initialHeatmaps ?: [NSNull null], - self.initialTileOverlays ?: [NSNull null], - self.initialClusterManagers ?: [NSNull null], - self.initialGroundOverlays ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformMapViewCreationParams *other = (FGMPlatformMapViewCreationParams *)object; - return FLTPigeonDeepEquals(self.initialCameraPosition, other.initialCameraPosition) && - FLTPigeonDeepEquals(self.mapConfiguration, other.mapConfiguration) && - FLTPigeonDeepEquals(self.initialCircles, other.initialCircles) && - FLTPigeonDeepEquals(self.initialMarkers, other.initialMarkers) && - FLTPigeonDeepEquals(self.initialPolygons, other.initialPolygons) && - FLTPigeonDeepEquals(self.initialPolylines, other.initialPolylines) && - FLTPigeonDeepEquals(self.initialHeatmaps, other.initialHeatmaps) && - FLTPigeonDeepEquals(self.initialTileOverlays, other.initialTileOverlays) && - FLTPigeonDeepEquals(self.initialClusterManagers, other.initialClusterManagers) && - FLTPigeonDeepEquals(self.initialGroundOverlays, other.initialGroundOverlays); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.initialCameraPosition); - result = result * 31 + FLTPigeonDeepHash(self.mapConfiguration); - result = result * 31 + FLTPigeonDeepHash(self.initialCircles); - result = result * 31 + FLTPigeonDeepHash(self.initialMarkers); - result = result * 31 + FLTPigeonDeepHash(self.initialPolygons); - result = result * 31 + FLTPigeonDeepHash(self.initialPolylines); - result = result * 31 + FLTPigeonDeepHash(self.initialHeatmaps); - result = result * 31 + FLTPigeonDeepHash(self.initialTileOverlays); - result = result * 31 + FLTPigeonDeepHash(self.initialClusterManagers); - result = result * 31 + FLTPigeonDeepHash(self.initialGroundOverlays); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat: - @"FGMPlatformMapViewCreationParams(initialCameraPosition: %@, mapConfiguration: %@, " - @"initialCircles: %@, initialMarkers: %@, initialPolygons: %@, initialPolylines: %@, " - @"initialHeatmaps: %@, initialTileOverlays: %@, initialClusterManagers: %@, " - @"initialGroundOverlays: %@)", - self.initialCameraPosition, self.mapConfiguration, self.initialCircles, - self.initialMarkers, self.initialPolygons, self.initialPolylines, self.initialHeatmaps, - self.initialTileOverlays, self.initialClusterManagers, self.initialGroundOverlays]; -} -@end - -@implementation FGMPlatformMapConfiguration -+ (instancetype)makeWithCompassEnabled:(nullable NSNumber *)compassEnabled - cameraTargetBounds:(nullable FGMPlatformCameraTargetBounds *)cameraTargetBounds - mapType:(nullable FGMPlatformMapTypeBox *)mapType - minMaxZoomPreference:(nullable FGMPlatformZoomRange *)minMaxZoomPreference - rotateGesturesEnabled:(nullable NSNumber *)rotateGesturesEnabled - scrollGesturesEnabled:(nullable NSNumber *)scrollGesturesEnabled - tiltGesturesEnabled:(nullable NSNumber *)tiltGesturesEnabled - trackCameraPosition:(nullable NSNumber *)trackCameraPosition - zoomGesturesEnabled:(nullable NSNumber *)zoomGesturesEnabled - myLocationEnabled:(nullable NSNumber *)myLocationEnabled - myLocationButtonEnabled:(nullable NSNumber *)myLocationButtonEnabled - padding:(nullable FGMPlatformEdgeInsets *)padding - indoorViewEnabled:(nullable NSNumber *)indoorViewEnabled - trafficEnabled:(nullable NSNumber *)trafficEnabled - buildingsEnabled:(nullable NSNumber *)buildingsEnabled - markerType:(FGMPlatformMarkerType)markerType - mapId:(nullable NSString *)mapId - style:(nullable NSString *)style { - FGMPlatformMapConfiguration *pigeonResult = [[FGMPlatformMapConfiguration alloc] init]; - pigeonResult.compassEnabled = compassEnabled; - pigeonResult.cameraTargetBounds = cameraTargetBounds; - pigeonResult.mapType = mapType; - pigeonResult.minMaxZoomPreference = minMaxZoomPreference; - pigeonResult.rotateGesturesEnabled = rotateGesturesEnabled; - pigeonResult.scrollGesturesEnabled = scrollGesturesEnabled; - pigeonResult.tiltGesturesEnabled = tiltGesturesEnabled; - pigeonResult.trackCameraPosition = trackCameraPosition; - pigeonResult.zoomGesturesEnabled = zoomGesturesEnabled; - pigeonResult.myLocationEnabled = myLocationEnabled; - pigeonResult.myLocationButtonEnabled = myLocationButtonEnabled; - pigeonResult.padding = padding; - pigeonResult.indoorViewEnabled = indoorViewEnabled; - pigeonResult.trafficEnabled = trafficEnabled; - pigeonResult.buildingsEnabled = buildingsEnabled; - pigeonResult.markerType = markerType; - pigeonResult.mapId = mapId; - pigeonResult.style = style; - return pigeonResult; -} -+ (FGMPlatformMapConfiguration *)fromList:(NSArray *)list { - FGMPlatformMapConfiguration *pigeonResult = [[FGMPlatformMapConfiguration alloc] init]; - pigeonResult.compassEnabled = GetNullableObjectAtIndex(list, 0); - pigeonResult.cameraTargetBounds = GetNullableObjectAtIndex(list, 1); - pigeonResult.mapType = GetNullableObjectAtIndex(list, 2); - pigeonResult.minMaxZoomPreference = GetNullableObjectAtIndex(list, 3); - pigeonResult.rotateGesturesEnabled = GetNullableObjectAtIndex(list, 4); - pigeonResult.scrollGesturesEnabled = GetNullableObjectAtIndex(list, 5); - pigeonResult.tiltGesturesEnabled = GetNullableObjectAtIndex(list, 6); - pigeonResult.trackCameraPosition = GetNullableObjectAtIndex(list, 7); - pigeonResult.zoomGesturesEnabled = GetNullableObjectAtIndex(list, 8); - pigeonResult.myLocationEnabled = GetNullableObjectAtIndex(list, 9); - pigeonResult.myLocationButtonEnabled = GetNullableObjectAtIndex(list, 10); - pigeonResult.padding = GetNullableObjectAtIndex(list, 11); - pigeonResult.indoorViewEnabled = GetNullableObjectAtIndex(list, 12); - pigeonResult.trafficEnabled = GetNullableObjectAtIndex(list, 13); - pigeonResult.buildingsEnabled = GetNullableObjectAtIndex(list, 14); - FGMPlatformMarkerTypeBox *boxedFGMPlatformMarkerType = GetNullableObjectAtIndex(list, 15); - pigeonResult.markerType = boxedFGMPlatformMarkerType.value; - pigeonResult.mapId = GetNullableObjectAtIndex(list, 16); - pigeonResult.style = GetNullableObjectAtIndex(list, 17); - return pigeonResult; -} -+ (nullable FGMPlatformMapConfiguration *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformMapConfiguration fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.compassEnabled ?: [NSNull null], - self.cameraTargetBounds ?: [NSNull null], - self.mapType ?: [NSNull null], - self.minMaxZoomPreference ?: [NSNull null], - self.rotateGesturesEnabled ?: [NSNull null], - self.scrollGesturesEnabled ?: [NSNull null], - self.tiltGesturesEnabled ?: [NSNull null], - self.trackCameraPosition ?: [NSNull null], - self.zoomGesturesEnabled ?: [NSNull null], - self.myLocationEnabled ?: [NSNull null], - self.myLocationButtonEnabled ?: [NSNull null], - self.padding ?: [NSNull null], - self.indoorViewEnabled ?: [NSNull null], - self.trafficEnabled ?: [NSNull null], - self.buildingsEnabled ?: [NSNull null], - [[FGMPlatformMarkerTypeBox alloc] initWithValue:self.markerType], - self.mapId ?: [NSNull null], - self.style ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformMapConfiguration *other = (FGMPlatformMapConfiguration *)object; - return FLTPigeonDeepEquals(self.compassEnabled, other.compassEnabled) && - FLTPigeonDeepEquals(self.cameraTargetBounds, other.cameraTargetBounds) && - FLTPigeonDeepEquals(self.mapType, other.mapType) && - FLTPigeonDeepEquals(self.minMaxZoomPreference, other.minMaxZoomPreference) && - FLTPigeonDeepEquals(self.rotateGesturesEnabled, other.rotateGesturesEnabled) && - FLTPigeonDeepEquals(self.scrollGesturesEnabled, other.scrollGesturesEnabled) && - FLTPigeonDeepEquals(self.tiltGesturesEnabled, other.tiltGesturesEnabled) && - FLTPigeonDeepEquals(self.trackCameraPosition, other.trackCameraPosition) && - FLTPigeonDeepEquals(self.zoomGesturesEnabled, other.zoomGesturesEnabled) && - FLTPigeonDeepEquals(self.myLocationEnabled, other.myLocationEnabled) && - FLTPigeonDeepEquals(self.myLocationButtonEnabled, other.myLocationButtonEnabled) && - FLTPigeonDeepEquals(self.padding, other.padding) && - FLTPigeonDeepEquals(self.indoorViewEnabled, other.indoorViewEnabled) && - FLTPigeonDeepEquals(self.trafficEnabled, other.trafficEnabled) && - FLTPigeonDeepEquals(self.buildingsEnabled, other.buildingsEnabled) && - self.markerType == other.markerType && FLTPigeonDeepEquals(self.mapId, other.mapId) && - FLTPigeonDeepEquals(self.style, other.style); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.compassEnabled); - result = result * 31 + FLTPigeonDeepHash(self.cameraTargetBounds); - result = result * 31 + FLTPigeonDeepHash(self.mapType); - result = result * 31 + FLTPigeonDeepHash(self.minMaxZoomPreference); - result = result * 31 + FLTPigeonDeepHash(self.rotateGesturesEnabled); - result = result * 31 + FLTPigeonDeepHash(self.scrollGesturesEnabled); - result = result * 31 + FLTPigeonDeepHash(self.tiltGesturesEnabled); - result = result * 31 + FLTPigeonDeepHash(self.trackCameraPosition); - result = result * 31 + FLTPigeonDeepHash(self.zoomGesturesEnabled); - result = result * 31 + FLTPigeonDeepHash(self.myLocationEnabled); - result = result * 31 + FLTPigeonDeepHash(self.myLocationButtonEnabled); - result = result * 31 + FLTPigeonDeepHash(self.padding); - result = result * 31 + FLTPigeonDeepHash(self.indoorViewEnabled); - result = result * 31 + FLTPigeonDeepHash(self.trafficEnabled); - result = result * 31 + FLTPigeonDeepHash(self.buildingsEnabled); - result = result * 31 + @(self.markerType).hash; - result = result * 31 + FLTPigeonDeepHash(self.mapId); - result = result * 31 + FLTPigeonDeepHash(self.style); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat: - @"FGMPlatformMapConfiguration(compassEnabled: %@, cameraTargetBounds: %@, mapType: %@, " - @"minMaxZoomPreference: %@, rotateGesturesEnabled: %@, scrollGesturesEnabled: %@, " - @"tiltGesturesEnabled: %@, trackCameraPosition: %@, zoomGesturesEnabled: %@, " - @"myLocationEnabled: %@, myLocationButtonEnabled: %@, padding: %@, indoorViewEnabled: " - @"%@, trafficEnabled: %@, buildingsEnabled: %@, markerType: %ld, mapId: %@, style: %@)", - self.compassEnabled, self.cameraTargetBounds, self.mapType, self.minMaxZoomPreference, - self.rotateGesturesEnabled, self.scrollGesturesEnabled, self.tiltGesturesEnabled, - self.trackCameraPosition, self.zoomGesturesEnabled, self.myLocationEnabled, - self.myLocationButtonEnabled, self.padding, self.indoorViewEnabled, self.trafficEnabled, - self.buildingsEnabled, (long)self.markerType, self.mapId, self.style]; -} -@end - -@implementation FGMPlatformPoint -+ (instancetype)makeWithX:(double)x y:(double)y { - FGMPlatformPoint *pigeonResult = [[FGMPlatformPoint alloc] init]; - pigeonResult.x = x; - pigeonResult.y = y; - return pigeonResult; -} -+ (FGMPlatformPoint *)fromList:(NSArray *)list { - FGMPlatformPoint *pigeonResult = [[FGMPlatformPoint alloc] init]; - pigeonResult.x = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.y = [GetNullableObjectAtIndex(list, 1) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformPoint *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformPoint fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.x), - @(self.y), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformPoint *other = (FGMPlatformPoint *)object; - return (self.x == other.x || (isnan(self.x) && isnan(other.x))) && - (self.y == other.y || (isnan(self.y) && isnan(other.y))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + (isnan(self.x) ? (NSUInteger)0x7FF8000000000000 : @(self.x).hash); - result = result * 31 + (isnan(self.y) ? (NSUInteger)0x7FF8000000000000 : @(self.y).hash); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformPoint(x: %f, y: %f)", self.x, self.y]; -} -@end - -@implementation FGMPlatformSize -+ (instancetype)makeWithWidth:(double)width height:(double)height { - FGMPlatformSize *pigeonResult = [[FGMPlatformSize alloc] init]; - pigeonResult.width = width; - pigeonResult.height = height; - return pigeonResult; -} -+ (FGMPlatformSize *)fromList:(NSArray *)list { - FGMPlatformSize *pigeonResult = [[FGMPlatformSize alloc] init]; - pigeonResult.width = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.height = [GetNullableObjectAtIndex(list, 1) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformSize *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformSize fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.width), - @(self.height), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformSize *other = (FGMPlatformSize *)object; - return (self.width == other.width || (isnan(self.width) && isnan(other.width))) && - (self.height == other.height || (isnan(self.height) && isnan(other.height))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + (isnan(self.width) ? (NSUInteger)0x7FF8000000000000 : @(self.width).hash); - result = - result * 31 + (isnan(self.height) ? (NSUInteger)0x7FF8000000000000 : @(self.height).hash); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformSize(width: %f, height: %f)", self.width, self.height]; -} -@end - -@implementation FGMPlatformColor -+ (instancetype)makeWithRed:(double)red green:(double)green blue:(double)blue alpha:(double)alpha { - FGMPlatformColor *pigeonResult = [[FGMPlatformColor alloc] init]; - pigeonResult.red = red; - pigeonResult.green = green; - pigeonResult.blue = blue; - pigeonResult.alpha = alpha; - return pigeonResult; -} -+ (FGMPlatformColor *)fromList:(NSArray *)list { - FGMPlatformColor *pigeonResult = [[FGMPlatformColor alloc] init]; - pigeonResult.red = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.green = [GetNullableObjectAtIndex(list, 1) doubleValue]; - pigeonResult.blue = [GetNullableObjectAtIndex(list, 2) doubleValue]; - pigeonResult.alpha = [GetNullableObjectAtIndex(list, 3) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformColor *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformColor fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.red), - @(self.green), - @(self.blue), - @(self.alpha), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformColor *other = (FGMPlatformColor *)object; - return (self.red == other.red || (isnan(self.red) && isnan(other.red))) && - (self.green == other.green || (isnan(self.green) && isnan(other.green))) && - (self.blue == other.blue || (isnan(self.blue) && isnan(other.blue))) && - (self.alpha == other.alpha || (isnan(self.alpha) && isnan(other.alpha))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + (isnan(self.red) ? (NSUInteger)0x7FF8000000000000 : @(self.red).hash); - result = result * 31 + (isnan(self.green) ? (NSUInteger)0x7FF8000000000000 : @(self.green).hash); - result = result * 31 + (isnan(self.blue) ? (NSUInteger)0x7FF8000000000000 : @(self.blue).hash); - result = result * 31 + (isnan(self.alpha) ? (NSUInteger)0x7FF8000000000000 : @(self.alpha).hash); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformColor(red: %f, green: %f, blue: %f, alpha: %f)", - self.red, self.green, self.blue, self.alpha]; -} -@end - -@implementation FGMPlatformTileLayer -+ (instancetype)makeWithVisible:(BOOL)visible - fadeIn:(BOOL)fadeIn - opacity:(double)opacity - zIndex:(NSInteger)zIndex { - FGMPlatformTileLayer *pigeonResult = [[FGMPlatformTileLayer alloc] init]; - pigeonResult.visible = visible; - pigeonResult.fadeIn = fadeIn; - pigeonResult.opacity = opacity; - pigeonResult.zIndex = zIndex; - return pigeonResult; -} -+ (FGMPlatformTileLayer *)fromList:(NSArray *)list { - FGMPlatformTileLayer *pigeonResult = [[FGMPlatformTileLayer alloc] init]; - pigeonResult.visible = [GetNullableObjectAtIndex(list, 0) boolValue]; - pigeonResult.fadeIn = [GetNullableObjectAtIndex(list, 1) boolValue]; - pigeonResult.opacity = [GetNullableObjectAtIndex(list, 2) doubleValue]; - pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 3) integerValue]; - return pigeonResult; -} -+ (nullable FGMPlatformTileLayer *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformTileLayer fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.visible), - @(self.fadeIn), - @(self.opacity), - @(self.zIndex), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformTileLayer *other = (FGMPlatformTileLayer *)object; - return self.visible == other.visible && self.fadeIn == other.fadeIn && - (self.opacity == other.opacity || (isnan(self.opacity) && isnan(other.opacity))) && - self.zIndex == other.zIndex; -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + @(self.visible).hash; - result = result * 31 + @(self.fadeIn).hash; - result = - result * 31 + (isnan(self.opacity) ? (NSUInteger)0x7FF8000000000000 : @(self.opacity).hash); - result = result * 31 + @(self.zIndex).hash; - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformTileLayer(visible: %@, fadeIn: %@, opacity: %f, zIndex: %ld)", - self.visible ? @"true" : @"false", self.fadeIn ? @"true" : @"false", - self.opacity, (long)self.zIndex]; -} -@end - -@implementation FGMPlatformZoomRange -+ (instancetype)makeWithMin:(nullable NSNumber *)min max:(nullable NSNumber *)max { - FGMPlatformZoomRange *pigeonResult = [[FGMPlatformZoomRange alloc] init]; - pigeonResult.min = min; - pigeonResult.max = max; - return pigeonResult; -} -+ (FGMPlatformZoomRange *)fromList:(NSArray *)list { - FGMPlatformZoomRange *pigeonResult = [[FGMPlatformZoomRange alloc] init]; - pigeonResult.min = GetNullableObjectAtIndex(list, 0); - pigeonResult.max = GetNullableObjectAtIndex(list, 1); - return pigeonResult; -} -+ (nullable FGMPlatformZoomRange *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformZoomRange fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.min ?: [NSNull null], - self.max ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformZoomRange *other = (FGMPlatformZoomRange *)object; - return FLTPigeonDeepEquals(self.min, other.min) && FLTPigeonDeepEquals(self.max, other.max); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.min); - result = result * 31 + FLTPigeonDeepHash(self.max); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformZoomRange(min: %@, max: %@)", self.min, self.max]; -} -@end - -@implementation FGMPlatformBitmap -+ (instancetype)makeWithBitmap:(id)bitmap { - FGMPlatformBitmap *pigeonResult = [[FGMPlatformBitmap alloc] init]; - pigeonResult.bitmap = bitmap; - return pigeonResult; -} -+ (FGMPlatformBitmap *)fromList:(NSArray *)list { - FGMPlatformBitmap *pigeonResult = [[FGMPlatformBitmap alloc] init]; - pigeonResult.bitmap = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FGMPlatformBitmap *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmap fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.bitmap ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmap *other = (FGMPlatformBitmap *)object; - return FLTPigeonDeepEquals(self.bitmap, other.bitmap); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.bitmap); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformBitmap(bitmap: %@)", self.bitmap]; -} -@end - -@implementation FGMPlatformBitmapDefaultMarker -+ (instancetype)makeWithHue:(nullable NSNumber *)hue { - FGMPlatformBitmapDefaultMarker *pigeonResult = [[FGMPlatformBitmapDefaultMarker alloc] init]; - pigeonResult.hue = hue; - return pigeonResult; -} -+ (FGMPlatformBitmapDefaultMarker *)fromList:(NSArray *)list { - FGMPlatformBitmapDefaultMarker *pigeonResult = [[FGMPlatformBitmapDefaultMarker alloc] init]; - pigeonResult.hue = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FGMPlatformBitmapDefaultMarker *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmapDefaultMarker fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.hue ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmapDefaultMarker *other = (FGMPlatformBitmapDefaultMarker *)object; - return FLTPigeonDeepEquals(self.hue, other.hue); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.hue); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformBitmapDefaultMarker(hue: %@)", self.hue]; -} -@end - -@implementation FGMPlatformBitmapBytes -+ (instancetype)makeWithByteData:(FlutterStandardTypedData *)byteData - size:(nullable FGMPlatformSize *)size { - FGMPlatformBitmapBytes *pigeonResult = [[FGMPlatformBitmapBytes alloc] init]; - pigeonResult.byteData = byteData; - pigeonResult.size = size; - return pigeonResult; -} -+ (FGMPlatformBitmapBytes *)fromList:(NSArray *)list { - FGMPlatformBitmapBytes *pigeonResult = [[FGMPlatformBitmapBytes alloc] init]; - pigeonResult.byteData = GetNullableObjectAtIndex(list, 0); - pigeonResult.size = GetNullableObjectAtIndex(list, 1); - return pigeonResult; -} -+ (nullable FGMPlatformBitmapBytes *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmapBytes fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.byteData ?: [NSNull null], - self.size ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmapBytes *other = (FGMPlatformBitmapBytes *)object; - return FLTPigeonDeepEquals(self.byteData, other.byteData) && - FLTPigeonDeepEquals(self.size, other.size); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.byteData); - result = result * 31 + FLTPigeonDeepHash(self.size); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformBitmapBytes(byteData: %@, size: %@)", self.byteData, self.size]; -} -@end - -@implementation FGMPlatformBitmapAsset -+ (instancetype)makeWithName:(NSString *)name pkg:(nullable NSString *)pkg { - FGMPlatformBitmapAsset *pigeonResult = [[FGMPlatformBitmapAsset alloc] init]; - pigeonResult.name = name; - pigeonResult.pkg = pkg; - return pigeonResult; -} -+ (FGMPlatformBitmapAsset *)fromList:(NSArray *)list { - FGMPlatformBitmapAsset *pigeonResult = [[FGMPlatformBitmapAsset alloc] init]; - pigeonResult.name = GetNullableObjectAtIndex(list, 0); - pigeonResult.pkg = GetNullableObjectAtIndex(list, 1); - return pigeonResult; -} -+ (nullable FGMPlatformBitmapAsset *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmapAsset fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.name ?: [NSNull null], - self.pkg ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmapAsset *other = (FGMPlatformBitmapAsset *)object; - return FLTPigeonDeepEquals(self.name, other.name) && FLTPigeonDeepEquals(self.pkg, other.pkg); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.name); - result = result * 31 + FLTPigeonDeepHash(self.pkg); - return result; -} -- (NSString *)description { - return - [NSString stringWithFormat:@"FGMPlatformBitmapAsset(name: %@, pkg: %@)", self.name, self.pkg]; -} -@end - -@implementation FGMPlatformBitmapAssetImage -+ (instancetype)makeWithName:(NSString *)name - scale:(double)scale - size:(nullable FGMPlatformSize *)size { - FGMPlatformBitmapAssetImage *pigeonResult = [[FGMPlatformBitmapAssetImage alloc] init]; - pigeonResult.name = name; - pigeonResult.scale = scale; - pigeonResult.size = size; - return pigeonResult; -} -+ (FGMPlatformBitmapAssetImage *)fromList:(NSArray *)list { - FGMPlatformBitmapAssetImage *pigeonResult = [[FGMPlatformBitmapAssetImage alloc] init]; - pigeonResult.name = GetNullableObjectAtIndex(list, 0); - pigeonResult.scale = [GetNullableObjectAtIndex(list, 1) doubleValue]; - pigeonResult.size = GetNullableObjectAtIndex(list, 2); - return pigeonResult; -} -+ (nullable FGMPlatformBitmapAssetImage *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmapAssetImage fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.name ?: [NSNull null], - @(self.scale), - self.size ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmapAssetImage *other = (FGMPlatformBitmapAssetImage *)object; - return FLTPigeonDeepEquals(self.name, other.name) && - (self.scale == other.scale || (isnan(self.scale) && isnan(other.scale))) && - FLTPigeonDeepEquals(self.size, other.size); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.name); - result = result * 31 + (isnan(self.scale) ? (NSUInteger)0x7FF8000000000000 : @(self.scale).hash); - result = result * 31 + FLTPigeonDeepHash(self.size); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformBitmapAssetImage(name: %@, scale: %f, size: %@)", - self.name, self.scale, self.size]; -} -@end - -@implementation FGMPlatformBitmapAssetMap -+ (instancetype)makeWithAssetName:(NSString *)assetName - bitmapScaling:(FGMPlatformMapBitmapScaling)bitmapScaling - imagePixelRatio:(double)imagePixelRatio - width:(nullable NSNumber *)width - height:(nullable NSNumber *)height { - FGMPlatformBitmapAssetMap *pigeonResult = [[FGMPlatformBitmapAssetMap alloc] init]; - pigeonResult.assetName = assetName; - pigeonResult.bitmapScaling = bitmapScaling; - pigeonResult.imagePixelRatio = imagePixelRatio; - pigeonResult.width = width; - pigeonResult.height = height; - return pigeonResult; -} -+ (FGMPlatformBitmapAssetMap *)fromList:(NSArray *)list { - FGMPlatformBitmapAssetMap *pigeonResult = [[FGMPlatformBitmapAssetMap alloc] init]; - pigeonResult.assetName = GetNullableObjectAtIndex(list, 0); - FGMPlatformMapBitmapScalingBox *boxedFGMPlatformMapBitmapScaling = - GetNullableObjectAtIndex(list, 1); - pigeonResult.bitmapScaling = boxedFGMPlatformMapBitmapScaling.value; - pigeonResult.imagePixelRatio = [GetNullableObjectAtIndex(list, 2) doubleValue]; - pigeonResult.width = GetNullableObjectAtIndex(list, 3); - pigeonResult.height = GetNullableObjectAtIndex(list, 4); - return pigeonResult; -} -+ (nullable FGMPlatformBitmapAssetMap *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmapAssetMap fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.assetName ?: [NSNull null], - [[FGMPlatformMapBitmapScalingBox alloc] initWithValue:self.bitmapScaling], - @(self.imagePixelRatio), - self.width ?: [NSNull null], - self.height ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmapAssetMap *other = (FGMPlatformBitmapAssetMap *)object; - return FLTPigeonDeepEquals(self.assetName, other.assetName) && - self.bitmapScaling == other.bitmapScaling && - (self.imagePixelRatio == other.imagePixelRatio || - (isnan(self.imagePixelRatio) && isnan(other.imagePixelRatio))) && - FLTPigeonDeepEquals(self.width, other.width) && - FLTPigeonDeepEquals(self.height, other.height); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.assetName); - result = result * 31 + @(self.bitmapScaling).hash; - result = result * 31 + (isnan(self.imagePixelRatio) ? (NSUInteger)0x7FF8000000000000 - : @(self.imagePixelRatio).hash); - result = result * 31 + FLTPigeonDeepHash(self.width); - result = result * 31 + FLTPigeonDeepHash(self.height); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformBitmapAssetMap(assetName: %@, bitmapScaling: %ld, " - @"imagePixelRatio: %f, width: %@, height: %@)", - self.assetName, (long)self.bitmapScaling, self.imagePixelRatio, - self.width, self.height]; -} -@end - -@implementation FGMPlatformBitmapBytesMap -+ (instancetype)makeWithByteData:(FlutterStandardTypedData *)byteData - bitmapScaling:(FGMPlatformMapBitmapScaling)bitmapScaling - imagePixelRatio:(double)imagePixelRatio - width:(nullable NSNumber *)width - height:(nullable NSNumber *)height { - FGMPlatformBitmapBytesMap *pigeonResult = [[FGMPlatformBitmapBytesMap alloc] init]; - pigeonResult.byteData = byteData; - pigeonResult.bitmapScaling = bitmapScaling; - pigeonResult.imagePixelRatio = imagePixelRatio; - pigeonResult.width = width; - pigeonResult.height = height; - return pigeonResult; -} -+ (FGMPlatformBitmapBytesMap *)fromList:(NSArray *)list { - FGMPlatformBitmapBytesMap *pigeonResult = [[FGMPlatformBitmapBytesMap alloc] init]; - pigeonResult.byteData = GetNullableObjectAtIndex(list, 0); - FGMPlatformMapBitmapScalingBox *boxedFGMPlatformMapBitmapScaling = - GetNullableObjectAtIndex(list, 1); - pigeonResult.bitmapScaling = boxedFGMPlatformMapBitmapScaling.value; - pigeonResult.imagePixelRatio = [GetNullableObjectAtIndex(list, 2) doubleValue]; - pigeonResult.width = GetNullableObjectAtIndex(list, 3); - pigeonResult.height = GetNullableObjectAtIndex(list, 4); - return pigeonResult; -} -+ (nullable FGMPlatformBitmapBytesMap *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmapBytesMap fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.byteData ?: [NSNull null], - [[FGMPlatformMapBitmapScalingBox alloc] initWithValue:self.bitmapScaling], - @(self.imagePixelRatio), - self.width ?: [NSNull null], - self.height ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmapBytesMap *other = (FGMPlatformBitmapBytesMap *)object; - return FLTPigeonDeepEquals(self.byteData, other.byteData) && - self.bitmapScaling == other.bitmapScaling && - (self.imagePixelRatio == other.imagePixelRatio || - (isnan(self.imagePixelRatio) && isnan(other.imagePixelRatio))) && - FLTPigeonDeepEquals(self.width, other.width) && - FLTPigeonDeepEquals(self.height, other.height); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.byteData); - result = result * 31 + @(self.bitmapScaling).hash; - result = result * 31 + (isnan(self.imagePixelRatio) ? (NSUInteger)0x7FF8000000000000 - : @(self.imagePixelRatio).hash); - result = result * 31 + FLTPigeonDeepHash(self.width); - result = result * 31 + FLTPigeonDeepHash(self.height); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformBitmapBytesMap(byteData: %@, bitmapScaling: %ld, " - @"imagePixelRatio: %f, width: %@, height: %@)", - self.byteData, (long)self.bitmapScaling, self.imagePixelRatio, - self.width, self.height]; -} -@end - -@implementation FGMPlatformBitmapPinConfig -+ (instancetype)makeWithBackgroundColor:(nullable FGMPlatformColor *)backgroundColor - borderColor:(nullable FGMPlatformColor *)borderColor - glyphColor:(nullable FGMPlatformColor *)glyphColor - glyphTextColor:(nullable FGMPlatformColor *)glyphTextColor - glyphText:(nullable NSString *)glyphText - glyphBitmap:(nullable FGMPlatformBitmap *)glyphBitmap { - FGMPlatformBitmapPinConfig *pigeonResult = [[FGMPlatformBitmapPinConfig alloc] init]; - pigeonResult.backgroundColor = backgroundColor; - pigeonResult.borderColor = borderColor; - pigeonResult.glyphColor = glyphColor; - pigeonResult.glyphTextColor = glyphTextColor; - pigeonResult.glyphText = glyphText; - pigeonResult.glyphBitmap = glyphBitmap; - return pigeonResult; -} -+ (FGMPlatformBitmapPinConfig *)fromList:(NSArray *)list { - FGMPlatformBitmapPinConfig *pigeonResult = [[FGMPlatformBitmapPinConfig alloc] init]; - pigeonResult.backgroundColor = GetNullableObjectAtIndex(list, 0); - pigeonResult.borderColor = GetNullableObjectAtIndex(list, 1); - pigeonResult.glyphColor = GetNullableObjectAtIndex(list, 2); - pigeonResult.glyphTextColor = GetNullableObjectAtIndex(list, 3); - pigeonResult.glyphText = GetNullableObjectAtIndex(list, 4); - pigeonResult.glyphBitmap = GetNullableObjectAtIndex(list, 5); - return pigeonResult; -} -+ (nullable FGMPlatformBitmapPinConfig *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmapPinConfig fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.backgroundColor ?: [NSNull null], - self.borderColor ?: [NSNull null], - self.glyphColor ?: [NSNull null], - self.glyphTextColor ?: [NSNull null], - self.glyphText ?: [NSNull null], - self.glyphBitmap ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmapPinConfig *other = (FGMPlatformBitmapPinConfig *)object; - return FLTPigeonDeepEquals(self.backgroundColor, other.backgroundColor) && - FLTPigeonDeepEquals(self.borderColor, other.borderColor) && - FLTPigeonDeepEquals(self.glyphColor, other.glyphColor) && - FLTPigeonDeepEquals(self.glyphTextColor, other.glyphTextColor) && - FLTPigeonDeepEquals(self.glyphText, other.glyphText) && - FLTPigeonDeepEquals(self.glyphBitmap, other.glyphBitmap); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.backgroundColor); - result = result * 31 + FLTPigeonDeepHash(self.borderColor); - result = result * 31 + FLTPigeonDeepHash(self.glyphColor); - result = result * 31 + FLTPigeonDeepHash(self.glyphTextColor); - result = result * 31 + FLTPigeonDeepHash(self.glyphText); - result = result * 31 + FLTPigeonDeepHash(self.glyphBitmap); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformBitmapPinConfig(backgroundColor: %@, borderColor: %@, " - @"glyphColor: %@, glyphTextColor: %@, glyphText: %@, glyphBitmap: %@)", - self.backgroundColor, self.borderColor, self.glyphColor, self.glyphTextColor, - self.glyphText, self.glyphBitmap]; -} -@end - -@interface FGMGoogleMapsFlutterPigeonMessagesPigeonCodecReader : FlutterStandardReader -@end -@implementation FGMGoogleMapsFlutterPigeonMessagesPigeonCodecReader -- (nullable id)readValueOfType:(UInt8)type { - switch (type) { - case 129: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil - ? nil - : [[FGMPlatformMapTypeBox alloc] initWithValue:[enumAsNumber integerValue]]; - } - case 130: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil ? nil - : [[FGMPlatformMarkerCollisionBehaviorBox alloc] - initWithValue:[enumAsNumber integerValue]]; - } - case 131: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil - ? nil - : [[FGMPlatformJointTypeBox alloc] initWithValue:[enumAsNumber integerValue]]; - } - case 132: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil ? nil - : [[FGMPlatformPatternItemTypeBox alloc] - initWithValue:[enumAsNumber integerValue]]; - } - case 133: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil - ? nil - : [[FGMPlatformMarkerTypeBox alloc] initWithValue:[enumAsNumber integerValue]]; - } - case 134: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil ? nil - : [[FGMPlatformMapBitmapScalingBox alloc] - initWithValue:[enumAsNumber integerValue]]; - } - case 135: - return [FGMPlatformCameraPosition fromList:[self readValue]]; - case 136: - return [FGMPlatformCameraUpdate fromList:[self readValue]]; - case 137: - return [FGMPlatformCameraUpdateNewCameraPosition fromList:[self readValue]]; - case 138: - return [FGMPlatformCameraUpdateNewLatLng fromList:[self readValue]]; - case 139: - return [FGMPlatformCameraUpdateNewLatLngBounds fromList:[self readValue]]; - case 140: - return [FGMPlatformCameraUpdateNewLatLngZoom fromList:[self readValue]]; - case 141: - return [FGMPlatformCameraUpdateScrollBy fromList:[self readValue]]; - case 142: - return [FGMPlatformCameraUpdateZoomBy fromList:[self readValue]]; - case 143: - return [FGMPlatformCameraUpdateZoom fromList:[self readValue]]; - case 144: - return [FGMPlatformCameraUpdateZoomTo fromList:[self readValue]]; - case 145: - return [FGMPlatformCircle fromList:[self readValue]]; - case 146: - return [FGMPlatformHeatmap fromList:[self readValue]]; - case 147: - return [FGMPlatformHeatmapGradient fromList:[self readValue]]; - case 148: - return [FGMPlatformWeightedLatLng fromList:[self readValue]]; - case 149: - return [FGMPlatformInfoWindow fromList:[self readValue]]; - case 150: - return [FGMPlatformCluster fromList:[self readValue]]; - case 151: - return [FGMPlatformClusterManager fromList:[self readValue]]; - case 152: - return [FGMPlatformMarker fromList:[self readValue]]; - case 153: - return [FGMPlatformPolygon fromList:[self readValue]]; - case 154: - return [FGMPlatformPolyline fromList:[self readValue]]; - case 155: - return [FGMPlatformPatternItem fromList:[self readValue]]; - case 156: - return [FGMPlatformTile fromList:[self readValue]]; - case 157: - return [FGMPlatformTileOverlay fromList:[self readValue]]; - case 158: - return [FGMPlatformEdgeInsets fromList:[self readValue]]; - case 159: - return [FGMPlatformLatLng fromList:[self readValue]]; - case 160: - return [FGMPlatformLatLngBounds fromList:[self readValue]]; - case 161: - return [FGMPlatformCameraTargetBounds fromList:[self readValue]]; - case 162: - return [FGMPlatformGroundOverlay fromList:[self readValue]]; - case 163: - return [FGMPlatformMapViewCreationParams fromList:[self readValue]]; - case 164: - return [FGMPlatformMapConfiguration fromList:[self readValue]]; - case 165: - return [FGMPlatformPoint fromList:[self readValue]]; - case 166: - return [FGMPlatformSize fromList:[self readValue]]; - case 167: - return [FGMPlatformColor fromList:[self readValue]]; - case 168: - return [FGMPlatformTileLayer fromList:[self readValue]]; - case 169: - return [FGMPlatformZoomRange fromList:[self readValue]]; - case 170: - return [FGMPlatformBitmap fromList:[self readValue]]; - case 171: - return [FGMPlatformBitmapDefaultMarker fromList:[self readValue]]; - case 172: - return [FGMPlatformBitmapBytes fromList:[self readValue]]; - case 173: - return [FGMPlatformBitmapAsset fromList:[self readValue]]; - case 174: - return [FGMPlatformBitmapAssetImage fromList:[self readValue]]; - case 175: - return [FGMPlatformBitmapAssetMap fromList:[self readValue]]; - case 176: - return [FGMPlatformBitmapBytesMap fromList:[self readValue]]; - case 177: - return [FGMPlatformBitmapPinConfig fromList:[self readValue]]; - default: - return [super readValueOfType:type]; - } -} -@end - -@interface FGMGoogleMapsFlutterPigeonMessagesPigeonCodecWriter : FlutterStandardWriter -@end -@implementation FGMGoogleMapsFlutterPigeonMessagesPigeonCodecWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[FGMPlatformMapTypeBox class]]) { - FGMPlatformMapTypeBox *box = (FGMPlatformMapTypeBox *)value; - [self writeByte:129]; - [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[FGMPlatformMarkerCollisionBehaviorBox class]]) { - FGMPlatformMarkerCollisionBehaviorBox *box = (FGMPlatformMarkerCollisionBehaviorBox *)value; - [self writeByte:130]; - [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[FGMPlatformJointTypeBox class]]) { - FGMPlatformJointTypeBox *box = (FGMPlatformJointTypeBox *)value; - [self writeByte:131]; - [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[FGMPlatformPatternItemTypeBox class]]) { - FGMPlatformPatternItemTypeBox *box = (FGMPlatformPatternItemTypeBox *)value; - [self writeByte:132]; - [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[FGMPlatformMarkerTypeBox class]]) { - FGMPlatformMarkerTypeBox *box = (FGMPlatformMarkerTypeBox *)value; - [self writeByte:133]; - [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[FGMPlatformMapBitmapScalingBox class]]) { - FGMPlatformMapBitmapScalingBox *box = (FGMPlatformMapBitmapScalingBox *)value; - [self writeByte:134]; - [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[FGMPlatformCameraPosition class]]) { - [self writeByte:135]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdate class]]) { - [self writeByte:136]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateNewCameraPosition class]]) { - [self writeByte:137]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateNewLatLng class]]) { - [self writeByte:138]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateNewLatLngBounds class]]) { - [self writeByte:139]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateNewLatLngZoom class]]) { - [self writeByte:140]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateScrollBy class]]) { - [self writeByte:141]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateZoomBy class]]) { - [self writeByte:142]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateZoom class]]) { - [self writeByte:143]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateZoomTo class]]) { - [self writeByte:144]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCircle class]]) { - [self writeByte:145]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformHeatmap class]]) { - [self writeByte:146]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformHeatmapGradient class]]) { - [self writeByte:147]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformWeightedLatLng class]]) { - [self writeByte:148]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformInfoWindow class]]) { - [self writeByte:149]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCluster class]]) { - [self writeByte:150]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformClusterManager class]]) { - [self writeByte:151]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformMarker class]]) { - [self writeByte:152]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformPolygon class]]) { - [self writeByte:153]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformPolyline class]]) { - [self writeByte:154]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformPatternItem class]]) { - [self writeByte:155]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformTile class]]) { - [self writeByte:156]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformTileOverlay class]]) { - [self writeByte:157]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformEdgeInsets class]]) { - [self writeByte:158]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformLatLng class]]) { - [self writeByte:159]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformLatLngBounds class]]) { - [self writeByte:160]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraTargetBounds class]]) { - [self writeByte:161]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformGroundOverlay class]]) { - [self writeByte:162]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformMapViewCreationParams class]]) { - [self writeByte:163]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformMapConfiguration class]]) { - [self writeByte:164]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformPoint class]]) { - [self writeByte:165]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformSize class]]) { - [self writeByte:166]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformColor class]]) { - [self writeByte:167]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformTileLayer class]]) { - [self writeByte:168]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformZoomRange class]]) { - [self writeByte:169]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmap class]]) { - [self writeByte:170]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmapDefaultMarker class]]) { - [self writeByte:171]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmapBytes class]]) { - [self writeByte:172]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmapAsset class]]) { - [self writeByte:173]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmapAssetImage class]]) { - [self writeByte:174]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmapAssetMap class]]) { - [self writeByte:175]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmapBytesMap class]]) { - [self writeByte:176]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmapPinConfig class]]) { - [self writeByte:177]; - [self writeValue:[value toList]]; - } else { - [super writeValue:value]; - } -} -@end - -@interface FGMGoogleMapsFlutterPigeonMessagesPigeonCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation FGMGoogleMapsFlutterPigeonMessagesPigeonCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FGMGoogleMapsFlutterPigeonMessagesPigeonCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FGMGoogleMapsFlutterPigeonMessagesPigeonCodecReader alloc] initWithData:data]; -} -@end - -NSObject *FGMGetGoogleMapsFlutterPigeonMessagesCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - static dispatch_once_t sPred = 0; - dispatch_once(&sPred, ^{ - FGMGoogleMapsFlutterPigeonMessagesPigeonCodecReaderWriter *readerWriter = - [[FGMGoogleMapsFlutterPigeonMessagesPigeonCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); - return sSharedObject; -} -void SetUpFGMMapsApi(id binaryMessenger, NSObject *api) { - SetUpFGMMapsApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFGMMapsApiWithSuffix(id binaryMessenger, - NSObject *api, NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - /// Returns once the map instance is available. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.waitForMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(waitForMapWithError:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(waitForMapWithError:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - [api waitForMapWithError:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the map's configuration options. - /// - /// Only non-null configuration values will result in updates; options with - /// null values will remain unchanged. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.updateMapConfiguration", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(updateWithMapConfiguration:error:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(updateWithMapConfiguration:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FGMPlatformMapConfiguration *arg_configuration = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - [api updateWithMapConfiguration:arg_configuration error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of circles on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateCircles", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updateCirclesByAdding:changing:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updateCirclesByAdding:changing:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_toChange = GetNullableObjectAtIndex(args, 1); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api updateCirclesByAdding:arg_toAdd - changing:arg_toChange - removing:arg_idsToRemove - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of heatmaps on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.updateHeatmaps", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updateHeatmapsByAdding:changing:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updateHeatmapsByAdding:changing:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_toChange = GetNullableObjectAtIndex(args, 1); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api updateHeatmapsByAdding:arg_toAdd - changing:arg_toChange - removing:arg_idsToRemove - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of custer managers for clusters on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.updateClusterManagers", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updateClusterManagersByAdding:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updateClusterManagersByAdding:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 1); - FlutterError *error; - [api updateClusterManagersByAdding:arg_toAdd removing:arg_idsToRemove error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of markers on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateMarkers", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updateMarkersByAdding:changing:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updateMarkersByAdding:changing:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_toChange = GetNullableObjectAtIndex(args, 1); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api updateMarkersByAdding:arg_toAdd - changing:arg_toChange - removing:arg_idsToRemove - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of polygonss on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.updatePolygons", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updatePolygonsByAdding:changing:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updatePolygonsByAdding:changing:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_toChange = GetNullableObjectAtIndex(args, 1); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api updatePolygonsByAdding:arg_toAdd - changing:arg_toChange - removing:arg_idsToRemove - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of polylines on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.updatePolylines", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updatePolylinesByAdding: - changing:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updatePolylinesByAdding:changing:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_toChange = GetNullableObjectAtIndex(args, 1); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api updatePolylinesByAdding:arg_toAdd - changing:arg_toChange - removing:arg_idsToRemove - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of tile overlays on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.updateTileOverlays", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updateTileOverlaysByAdding: - changing:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updateTileOverlaysByAdding:changing:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_toChange = GetNullableObjectAtIndex(args, 1); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api updateTileOverlaysByAdding:arg_toAdd - changing:arg_toChange - removing:arg_idsToRemove - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of ground overlays on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.updateGroundOverlays", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updateGroundOverlaysByAdding: - changing:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updateGroundOverlaysByAdding:changing:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_toChange = GetNullableObjectAtIndex(args, 1); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api updateGroundOverlaysByAdding:arg_toAdd - changing:arg_toChange - removing:arg_idsToRemove - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Gets the screen coordinate for the given map location. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.getScreenCoordinate", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(screenCoordinatesForLatLng:error:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(screenCoordinatesForLatLng:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FGMPlatformLatLng *arg_latLng = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FGMPlatformPoint *output = [api screenCoordinatesForLatLng:arg_latLng error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Gets the map location for the given screen coordinate. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getLatLng", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(latLngForScreenCoordinate:error:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(latLngForScreenCoordinate:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FGMPlatformPoint *arg_screenCoordinate = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FGMPlatformLatLng *output = [api latLngForScreenCoordinate:arg_screenCoordinate - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Gets the map region currently displayed on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.getVisibleRegion", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(visibleMapRegion:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(visibleMapRegion:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - FGMPlatformLatLngBounds *output = [api visibleMapRegion:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Moves the camera according to [cameraUpdate] immediately, with no - /// animation. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.moveCamera", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(moveCameraWithUpdate:error:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(moveCameraWithUpdate:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FGMPlatformCameraUpdate *arg_cameraUpdate = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - [api moveCameraWithUpdate:arg_cameraUpdate error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Moves the camera according to [cameraUpdate], animating the update using a - /// duration in milliseconds if provided. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.animateCamera", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(animateCameraWithUpdate:duration:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(animateCameraWithUpdate:duration:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FGMPlatformCameraUpdate *arg_cameraUpdate = GetNullableObjectAtIndex(args, 0); - NSNumber *arg_durationMilliseconds = GetNullableObjectAtIndex(args, 1); - FlutterError *error; - [api animateCameraWithUpdate:arg_cameraUpdate - duration:arg_durationMilliseconds - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Gets the current map zoom level. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getZoomLevel", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(currentZoomLevel:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(currentZoomLevel:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api currentZoomLevel:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Show the info window for the marker with the given ID. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.showInfoWindow", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(showInfoWindowForMarkerWithIdentifier:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(showInfoWindowForMarkerWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_markerId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - [api showInfoWindowForMarkerWithIdentifier:arg_markerId error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Hide the info window for the marker with the given ID. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.hideInfoWindow", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(hideInfoWindowForMarkerWithIdentifier:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(hideInfoWindowForMarkerWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_markerId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - [api hideInfoWindowForMarkerWithIdentifier:arg_markerId error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns true if the marker with the given ID is currently displaying its - /// info window. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.isInfoWindowShown", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(isShowingInfoWindowForMarkerWithIdentifier: - error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(isShowingInfoWindowForMarkerWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_markerId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSNumber *output = [api isShowingInfoWindowForMarkerWithIdentifier:arg_markerId - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Sets the style to the given map style string, where an empty string - /// indicates that the style should be cleared. - /// - /// If there was an error setting the style, such as an invalid style string, - /// returns the error message. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.setStyle", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(setStyle:error:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(setStyle:error:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_style = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSString *output = [api setStyle:arg_style error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the error string from the last attempt to set the map style, if - /// any. - /// - /// This allows checking asynchronously for initial style failures, as there - /// is no way to return failures from map initialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.getLastStyleError", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(lastStyleError:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(lastStyleError:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSString *output = [api lastStyleError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Clears the cache of tiles previously requseted from the tile provider. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.clearTileCache", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(clearTileCacheForOverlayWithIdentifier:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(clearTileCacheForOverlayWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_tileOverlayId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - [api clearTileCacheForOverlayWithIdentifier:arg_tileOverlayId error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Takes a snapshot of the map and returns its image data. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.takeSnapshot", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(takeSnapshotWithError:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(takeSnapshotWithError:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - FlutterStandardTypedData *output = [api takeSnapshotWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns true if the map supports advanced markers. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.isAdvancedMarkersAvailable", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(isAdvancedMarkersAvailable:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(isAdvancedMarkersAvailable:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api isAdvancedMarkersAvailable:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -@interface FGMMapsCallbackApi () -@property(nonatomic, strong) NSObject *binaryMessenger; -@property(nonatomic, strong) NSString *messageChannelSuffix; -@end - -@implementation FGMMapsCallbackApi - -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; -} -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 - ? @"" - : [NSString stringWithFormat:@".%@", messageChannelSuffix]; - } - return self; -} -- (void)didStartCameraMoveWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCameraMoveStarted", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didMoveCameraToPosition:(FGMPlatformCameraPosition *)arg_cameraPosition - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCameraMove", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_cameraPosition ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didIdleCameraWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCameraIdle", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapAtPosition:(FGMPlatformLatLng *)arg_position - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_position ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didLongPressAtPosition:(FGMPlatformLatLng *)arg_position - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onLongPress", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_position ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapMarkerWithIdentifier:(NSString *)arg_markerId - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_markerId ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didStartDragForMarkerWithIdentifier:(NSString *)arg_markerId - atPosition:(FGMPlatformLatLng *)arg_position - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDragStart", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_markerId ?: [NSNull null], arg_position ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didDragMarkerWithIdentifier:(NSString *)arg_markerId - atPosition:(FGMPlatformLatLng *)arg_position - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDrag", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_markerId ?: [NSNull null], arg_position ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didEndDragForMarkerWithIdentifier:(NSString *)arg_markerId - atPosition:(FGMPlatformLatLng *)arg_position - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDragEnd", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_markerId ?: [NSNull null], arg_position ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapInfoWindowOfMarkerWithIdentifier:(NSString *)arg_markerId - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onInfoWindowTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_markerId ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapCircleWithIdentifier:(NSString *)arg_circleId - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCircleTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_circleId ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapCluster:(FGMPlatformCluster *)arg_cluster - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onClusterTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_cluster ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapPolygonWithIdentifier:(NSString *)arg_polygonId - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onPolygonTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_polygonId ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapPolylineWithIdentifier:(NSString *)arg_polylineId - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onPolylineTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_polylineId ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapGroundOverlayWithIdentifier:(NSString *)arg_groundOverlayId - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onGroundOverlayTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_groundOverlayId ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)tileWithOverlayIdentifier:(NSString *)arg_tileOverlayId - location:(FGMPlatformPoint *)arg_location - zoom:(NSInteger)arg_zoom - completion:(void (^)(FGMPlatformTile *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.getTileOverlayTile", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ - arg_tileOverlayId ?: [NSNull null], arg_location ?: [NSNull null], @(arg_zoom) - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FGMPlatformTile *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -@end - -void SetUpFGMMapsPlatformViewApi(id binaryMessenger, - NSObject *api) { - SetUpFGMMapsPlatformViewApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFGMMapsPlatformViewApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsPlatformViewApi.createView", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(createViewType:error:)], - @"FGMMapsPlatformViewApi api (%@) doesn't respond to @selector(createViewType:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FGMPlatformMapViewCreationParams *arg_type = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - [api createViewType:arg_type error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -void SetUpFGMMapsInspectorApi(id binaryMessenger, - NSObject *api) { - SetUpFGMMapsInspectorApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFGMMapsInspectorApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.areBuildingsEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(areBuildingsEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(areBuildingsEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api areBuildingsEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.areRotateGesturesEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(areRotateGesturesEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(areRotateGesturesEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api areRotateGesturesEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.areScrollGesturesEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(areScrollGesturesEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(areScrollGesturesEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api areScrollGesturesEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.areTiltGesturesEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(areTiltGesturesEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(areTiltGesturesEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api areTiltGesturesEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.areZoomGesturesEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(areZoomGesturesEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(areZoomGesturesEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api areZoomGesturesEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.isCompassEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(isCompassEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to @selector(isCompassEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api isCompassEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.isMyLocationButtonEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(isMyLocationButtonEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(isMyLocationButtonEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api isMyLocationButtonEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.isTrafficEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(isTrafficEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to @selector(isTrafficEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api isTrafficEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.getTileOverlayInfo", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(tileOverlayWithIdentifier:error:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(tileOverlayWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_tileOverlayId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FGMPlatformTileLayer *output = [api tileOverlayWithIdentifier:arg_tileOverlayId - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.getGroundOverlayInfo", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(groundOverlayWithIdentifier:error:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(groundOverlayWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_groundOverlayId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FGMPlatformGroundOverlay *output = [api groundOverlayWithIdentifier:arg_groundOverlayId - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.getHeatmapInfo", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(heatmapWithIdentifier:error:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(heatmapWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_heatmapId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FGMPlatformHeatmap *output = [api heatmapWithIdentifier:arg_heatmapId error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.getZoomRange", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(zoomRange:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to @selector(zoomRange:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - FGMPlatformZoomRange *output = [api zoomRange:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.getClusters", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(clustersWithIdentifier:error:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(clustersWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_clusterManagerId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSArray *output = [api clustersWithIdentifier:arg_clusterManagerId - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.getCameraPosition", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(cameraPosition:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to @selector(cameraPosition:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - FGMPlatformCameraPosition *output = [api cameraPosition:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/google_maps_flutter_ios_sdk10_objc/google_maps_flutter_pigeon_messages.g.h b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/google_maps_flutter_ios_sdk10_objc/google_maps_flutter_pigeon_messages.g.h deleted file mode 100644 index fbd78a7c44a9..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/google_maps_flutter_ios_sdk10_objc/google_maps_flutter_pigeon_messages.g.h +++ /dev/null @@ -1,991 +0,0 @@ -// Copyright 2013 The Flutter Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// Autogenerated from Pigeon (v27.3.2), do not edit directly. -// See also: https://pub.dev/packages/pigeon - -@import Foundation; - -@protocol FlutterBinaryMessenger; -@protocol FlutterMessageCodec; -@class FlutterError; -@class FlutterStandardTypedData; - -NS_ASSUME_NONNULL_BEGIN - -/// Pigeon equivalent of MapType -typedef NS_ENUM(NSUInteger, FGMPlatformMapType) { - FGMPlatformMapTypeNone = 0, - FGMPlatformMapTypeNormal = 1, - FGMPlatformMapTypeSatellite = 2, - FGMPlatformMapTypeTerrain = 3, - FGMPlatformMapTypeHybrid = 4, -}; - -/// Wrapper for FGMPlatformMapType to allow for nullability. -@interface FGMPlatformMapTypeBox : NSObject -@property(nonatomic, assign) FGMPlatformMapType value; -- (instancetype)initWithValue:(FGMPlatformMapType)value; -@end - -/// Pigeon equivalent of the MarkerCollisionBehavior enum. -typedef NS_ENUM(NSUInteger, FGMPlatformMarkerCollisionBehavior) { - FGMPlatformMarkerCollisionBehaviorRequiredDisplay = 0, - FGMPlatformMarkerCollisionBehaviorOptionalAndHidesLowerPriority = 1, - FGMPlatformMarkerCollisionBehaviorRequiredAndHidesOptional = 2, -}; - -/// Wrapper for FGMPlatformMarkerCollisionBehavior to allow for nullability. -@interface FGMPlatformMarkerCollisionBehaviorBox : NSObject -@property(nonatomic, assign) FGMPlatformMarkerCollisionBehavior value; -- (instancetype)initWithValue:(FGMPlatformMarkerCollisionBehavior)value; -@end - -/// Join types for polyline joints. -typedef NS_ENUM(NSUInteger, FGMPlatformJointType) { - FGMPlatformJointTypeMitered = 0, - FGMPlatformJointTypeBevel = 1, - FGMPlatformJointTypeRound = 2, -}; - -/// Wrapper for FGMPlatformJointType to allow for nullability. -@interface FGMPlatformJointTypeBox : NSObject -@property(nonatomic, assign) FGMPlatformJointType value; -- (instancetype)initWithValue:(FGMPlatformJointType)value; -@end - -/// Enumeration of possible types for PatternItem. -typedef NS_ENUM(NSUInteger, FGMPlatformPatternItemType) { - FGMPlatformPatternItemTypeDot = 0, - FGMPlatformPatternItemTypeDash = 1, - FGMPlatformPatternItemTypeGap = 2, -}; - -/// Wrapper for FGMPlatformPatternItemType to allow for nullability. -@interface FGMPlatformPatternItemTypeBox : NSObject -@property(nonatomic, assign) FGMPlatformPatternItemType value; -- (instancetype)initWithValue:(FGMPlatformPatternItemType)value; -@end - -typedef NS_ENUM(NSUInteger, FGMPlatformMarkerType) { - FGMPlatformMarkerTypeMarker = 0, - FGMPlatformMarkerTypeAdvancedMarker = 1, -}; - -/// Wrapper for FGMPlatformMarkerType to allow for nullability. -@interface FGMPlatformMarkerTypeBox : NSObject -@property(nonatomic, assign) FGMPlatformMarkerType value; -- (instancetype)initWithValue:(FGMPlatformMarkerType)value; -@end - -/// Pigeon equivalent of [MapBitmapScaling]. -typedef NS_ENUM(NSUInteger, FGMPlatformMapBitmapScaling) { - FGMPlatformMapBitmapScalingAuto = 0, - FGMPlatformMapBitmapScalingNone = 1, -}; - -/// Wrapper for FGMPlatformMapBitmapScaling to allow for nullability. -@interface FGMPlatformMapBitmapScalingBox : NSObject -@property(nonatomic, assign) FGMPlatformMapBitmapScaling value; -- (instancetype)initWithValue:(FGMPlatformMapBitmapScaling)value; -@end - -@class FGMPlatformCameraPosition; -@class FGMPlatformCameraUpdate; -@class FGMPlatformCameraUpdateNewCameraPosition; -@class FGMPlatformCameraUpdateNewLatLng; -@class FGMPlatformCameraUpdateNewLatLngBounds; -@class FGMPlatformCameraUpdateNewLatLngZoom; -@class FGMPlatformCameraUpdateScrollBy; -@class FGMPlatformCameraUpdateZoomBy; -@class FGMPlatformCameraUpdateZoom; -@class FGMPlatformCameraUpdateZoomTo; -@class FGMPlatformCircle; -@class FGMPlatformHeatmap; -@class FGMPlatformHeatmapGradient; -@class FGMPlatformWeightedLatLng; -@class FGMPlatformInfoWindow; -@class FGMPlatformCluster; -@class FGMPlatformClusterManager; -@class FGMPlatformMarker; -@class FGMPlatformPolygon; -@class FGMPlatformPolyline; -@class FGMPlatformPatternItem; -@class FGMPlatformTile; -@class FGMPlatformTileOverlay; -@class FGMPlatformEdgeInsets; -@class FGMPlatformLatLng; -@class FGMPlatformLatLngBounds; -@class FGMPlatformCameraTargetBounds; -@class FGMPlatformGroundOverlay; -@class FGMPlatformMapViewCreationParams; -@class FGMPlatformMapConfiguration; -@class FGMPlatformPoint; -@class FGMPlatformSize; -@class FGMPlatformColor; -@class FGMPlatformTileLayer; -@class FGMPlatformZoomRange; -@class FGMPlatformBitmap; -@class FGMPlatformBitmapDefaultMarker; -@class FGMPlatformBitmapBytes; -@class FGMPlatformBitmapAsset; -@class FGMPlatformBitmapAssetImage; -@class FGMPlatformBitmapAssetMap; -@class FGMPlatformBitmapBytesMap; -@class FGMPlatformBitmapPinConfig; - -/// Pigeon representatation of a CameraPosition. -@interface FGMPlatformCameraPosition : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithBearing:(double)bearing - target:(FGMPlatformLatLng *)target - tilt:(double)tilt - zoom:(double)zoom; -@property(nonatomic, assign) double bearing; -@property(nonatomic, strong) FGMPlatformLatLng *target; -@property(nonatomic, assign) double tilt; -@property(nonatomic, assign) double zoom; -@end - -/// Pigeon representation of a CameraUpdate. -@interface FGMPlatformCameraUpdate : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithCameraUpdate:(id)cameraUpdate; -/// This Object must be one of the classes below prefixed with -/// PlatformCameraUpdate. Each such class represents a different type of -/// camera update, and each holds a different set of data, preventing the -/// use of a single unified class. -@property(nonatomic, strong) id cameraUpdate; -@end - -/// Pigeon equivalent of NewCameraPosition -@interface FGMPlatformCameraUpdateNewCameraPosition : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithCameraPosition:(FGMPlatformCameraPosition *)cameraPosition; -@property(nonatomic, strong) FGMPlatformCameraPosition *cameraPosition; -@end - -/// Pigeon equivalent of NewLatLng -@interface FGMPlatformCameraUpdateNewLatLng : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithLatLng:(FGMPlatformLatLng *)latLng; -@property(nonatomic, strong) FGMPlatformLatLng *latLng; -@end - -/// Pigeon equivalent of NewLatLngBounds -@interface FGMPlatformCameraUpdateNewLatLngBounds : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithBounds:(FGMPlatformLatLngBounds *)bounds padding:(double)padding; -@property(nonatomic, strong) FGMPlatformLatLngBounds *bounds; -@property(nonatomic, assign) double padding; -@end - -/// Pigeon equivalent of NewLatLngZoom -@interface FGMPlatformCameraUpdateNewLatLngZoom : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithLatLng:(FGMPlatformLatLng *)latLng zoom:(double)zoom; -@property(nonatomic, strong) FGMPlatformLatLng *latLng; -@property(nonatomic, assign) double zoom; -@end - -/// Pigeon equivalent of ScrollBy -@interface FGMPlatformCameraUpdateScrollBy : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithDx:(double)dx dy:(double)dy; -@property(nonatomic, assign) double dx; -@property(nonatomic, assign) double dy; -@end - -/// Pigeon equivalent of ZoomBy -@interface FGMPlatformCameraUpdateZoomBy : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithAmount:(double)amount focus:(nullable FGMPlatformPoint *)focus; -@property(nonatomic, assign) double amount; -@property(nonatomic, strong, nullable) FGMPlatformPoint *focus; -@end - -/// Pigeon equivalent of ZoomIn/ZoomOut -@interface FGMPlatformCameraUpdateZoom : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithOut:(BOOL)out; -@property(nonatomic, assign) BOOL out; -@end - -/// Pigeon equivalent of ZoomTo -@interface FGMPlatformCameraUpdateZoomTo : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithZoom:(double)zoom; -@property(nonatomic, assign) double zoom; -@end - -/// Pigeon equivalent of the Circle class. -@interface FGMPlatformCircle : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithConsumeTapEvents:(BOOL)consumeTapEvents - fillColor:(FGMPlatformColor *)fillColor - strokeColor:(FGMPlatformColor *)strokeColor - visible:(BOOL)visible - strokeWidth:(NSInteger)strokeWidth - zIndex:(double)zIndex - center:(FGMPlatformLatLng *)center - radius:(double)radius - circleId:(NSString *)circleId; -@property(nonatomic, assign) BOOL consumeTapEvents; -@property(nonatomic, strong) FGMPlatformColor *fillColor; -@property(nonatomic, strong) FGMPlatformColor *strokeColor; -@property(nonatomic, assign) BOOL visible; -@property(nonatomic, assign) NSInteger strokeWidth; -@property(nonatomic, assign) double zIndex; -@property(nonatomic, strong) FGMPlatformLatLng *center; -@property(nonatomic, assign) double radius; -@property(nonatomic, copy) NSString *circleId; -@end - -/// Pigeon equivalent of the Heatmap class. -@interface FGMPlatformHeatmap : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithHeatmapId:(NSString *)heatmapId - data:(NSArray *)data - gradient:(nullable FGMPlatformHeatmapGradient *)gradient - opacity:(double)opacity - radius:(NSInteger)radius - minimumZoomIntensity:(NSInteger)minimumZoomIntensity - maximumZoomIntensity:(NSInteger)maximumZoomIntensity; -@property(nonatomic, copy) NSString *heatmapId; -@property(nonatomic, copy) NSArray *data; -@property(nonatomic, strong, nullable) FGMPlatformHeatmapGradient *gradient; -@property(nonatomic, assign) double opacity; -@property(nonatomic, assign) NSInteger radius; -@property(nonatomic, assign) NSInteger minimumZoomIntensity; -@property(nonatomic, assign) NSInteger maximumZoomIntensity; -@end - -/// Pigeon equivalent of the HeatmapGradient class. -/// -/// The GMUGradient structure is slightly different from HeatmapGradient, so -/// this matches the iOS API so that conversion can be done on the Dart side -/// where the structures are easier to work with. -@interface FGMPlatformHeatmapGradient : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithColors:(NSArray *)colors - startPoints:(NSArray *)startPoints - colorMapSize:(NSInteger)colorMapSize; -@property(nonatomic, copy) NSArray *colors; -@property(nonatomic, copy) NSArray *startPoints; -@property(nonatomic, assign) NSInteger colorMapSize; -@end - -/// Pigeon equivalent of the WeightedLatLng class. -@interface FGMPlatformWeightedLatLng : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithPoint:(FGMPlatformLatLng *)point weight:(double)weight; -@property(nonatomic, strong) FGMPlatformLatLng *point; -@property(nonatomic, assign) double weight; -@end - -/// Pigeon equivalent of the InfoWindow class. -@interface FGMPlatformInfoWindow : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithTitle:(nullable NSString *)title - snippet:(nullable NSString *)snippet - anchor:(FGMPlatformPoint *)anchor; -@property(nonatomic, copy, nullable) NSString *title; -@property(nonatomic, copy, nullable) NSString *snippet; -@property(nonatomic, strong) FGMPlatformPoint *anchor; -@end - -/// Pigeon equivalent of Cluster. -@interface FGMPlatformCluster : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithClusterManagerId:(NSString *)clusterManagerId - position:(FGMPlatformLatLng *)position - bounds:(FGMPlatformLatLngBounds *)bounds - markerIds:(NSArray *)markerIds; -@property(nonatomic, copy) NSString *clusterManagerId; -@property(nonatomic, strong) FGMPlatformLatLng *position; -@property(nonatomic, strong) FGMPlatformLatLngBounds *bounds; -@property(nonatomic, copy) NSArray *markerIds; -@end - -/// Pigeon equivalent of the ClusterManager class. -@interface FGMPlatformClusterManager : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithIdentifier:(NSString *)identifier; -@property(nonatomic, copy) NSString *identifier; -@end - -/// Pigeon equivalent of the Marker class. -@interface FGMPlatformMarker : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithAlpha:(double)alpha - anchor:(FGMPlatformPoint *)anchor - consumeTapEvents:(BOOL)consumeTapEvents - draggable:(BOOL)draggable - flat:(BOOL)flat - icon:(FGMPlatformBitmap *)icon - infoWindow:(FGMPlatformInfoWindow *)infoWindow - position:(FGMPlatformLatLng *)position - rotation:(double)rotation - visible:(BOOL)visible - zIndex:(NSInteger)zIndex - markerId:(NSString *)markerId - clusterManagerId:(nullable NSString *)clusterManagerId - collisionBehavior:(nullable FGMPlatformMarkerCollisionBehaviorBox *)collisionBehavior; -@property(nonatomic, assign) double alpha; -@property(nonatomic, strong) FGMPlatformPoint *anchor; -@property(nonatomic, assign) BOOL consumeTapEvents; -@property(nonatomic, assign) BOOL draggable; -@property(nonatomic, assign) BOOL flat; -@property(nonatomic, strong) FGMPlatformBitmap *icon; -@property(nonatomic, strong) FGMPlatformInfoWindow *infoWindow; -@property(nonatomic, strong) FGMPlatformLatLng *position; -@property(nonatomic, assign) double rotation; -@property(nonatomic, assign) BOOL visible; -@property(nonatomic, assign) NSInteger zIndex; -@property(nonatomic, copy) NSString *markerId; -@property(nonatomic, copy, nullable) NSString *clusterManagerId; -@property(nonatomic, strong, nullable) FGMPlatformMarkerCollisionBehaviorBox *collisionBehavior; -@end - -/// Pigeon equivalent of the Polygon class. -@interface FGMPlatformPolygon : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithPolygonId:(NSString *)polygonId - consumesTapEvents:(BOOL)consumesTapEvents - fillColor:(FGMPlatformColor *)fillColor - geodesic:(BOOL)geodesic - points:(NSArray *)points - holes:(NSArray *> *)holes - visible:(BOOL)visible - strokeColor:(FGMPlatformColor *)strokeColor - strokeWidth:(NSInteger)strokeWidth - zIndex:(NSInteger)zIndex; -@property(nonatomic, copy) NSString *polygonId; -@property(nonatomic, assign) BOOL consumesTapEvents; -@property(nonatomic, strong) FGMPlatformColor *fillColor; -@property(nonatomic, assign) BOOL geodesic; -@property(nonatomic, copy) NSArray *points; -@property(nonatomic, copy) NSArray *> *holes; -@property(nonatomic, assign) BOOL visible; -@property(nonatomic, strong) FGMPlatformColor *strokeColor; -@property(nonatomic, assign) NSInteger strokeWidth; -@property(nonatomic, assign) NSInteger zIndex; -@end - -/// Pigeon equivalent of the Polyline class. -@interface FGMPlatformPolyline : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithPolylineId:(NSString *)polylineId - consumesTapEvents:(BOOL)consumesTapEvents - color:(FGMPlatformColor *)color - geodesic:(BOOL)geodesic - jointType:(FGMPlatformJointType)jointType - patterns:(NSArray *)patterns - points:(NSArray *)points - visible:(BOOL)visible - width:(NSInteger)width - zIndex:(NSInteger)zIndex; -@property(nonatomic, copy) NSString *polylineId; -@property(nonatomic, assign) BOOL consumesTapEvents; -@property(nonatomic, strong) FGMPlatformColor *color; -@property(nonatomic, assign) BOOL geodesic; -/// The joint type. -@property(nonatomic, assign) FGMPlatformJointType jointType; -/// The pattern data, as a list of pattern items. -@property(nonatomic, copy) NSArray *patterns; -@property(nonatomic, copy) NSArray *points; -@property(nonatomic, assign) BOOL visible; -@property(nonatomic, assign) NSInteger width; -@property(nonatomic, assign) NSInteger zIndex; -@end - -/// Pigeon equivalent of the PatternItem class. -@interface FGMPlatformPatternItem : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithType:(FGMPlatformPatternItemType)type length:(nullable NSNumber *)length; -@property(nonatomic, assign) FGMPlatformPatternItemType type; -@property(nonatomic, strong, nullable) NSNumber *length; -@end - -/// Pigeon equivalent of the Tile class. -@interface FGMPlatformTile : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithWidth:(NSInteger)width - height:(NSInteger)height - data:(nullable FlutterStandardTypedData *)data; -@property(nonatomic, assign) NSInteger width; -@property(nonatomic, assign) NSInteger height; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *data; -@end - -/// Pigeon equivalent of the TileOverlay class. -@interface FGMPlatformTileOverlay : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithTileOverlayId:(NSString *)tileOverlayId - fadeIn:(BOOL)fadeIn - transparency:(double)transparency - zIndex:(NSInteger)zIndex - visible:(BOOL)visible - tileSize:(NSInteger)tileSize; -@property(nonatomic, copy) NSString *tileOverlayId; -@property(nonatomic, assign) BOOL fadeIn; -@property(nonatomic, assign) double transparency; -@property(nonatomic, assign) NSInteger zIndex; -@property(nonatomic, assign) BOOL visible; -@property(nonatomic, assign) NSInteger tileSize; -@end - -/// Pigeon equivalent of Flutter's EdgeInsets. -@interface FGMPlatformEdgeInsets : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithTop:(double)top bottom:(double)bottom left:(double)left right:(double)right; -@property(nonatomic, assign) double top; -@property(nonatomic, assign) double bottom; -@property(nonatomic, assign) double left; -@property(nonatomic, assign) double right; -@end - -/// Pigeon equivalent of LatLng. -@interface FGMPlatformLatLng : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithLatitude:(double)latitude longitude:(double)longitude; -@property(nonatomic, assign) double latitude; -@property(nonatomic, assign) double longitude; -@end - -/// Pigeon equivalent of LatLngBounds. -@interface FGMPlatformLatLngBounds : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithNortheast:(FGMPlatformLatLng *)northeast - southwest:(FGMPlatformLatLng *)southwest; -@property(nonatomic, strong) FGMPlatformLatLng *northeast; -@property(nonatomic, strong) FGMPlatformLatLng *southwest; -@end - -/// Pigeon equivalent of CameraTargetBounds. -/// -/// As with the Dart version, it exists to distinguish between not setting a -/// a target, and having an explicitly unbounded target (null [bounds]). -@interface FGMPlatformCameraTargetBounds : NSObject -+ (instancetype)makeWithBounds:(nullable FGMPlatformLatLngBounds *)bounds; -@property(nonatomic, strong, nullable) FGMPlatformLatLngBounds *bounds; -@end - -/// Pigeon equivalent of the GroundOverlay class. -@interface FGMPlatformGroundOverlay : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithGroundOverlayId:(NSString *)groundOverlayId - image:(FGMPlatformBitmap *)image - position:(nullable FGMPlatformLatLng *)position - bounds:(nullable FGMPlatformLatLngBounds *)bounds - anchor:(nullable FGMPlatformPoint *)anchor - transparency:(double)transparency - bearing:(double)bearing - zIndex:(NSInteger)zIndex - visible:(BOOL)visible - clickable:(BOOL)clickable - zoomLevel:(nullable NSNumber *)zoomLevel; -@property(nonatomic, copy) NSString *groundOverlayId; -@property(nonatomic, strong) FGMPlatformBitmap *image; -@property(nonatomic, strong, nullable) FGMPlatformLatLng *position; -@property(nonatomic, strong, nullable) FGMPlatformLatLngBounds *bounds; -@property(nonatomic, strong, nullable) FGMPlatformPoint *anchor; -@property(nonatomic, assign) double transparency; -@property(nonatomic, assign) double bearing; -@property(nonatomic, assign) NSInteger zIndex; -@property(nonatomic, assign) BOOL visible; -@property(nonatomic, assign) BOOL clickable; -@property(nonatomic, strong, nullable) NSNumber *zoomLevel; -@end - -/// Information passed to the platform view creation. -@interface FGMPlatformMapViewCreationParams : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype) - makeWithInitialCameraPosition:(FGMPlatformCameraPosition *)initialCameraPosition - mapConfiguration:(FGMPlatformMapConfiguration *)mapConfiguration - initialCircles:(NSArray *)initialCircles - initialMarkers:(NSArray *)initialMarkers - initialPolygons:(NSArray *)initialPolygons - initialPolylines:(NSArray *)initialPolylines - initialHeatmaps:(NSArray *)initialHeatmaps - initialTileOverlays:(NSArray *)initialTileOverlays - initialClusterManagers:(NSArray *)initialClusterManagers - initialGroundOverlays:(NSArray *)initialGroundOverlays; -@property(nonatomic, strong) FGMPlatformCameraPosition *initialCameraPosition; -@property(nonatomic, strong) FGMPlatformMapConfiguration *mapConfiguration; -@property(nonatomic, copy) NSArray *initialCircles; -@property(nonatomic, copy) NSArray *initialMarkers; -@property(nonatomic, copy) NSArray *initialPolygons; -@property(nonatomic, copy) NSArray *initialPolylines; -@property(nonatomic, copy) NSArray *initialHeatmaps; -@property(nonatomic, copy) NSArray *initialTileOverlays; -@property(nonatomic, copy) NSArray *initialClusterManagers; -@property(nonatomic, copy) NSArray *initialGroundOverlays; -@end - -/// Pigeon equivalent of MapConfiguration. -@interface FGMPlatformMapConfiguration : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithCompassEnabled:(nullable NSNumber *)compassEnabled - cameraTargetBounds:(nullable FGMPlatformCameraTargetBounds *)cameraTargetBounds - mapType:(nullable FGMPlatformMapTypeBox *)mapType - minMaxZoomPreference:(nullable FGMPlatformZoomRange *)minMaxZoomPreference - rotateGesturesEnabled:(nullable NSNumber *)rotateGesturesEnabled - scrollGesturesEnabled:(nullable NSNumber *)scrollGesturesEnabled - tiltGesturesEnabled:(nullable NSNumber *)tiltGesturesEnabled - trackCameraPosition:(nullable NSNumber *)trackCameraPosition - zoomGesturesEnabled:(nullable NSNumber *)zoomGesturesEnabled - myLocationEnabled:(nullable NSNumber *)myLocationEnabled - myLocationButtonEnabled:(nullable NSNumber *)myLocationButtonEnabled - padding:(nullable FGMPlatformEdgeInsets *)padding - indoorViewEnabled:(nullable NSNumber *)indoorViewEnabled - trafficEnabled:(nullable NSNumber *)trafficEnabled - buildingsEnabled:(nullable NSNumber *)buildingsEnabled - markerType:(FGMPlatformMarkerType)markerType - mapId:(nullable NSString *)mapId - style:(nullable NSString *)style; -@property(nonatomic, strong, nullable) NSNumber *compassEnabled; -@property(nonatomic, strong, nullable) FGMPlatformCameraTargetBounds *cameraTargetBounds; -@property(nonatomic, strong, nullable) FGMPlatformMapTypeBox *mapType; -@property(nonatomic, strong, nullable) FGMPlatformZoomRange *minMaxZoomPreference; -@property(nonatomic, strong, nullable) NSNumber *rotateGesturesEnabled; -@property(nonatomic, strong, nullable) NSNumber *scrollGesturesEnabled; -@property(nonatomic, strong, nullable) NSNumber *tiltGesturesEnabled; -@property(nonatomic, strong, nullable) NSNumber *trackCameraPosition; -@property(nonatomic, strong, nullable) NSNumber *zoomGesturesEnabled; -@property(nonatomic, strong, nullable) NSNumber *myLocationEnabled; -@property(nonatomic, strong, nullable) NSNumber *myLocationButtonEnabled; -@property(nonatomic, strong, nullable) FGMPlatformEdgeInsets *padding; -@property(nonatomic, strong, nullable) NSNumber *indoorViewEnabled; -@property(nonatomic, strong, nullable) NSNumber *trafficEnabled; -@property(nonatomic, strong, nullable) NSNumber *buildingsEnabled; -@property(nonatomic, assign) FGMPlatformMarkerType markerType; -@property(nonatomic, copy, nullable) NSString *mapId; -@property(nonatomic, copy, nullable) NSString *style; -@end - -/// Pigeon representation of an x,y coordinate. -@interface FGMPlatformPoint : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithX:(double)x y:(double)y; -@property(nonatomic, assign) double x; -@property(nonatomic, assign) double y; -@end - -/// Pigeon representation of a size. -@interface FGMPlatformSize : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithWidth:(double)width height:(double)height; -@property(nonatomic, assign) double width; -@property(nonatomic, assign) double height; -@end - -/// Pigeon representation of a color. -@interface FGMPlatformColor : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithRed:(double)red green:(double)green blue:(double)blue alpha:(double)alpha; -@property(nonatomic, assign) double red; -@property(nonatomic, assign) double green; -@property(nonatomic, assign) double blue; -@property(nonatomic, assign) double alpha; -@end - -/// Pigeon equivalent of GMSTileLayer properties. -@interface FGMPlatformTileLayer : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithVisible:(BOOL)visible - fadeIn:(BOOL)fadeIn - opacity:(double)opacity - zIndex:(NSInteger)zIndex; -@property(nonatomic, assign) BOOL visible; -@property(nonatomic, assign) BOOL fadeIn; -@property(nonatomic, assign) double opacity; -@property(nonatomic, assign) NSInteger zIndex; -@end - -/// Pigeon equivalent of MinMaxZoomPreference. -@interface FGMPlatformZoomRange : NSObject -+ (instancetype)makeWithMin:(nullable NSNumber *)min max:(nullable NSNumber *)max; -@property(nonatomic, strong, nullable) NSNumber *min; -@property(nonatomic, strong, nullable) NSNumber *max; -@end - -/// Pigeon equivalent of [BitmapDescriptor]. As there are multiple disjoint -/// types of [BitmapDescriptor], [PlatformBitmap] contains a single field which -/// may hold the pigeon equivalent type of any of them. -@interface FGMPlatformBitmap : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithBitmap:(id)bitmap; -/// One of [PlatformBitmapAssetMap], [PlatformBitmapAsset], -/// [PlatformBitmapAssetImage], [PlatformBitmapBytesMap], -/// [PlatformBitmapBytes], or [PlatformBitmapDefaultMarker]. -/// As Pigeon does not currently support data class inheritance, this -/// approach allows for the different bitmap implementations to be valid -/// argument and return types of the API methods. See -/// https://github.com/flutter/flutter/issues/117819. -@property(nonatomic, strong) id bitmap; -@end - -/// Pigeon equivalent of [DefaultMarker]. -@interface FGMPlatformBitmapDefaultMarker : NSObject -+ (instancetype)makeWithHue:(nullable NSNumber *)hue; -@property(nonatomic, strong, nullable) NSNumber *hue; -@end - -/// Pigeon equivalent of [BytesBitmap]. -@interface FGMPlatformBitmapBytes : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithByteData:(FlutterStandardTypedData *)byteData - size:(nullable FGMPlatformSize *)size; -@property(nonatomic, strong) FlutterStandardTypedData *byteData; -@property(nonatomic, strong, nullable) FGMPlatformSize *size; -@end - -/// Pigeon equivalent of [AssetBitmap]. -@interface FGMPlatformBitmapAsset : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithName:(NSString *)name pkg:(nullable NSString *)pkg; -@property(nonatomic, copy) NSString *name; -@property(nonatomic, copy, nullable) NSString *pkg; -@end - -/// Pigeon equivalent of [AssetImageBitmap]. -@interface FGMPlatformBitmapAssetImage : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithName:(NSString *)name - scale:(double)scale - size:(nullable FGMPlatformSize *)size; -@property(nonatomic, copy) NSString *name; -@property(nonatomic, assign) double scale; -@property(nonatomic, strong, nullable) FGMPlatformSize *size; -@end - -/// Pigeon equivalent of [AssetMapBitmap]. -@interface FGMPlatformBitmapAssetMap : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithAssetName:(NSString *)assetName - bitmapScaling:(FGMPlatformMapBitmapScaling)bitmapScaling - imagePixelRatio:(double)imagePixelRatio - width:(nullable NSNumber *)width - height:(nullable NSNumber *)height; -@property(nonatomic, copy) NSString *assetName; -@property(nonatomic, assign) FGMPlatformMapBitmapScaling bitmapScaling; -@property(nonatomic, assign) double imagePixelRatio; -@property(nonatomic, strong, nullable) NSNumber *width; -@property(nonatomic, strong, nullable) NSNumber *height; -@end - -/// Pigeon equivalent of [BytesMapBitmap]. -@interface FGMPlatformBitmapBytesMap : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithByteData:(FlutterStandardTypedData *)byteData - bitmapScaling:(FGMPlatformMapBitmapScaling)bitmapScaling - imagePixelRatio:(double)imagePixelRatio - width:(nullable NSNumber *)width - height:(nullable NSNumber *)height; -@property(nonatomic, strong) FlutterStandardTypedData *byteData; -@property(nonatomic, assign) FGMPlatformMapBitmapScaling bitmapScaling; -@property(nonatomic, assign) double imagePixelRatio; -@property(nonatomic, strong, nullable) NSNumber *width; -@property(nonatomic, strong, nullable) NSNumber *height; -@end - -/// Pigeon equivalent of [PinConfig]. -@interface FGMPlatformBitmapPinConfig : NSObject -+ (instancetype)makeWithBackgroundColor:(nullable FGMPlatformColor *)backgroundColor - borderColor:(nullable FGMPlatformColor *)borderColor - glyphColor:(nullable FGMPlatformColor *)glyphColor - glyphTextColor:(nullable FGMPlatformColor *)glyphTextColor - glyphText:(nullable NSString *)glyphText - glyphBitmap:(nullable FGMPlatformBitmap *)glyphBitmap; -@property(nonatomic, strong, nullable) FGMPlatformColor *backgroundColor; -@property(nonatomic, strong, nullable) FGMPlatformColor *borderColor; -@property(nonatomic, strong, nullable) FGMPlatformColor *glyphColor; -@property(nonatomic, strong, nullable) FGMPlatformColor *glyphTextColor; -@property(nonatomic, copy, nullable) NSString *glyphText; -@property(nonatomic, strong, nullable) FGMPlatformBitmap *glyphBitmap; -@end - -/// The codec used by all APIs. -NSObject *FGMGetGoogleMapsFlutterPigeonMessagesCodec(void); - -/// Interface for non-test interactions with the native SDK. -/// -/// For test-only state queries, see [MapsInspectorApi]. -@protocol FGMMapsApi -/// Returns once the map instance is available. -- (void)waitForMapWithError:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the map's configuration options. -/// -/// Only non-null configuration values will result in updates; options with -/// null values will remain unchanged. -- (void)updateWithMapConfiguration:(FGMPlatformMapConfiguration *)configuration - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of circles on the map. -- (void)updateCirclesByAdding:(NSArray *)toAdd - changing:(NSArray *)toChange - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of heatmaps on the map. -- (void)updateHeatmapsByAdding:(NSArray *)toAdd - changing:(NSArray *)toChange - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of custer managers for clusters on the map. -- (void)updateClusterManagersByAdding:(NSArray *)toAdd - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of markers on the map. -- (void)updateMarkersByAdding:(NSArray *)toAdd - changing:(NSArray *)toChange - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of polygonss on the map. -- (void)updatePolygonsByAdding:(NSArray *)toAdd - changing:(NSArray *)toChange - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of polylines on the map. -- (void)updatePolylinesByAdding:(NSArray *)toAdd - changing:(NSArray *)toChange - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of tile overlays on the map. -- (void)updateTileOverlaysByAdding:(NSArray *)toAdd - changing:(NSArray *)toChange - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of ground overlays on the map. -- (void)updateGroundOverlaysByAdding:(NSArray *)toAdd - changing:(NSArray *)toChange - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Gets the screen coordinate for the given map location. -/// -/// @return `nil` only when `error != nil`. -- (nullable FGMPlatformPoint *)screenCoordinatesForLatLng:(FGMPlatformLatLng *)latLng - error:(FlutterError *_Nullable *_Nonnull)error; -/// Gets the map location for the given screen coordinate. -/// -/// @return `nil` only when `error != nil`. -- (nullable FGMPlatformLatLng *)latLngForScreenCoordinate:(FGMPlatformPoint *)screenCoordinate - error:(FlutterError *_Nullable *_Nonnull)error; -/// Gets the map region currently displayed on the map. -/// -/// @return `nil` only when `error != nil`. -- (nullable FGMPlatformLatLngBounds *)visibleMapRegion:(FlutterError *_Nullable *_Nonnull)error; -/// Moves the camera according to [cameraUpdate] immediately, with no -/// animation. -- (void)moveCameraWithUpdate:(FGMPlatformCameraUpdate *)cameraUpdate - error:(FlutterError *_Nullable *_Nonnull)error; -/// Moves the camera according to [cameraUpdate], animating the update using a -/// duration in milliseconds if provided. -- (void)animateCameraWithUpdate:(FGMPlatformCameraUpdate *)cameraUpdate - duration:(nullable NSNumber *)durationMilliseconds - error:(FlutterError *_Nullable *_Nonnull)error; -/// Gets the current map zoom level. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)currentZoomLevel:(FlutterError *_Nullable *_Nonnull)error; -/// Show the info window for the marker with the given ID. -- (void)showInfoWindowForMarkerWithIdentifier:(NSString *)markerId - error:(FlutterError *_Nullable *_Nonnull)error; -/// Hide the info window for the marker with the given ID. -- (void)hideInfoWindowForMarkerWithIdentifier:(NSString *)markerId - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns true if the marker with the given ID is currently displaying its -/// info window. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *) - isShowingInfoWindowForMarkerWithIdentifier:(NSString *)markerId - error:(FlutterError *_Nullable *_Nonnull)error; -/// Sets the style to the given map style string, where an empty string -/// indicates that the style should be cleared. -/// -/// If there was an error setting the style, such as an invalid style string, -/// returns the error message. -- (nullable NSString *)setStyle:(NSString *)style error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the error string from the last attempt to set the map style, if -/// any. -/// -/// This allows checking asynchronously for initial style failures, as there -/// is no way to return failures from map initialization. -- (nullable NSString *)lastStyleError:(FlutterError *_Nullable *_Nonnull)error; -/// Clears the cache of tiles previously requseted from the tile provider. -- (void)clearTileCacheForOverlayWithIdentifier:(NSString *)tileOverlayId - error:(FlutterError *_Nullable *_Nonnull)error; -/// Takes a snapshot of the map and returns its image data. -- (nullable FlutterStandardTypedData *)takeSnapshotWithError: - (FlutterError *_Nullable *_Nonnull)error; -/// Returns true if the map supports advanced markers. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)isAdvancedMarkersAvailable:(FlutterError *_Nullable *_Nonnull)error; -@end - -extern void SetUpFGMMapsApi(id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFGMMapsApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); - -/// Interface for calls from the native SDK to Dart. -@interface FGMMapsCallbackApi : NSObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix; -/// Called when the map camera starts moving. -- (void)didStartCameraMoveWithCompletion:(void (^)(FlutterError *_Nullable))completion; -/// Called when the map camera moves. -- (void)didMoveCameraToPosition:(FGMPlatformCameraPosition *)cameraPosition - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when the map camera stops moving. -- (void)didIdleCameraWithCompletion:(void (^)(FlutterError *_Nullable))completion; -/// Called when the map, not a specifc map object, is tapped. -- (void)didTapAtPosition:(FGMPlatformLatLng *)position - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when the map, not a specifc map object, is long pressed. -- (void)didLongPressAtPosition:(FGMPlatformLatLng *)position - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a marker is tapped. -- (void)didTapMarkerWithIdentifier:(NSString *)markerId - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a marker drag starts. -- (void)didStartDragForMarkerWithIdentifier:(NSString *)markerId - atPosition:(FGMPlatformLatLng *)position - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a marker drag updates. -- (void)didDragMarkerWithIdentifier:(NSString *)markerId - atPosition:(FGMPlatformLatLng *)position - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a marker drag ends. -- (void)didEndDragForMarkerWithIdentifier:(NSString *)markerId - atPosition:(FGMPlatformLatLng *)position - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a marker's info window is tapped. -- (void)didTapInfoWindowOfMarkerWithIdentifier:(NSString *)markerId - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a circle is tapped. -- (void)didTapCircleWithIdentifier:(NSString *)circleId - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a marker cluster is tapped. -- (void)didTapCluster:(FGMPlatformCluster *)cluster - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a polygon is tapped. -- (void)didTapPolygonWithIdentifier:(NSString *)polygonId - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a polyline is tapped. -- (void)didTapPolylineWithIdentifier:(NSString *)polylineId - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a ground overlay is tapped. -- (void)didTapGroundOverlayWithIdentifier:(NSString *)groundOverlayId - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called to get data for a map tile. -- (void)tileWithOverlayIdentifier:(NSString *)tileOverlayId - location:(FGMPlatformPoint *)location - zoom:(NSInteger)zoom - completion:(void (^)(FGMPlatformTile *_Nullable, - FlutterError *_Nullable))completion; -@end - -/// Dummy interface to force generation of the platform view creation params, -/// which are not used in any Pigeon calls, only the platform view creation -/// call made internally by Flutter. -@protocol FGMMapsPlatformViewApi -- (void)createViewType:(nullable FGMPlatformMapViewCreationParams *)type - error:(FlutterError *_Nullable *_Nonnull)error; -@end - -extern void SetUpFGMMapsPlatformViewApi(id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFGMMapsPlatformViewApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); - -/// Inspector API only intended for use in integration tests. -@protocol FGMMapsInspectorApi -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)areBuildingsEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)areRotateGesturesEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)areScrollGesturesEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)areTiltGesturesEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)areZoomGesturesEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)isCompassEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)isMyLocationButtonEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)isTrafficEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -- (nullable FGMPlatformTileLayer *)tileOverlayWithIdentifier:(NSString *)tileOverlayId - error: - (FlutterError *_Nullable *_Nonnull)error; -- (nullable FGMPlatformGroundOverlay *) - groundOverlayWithIdentifier:(NSString *)groundOverlayId - error:(FlutterError *_Nullable *_Nonnull)error; -- (nullable FGMPlatformHeatmap *)heatmapWithIdentifier:(NSString *)heatmapId - error:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable FGMPlatformZoomRange *)zoomRange:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSArray *) - clustersWithIdentifier:(NSString *)clusterManagerId - error:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable FGMPlatformCameraPosition *)cameraPosition:(FlutterError *_Nullable *_Nonnull)error; -@end - -extern void SetUpFGMMapsInspectorApi(id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFGMMapsInspectorApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); - -NS_ASSUME_NONNULL_END diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/lib/src/google_maps_flutter_ios.dart b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/lib/src/google_maps_flutter_ios.dart index c0c8db027c8d..11df18180a50 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/lib/src/google_maps_flutter_ios.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/lib/src/google_maps_flutter_ios.dart @@ -714,57 +714,43 @@ class GoogleMapsFlutterIOS extends GoogleMapsFlutterPlatform { switch (update.updateType) { case CameraUpdateType.newCameraPosition: update as CameraUpdateNewCameraPosition; - return PlatformCameraUpdate( - cameraUpdate: PlatformCameraUpdateNewCameraPosition( - cameraPosition: _platformCameraPositionFromCameraPosition(update.cameraPosition), - ), + return PlatformCameraUpdateNewCameraPosition( + cameraPosition: _platformCameraPositionFromCameraPosition(update.cameraPosition), ); case CameraUpdateType.newLatLng: update as CameraUpdateNewLatLng; - return PlatformCameraUpdate( - cameraUpdate: PlatformCameraUpdateNewLatLng( - latLng: _platformLatLngFromLatLng(update.latLng), - ), - ); + return PlatformCameraUpdateNewLatLng(latLng: _platformLatLngFromLatLng(update.latLng)); case CameraUpdateType.newLatLngZoom: update as CameraUpdateNewLatLngZoom; - return PlatformCameraUpdate( - cameraUpdate: PlatformCameraUpdateNewLatLngZoom( - latLng: _platformLatLngFromLatLng(update.latLng), - zoom: update.zoom, - ), + return PlatformCameraUpdateNewLatLngZoom( + latLng: _platformLatLngFromLatLng(update.latLng), + zoom: update.zoom, ); case CameraUpdateType.newLatLngBounds: update as CameraUpdateNewLatLngBounds; - return PlatformCameraUpdate( - cameraUpdate: PlatformCameraUpdateNewLatLngBounds( - bounds: _platformLatLngBoundsFromLatLngBounds(update.bounds)!, - padding: update.padding, - ), + return PlatformCameraUpdateNewLatLngBounds( + bounds: _platformLatLngBoundsFromLatLngBounds(update.bounds)!, + padding: update.padding, ); case CameraUpdateType.zoomTo: update as CameraUpdateZoomTo; - return PlatformCameraUpdate(cameraUpdate: PlatformCameraUpdateZoomTo(zoom: update.zoom)); + return PlatformCameraUpdateZoomTo(zoom: update.zoom); case CameraUpdateType.zoomBy: update as CameraUpdateZoomBy; final Offset? focus = update.focus; - return PlatformCameraUpdate( - cameraUpdate: PlatformCameraUpdateZoomBy( - amount: update.amount, - focus: focus == null ? null : _platformPointFromOffset(focus), - ), + return PlatformCameraUpdateZoomBy( + amount: update.amount, + focus: focus == null ? null : _platformPointFromOffset(focus), ); case CameraUpdateType.zoomIn: update as CameraUpdateZoomIn; - return PlatformCameraUpdate(cameraUpdate: PlatformCameraUpdateZoom(out: false)); + return PlatformCameraUpdateZoom(out: false); case CameraUpdateType.zoomOut: update as CameraUpdateZoomOut; - return PlatformCameraUpdate(cameraUpdate: PlatformCameraUpdateZoom(out: true)); + return PlatformCameraUpdateZoom(out: true); case CameraUpdateType.scrollBy: update as CameraUpdateScrollBy; - return PlatformCameraUpdate( - cameraUpdate: PlatformCameraUpdateScrollBy(dx: update.dx, dy: update.dy), - ); + return PlatformCameraUpdateScrollBy(dx: update.dx, dy: update.dy); } } @@ -816,51 +802,41 @@ class GoogleMapsFlutterIOS extends GoogleMapsFlutterPlatform { static PlatformBitmap platformBitmapFromBitmapDescriptor(BitmapDescriptor bitmap) { switch (bitmap) { case final DefaultMarker marker: - return PlatformBitmap(bitmap: PlatformBitmapDefaultMarker(hue: marker.hue?.toDouble())); + return PlatformBitmapDefaultMarker(hue: marker.hue?.toDouble()); // Clients may still use this deprecated format, so it must be supported. // ignore: deprecated_member_use case final BytesBitmap bytes: final Size? size = bytes.size; - return PlatformBitmap( - bitmap: PlatformBitmapBytes( - byteData: bytes.byteData, - size: (size == null) ? null : _platformSizeFromSize(size), - ), + return PlatformBitmapBytes( + byteData: bytes.byteData, + size: (size == null) ? null : _platformSizeFromSize(size), ); case final AssetBitmap asset: - return PlatformBitmap( - bitmap: PlatformBitmapAsset(name: asset.name, pkg: asset.package), - ); + return PlatformBitmapAsset(name: asset.name, pkg: asset.package); // Clients may still use this deprecated format, so it must be supported. // ignore: deprecated_member_use case final AssetImageBitmap asset: final Size? size = asset.size; - return PlatformBitmap( - bitmap: PlatformBitmapAssetImage( - name: asset.name, - scale: asset.scale, - size: (size == null) ? null : _platformSizeFromSize(size), - ), + return PlatformBitmapAssetImage( + name: asset.name, + scale: asset.scale, + size: (size == null) ? null : _platformSizeFromSize(size), ); case final AssetMapBitmap asset: - return PlatformBitmap( - bitmap: PlatformBitmapAssetMap( - assetName: asset.assetName, - bitmapScaling: platformMapBitmapScalingFromScaling(asset.bitmapScaling), - imagePixelRatio: asset.imagePixelRatio, - width: asset.width, - height: asset.height, - ), + return PlatformBitmapAssetMap( + assetName: asset.assetName, + bitmapScaling: platformMapBitmapScalingFromScaling(asset.bitmapScaling), + imagePixelRatio: asset.imagePixelRatio, + width: asset.width, + height: asset.height, ); case final BytesMapBitmap bytes: - return PlatformBitmap( - bitmap: PlatformBitmapBytesMap( - byteData: bytes.byteData, - bitmapScaling: platformMapBitmapScalingFromScaling(bytes.bitmapScaling), - imagePixelRatio: bytes.imagePixelRatio, - width: bytes.width, - height: bytes.height, - ), + return PlatformBitmapBytesMap( + byteData: bytes.byteData, + bitmapScaling: platformMapBitmapScalingFromScaling(bytes.bitmapScaling), + imagePixelRatio: bytes.imagePixelRatio, + width: bytes.width, + height: bytes.height, ); case final PinConfig pinConfig: final PlatformColor? backgroundColor = pinConfig.backgroundColor != null @@ -871,38 +847,30 @@ class GoogleMapsFlutterIOS extends GoogleMapsFlutterPlatform { : null; switch (pinConfig.glyph) { case final CircleGlyph circleGlyph: - return PlatformBitmap( - bitmap: PlatformBitmapPinConfig( - backgroundColor: backgroundColor, - borderColor: borderColor, - glyphColor: _platformColorFromColor(circleGlyph.color), - ), + return PlatformBitmapPinConfig( + backgroundColor: backgroundColor, + borderColor: borderColor, + glyphColor: _platformColorFromColor(circleGlyph.color), ); case final TextGlyph textGlyph: - return PlatformBitmap( - bitmap: PlatformBitmapPinConfig( - backgroundColor: backgroundColor, - borderColor: borderColor, - glyphText: textGlyph.text, - glyphTextColor: textGlyph.textColor != null - ? _platformColorFromColor(textGlyph.textColor!) - : null, - ), + return PlatformBitmapPinConfig( + backgroundColor: backgroundColor, + borderColor: borderColor, + glyphText: textGlyph.text, + glyphTextColor: textGlyph.textColor != null + ? _platformColorFromColor(textGlyph.textColor!) + : null, ); case final BitmapGlyph bitmapGlyph: - return PlatformBitmap( - bitmap: PlatformBitmapPinConfig( - backgroundColor: backgroundColor, - borderColor: borderColor, - glyphBitmap: platformBitmapFromBitmapDescriptor(bitmapGlyph.bitmap), - ), + return PlatformBitmapPinConfig( + backgroundColor: backgroundColor, + borderColor: borderColor, + glyphBitmap: platformBitmapFromBitmapDescriptor(bitmapGlyph.bitmap), ); case null: - return PlatformBitmap( - bitmap: PlatformBitmapPinConfig( - backgroundColor: backgroundColor, - borderColor: borderColor, - ), + return PlatformBitmapPinConfig( + backgroundColor: backgroundColor, + borderColor: borderColor, ); } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/lib/src/messages.g.dart b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/lib/src/messages.g.dart index ee3002aa13ce..0d4c1db5f19f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/lib/src/messages.g.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/lib/src/messages.g.dart @@ -190,52 +190,10 @@ class PlatformCameraPosition { } /// Pigeon representation of a CameraUpdate. -class PlatformCameraUpdate { - PlatformCameraUpdate({required this.cameraUpdate}); - - /// This Object must be one of the classes below prefixed with - /// PlatformCameraUpdate. Each such class represents a different type of - /// camera update, and each holds a different set of data, preventing the - /// use of a single unified class. - Object cameraUpdate; - - List _toList() { - return [cameraUpdate]; - } - - Object encode() { - return _toList(); - } - - static PlatformCameraUpdate decode(Object result) { - result as List; - return PlatformCameraUpdate(cameraUpdate: result[0]!); - } - - @override - // ignore: avoid_equals_and_hash_code_on_mutable_classes - bool operator ==(Object other) { - if (other is! PlatformCameraUpdate || other.runtimeType != runtimeType) { - return false; - } - if (identical(this, other)) { - return true; - } - return _deepEquals(cameraUpdate, other.cameraUpdate); - } - - @override - // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => _deepHash([runtimeType, ..._toList()]); - - @override - String toString() { - return 'PlatformCameraUpdate(cameraUpdate: $cameraUpdate)'; - } -} +sealed class PlatformCameraUpdate {} /// Pigeon equivalent of NewCameraPosition -class PlatformCameraUpdateNewCameraPosition { +class PlatformCameraUpdateNewCameraPosition extends PlatformCameraUpdate { PlatformCameraUpdateNewCameraPosition({required this.cameraPosition}); PlatformCameraPosition cameraPosition; @@ -278,7 +236,7 @@ class PlatformCameraUpdateNewCameraPosition { } /// Pigeon equivalent of NewLatLng -class PlatformCameraUpdateNewLatLng { +class PlatformCameraUpdateNewLatLng extends PlatformCameraUpdate { PlatformCameraUpdateNewLatLng({required this.latLng}); PlatformLatLng latLng; @@ -319,7 +277,7 @@ class PlatformCameraUpdateNewLatLng { } /// Pigeon equivalent of NewLatLngBounds -class PlatformCameraUpdateNewLatLngBounds { +class PlatformCameraUpdateNewLatLngBounds extends PlatformCameraUpdate { PlatformCameraUpdateNewLatLngBounds({required this.bounds, required this.padding}); PlatformLatLngBounds bounds; @@ -365,7 +323,7 @@ class PlatformCameraUpdateNewLatLngBounds { } /// Pigeon equivalent of NewLatLngZoom -class PlatformCameraUpdateNewLatLngZoom { +class PlatformCameraUpdateNewLatLngZoom extends PlatformCameraUpdate { PlatformCameraUpdateNewLatLngZoom({required this.latLng, required this.zoom}); PlatformLatLng latLng; @@ -411,7 +369,7 @@ class PlatformCameraUpdateNewLatLngZoom { } /// Pigeon equivalent of ScrollBy -class PlatformCameraUpdateScrollBy { +class PlatformCameraUpdateScrollBy extends PlatformCameraUpdate { PlatformCameraUpdateScrollBy({required this.dx, required this.dy}); double dx; @@ -454,7 +412,7 @@ class PlatformCameraUpdateScrollBy { } /// Pigeon equivalent of ZoomBy -class PlatformCameraUpdateZoomBy { +class PlatformCameraUpdateZoomBy extends PlatformCameraUpdate { PlatformCameraUpdateZoomBy({required this.amount, this.focus}); double amount; @@ -500,7 +458,7 @@ class PlatformCameraUpdateZoomBy { } /// Pigeon equivalent of ZoomIn/ZoomOut -class PlatformCameraUpdateZoom { +class PlatformCameraUpdateZoom extends PlatformCameraUpdate { PlatformCameraUpdateZoom({required this.out}); bool out; @@ -541,7 +499,7 @@ class PlatformCameraUpdateZoom { } /// Pigeon equivalent of ZoomTo -class PlatformCameraUpdateZoomTo { +class PlatformCameraUpdateZoomTo extends PlatformCameraUpdate { PlatformCameraUpdateZoomTo({required this.zoom}); double zoom; @@ -2306,58 +2264,11 @@ class PlatformZoomRange { } } -/// Pigeon equivalent of [BitmapDescriptor]. As there are multiple disjoint -/// types of [BitmapDescriptor], [PlatformBitmap] contains a single field which -/// may hold the pigeon equivalent type of any of them. -class PlatformBitmap { - PlatformBitmap({required this.bitmap}); - - /// One of [PlatformBitmapAssetMap], [PlatformBitmapAsset], - /// [PlatformBitmapAssetImage], [PlatformBitmapBytesMap], - /// [PlatformBitmapBytes], or [PlatformBitmapDefaultMarker]. - /// As Pigeon does not currently support data class inheritance, this - /// approach allows for the different bitmap implementations to be valid - /// argument and return types of the API methods. See - /// https://github.com/flutter/flutter/issues/117819. - Object bitmap; - - List _toList() { - return [bitmap]; - } - - Object encode() { - return _toList(); - } - - static PlatformBitmap decode(Object result) { - result as List; - return PlatformBitmap(bitmap: result[0]!); - } - - @override - // ignore: avoid_equals_and_hash_code_on_mutable_classes - bool operator ==(Object other) { - if (other is! PlatformBitmap || other.runtimeType != runtimeType) { - return false; - } - if (identical(this, other)) { - return true; - } - return _deepEquals(bitmap, other.bitmap); - } - - @override - // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => _deepHash([runtimeType, ..._toList()]); - - @override - String toString() { - return 'PlatformBitmap(bitmap: $bitmap)'; - } -} +/// Pigeon equivalent of [BitmapDescriptor]. +sealed class PlatformBitmap {} /// Pigeon equivalent of [DefaultMarker]. -class PlatformBitmapDefaultMarker { +class PlatformBitmapDefaultMarker extends PlatformBitmap { PlatformBitmapDefaultMarker({this.hue}); double? hue; @@ -2398,7 +2309,7 @@ class PlatformBitmapDefaultMarker { } /// Pigeon equivalent of [BytesBitmap]. -class PlatformBitmapBytes { +class PlatformBitmapBytes extends PlatformBitmap { PlatformBitmapBytes({required this.byteData, this.size}); Uint8List byteData; @@ -2441,7 +2352,7 @@ class PlatformBitmapBytes { } /// Pigeon equivalent of [AssetBitmap]. -class PlatformBitmapAsset { +class PlatformBitmapAsset extends PlatformBitmap { PlatformBitmapAsset({required this.name, this.pkg}); String name; @@ -2484,7 +2395,7 @@ class PlatformBitmapAsset { } /// Pigeon equivalent of [AssetImageBitmap]. -class PlatformBitmapAssetImage { +class PlatformBitmapAssetImage extends PlatformBitmap { PlatformBitmapAssetImage({required this.name, required this.scale, this.size}); String name; @@ -2535,7 +2446,7 @@ class PlatformBitmapAssetImage { } /// Pigeon equivalent of [AssetMapBitmap]. -class PlatformBitmapAssetMap { +class PlatformBitmapAssetMap extends PlatformBitmap { PlatformBitmapAssetMap({ required this.assetName, required this.bitmapScaling, @@ -2600,7 +2511,7 @@ class PlatformBitmapAssetMap { } /// Pigeon equivalent of [BytesMapBitmap]. -class PlatformBitmapBytesMap { +class PlatformBitmapBytesMap extends PlatformBitmap { PlatformBitmapBytesMap({ required this.byteData, required this.bitmapScaling, @@ -2665,7 +2576,7 @@ class PlatformBitmapBytesMap { } /// Pigeon equivalent of [PinConfig]. -class PlatformBitmapPinConfig { +class PlatformBitmapPinConfig extends PlatformBitmap { PlatformBitmapPinConfig({ this.backgroundColor, this.borderColor, @@ -2769,131 +2680,125 @@ class _PigeonCodec extends StandardMessageCodec { } else if (value is PlatformCameraPosition) { buffer.putUint8(135); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdate) { - buffer.putUint8(136); - writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateNewCameraPosition) { - buffer.putUint8(137); + buffer.putUint8(136); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateNewLatLng) { - buffer.putUint8(138); + buffer.putUint8(137); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateNewLatLngBounds) { - buffer.putUint8(139); + buffer.putUint8(138); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateNewLatLngZoom) { - buffer.putUint8(140); + buffer.putUint8(139); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateScrollBy) { - buffer.putUint8(141); + buffer.putUint8(140); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateZoomBy) { - buffer.putUint8(142); + buffer.putUint8(141); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateZoom) { - buffer.putUint8(143); + buffer.putUint8(142); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateZoomTo) { - buffer.putUint8(144); + buffer.putUint8(143); writeValue(buffer, value.encode()); } else if (value is PlatformCircle) { - buffer.putUint8(145); + buffer.putUint8(144); writeValue(buffer, value.encode()); } else if (value is PlatformHeatmap) { - buffer.putUint8(146); + buffer.putUint8(145); writeValue(buffer, value.encode()); } else if (value is PlatformHeatmapGradient) { - buffer.putUint8(147); + buffer.putUint8(146); writeValue(buffer, value.encode()); } else if (value is PlatformWeightedLatLng) { - buffer.putUint8(148); + buffer.putUint8(147); writeValue(buffer, value.encode()); } else if (value is PlatformInfoWindow) { - buffer.putUint8(149); + buffer.putUint8(148); writeValue(buffer, value.encode()); } else if (value is PlatformCluster) { - buffer.putUint8(150); + buffer.putUint8(149); writeValue(buffer, value.encode()); } else if (value is PlatformClusterManager) { - buffer.putUint8(151); + buffer.putUint8(150); writeValue(buffer, value.encode()); } else if (value is PlatformMarker) { - buffer.putUint8(152); + buffer.putUint8(151); writeValue(buffer, value.encode()); } else if (value is PlatformPolygon) { - buffer.putUint8(153); + buffer.putUint8(152); writeValue(buffer, value.encode()); } else if (value is PlatformPolyline) { - buffer.putUint8(154); + buffer.putUint8(153); writeValue(buffer, value.encode()); } else if (value is PlatformPatternItem) { - buffer.putUint8(155); + buffer.putUint8(154); writeValue(buffer, value.encode()); } else if (value is PlatformTile) { - buffer.putUint8(156); + buffer.putUint8(155); writeValue(buffer, value.encode()); } else if (value is PlatformTileOverlay) { - buffer.putUint8(157); + buffer.putUint8(156); writeValue(buffer, value.encode()); } else if (value is PlatformEdgeInsets) { - buffer.putUint8(158); + buffer.putUint8(157); writeValue(buffer, value.encode()); } else if (value is PlatformLatLng) { - buffer.putUint8(159); + buffer.putUint8(158); writeValue(buffer, value.encode()); } else if (value is PlatformLatLngBounds) { - buffer.putUint8(160); + buffer.putUint8(159); writeValue(buffer, value.encode()); } else if (value is PlatformCameraTargetBounds) { - buffer.putUint8(161); + buffer.putUint8(160); writeValue(buffer, value.encode()); } else if (value is PlatformGroundOverlay) { - buffer.putUint8(162); + buffer.putUint8(161); writeValue(buffer, value.encode()); } else if (value is PlatformMapViewCreationParams) { - buffer.putUint8(163); + buffer.putUint8(162); writeValue(buffer, value.encode()); } else if (value is PlatformMapConfiguration) { - buffer.putUint8(164); + buffer.putUint8(163); writeValue(buffer, value.encode()); } else if (value is PlatformPoint) { - buffer.putUint8(165); + buffer.putUint8(164); writeValue(buffer, value.encode()); } else if (value is PlatformSize) { - buffer.putUint8(166); + buffer.putUint8(165); writeValue(buffer, value.encode()); } else if (value is PlatformColor) { - buffer.putUint8(167); + buffer.putUint8(166); writeValue(buffer, value.encode()); } else if (value is PlatformTileLayer) { - buffer.putUint8(168); + buffer.putUint8(167); writeValue(buffer, value.encode()); } else if (value is PlatformZoomRange) { - buffer.putUint8(169); - writeValue(buffer, value.encode()); - } else if (value is PlatformBitmap) { - buffer.putUint8(170); + buffer.putUint8(168); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapDefaultMarker) { - buffer.putUint8(171); + buffer.putUint8(169); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapBytes) { - buffer.putUint8(172); + buffer.putUint8(170); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapAsset) { - buffer.putUint8(173); + buffer.putUint8(171); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapAssetImage) { - buffer.putUint8(174); + buffer.putUint8(172); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapAssetMap) { - buffer.putUint8(175); + buffer.putUint8(173); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapBytesMap) { - buffer.putUint8(176); + buffer.putUint8(174); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapPinConfig) { - buffer.putUint8(177); + buffer.putUint8(175); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); @@ -2924,88 +2829,84 @@ class _PigeonCodec extends StandardMessageCodec { case 135: return PlatformCameraPosition.decode(readValue(buffer)!); case 136: - return PlatformCameraUpdate.decode(readValue(buffer)!); - case 137: return PlatformCameraUpdateNewCameraPosition.decode(readValue(buffer)!); - case 138: + case 137: return PlatformCameraUpdateNewLatLng.decode(readValue(buffer)!); - case 139: + case 138: return PlatformCameraUpdateNewLatLngBounds.decode(readValue(buffer)!); - case 140: + case 139: return PlatformCameraUpdateNewLatLngZoom.decode(readValue(buffer)!); - case 141: + case 140: return PlatformCameraUpdateScrollBy.decode(readValue(buffer)!); - case 142: + case 141: return PlatformCameraUpdateZoomBy.decode(readValue(buffer)!); - case 143: + case 142: return PlatformCameraUpdateZoom.decode(readValue(buffer)!); - case 144: + case 143: return PlatformCameraUpdateZoomTo.decode(readValue(buffer)!); - case 145: + case 144: return PlatformCircle.decode(readValue(buffer)!); - case 146: + case 145: return PlatformHeatmap.decode(readValue(buffer)!); - case 147: + case 146: return PlatformHeatmapGradient.decode(readValue(buffer)!); - case 148: + case 147: return PlatformWeightedLatLng.decode(readValue(buffer)!); - case 149: + case 148: return PlatformInfoWindow.decode(readValue(buffer)!); - case 150: + case 149: return PlatformCluster.decode(readValue(buffer)!); - case 151: + case 150: return PlatformClusterManager.decode(readValue(buffer)!); - case 152: + case 151: return PlatformMarker.decode(readValue(buffer)!); - case 153: + case 152: return PlatformPolygon.decode(readValue(buffer)!); - case 154: + case 153: return PlatformPolyline.decode(readValue(buffer)!); - case 155: + case 154: return PlatformPatternItem.decode(readValue(buffer)!); - case 156: + case 155: return PlatformTile.decode(readValue(buffer)!); - case 157: + case 156: return PlatformTileOverlay.decode(readValue(buffer)!); - case 158: + case 157: return PlatformEdgeInsets.decode(readValue(buffer)!); - case 159: + case 158: return PlatformLatLng.decode(readValue(buffer)!); - case 160: + case 159: return PlatformLatLngBounds.decode(readValue(buffer)!); - case 161: + case 160: return PlatformCameraTargetBounds.decode(readValue(buffer)!); - case 162: + case 161: return PlatformGroundOverlay.decode(readValue(buffer)!); - case 163: + case 162: return PlatformMapViewCreationParams.decode(readValue(buffer)!); - case 164: + case 163: return PlatformMapConfiguration.decode(readValue(buffer)!); - case 165: + case 164: return PlatformPoint.decode(readValue(buffer)!); - case 166: + case 165: return PlatformSize.decode(readValue(buffer)!); - case 167: + case 166: return PlatformColor.decode(readValue(buffer)!); - case 168: + case 167: return PlatformTileLayer.decode(readValue(buffer)!); - case 169: + case 168: return PlatformZoomRange.decode(readValue(buffer)!); - case 170: - return PlatformBitmap.decode(readValue(buffer)!); - case 171: + case 169: return PlatformBitmapDefaultMarker.decode(readValue(buffer)!); - case 172: + case 170: return PlatformBitmapBytes.decode(readValue(buffer)!); - case 173: + case 171: return PlatformBitmapAsset.decode(readValue(buffer)!); - case 174: + case 172: return PlatformBitmapAssetImage.decode(readValue(buffer)!); - case 175: + case 173: return PlatformBitmapAssetMap.decode(readValue(buffer)!); - case 176: + case 174: return PlatformBitmapBytesMap.decode(readValue(buffer)!); - case 177: + case 175: return PlatformBitmapPinConfig.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/pigeons/messages.dart b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/pigeons/messages.dart index f1d95e70ae0b..3f620b692269 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/pigeons/messages.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/pigeons/messages.dart @@ -7,14 +7,8 @@ import 'package:pigeon/pigeon.dart'; @ConfigurePigeon( PigeonOptions( dartOut: 'lib/src/messages.g.dart', - // This uses a different output name to avoid conflicts with the pigeon - // files in other packages, without having to use full relative paths - // in #includes (which would make source sharing harder to manage). - objcHeaderOut: - 'ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/google_maps_flutter_ios_sdk10_objc/google_maps_flutter_pigeon_messages.g.h', - objcSourceOut: - 'ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/google_maps_flutter_pigeon_messages.g.m', - objcOptions: ObjcOptions(prefix: 'FGM'), + swiftOut: + 'ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10/Messages.g.swift', copyrightHeader: 'pigeons/copyright.txt', // Use the base package name so that the generated code can be shared // across the implementation copies. @@ -40,66 +34,56 @@ class PlatformCameraPosition { } /// Pigeon representation of a CameraUpdate. -class PlatformCameraUpdate { - PlatformCameraUpdate(this.cameraUpdate); - - /// This Object must be one of the classes below prefixed with - /// PlatformCameraUpdate. Each such class represents a different type of - /// camera update, and each holds a different set of data, preventing the - /// use of a single unified class. - // Pigeon does not support inheritance, which prevents a more strict type - // bound. See https://github.com/flutter/flutter/issues/117819. - final Object cameraUpdate; -} +sealed class PlatformCameraUpdate {} /// Pigeon equivalent of NewCameraPosition -class PlatformCameraUpdateNewCameraPosition { +class PlatformCameraUpdateNewCameraPosition extends PlatformCameraUpdate { PlatformCameraUpdateNewCameraPosition(this.cameraPosition); final PlatformCameraPosition cameraPosition; } /// Pigeon equivalent of NewLatLng -class PlatformCameraUpdateNewLatLng { +class PlatformCameraUpdateNewLatLng extends PlatformCameraUpdate { PlatformCameraUpdateNewLatLng(this.latLng); final PlatformLatLng latLng; } /// Pigeon equivalent of NewLatLngBounds -class PlatformCameraUpdateNewLatLngBounds { +class PlatformCameraUpdateNewLatLngBounds extends PlatformCameraUpdate { PlatformCameraUpdateNewLatLngBounds(this.bounds, this.padding); final PlatformLatLngBounds bounds; final double padding; } /// Pigeon equivalent of NewLatLngZoom -class PlatformCameraUpdateNewLatLngZoom { +class PlatformCameraUpdateNewLatLngZoom extends PlatformCameraUpdate { PlatformCameraUpdateNewLatLngZoom(this.latLng, this.zoom); final PlatformLatLng latLng; final double zoom; } /// Pigeon equivalent of ScrollBy -class PlatformCameraUpdateScrollBy { +class PlatformCameraUpdateScrollBy extends PlatformCameraUpdate { PlatformCameraUpdateScrollBy(this.dx, this.dy); final double dx; final double dy; } /// Pigeon equivalent of ZoomBy -class PlatformCameraUpdateZoomBy { +class PlatformCameraUpdateZoomBy extends PlatformCameraUpdate { PlatformCameraUpdateZoomBy(this.amount, [this.focus]); final double amount; final PlatformPoint? focus; } /// Pigeon equivalent of ZoomIn/ZoomOut -class PlatformCameraUpdateZoom { +class PlatformCameraUpdateZoom extends PlatformCameraUpdate { PlatformCameraUpdateZoom(this.out); final bool out; } /// Pigeon equivalent of ZoomTo -class PlatformCameraUpdateZoomTo { +class PlatformCameraUpdateZoomTo extends PlatformCameraUpdate { PlatformCameraUpdateZoomTo(this.zoom); final double zoom; } @@ -541,31 +525,18 @@ class PlatformZoomRange { final double? max; } -/// Pigeon equivalent of [BitmapDescriptor]. As there are multiple disjoint -/// types of [BitmapDescriptor], [PlatformBitmap] contains a single field which -/// may hold the pigeon equivalent type of any of them. -class PlatformBitmap { - PlatformBitmap({required this.bitmap}); - - /// One of [PlatformBitmapAssetMap], [PlatformBitmapAsset], - /// [PlatformBitmapAssetImage], [PlatformBitmapBytesMap], - /// [PlatformBitmapBytes], or [PlatformBitmapDefaultMarker]. - /// As Pigeon does not currently support data class inheritance, this - /// approach allows for the different bitmap implementations to be valid - /// argument and return types of the API methods. See - /// https://github.com/flutter/flutter/issues/117819. - final Object bitmap; -} +/// Pigeon equivalent of [BitmapDescriptor]. +sealed class PlatformBitmap {} /// Pigeon equivalent of [DefaultMarker]. -class PlatformBitmapDefaultMarker { +class PlatformBitmapDefaultMarker extends PlatformBitmap { PlatformBitmapDefaultMarker({this.hue}); final double? hue; } /// Pigeon equivalent of [BytesBitmap]. -class PlatformBitmapBytes { +class PlatformBitmapBytes extends PlatformBitmap { PlatformBitmapBytes({required this.byteData, this.size}); final Uint8List byteData; @@ -573,7 +544,7 @@ class PlatformBitmapBytes { } /// Pigeon equivalent of [AssetBitmap]. -class PlatformBitmapAsset { +class PlatformBitmapAsset extends PlatformBitmap { PlatformBitmapAsset({required this.name, this.pkg}); final String name; @@ -581,7 +552,7 @@ class PlatformBitmapAsset { } /// Pigeon equivalent of [AssetImageBitmap]. -class PlatformBitmapAssetImage { +class PlatformBitmapAssetImage extends PlatformBitmap { PlatformBitmapAssetImage({required this.name, required this.scale, this.size}); final String name; final double scale; @@ -589,7 +560,7 @@ class PlatformBitmapAssetImage { } /// Pigeon equivalent of [AssetMapBitmap]. -class PlatformBitmapAssetMap { +class PlatformBitmapAssetMap extends PlatformBitmap { PlatformBitmapAssetMap({ required this.assetName, required this.bitmapScaling, @@ -605,7 +576,7 @@ class PlatformBitmapAssetMap { } /// Pigeon equivalent of [BytesMapBitmap]. -class PlatformBitmapBytesMap { +class PlatformBitmapBytesMap extends PlatformBitmap { PlatformBitmapBytesMap({ required this.byteData, required this.bitmapScaling, @@ -624,7 +595,7 @@ class PlatformBitmapBytesMap { enum PlatformMapBitmapScaling { auto, none } /// Pigeon equivalent of [PinConfig]. -class PlatformBitmapPinConfig { +class PlatformBitmapPinConfig extends PlatformBitmap { PlatformBitmapPinConfig({ required this.backgroundColor, required this.borderColor, @@ -655,11 +626,11 @@ abstract class MapsApi { /// /// Only non-null configuration values will result in updates; options with /// null values will remain unchanged. - @ObjCSelector('updateWithMapConfiguration:') + @SwiftFunction('updateWithMapConfiguration(_:)') void updateMapConfiguration(PlatformMapConfiguration configuration); /// Updates the set of circles on the map. - @ObjCSelector('updateCirclesByAdding:changing:removing:') + @SwiftFunction('updateCircles(adding:changing:removing:)') void updateCircles( List toAdd, List toChange, @@ -667,7 +638,7 @@ abstract class MapsApi { ); /// Updates the set of heatmaps on the map. - @ObjCSelector('updateHeatmapsByAdding:changing:removing:') + @SwiftFunction('updateHeatmaps(adding:changing:removing:)') void updateHeatmaps( List toAdd, List toChange, @@ -675,11 +646,11 @@ abstract class MapsApi { ); /// Updates the set of custer managers for clusters on the map. - @ObjCSelector('updateClusterManagersByAdding:removing:') + @SwiftFunction('updateClusterManagers(adding:removing:)') void updateClusterManagers(List toAdd, List idsToRemove); /// Updates the set of markers on the map. - @ObjCSelector('updateMarkersByAdding:changing:removing:') + @SwiftFunction('updateMarkers(adding:changing:removing:)') void updateMarkers( List toAdd, List toChange, @@ -687,7 +658,7 @@ abstract class MapsApi { ); /// Updates the set of polygonss on the map. - @ObjCSelector('updatePolygonsByAdding:changing:removing:') + @SwiftFunction('updatePolygons(adding:changing:removing:)') void updatePolygons( List toAdd, List toChange, @@ -695,7 +666,7 @@ abstract class MapsApi { ); /// Updates the set of polylines on the map. - @ObjCSelector('updatePolylinesByAdding:changing:removing:') + @SwiftFunction('updatePolylines(adding:changing:removing:)') void updatePolylines( List toAdd, List toChange, @@ -703,7 +674,7 @@ abstract class MapsApi { ); /// Updates the set of tile overlays on the map. - @ObjCSelector('updateTileOverlaysByAdding:changing:removing:') + @SwiftFunction('updateTileOverlays(adding:changing:removing:)') void updateTileOverlays( List toAdd, List toChange, @@ -711,7 +682,7 @@ abstract class MapsApi { ); /// Updates the set of ground overlays on the map. - @ObjCSelector('updateGroundOverlaysByAdding:changing:removing:') + @SwiftFunction('updateGroundOverlays(adding:changing:removing:)') void updateGroundOverlays( List toAdd, List toChange, @@ -719,42 +690,42 @@ abstract class MapsApi { ); /// Gets the screen coordinate for the given map location. - @ObjCSelector('screenCoordinatesForLatLng:') + @SwiftFunction('screenCoordinates(for:)') PlatformPoint getScreenCoordinate(PlatformLatLng latLng); /// Gets the map location for the given screen coordinate. - @ObjCSelector('latLngForScreenCoordinate:') + @SwiftFunction('latLng(for:)') PlatformLatLng getLatLng(PlatformPoint screenCoordinate); /// Gets the map region currently displayed on the map. - @ObjCSelector('visibleMapRegion') + @SwiftFunction('visibleMapRegion()') PlatformLatLngBounds getVisibleRegion(); /// Moves the camera according to [cameraUpdate] immediately, with no /// animation. - @ObjCSelector('moveCameraWithUpdate:') + @SwiftFunction('moveCamera(_:)') void moveCamera(PlatformCameraUpdate cameraUpdate); /// Moves the camera according to [cameraUpdate], animating the update using a /// duration in milliseconds if provided. - @ObjCSelector('animateCameraWithUpdate:duration:') + @SwiftFunction('animateCamera(_:duration:)') void animateCamera(PlatformCameraUpdate cameraUpdate, int? durationMilliseconds); /// Gets the current map zoom level. - @ObjCSelector('currentZoomLevel') + @SwiftFunction('zoomLevel()') double getZoomLevel(); /// Show the info window for the marker with the given ID. - @ObjCSelector('showInfoWindowForMarkerWithIdentifier:') + @SwiftFunction('showInfoWindowForMarker(withIdentifier:)') void showInfoWindow(String markerId); /// Hide the info window for the marker with the given ID. - @ObjCSelector('hideInfoWindowForMarkerWithIdentifier:') + @SwiftFunction('hideInfoWindowForMarker(withIdentifier:)') void hideInfoWindow(String markerId); /// Returns true if the marker with the given ID is currently displaying its /// info window. - @ObjCSelector('isShowingInfoWindowForMarkerWithIdentifier:') + @SwiftFunction('isShowingInfoWindowForMarker(withIdentifier:)') bool isInfoWindowShown(String markerId); /// Sets the style to the given map style string, where an empty string @@ -762,7 +733,7 @@ abstract class MapsApi { /// /// If there was an error setting the style, such as an invalid style string, /// returns the error message. - @ObjCSelector('setStyle:') + @SwiftFunction('setStyle(_:)') String? setStyle(String style); /// Returns the error string from the last attempt to set the map style, if @@ -770,18 +741,18 @@ abstract class MapsApi { /// /// This allows checking asynchronously for initial style failures, as there /// is no way to return failures from map initialization. - @ObjCSelector('lastStyleError') + @SwiftFunction('lastStyleError()') String? getLastStyleError(); /// Clears the cache of tiles previously requseted from the tile provider. - @ObjCSelector('clearTileCacheForOverlayWithIdentifier:') + @SwiftFunction('clearTileCacheForOverlay(withIdentifier:)') void clearTileCache(String tileOverlayId); /// Takes a snapshot of the map and returns its image data. Uint8List? takeSnapshot(); /// Returns true if the map supports advanced markers. - @ObjCSelector('isAdvancedMarkersAvailable') + @SwiftFunction('isAdvancedMarkersAvailable()') bool isAdvancedMarkersAvailable(); } @@ -789,68 +760,68 @@ abstract class MapsApi { @FlutterApi() abstract class MapsCallbackApi { /// Called when the map camera starts moving. - @ObjCSelector('didStartCameraMoveWithCompletion') + @SwiftFunction('didStartCameraMove()') void onCameraMoveStarted(); /// Called when the map camera moves. - @ObjCSelector('didMoveCameraToPosition:') + @SwiftFunction('didMoveCamera(to:)') void onCameraMove(PlatformCameraPosition cameraPosition); /// Called when the map camera stops moving. - @ObjCSelector('didIdleCameraWithCompletion') + @SwiftFunction('didIdleCamera()') void onCameraIdle(); /// Called when the map, not a specifc map object, is tapped. - @ObjCSelector('didTapAtPosition:') + @SwiftFunction('didTap(at:)') void onTap(PlatformLatLng position); /// Called when the map, not a specifc map object, is long pressed. - @ObjCSelector('didLongPressAtPosition:') + @SwiftFunction('didLongPress(at:)') void onLongPress(PlatformLatLng position); /// Called when a marker is tapped. - @ObjCSelector('didTapMarkerWithIdentifier:') + @SwiftFunction('didTapMarker(withIdentifier:)') void onMarkerTap(String markerId); /// Called when a marker drag starts. - @ObjCSelector('didStartDragForMarkerWithIdentifier:atPosition:') + @SwiftFunction('didStartDragForMarker(withIdentifier:at:)') void onMarkerDragStart(String markerId, PlatformLatLng position); /// Called when a marker drag updates. - @ObjCSelector('didDragMarkerWithIdentifier:atPosition:') + @SwiftFunction('didDragMarker(withIdentifier:at:)') void onMarkerDrag(String markerId, PlatformLatLng position); /// Called when a marker drag ends. - @ObjCSelector('didEndDragForMarkerWithIdentifier:atPosition:') + @SwiftFunction('didEndDragForMarker(withIdentifier:at:)') void onMarkerDragEnd(String markerId, PlatformLatLng position); /// Called when a marker's info window is tapped. - @ObjCSelector('didTapInfoWindowOfMarkerWithIdentifier:') + @SwiftFunction('didTapInfoWindowOfMarker(withIdentifier:)') void onInfoWindowTap(String markerId); /// Called when a circle is tapped. - @ObjCSelector('didTapCircleWithIdentifier:') + @SwiftFunction('didTapCircle(withIdentifier:)') void onCircleTap(String circleId); /// Called when a marker cluster is tapped. - @ObjCSelector('didTapCluster:') + @SwiftFunction('didTapCluster(_:)') void onClusterTap(PlatformCluster cluster); /// Called when a polygon is tapped. - @ObjCSelector('didTapPolygonWithIdentifier:') + @SwiftFunction('didTapPolygon(withIdentifier:)') void onPolygonTap(String polygonId); /// Called when a polyline is tapped. - @ObjCSelector('didTapPolylineWithIdentifier:') + @SwiftFunction('didTapPolyline(withIdentifier:)') void onPolylineTap(String polylineId); /// Called when a ground overlay is tapped. - @ObjCSelector('didTapGroundOverlayWithIdentifier:') + @SwiftFunction('didTapGroundOverlay(withIdentifier:)') void onGroundOverlayTap(String groundOverlayId); /// Called to get data for a map tile. @async - @ObjCSelector('tileWithOverlayIdentifier:location:zoom:') + @SwiftFunction('tile(withOverlayIdentifier:location:zoom:)') PlatformTile getTileOverlayTile(String tileOverlayId, PlatformPoint location, int zoom); } @@ -874,16 +845,16 @@ abstract class MapsInspectorApi { bool isCompassEnabled(); bool isMyLocationButtonEnabled(); bool isTrafficEnabled(); - @ObjCSelector('tileOverlayWithIdentifier:') + @SwiftFunction('tileOverlay(withIdentifier:)') PlatformTileLayer? getTileOverlayInfo(String tileOverlayId); - @ObjCSelector('groundOverlayWithIdentifier:') + @SwiftFunction('groundOverlay(withIdentifier:)') PlatformGroundOverlay? getGroundOverlayInfo(String groundOverlayId); - @ObjCSelector('heatmapWithIdentifier:') + @SwiftFunction('heatmap(withIdentifier:)') PlatformHeatmap? getHeatmapInfo(String heatmapId); - @ObjCSelector('zoomRange') + @SwiftFunction('zoomRange()') PlatformZoomRange getZoomRange(); - @ObjCSelector('clustersWithIdentifier:') + @SwiftFunction('clusters(withIdentifier:)') List getClusters(String clusterManagerId); - @ObjCSelector('cameraPosition') + @SwiftFunction('cameraPosition()') PlatformCameraPosition getCameraPosition(); } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/tool/unshared_source_files.dart b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/tool/unshared_source_files.dart index fb0eab0fb288..8660b7e6a17e 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/tool/unshared_source_files.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/tool/unshared_source_files.dart @@ -12,6 +12,4 @@ const intentionallyUnsharedSourceFiles = [ 'test/package_specific_test_import.dart', // Each package will have its own list. 'tool/unshared_source_files.dart', - // Unshared due to https://github.com/flutter/flutter/issues/183441. - 'ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/google_maps_flutter_ios_sdk10_objc/GoogleMapsUtilsTrampoline.h', ]; diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9.podspec b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9.podspec index eb38d5648233..7bb0a419560b 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9.podspec +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/ios/google_maps_flutter_ios_sdk9.podspec @@ -14,7 +14,7 @@ Downloaded by pub (not CocoaPods). s.author = { 'Flutter Dev Team' => 'flutter-dev@googlegroups.com' } s.source = { :http => 'https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_ios_sdk9' } s.documentation_url = 'https://pub.dev/packages/google_maps_flutter_ios_sdk9' - s.source_files = 'google_maps_flutter_ios_sdk9/Sources/**/*.{swift}' + s.source_files = 'google_maps_flutter_ios_sdk9/Sources/**/*.swift' s.dependency 'Flutter' s.dependency 'GoogleMaps', '~> 9.2' # Google-Maps-iOS-Utils 6.0 and 6.1.0 support GoogleMaps 9.x. The next release diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/CircleControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/CircleControllerTests.swift index 5be000f1d2a9..cbcbca2dc372 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/CircleControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/CircleControllerTests.swift @@ -4,7 +4,6 @@ import GoogleMaps import Testing -import google_maps_flutter_ios_objc @testable import google_maps_flutter_ios @@ -14,14 +13,14 @@ import google_maps_flutter_ios_objc let circle = PropertyOrderValidatingCircle() CircleController.update( circle, - from: FGMPlatformCircle.make( - withConsumeTapEvents: false, - fill: FGMPlatformColor.make(withRed: 0, green: 0, blue: 0, alpha: 0), - stroke: FGMPlatformColor.make(withRed: 0, green: 0, blue: 0, alpha: 0), + from: PlatformCircle( + consumeTapEvents: false, + fillColor: PlatformColor(red: 0, green: 0, blue: 0, alpha: 0), + strokeColor: PlatformColor(red: 0, green: 0, blue: 0, alpha: 0), visible: true, strokeWidth: 0, zIndex: 0, - center: FGMPlatformLatLng.make(withLatitude: 0, longitude: 0), + center: PlatformLatLng(latitude: 0, longitude: 0), radius: 10, circleId: "circle" ), diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/ClusterManagersControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/ClusterManagersControllerTests.swift index 0d2cf1f8a891..38bcae7f6962 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/ClusterManagersControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/ClusterManagersControllerTests.swift @@ -5,7 +5,6 @@ import Flutter import GoogleMaps import Testing -import google_maps_flutter_ios_objc @testable import google_maps_flutter_ios @@ -36,7 +35,7 @@ import google_maps_flutter_ios_objc // Add cluster managers. let clusterManagerId = "cm" - let clusterManagerToAdd = FGMPlatformClusterManager.make(withIdentifier: clusterManagerId) + let clusterManagerToAdd = PlatformClusterManager(identifier: clusterManagerId) clusterManagersController.add([clusterManagerToAdd]) // Verify that cluster managers are available @@ -47,18 +46,16 @@ import google_maps_flutter_ios_objc let markerId1 = "m1" let markerId2 = "m2" - let zeroPoint = FGMPlatformPoint.makeWith(x: 0, y: 0) - let zeroLatLng = FGMPlatformLatLng.make(withLatitude: 0, longitude: 0) - let bitmap = FGMPlatformBitmap.make( - withBitmap: FGMPlatformBitmapDefaultMarker.make(withHue: 0) - ) - let infoWindow = FGMPlatformInfoWindow.make( - withTitle: "Info", + let zeroPoint = PlatformPoint(x: 0, y: 0) + let zeroLatLng = PlatformLatLng(latitude: 0, longitude: 0) + let bitmap = PlatformBitmapDefaultMarker(hue: 0) + let infoWindow = PlatformInfoWindow( + title: "Info", snippet: nil, anchor: zeroPoint ) - let marker1 = FGMPlatformMarker.make( - withAlpha: 1, + let marker1 = PlatformMarker( + alpha: 1, anchor: zeroPoint, consumeTapEvents: false, draggable: false, @@ -73,8 +70,8 @@ import google_maps_flutter_ios_objc clusterManagerId: clusterManagerId, collisionBehavior: nil ) - let marker2 = FGMPlatformMarker.make( - withAlpha: 1, + let marker2 = PlatformMarker( + alpha: 1, anchor: zeroPoint, consumeTapEvents: false, draggable: false, @@ -96,11 +93,7 @@ import google_maps_flutter_ios_objc clusterManagersController.invokeClusteringForEachClusterManager() // Verify that the markers were added to the cluster manager - var error: FlutterError? = nil - let clusters1 = try #require( - clusterManagersController.clusters(withIdentifier: clusterManagerId, error: &error) - ) - #expect(error == nil) + let clusters1 = try clusterManagersController.clusters(withIdentifier: clusterManagerId) let targetCluster = try #require( clusters1.first(where: { $0.clusterManagerId == clusterManagerId }) ) @@ -111,11 +104,7 @@ import google_maps_flutter_ios_objc markersController.removeMarkers(withIdentifiers: [markerId2]) // Verify that the marker2 is removed from the clusterManager - error = nil - let clusters2 = try #require( - clusterManagersController.clusters(withIdentifier: clusterManagerId, error: &error) - ) - #expect(error == nil) + let clusters2 = try clusterManagersController.clusters(withIdentifier: clusterManagerId) let targetCluster2 = try #require( clusters2.first(where: { $0.clusterManagerId == clusterManagerId }) ) @@ -125,11 +114,7 @@ import google_maps_flutter_ios_objc markersController.removeMarkers(withIdentifiers: [markerId1]) // Verify that all markers are removed from clusterManager - error = nil - let clusters3 = try #require( - clusterManagersController.clusters(withIdentifier: clusterManagerId, error: &error) - ) - #expect(error == nil) + let clusters3 = try clusterManagersController.clusters(withIdentifier: clusterManagerId) #expect(clusters3.count == 0) // Remove cluster manager diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/ConversionsUtilsTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/ConversionsUtilsTests.swift index 4c8f4d86b668..12e1b257e4c7 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/ConversionsUtilsTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/ConversionsUtilsTests.swift @@ -4,7 +4,6 @@ import GoogleMaps import Testing -import google_maps_flutter_ios_objc @testable import google_maps_flutter_ios @@ -15,8 +14,8 @@ import google_maps_flutter_ios_objc let platformGreen: CGFloat = 2 / 255.0 let platformBlue: CGFloat = 3 / 255.0 let platformAlpha: CGFloat = 4 / 255.0 - let color = FGMPlatformColor.make( - withRed: platformRed, + let color = PlatformColor( + red: platformRed, green: platformGreen, blue: platformBlue, alpha: platformAlpha @@ -39,7 +38,7 @@ import google_maps_flutter_ios_objc let blue: CGFloat = 3 / 255.0 let alpha: CGFloat = 4 / 255.0 let color = UIColor(red: red, green: green, blue: blue, alpha: alpha) - let platformColor = FGMPlatformColor.make(from: color) + let platformColor = PlatformColor.make(from: color) #expect(abs(red - platformColor.red) <= CGFloat.ulpOfOne) #expect(abs(green - platformColor.green) <= CGFloat.ulpOfOne) #expect(abs(blue - platformColor.blue) <= CGFloat.ulpOfOne) @@ -47,7 +46,7 @@ import google_maps_flutter_ios_objc } @Test func pointFromLatLong() { - let latlong = FGMPlatformLatLng.make(withLatitude: 1, longitude: 2) + let latlong = PlatformLatLng(latitude: 1, longitude: 2) let location = latlong.toCLLocationCoordinate2D() #expect(location.latitude == 1) #expect(location.longitude == 2) @@ -60,7 +59,7 @@ import google_maps_flutter_ios_objc bearing: 3.0, viewingAngle: 75.0 ) - let pigeonPosition = FGMPlatformCameraPosition.make(from: position) + let pigeonPosition = PlatformCameraPosition.make(from: position) #expect(abs(pigeonPosition.target.latitude - position.target.latitude) <= Double.ulpOfOne) #expect(abs(pigeonPosition.target.longitude - position.target.longitude) <= Double.ulpOfOne) #expect(abs(Float(pigeonPosition.zoom) - position.zoom) <= Float.ulpOfOne) @@ -70,7 +69,7 @@ import google_maps_flutter_ios_objc @Test func pigeonPointForGCPoint() { let point = CGPoint(x: 10, y: 20) - let pigeonPoint = FGMPlatformPoint.make(from: point) + let pigeonPoint = PlatformPoint.make(from: point) #expect(abs(pigeonPoint.x - Double(point.x)) <= Double.ulpOfOne) #expect(abs(pigeonPoint.y - Double(point.y)) <= Double.ulpOfOne) } @@ -80,7 +79,7 @@ import google_maps_flutter_ios_objc coordinate: CLLocationCoordinate2D(latitude: 10, longitude: 20), coordinate: CLLocationCoordinate2D(latitude: 30, longitude: 40) ) - let pigeonBounds = FGMPlatformLatLngBounds.make(from: bounds) + let pigeonBounds = PlatformLatLngBounds.make(from: bounds) #expect(abs(pigeonBounds.southwest.latitude - bounds.southWest.latitude) <= Double.ulpOfOne) #expect(abs(pigeonBounds.southwest.longitude - bounds.southWest.longitude) <= Double.ulpOfOne) #expect(abs(pigeonBounds.northeast.latitude - bounds.northEast.latitude) <= Double.ulpOfOne) @@ -88,9 +87,9 @@ import google_maps_flutter_ios_objc } @Test func getCameraPostionForPigeonCameraPosition() { - let pigeonCameraPosition = FGMPlatformCameraPosition.make( - withBearing: 1.0, - target: FGMPlatformLatLng.make(withLatitude: 2.0, longitude: 3.0), + let pigeonCameraPosition = PlatformCameraPosition( + bearing: 1.0, + target: PlatformLatLng(latitude: 2.0, longitude: 3.0), tilt: 4.0, zoom: 5.0 ) @@ -108,7 +107,7 @@ import google_maps_flutter_ios_objc } @Test func cgPointForPigeonPoint() { - let pigeonPoint = FGMPlatformPoint.makeWith(x: 1.0, y: 2.0) + let pigeonPoint = PlatformPoint(x: 1.0, y: 2.0) let point = pigeonPoint.toCGPoint() @@ -117,9 +116,9 @@ import google_maps_flutter_ios_objc } @Test func coordinateBoundsFromLatLongs() { - let pigeonBounds = FGMPlatformLatLngBounds.make( - withNortheast: FGMPlatformLatLng.make(withLatitude: 3, longitude: 4), - southwest: FGMPlatformLatLng.make(withLatitude: 1, longitude: 2) + let pigeonBounds = PlatformLatLngBounds( + northeast: PlatformLatLng(latitude: 3, longitude: 4), + southwest: PlatformLatLng(latitude: 1, longitude: 2) ) let bounds = pigeonBounds.toGMSCoordinateBounds() @@ -132,25 +131,25 @@ import google_maps_flutter_ios_objc } @Test func mapViewTypeFromPigeonType() { - #expect(GMSMapViewType.normal == FGMPlatformMapType.normal.gmsMapViewType) - #expect(GMSMapViewType.satellite == FGMPlatformMapType.satellite.gmsMapViewType) - #expect(GMSMapViewType.terrain == FGMPlatformMapType.terrain.gmsMapViewType) - #expect(GMSMapViewType.hybrid == FGMPlatformMapType.hybrid.gmsMapViewType) - #expect(GMSMapViewType.none == FGMPlatformMapType.none.gmsMapViewType) + #expect(GMSMapViewType.normal == PlatformMapType.normal.gmsMapViewType) + #expect(GMSMapViewType.satellite == PlatformMapType.satellite.gmsMapViewType) + #expect(GMSMapViewType.terrain == PlatformMapType.terrain.gmsMapViewType) + #expect(GMSMapViewType.hybrid == PlatformMapType.hybrid.gmsMapViewType) + #expect(GMSMapViewType.none == PlatformMapType.none.gmsMapViewType) } @Test func cameraUpdateFromNewCameraPosition() { - let newPositionUpdate = FGMPlatformCameraUpdateNewCameraPosition.make( - with: FGMPlatformCameraPosition.make( - withBearing: 4, - target: FGMPlatformLatLng.make(withLatitude: 1, longitude: 2), + let platformUpdate = PlatformCameraUpdateNewCameraPosition( + cameraPosition: PlatformCameraPosition( + bearing: 4, + target: PlatformLatLng(latitude: 1, longitude: 2), tilt: 5, zoom: 3 ) ) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: newPositionUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @@ -158,32 +157,32 @@ import google_maps_flutter_ios_objc @Test func cameraUpdateFromNewLatLong() { let lat: Double = 1 let lng: Double = 2 - let platformUpdate = FGMPlatformCameraUpdateNewLatLng.make( - with: FGMPlatformLatLng.make(withLatitude: lat, longitude: lng) + let platformUpdate = PlatformCameraUpdateNewLatLng( + latLng: PlatformLatLng(latitude: lat, longitude: lng) ) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @Test func cameraUpdateFromNewLatLngBounds() { - let pigeonBounds = FGMPlatformLatLngBounds.make( - withNortheast: FGMPlatformLatLng.make(withLatitude: 1, longitude: 2), - southwest: FGMPlatformLatLng.make(withLatitude: 3, longitude: 4) + let pigeonBounds = PlatformLatLngBounds( + northeast: PlatformLatLng(latitude: 1, longitude: 2), + southwest: PlatformLatLng(latitude: 3, longitude: 4) ) let bounds = pigeonBounds.toGMSCoordinateBounds() let padding: Double = 20 - let platformUpdate = FGMPlatformCameraUpdateNewLatLngBounds.make( - with: FGMPlatformLatLngBounds.make(from: bounds), + let platformUpdate = PlatformCameraUpdateNewLatLngBounds( + bounds: PlatformLatLngBounds.make(from: bounds), padding: padding ) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @@ -192,14 +191,14 @@ import google_maps_flutter_ios_objc let lat: Double = 1 let lng: Double = 2 let zoom: Double = 3 - let platformUpdate = FGMPlatformCameraUpdateNewLatLngZoom.make( - with: FGMPlatformLatLng.make(withLatitude: lat, longitude: lng), + let platformUpdate = PlatformCameraUpdateNewLatLngZoom( + latLng: PlatformLatLng(latitude: lat, longitude: lng), zoom: zoom ) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @@ -207,22 +206,22 @@ import google_maps_flutter_ios_objc @Test func cameraUpdateFromScrollBy() { let x: Double = 1 let y: Double = 2 - let platformUpdate = FGMPlatformCameraUpdateScrollBy.make(withDx: x, dy: y) + let platformUpdate = PlatformCameraUpdateScrollBy(dx: x, dy: y) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @Test func cameraUpdateFromZoomBy() { let zoom: Double = 1 - let platformUpdateNoPoint = FGMPlatformCameraUpdateZoomBy.make(withAmount: zoom, focus: nil) + let platformUpdateNoPoint = PlatformCameraUpdateZoomBy(amount: zoom, focus: nil) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdateNoPoint).toGMSCameraUpdate() + _ = platformUpdateNoPoint.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @@ -231,51 +230,48 @@ import google_maps_flutter_ios_objc let zoom: Double = 1 let x: Double = 2 let y: Double = 3 - let platformUpdate = FGMPlatformCameraUpdateZoomBy.make( - withAmount: zoom, - focus: FGMPlatformPoint.makeWith(x: x, y: y) - ) + let platformUpdate = PlatformCameraUpdateZoomBy(amount: zoom, focus: PlatformPoint(x: x, y: y)) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @Test func cameraUpdateFromZoomIn() { - let platformUpdate = FGMPlatformCameraUpdateZoom.make(withOut: false) + let platformUpdate = PlatformCameraUpdateZoom(out: false) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @Test func cameraUpdateFromZoomOut() { - let platformUpdate = FGMPlatformCameraUpdateZoom.make(withOut: true) + let platformUpdate = PlatformCameraUpdateZoom(out: true) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @Test func cameraUpdateFromZoomTo() { let zoom: Double = 1 - let platformUpdate = FGMPlatformCameraUpdateZoomTo.make(withZoom: zoom) + let platformUpdate = PlatformCameraUpdateZoomTo(zoom: zoom) - _ = FGMPlatformCameraUpdate.make(withCameraUpdate: platformUpdate).toGMSCameraUpdate() + _ = platformUpdate.toGMSCameraUpdate() // GMSCameraUpdate is not inspectable, so this test just ensures that the codepath - // doesn't throw. FGMGetCameraUpdateForPigeonCameraUpdate is simple enough that + // doesn't throw. toGMSCameraUpdate is simple enough that // injecting a wrapper would not meaningfully improve test coverage, since the non-test // implementation would be about as complex as the conversion function itself. } @Test func strokeStyleFromPattern() { - let pattern = FGMPlatformPatternItem.make(with: .dash, length: 1) + let pattern = PlatformPatternItem(type: .dash, length: 1) let strokeColor = UIColor.red _ = pattern.gmsStrokeStyle(strokeColor: strokeColor) @@ -285,7 +281,7 @@ import google_maps_flutter_ios_objc @Test func nonNullLengthFromPatternItem() { let length: Double = 6.4 - let pattern = FGMPlatformPatternItem.make(with: .gap, length: length as NSNumber) + let pattern = PlatformPatternItem(type: .gap, length: length) let spanLength = pattern.gmsStyleSpanLength() @@ -293,7 +289,7 @@ import google_maps_flutter_ios_objc } @Test func nullLengthFromPatternItem() { - let pattern = FGMPlatformPatternItem.make(with: .dot, length: nil) + let pattern = PlatformPatternItem(type: .dot, length: nil) let spanLength = pattern.gmsStyleSpanLength() @@ -302,8 +298,8 @@ import google_maps_flutter_ios_objc @Test func weightedLatLngFromPlatformWeightedLatLng() { let intensity: Double = 3.0 - let data = FGMPlatformWeightedLatLng.make( - withPoint: FGMPlatformLatLng.make(withLatitude: 10, longitude: 20), + let data = PlatformWeightedLatLng( + point: PlatformLatLng(latitude: 10, longitude: 20), weight: intensity ) @@ -318,17 +314,17 @@ import google_maps_flutter_ios_objc let platformBlue: Double = 0.3 let platformAlpha: Double = 0.4 let colorMapSize: Int = 200 - let platformGradient = FGMPlatformHeatmapGradient.make( - with: [ - FGMPlatformColor.make( - withRed: platformRed, + let platformGradient = PlatformHeatmapGradient( + colors: [ + PlatformColor( + red: platformRed, green: platformGreen, blue: platformBlue, alpha: platformAlpha ) ], - startPoints: [startPoint as NSNumber], - colorMapSize: colorMapSize + startPoints: [startPoint], + colorMapSize: Int64(colorMapSize) ) let gradient = platformGradient.toGMUGradient() diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/ExtractIconFromDataTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/ExtractIconFromDataTests.swift index 0b9e8c92feb7..06f0ab942a4d 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/ExtractIconFromDataTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/ExtractIconFromDataTests.swift @@ -4,7 +4,6 @@ import Flutter import Testing -import google_maps_flutter_ios_objc @testable import google_maps_flutter_ios @@ -15,8 +14,8 @@ import google_maps_flutter_ios_objc let assetName = "fakeImageName" let assetProvider = TestAssetProvider(image: testImage, forAssetName: assetName, package: nil) - let bitmap = FGMPlatformBitmapAssetMap.make( - withAssetName: assetName, + let bitmap = PlatformBitmapAssetMap( + assetName: assetName, bitmapScaling: .auto, imagePixelRatio: 1, width: nil, @@ -25,10 +24,7 @@ import google_maps_flutter_ios_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = bitmap.createIcon(assetProvider: assetProvider, screenScale: screenScale) #expect(resultImage != nil) #expect(resultImage?.scale == 1.0) @@ -42,8 +38,8 @@ import google_maps_flutter_ios_objc let assetName = "fakeImageName" let assetProvider = TestAssetProvider(image: testImage, forAssetName: assetName, package: nil) - let bitmap = FGMPlatformBitmapAssetMap.make( - withAssetName: assetName, + let bitmap = PlatformBitmapAssetMap( + assetName: assetName, bitmapScaling: .auto, imagePixelRatio: 10, width: nil, @@ -52,10 +48,7 @@ import google_maps_flutter_ios_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = bitmap.createIcon(assetProvider: assetProvider, screenScale: screenScale) #expect(resultImage != nil) #expect(resultImage?.scale == 10) @@ -71,20 +64,17 @@ import google_maps_flutter_ios_objc let assetProvider = TestAssetProvider(image: testImage, forAssetName: assetName, package: nil) let width: CGFloat = 15.0 - let bitmap = FGMPlatformBitmapAssetMap.make( - withAssetName: assetName, + let bitmap = PlatformBitmapAssetMap( + assetName: assetName, bitmapScaling: .auto, imagePixelRatio: 1, - width: width as NSNumber, + width: width, height: nil ) let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = bitmap.createIcon(assetProvider: assetProvider, screenScale: screenScale) #expect(resultImage != nil) #expect(testImage.scale == 1.0) @@ -105,20 +95,17 @@ import google_maps_flutter_ios_objc let width: CGFloat = 15.0 let height: CGFloat = 45.0 - let bitmap = FGMPlatformBitmapAssetMap.make( - withAssetName: assetName, + let bitmap = PlatformBitmapAssetMap( + assetName: assetName, bitmapScaling: .auto, imagePixelRatio: 1, - width: width as NSNumber, - height: height as NSNumber + width: width, + height: height ) let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = bitmap.createIcon(assetProvider: assetProvider, screenScale: screenScale) #expect(resultImage != nil) #expect(resultImage?.scale == screenScale) #expect(resultImage?.size.width == width) @@ -131,8 +118,8 @@ import google_maps_flutter_ios_objc let assetName = "fakeImageName" let assetProvider = TestAssetProvider(image: testImage, forAssetName: assetName, package: nil) - let bitmap = FGMPlatformBitmapAssetMap.make( - withAssetName: assetName, + let bitmap = PlatformBitmapAssetMap( + assetName: assetName, bitmapScaling: .none, imagePixelRatio: 1, width: nil, @@ -141,10 +128,7 @@ import google_maps_flutter_ios_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = bitmap.createIcon(assetProvider: assetProvider, screenScale: screenScale) #expect(resultImage != nil) #expect(resultImage?.scale == 1.0) @@ -157,8 +141,8 @@ import google_maps_flutter_ios_objc let pngData = try #require(testImage.pngData()) let typedData = FlutterStandardTypedData(bytes: pngData) - let bitmap = FGMPlatformBitmapBytesMap.make( - withByteData: typedData, + let bitmap = PlatformBitmapBytesMap( + byteData: typedData, bitmapScaling: .auto, imagePixelRatio: 1, width: nil, @@ -167,7 +151,7 @@ import google_maps_flutter_ios_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( + let resultImage = bitmap.createIcon( assetProvider: TestAssetProvider(), screenScale: screenScale ) @@ -183,8 +167,8 @@ import google_maps_flutter_ios_objc let pngData = try #require(testImage.pngData()) let typedData = FlutterStandardTypedData(bytes: pngData) - let bitmap = FGMPlatformBitmapBytesMap.make( - withByteData: typedData, + let bitmap = PlatformBitmapBytesMap( + byteData: typedData, bitmapScaling: .auto, imagePixelRatio: 10, width: nil, @@ -193,7 +177,7 @@ import google_maps_flutter_ios_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( + let resultImage = bitmap.createIcon( assetProvider: TestAssetProvider(), screenScale: screenScale ) @@ -210,17 +194,17 @@ import google_maps_flutter_ios_objc let width: CGFloat = 15.0 let height: CGFloat = 15.0 let typedData = FlutterStandardTypedData(bytes: pngData) - let bitmap = FGMPlatformBitmapBytesMap.make( - withByteData: typedData, + let bitmap = PlatformBitmapBytesMap( + byteData: typedData, bitmapScaling: .auto, imagePixelRatio: 1, - width: width as NSNumber, - height: height as NSNumber + width: width, + height: height ) let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( + let resultImage = bitmap.createIcon( assetProvider: TestAssetProvider(), screenScale: screenScale ) @@ -244,17 +228,17 @@ import google_maps_flutter_ios_objc let width: CGFloat = 15.0 let height: CGFloat = 45.0 let typedData = FlutterStandardTypedData(bytes: pngData) - let bitmap = FGMPlatformBitmapBytesMap.make( - withByteData: typedData, + let bitmap = PlatformBitmapBytesMap( + byteData: typedData, bitmapScaling: .auto, imagePixelRatio: 1, - width: width as NSNumber, - height: height as NSNumber + width: width, + height: height ) let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( + let resultImage = bitmap.createIcon( assetProvider: TestAssetProvider(), screenScale: screenScale ) @@ -269,8 +253,8 @@ import google_maps_flutter_ios_objc let pngData = try #require(testImage.pngData()) let typedData = FlutterStandardTypedData(bytes: pngData) - let bitmap = FGMPlatformBitmapBytesMap.make( - withByteData: typedData, + let bitmap = PlatformBitmapBytesMap( + byteData: typedData, bitmapScaling: .none, imagePixelRatio: 1, width: nil, @@ -279,7 +263,7 @@ import google_maps_flutter_ios_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: bitmap).createIcon( + let resultImage = bitmap.createIcon( assetProvider: TestAssetProvider(), screenScale: screenScale ) @@ -294,12 +278,12 @@ import google_maps_flutter_ios_objc @Test func extractIconFromPinConfigWithGlyphColor() { let assetProvider = TestAssetProvider() - let backgroundColor = FGMPlatformColor.make(withRed: 0.0, green: 1.0, blue: 1.0, alpha: 1.0) - let borderColor = FGMPlatformColor.make(withRed: 1.0, green: 0.0, blue: 1.0, alpha: 1.0) - let glyphColor = FGMPlatformColor.make(withRed: 0.1, green: 0.2, blue: 0.3, alpha: 1.0) + let backgroundColor = PlatformColor(red: 0.0, green: 1.0, blue: 1.0, alpha: 1.0) + let borderColor = PlatformColor(red: 1.0, green: 0.0, blue: 1.0, alpha: 1.0) + let glyphColor = PlatformColor(red: 0.1, green: 0.2, blue: 0.3, alpha: 1.0) - let pinConfig = FGMPlatformBitmapPinConfig.make( - withBackgroundColor: backgroundColor, + let pinConfig = PlatformBitmapPinConfig( + backgroundColor: backgroundColor, borderColor: borderColor, glyphColor: glyphColor, glyphTextColor: nil, @@ -309,10 +293,7 @@ import google_maps_flutter_ios_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: pinConfig).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = pinConfig.createIcon(assetProvider: assetProvider, screenScale: screenScale) // PinConfig may return nil on old Google Maps SDK versions (<=8.4.0). // Also, due to a Google Maps SDK issue (https://issuetracker.google.com/issues/370536110), @@ -324,10 +305,10 @@ import google_maps_flutter_ios_objc @Test func extractIconFromPinConfigWithGlyphText() { let assetProvider = TestAssetProvider() - let glyphTextColor = FGMPlatformColor.make(withRed: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) + let glyphTextColor = PlatformColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) - let pinConfig = FGMPlatformBitmapPinConfig.make( - withBackgroundColor: nil, + let pinConfig = PlatformBitmapPinConfig( + backgroundColor: nil, borderColor: nil, glyphColor: nil, glyphTextColor: glyphTextColor, @@ -337,10 +318,7 @@ import google_maps_flutter_ios_objc let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: pinConfig).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = pinConfig.createIcon(assetProvider: assetProvider, screenScale: screenScale) // PinConfig returns nil on iOS versions without GMSPinImageOptions support (< iOS 16.0). // On simulators, GMSPinImage may also return a zero-dimension image. Both cases are acceptable @@ -355,33 +333,29 @@ import google_maps_flutter_ios_objc let assetName = "fakeImageNameKey" let assetProvider = TestAssetProvider(image: testImage, forAssetName: assetName, package: nil) - let assetBitmap = FGMPlatformBitmapAssetMap.make( - withAssetName: assetName, + let assetBitmap = PlatformBitmapAssetMap( + assetName: assetName, bitmapScaling: .auto, imagePixelRatio: 1, width: nil, height: nil ) - let glyphBitmap = FGMPlatformBitmap.make(withBitmap: assetBitmap) - let backgroundColor = FGMPlatformColor.make(withRed: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) - let borderColor = FGMPlatformColor.make(withRed: 0.0, green: 0.0, blue: 0.0, alpha: 1.0) + let backgroundColor = PlatformColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0) + let borderColor = PlatformColor(red: 0.0, green: 0.0, blue: 0.0, alpha: 1.0) - let pinConfig = FGMPlatformBitmapPinConfig.make( - withBackgroundColor: backgroundColor, + let pinConfig = PlatformBitmapPinConfig( + backgroundColor: backgroundColor, borderColor: borderColor, glyphColor: nil, glyphTextColor: nil, glyphText: nil, - glyphBitmap: glyphBitmap + glyphBitmap: assetBitmap ) let screenScale: CGFloat = 3.0 - let resultImage = FGMPlatformBitmap.make(withBitmap: pinConfig).createIcon( - assetProvider: assetProvider, - screenScale: screenScale - ) + let resultImage = pinConfig.createIcon(assetProvider: assetProvider, screenScale: screenScale) // PinConfig returns nil on iOS versions without GMSPinImageOptions support (< iOS 16.0). // On simulators, GMSPinImage may also return a zero-dimension image. Both cases are acceptable diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/GoogleMapsTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/GoogleMapsTests.swift index a474194e412f..e918732d5b1d 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/GoogleMapsTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/GoogleMapsTests.swift @@ -5,11 +5,10 @@ import Flutter import GoogleMaps import Testing -import google_maps_flutter_ios_objc @testable import google_maps_flutter_ios -class MockCATransaction: NSObject, MapAnimationCATransactionProtocol { +class MockCATransaction: MapAnimationCATransactionProtocol { var beginCalled = false var commitCalled = false var animationDuration: CFTimeInterval = 0.0 @@ -129,12 +128,9 @@ class StubPluginRegistrar: NSObject, FlutterPluginRegistrar { let mockTransactionWrapper = MockCATransaction() controller.callHandler.transactionWrapper = mockTransactionWrapper - let zoomTo = FGMPlatformCameraUpdateZoomTo.make(withZoom: 10.0) - let cameraUpdate = FGMPlatformCameraUpdate.make(withCameraUpdate: zoomTo) - var error: FlutterError? = nil + let zoomTo = PlatformCameraUpdateZoomTo(zoom: 10.0) - controller.callHandler.animateCamera(with: cameraUpdate, duration: nil, error: &error) - #expect(error == nil) + try controller.callHandler.animateCamera(zoomTo, duration: nil) #expect(mapView.didAnimateCamera) #expect(!mockTransactionWrapper.beginCalled) #expect(!mockTransactionWrapper.commitCalled) @@ -161,21 +157,14 @@ class StubPluginRegistrar: NSObject, FlutterPluginRegistrar { let mockTransactionWrapper = MockCATransaction() controller.callHandler.transactionWrapper = mockTransactionWrapper - let zoomTo = FGMPlatformCameraUpdateZoomTo.make(withZoom: 10.0) - let cameraUpdate = FGMPlatformCameraUpdate.make(withCameraUpdate: zoomTo) - var error: FlutterError? = nil + let zoomTo = PlatformCameraUpdateZoomTo(zoom: 10.0) - let durationMilliseconds: NSNumber = 100 - controller.callHandler.animateCamera( - with: cameraUpdate, - duration: durationMilliseconds, - error: &error - ) - #expect(error == nil) + let durationMilliseconds: Int64 = 100 + try controller.callHandler.animateCamera(zoomTo, duration: durationMilliseconds) #expect(mapView.didAnimateCamera) #expect(mockTransactionWrapper.beginCalled) #expect(mockTransactionWrapper.commitCalled) - #expect(mockTransactionWrapper.animationDuration == durationMilliseconds.doubleValue / 1000) + #expect(mockTransactionWrapper.animationDuration == Double(durationMilliseconds) / 1000) } @Test func inspectorAPICameraPosition() throws { @@ -201,9 +190,7 @@ class StubPluginRegistrar: NSObject, FlutterPluginRegistrar { let inspector = MapInspector(messenger: binaryMessenger, pigeonSuffix: "0") inspector.controller = controller - var error: FlutterError? = nil - let cameraPosition = try #require(inspector.cameraPosition(&error)) - #expect(error == nil) + let cameraPosition = try inspector.cameraPosition() #expect(cameraPosition.target.latitude == initialCameraPosition.target.latitude) #expect(cameraPosition.target.longitude == initialCameraPosition.target.longitude) @@ -212,16 +199,16 @@ class StubPluginRegistrar: NSObject, FlutterPluginRegistrar { /// Creates an empty creation parameters object for tests where the values don't matter, just that /// there's a valid object to pass in. - private func emptyCreationParameters() -> FGMPlatformMapViewCreationParams { - return FGMPlatformMapViewCreationParams.make( - withInitialCameraPosition: FGMPlatformCameraPosition.make( - withBearing: 0.0, - target: FGMPlatformLatLng.make(withLatitude: 0.0, longitude: 0.0), + private func emptyCreationParameters() -> PlatformMapViewCreationParams { + return PlatformMapViewCreationParams( + initialCameraPosition: PlatformCameraPosition( + bearing: 0.0, + target: PlatformLatLng(latitude: 0.0, longitude: 0.0), tilt: 0.0, zoom: 0.0 ), - mapConfiguration: FGMPlatformMapConfiguration.make( - withCompassEnabled: nil, + mapConfiguration: PlatformMapConfiguration( + compassEnabled: nil, cameraTargetBounds: nil, mapType: nil, minMaxZoomPreference: nil, @@ -267,6 +254,7 @@ class StubPluginRegistrar: NSObject, FlutterPluginRegistrar { #expect(mapView.frameObserverCount == 1) + withExtendedLifetime(controller) {} // Deallocate the controller controller = nil @@ -288,8 +276,8 @@ class StubPluginRegistrar: NSObject, FlutterPluginRegistrar { #expect(controller.styleError != nil) // Update config without style - let config = FGMPlatformMapConfiguration.make( - withCompassEnabled: true, + let config = PlatformMapConfiguration( + compassEnabled: true, cameraTargetBounds: nil, mapType: nil, minMaxZoomPreference: nil, diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/GroundOverlayControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/GroundOverlayControllerTests.swift index 05ebaa988ce1..610c9c30ab0f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/GroundOverlayControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/GroundOverlayControllerTests.swift @@ -4,7 +4,6 @@ import GoogleMaps import Testing -import google_maps_flutter_ios_objc @testable import google_maps_flutter_ios @@ -76,18 +75,16 @@ import google_maps_flutter_ios_objc let (groundOverlayController, mapView) = try GroundOverlayControllerTests.groundOverlayControllerWithPositionWithMockedMap() - let position = FGMPlatformLatLng.make(withLatitude: 52.4816, longitude: 3.1791) + let position = PlatformLatLng(latitude: 52.4816, longitude: 3.1791) - let bitmap = FGMPlatformBitmap.make( - withBitmap: FGMPlatformBitmapDefaultMarker.make(withHue: 0) - ) + let bitmap = PlatformBitmapDefaultMarker(hue: 0) - let platformGroundOverlay = FGMPlatformGroundOverlay.make( - withGroundOverlayId: "id_1", + let platformGroundOverlay = PlatformGroundOverlay( + groundOverlayId: "id_1", image: bitmap, position: position, bounds: nil, - anchor: FGMPlatformPoint.makeWith(x: 0.5, y: 0.5), + anchor: PlatformPoint(x: 0.5, y: 0.5), transparency: 0.5, bearing: 65.0, zIndex: 2, @@ -116,7 +113,7 @@ import google_maps_flutter_ios_objc #expect(abs(groundOverlayController.groundOverlay.anchor.y - 0.5) <= Double.ulpOfOne) #expect(groundOverlayController.groundOverlay.zIndex == Int32(platformGroundOverlay.zIndex)) - let convertedPlatformGroundOverlay = FGMPlatformGroundOverlay.make( + let convertedPlatformGroundOverlay = PlatformGroundOverlay.make( from: groundOverlayController.groundOverlay, overlayId: "id_1", isCreatedWithBounds: false, @@ -128,7 +125,7 @@ import google_maps_flutter_ios_objc #expect( abs(convertedPlatformGroundOverlay.position!.longitude - position.longitude) <= Double.ulpOfOne) - #expect(convertedPlatformGroundOverlay.zoomLevel!.doubleValue == 14.0) + #expect(convertedPlatformGroundOverlay.zoomLevel == 14.0) #expect(convertedPlatformGroundOverlay.transparency == platformGroundOverlay.transparency) #expect(convertedPlatformGroundOverlay.bearing == platformGroundOverlay.bearing) #expect(abs(convertedPlatformGroundOverlay.anchor!.x - 0.5) <= Double.ulpOfOne) @@ -141,21 +138,19 @@ import google_maps_flutter_ios_objc let (groundOverlayController, mapView) = try GroundOverlayControllerTests.groundOverlayControllerWithBoundsWithMockedMap() - let bounds = FGMPlatformLatLngBounds.make( - withNortheast: FGMPlatformLatLng.make(withLatitude: 54.4816, longitude: 5.1791), - southwest: FGMPlatformLatLng.make(withLatitude: 52.4816, longitude: 3.1791) + let bounds = PlatformLatLngBounds( + northeast: PlatformLatLng(latitude: 54.4816, longitude: 5.1791), + southwest: PlatformLatLng(latitude: 52.4816, longitude: 3.1791) ) - let bitmap = FGMPlatformBitmap.make( - withBitmap: FGMPlatformBitmapDefaultMarker.make(withHue: 0) - ) + let bitmap = PlatformBitmapDefaultMarker(hue: 0) - let platformGroundOverlay = FGMPlatformGroundOverlay.make( - withGroundOverlayId: "id_1", + let platformGroundOverlay = PlatformGroundOverlay( + groundOverlayId: "id_1", image: bitmap, position: nil, bounds: bounds, - anchor: FGMPlatformPoint.makeWith(x: 0.5, y: 0.5), + anchor: PlatformPoint(x: 0.5, y: 0.5), transparency: 0.5, bearing: 65.0, zIndex: 2, @@ -183,7 +178,7 @@ import google_maps_flutter_ios_objc #expect(abs(groundOverlayController.groundOverlay.anchor.y - 0.5) <= Double.ulpOfOne) #expect(groundOverlayController.groundOverlay.zIndex == Int32(platformGroundOverlay.zIndex)) - let convertedPlatformGroundOverlay = FGMPlatformGroundOverlay.make( + let convertedPlatformGroundOverlay = PlatformGroundOverlay.make( from: groundOverlayController.groundOverlay, overlayId: "id_1", isCreatedWithBounds: true, @@ -214,17 +209,15 @@ import google_maps_flutter_ios_objc let groundOverlay = PropertyOrderValidatingGroundOverlay() GroundOverlayController.update( groundOverlay, - from: FGMPlatformGroundOverlay.make( - withGroundOverlayId: "groundOverlay", - image: FGMPlatformBitmap.make( - withBitmap: FGMPlatformBitmapDefaultMarker.make(withHue: 0) - ), - position: FGMPlatformLatLng.make(withLatitude: 0, longitude: 0), - bounds: FGMPlatformLatLngBounds.make( - withNortheast: FGMPlatformLatLng.make(withLatitude: 54.4816, longitude: 5.1791), - southwest: FGMPlatformLatLng.make(withLatitude: 52.4816, longitude: 3.1791) + from: PlatformGroundOverlay( + groundOverlayId: "groundOverlay", + image: PlatformBitmapDefaultMarker(hue: 0), + position: PlatformLatLng(latitude: 0, longitude: 0), + bounds: PlatformLatLngBounds( + northeast: PlatformLatLng(latitude: 54.4816, longitude: 5.1791), + southwest: PlatformLatLng(latitude: 52.4816, longitude: 3.1791) ), - anchor: FGMPlatformPoint.makeWith(x: 0.5, y: 0.5), + anchor: PlatformPoint(x: 0.5, y: 0.5), transparency: 0.5, bearing: 65.0, zIndex: 2, diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/HeatmapControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/HeatmapControllerTests.swift index 649d7311b640..9fdfcce8f75c 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/HeatmapControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/HeatmapControllerTests.swift @@ -5,7 +5,6 @@ import GoogleMaps import GoogleMapsUtils import Testing -import google_maps_flutter_ios_objc @testable import google_maps_flutter_ios @@ -13,25 +12,25 @@ import google_maps_flutter_ios_objc @Test func updateHeatmapSetsVisibilityLast() { let heatmap = PropertyOrderValidatingHeatmap() - let gradient = FGMPlatformHeatmapGradient.make( - with: [ - FGMPlatformColor.make(withRed: 0, green: 0, blue: 0, alpha: 0), - FGMPlatformColor.make(withRed: 1.0, green: 1.0, blue: 1.0, alpha: 1.0), + let gradient = PlatformHeatmapGradient( + colors: [ + PlatformColor(red: 0, green: 0, blue: 0, alpha: 0), + PlatformColor(red: 1.0, green: 1.0, blue: 1.0, alpha: 1.0), ], - startPoints: [0 as NSNumber, 1 as NSNumber], + startPoints: [0, 1], colorMapSize: 256 ) HeatmapController.update( heatmap, - from: FGMPlatformHeatmap.make( - withHeatmapId: "heatmap", + from: PlatformHeatmap( + heatmapId: "heatmap", data: [ - FGMPlatformWeightedLatLng.make( - withPoint: FGMPlatformLatLng.make(withLatitude: 5.0, longitude: 5.0), + PlatformWeightedLatLng( + point: PlatformLatLng(latitude: 5.0, longitude: 5.0), weight: 0.5 ), - FGMPlatformWeightedLatLng.make( - withPoint: FGMPlatformLatLng.make(withLatitude: 10.0, longitude: 10.0), + PlatformWeightedLatLng( + point: PlatformLatLng(latitude: 10.0, longitude: 10.0), weight: 0.75 ), ], diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/MarkerControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/MarkerControllerTests.swift index 9a6afe770ccc..a0dae94d21fb 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/MarkerControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/MarkerControllerTests.swift @@ -4,7 +4,6 @@ import GoogleMaps import Testing -import google_maps_flutter_ios_objc @testable import google_maps_flutter_ios @@ -18,7 +17,7 @@ import google_maps_flutter_ios_objc return PartiallyMockedMapView(options: mapViewOptions) } - /// Returns a FGMMarkersController instance instantiated with the given map view. + /// Returns a MarkersController instance instantiated with the given map view. /// /// The mapView should outlive the controller, as the controller keeps a weak reference to it. func markersController( @@ -34,8 +33,8 @@ import google_maps_flutter_ios_objc ) } - func placeholderBitmap() -> FGMPlatformBitmap { - return FGMPlatformBitmap.make(withBitmap: FGMPlatformBitmapDefaultMarker.make(withHue: 0)) + func placeholderBitmap() -> PlatformBitmap { + return PlatformBitmapDefaultMarker(hue: 0) } @Test func setsMarkerNumericProperties() throws { @@ -48,23 +47,23 @@ import google_maps_flutter_ios_objc let anchorY = 2.718 let alpha = 0.4 let rotation = 90.0 - let zIndex = 3 + let zIndex: Int64 = 3 let latitude = 10.0 let longitude = 20.0 controller.add([ - FGMPlatformMarker.make( - withAlpha: alpha, - anchor: FGMPlatformPoint.makeWith(x: anchorX, y: anchorY), + PlatformMarker( + alpha: alpha, + anchor: PlatformPoint(x: anchorX, y: anchorY), consumeTapEvents: true, draggable: true, flat: true, icon: placeholderBitmap(), - infoWindow: FGMPlatformInfoWindow.make( - withTitle: "info title", + infoWindow: PlatformInfoWindow( + title: "info title", snippet: "info snippet", - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0) + anchor: PlatformPoint(x: 0, y: 0) ), - position: FGMPlatformLatLng.make(withLatitude: latitude, longitude: longitude), + position: PlatformLatLng(latitude: latitude, longitude: longitude), rotation: rotation, visible: true, zIndex: zIndex, @@ -94,19 +93,19 @@ import google_maps_flutter_ios_objc let markerIdentifier = "marker" controller.add([ - FGMPlatformMarker.make( - withAlpha: 1.0, - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0), + PlatformMarker( + alpha: 1.0, + anchor: PlatformPoint(x: 0, y: 0), consumeTapEvents: false, draggable: true, flat: false, icon: placeholderBitmap(), - infoWindow: FGMPlatformInfoWindow.make( - withTitle: "info title", + infoWindow: PlatformInfoWindow( + title: "info title", snippet: "info snippet", - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0) + anchor: PlatformPoint(x: 0, y: 0) ), - position: FGMPlatformLatLng.make(withLatitude: 0.0, longitude: 0.0), + position: PlatformLatLng(latitude: 0.0, longitude: 0.0), rotation: 0, visible: false, zIndex: 0, @@ -131,19 +130,19 @@ import google_maps_flutter_ios_objc let markerIdentifier = "marker" controller.add([ - FGMPlatformMarker.make( - withAlpha: 1.0, - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0), + PlatformMarker( + alpha: 1.0, + anchor: PlatformPoint(x: 0, y: 0), consumeTapEvents: false, draggable: false, flat: true, icon: placeholderBitmap(), - infoWindow: FGMPlatformInfoWindow.make( - withTitle: "info title", + infoWindow: PlatformInfoWindow( + title: "info title", snippet: "info snippet", - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0) + anchor: PlatformPoint(x: 0, y: 0) ), - position: FGMPlatformLatLng.make(withLatitude: 0.0, longitude: 0.0), + position: PlatformLatLng(latitude: 0.0, longitude: 0.0), rotation: 0, visible: false, zIndex: 0, @@ -168,19 +167,19 @@ import google_maps_flutter_ios_objc let markerIdentifier = "marker" controller.add([ - FGMPlatformMarker.make( - withAlpha: 1.0, - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0), + PlatformMarker( + alpha: 1.0, + anchor: PlatformPoint(x: 0, y: 0), consumeTapEvents: false, draggable: false, flat: false, icon: placeholderBitmap(), - infoWindow: FGMPlatformInfoWindow.make( - withTitle: "info title", + infoWindow: PlatformInfoWindow( + title: "info title", snippet: "info snippet", - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0) + anchor: PlatformPoint(x: 0, y: 0) ), - position: FGMPlatformLatLng.make(withLatitude: 0.0, longitude: 0.0), + position: PlatformLatLng(latitude: 0.0, longitude: 0.0), rotation: 0, visible: true, zIndex: 0, @@ -208,19 +207,19 @@ import google_maps_flutter_ios_objc let anchorX = 3.14 let anchorY = 2.718 controller.add([ - FGMPlatformMarker.make( - withAlpha: 1.0, - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0), + PlatformMarker( + alpha: 1.0, + anchor: PlatformPoint(x: 0, y: 0), consumeTapEvents: true, draggable: true, flat: true, icon: placeholderBitmap(), - infoWindow: FGMPlatformInfoWindow.make( - withTitle: title, + infoWindow: PlatformInfoWindow( + title: title, snippet: snippet, - anchor: FGMPlatformPoint.makeWith(x: anchorX, y: anchorY) + anchor: PlatformPoint(x: anchorX, y: anchorY) ), - position: FGMPlatformLatLng.make(withLatitude: 0, longitude: 0), + position: PlatformLatLng(latitude: 0, longitude: 0), rotation: 0, visible: true, zIndex: 0, @@ -242,24 +241,22 @@ import google_maps_flutter_ios_objc @Test func updateMarkerSetsVisibilityLast() { let marker = PropertyOrderValidatingAdvancedMarker() - let collisionBehavior = FGMPlatformMarkerCollisionBehaviorBox( - value: .requiredAndHidesOptional - ) + let collisionBehavior = PlatformMarkerCollisionBehavior.requiredAndHidesOptional MarkerController.update( marker, - from: FGMPlatformMarker.make( - withAlpha: 1.0, - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0), + from: PlatformMarker( + alpha: 1.0, + anchor: PlatformPoint(x: 0, y: 0), consumeTapEvents: true, draggable: true, flat: true, icon: placeholderBitmap(), - infoWindow: FGMPlatformInfoWindow.make( - withTitle: "info title", + infoWindow: PlatformInfoWindow( + title: "info title", snippet: "info snippet", - anchor: FGMPlatformPoint.makeWith(x: 0, y: 0) + anchor: PlatformPoint(x: 0, y: 0) ), - position: FGMPlatformLatLng.make(withLatitude: 0, longitude: 0), + position: PlatformLatLng(latitude: 0, longitude: 0), rotation: 0, visible: true, zIndex: 0, diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/PolygonControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/PolygonControllerTests.swift index 921f095db538..078383baaf71 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/PolygonControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/PolygonControllerTests.swift @@ -4,7 +4,6 @@ import GoogleMaps import Testing -import google_maps_flutter_ios_objc @testable import google_maps_flutter_ios @@ -14,15 +13,15 @@ import google_maps_flutter_ios_objc let polygon = PropertyOrderValidatingPolygon() PolygonController.update( polygon, - from: FGMPlatformPolygon.make( - withPolygonId: "polygon", + from: PlatformPolygon( + polygonId: "polygon", consumesTapEvents: false, - fill: FGMPlatformColor.make(withRed: 0, green: 0, blue: 0, alpha: 0), + fillColor: PlatformColor(red: 0, green: 0, blue: 0, alpha: 0), geodesic: false, points: [], holes: [], visible: true, - stroke: FGMPlatformColor.make(withRed: 0, green: 0, blue: 0, alpha: 0), + strokeColor: PlatformColor(red: 0, green: 0, blue: 0, alpha: 0), strokeWidth: 0, zIndex: 0 ), diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/PolylineControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/PolylineControllerTests.swift index 2b8d9d4f75a7..691e2778f491 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/PolylineControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/PolylineControllerTests.swift @@ -4,7 +4,6 @@ import GoogleMaps import Testing -import google_maps_flutter_ios_objc @testable import google_maps_flutter_ios @@ -13,15 +12,15 @@ import google_maps_flutter_ios_objc @Test func patternsSetSpans() { let mapView = PolylineControllerTests.mapView() - let polyline = FGMPlatformPolyline.make( - withPolylineId: "polyline_id_0", + let polyline = PlatformPolyline( + polylineId: "polyline_id_0", consumesTapEvents: false, - color: FGMPlatformColor.make(withRed: 0, green: 0, blue: 0, alpha: 0), + color: PlatformColor(red: 0, green: 0, blue: 0, alpha: 0), geodesic: false, jointType: .round, patterns: [ - FGMPlatformPatternItem.make(with: .dot, length: 10), - FGMPlatformPatternItem.make(with: .dash, length: 10), + PlatformPatternItem(type: .dot, length: 10), + PlatformPatternItem(type: .dash, length: 10), ], points: PolylineControllerTests.polylinePoints(), visible: true, @@ -46,10 +45,10 @@ import google_maps_flutter_ios_objc let polyline = PropertyOrderValidatingPolyline() PolylineController.update( polyline, - from: FGMPlatformPolyline.make( - withPolylineId: "polyline", + from: PlatformPolyline( + polylineId: "polyline", consumesTapEvents: false, - color: FGMPlatformColor.make(withRed: 0, green: 0, blue: 0, alpha: 0), + color: PlatformColor(red: 0, green: 0, blue: 0, alpha: 0), geodesic: false, jointType: .round, patterns: [], @@ -72,12 +71,12 @@ import google_maps_flutter_ios_objc } /// Returns a set of points to use for tests that need a valid but arbitrary line. - static func polylinePoints() -> [FGMPlatformLatLng] { + static func polylinePoints() -> [PlatformLatLng] { return [ - FGMPlatformLatLng.make(withLatitude: 52.4816, longitude: -3.1791), - FGMPlatformLatLng.make(withLatitude: 54.043, longitude: -2.9925), - FGMPlatformLatLng.make(withLatitude: 54.1396, longitude: -4.2739), - FGMPlatformLatLng.make(withLatitude: 53.4153, longitude: -4.0829), + PlatformLatLng(latitude: 52.4816, longitude: -3.1791), + PlatformLatLng(latitude: 54.043, longitude: -2.9925), + PlatformLatLng(latitude: 54.1396, longitude: -4.2739), + PlatformLatLng(latitude: 53.4153, longitude: -4.0829), ] } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift index decb94221c5b..066c1d01b680 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/TestUtils/TestMapEventHandler.swift @@ -3,41 +3,114 @@ // found in the LICENSE file. import Foundation -import google_maps_flutter_ios_objc @testable import google_maps_flutter_ios -/// Fake implementation of FGMMapEventDelegate for unit tests. +/// Fake implementation of MapEventDelegate for unit tests. class TestMapEventHandler: MapEventDelegate { - func didStartCameraMove() {} - - func didMoveCamera(to cameraPosition: FGMPlatformCameraPosition) {} + func didStartCameraMove(completion: @escaping (Result) -> Void) {} + + func didMoveCamera( + to cameraPositionArg: PlatformCameraPosition, + completion: + @escaping ( + Result + ) -> Void + ) {} - func didIdleCamera() {} + func didIdleCamera(completion: @escaping (Result) -> Void) {} - func didTap(at position: FGMPlatformLatLng) {} + func didTap( + at positionArg: PlatformLatLng, + completion: + @escaping ( + Result + ) -> Void + ) {} - func didLongPress(at position: FGMPlatformLatLng) {} + func didLongPress( + at positionArg: PlatformLatLng, + completion: + @escaping ( + Result + ) -> Void + ) {} - func didTapMarker(withIdentifier markerId: String) {} + func didTapMarker( + withIdentifier markerIdArg: String, + completion: @escaping (Result) -> Void + ) {} func didStartDragForMarker( - withIdentifier markerId: String, at position: FGMPlatformLatLng + withIdentifier markerIdArg: String, + at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void ) {} - func didDragMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) {} + func didDragMarker( + withIdentifier markerIdArg: String, + at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void + ) {} - func didEndDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) {} + func didEndDragForMarker( + withIdentifier markerIdArg: String, + at positionArg: PlatformLatLng, + completion: + @escaping ( + Result + ) -> Void + ) {} - func didTapInfoWindowOfMarker(withIdentifier markerId: String) {} + func didTapInfoWindowOfMarker( + withIdentifier markerIdArg: String, + completion: + @escaping ( + Result + ) -> Void + ) {} - func didTapCircle(withIdentifier circleId: String) {} + func didTapCircle( + withIdentifier circleIdArg: String, + completion: @escaping (Result) -> Void + ) {} - func didTapCluster(_ cluster: FGMPlatformCluster) {} + func didTapCluster( + _ clusterArg: PlatformCluster, + completion: + @escaping ( + Result + ) -> Void + ) {} - func didTapPolygon(withIdentifier polygonId: String) {} + func didTapPolygon( + withIdentifier polygonIdArg: String, + completion: + @escaping ( + Result + ) -> Void + ) {} - func didTapPolyline(withIdentifier polylineId: String) {} + func didTapPolyline( + withIdentifier polylineIdArg: String, + completion: @escaping (Result) -> Void + ) {} - func didTapGroundOverlay(withIdentifier groundOverlayId: String) {} + func didTapGroundOverlay( + withIdentifier groundOverlayIdArg: String, + completion: + @escaping ( + Result + ) -> Void + ) {} + + func tile( + withOverlayIdentifier tileOverlayIdArg: String, + location locationArg: PlatformPoint, + zoom zoomArg: Int64, + completion: + @escaping ( + Result + ) -> Void + ) {} } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/TileOverlayControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/TileOverlayControllerTests.swift index 61c2e853bfcc..bcb00b16feb3 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/TileOverlayControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/TileOverlayControllerTests.swift @@ -4,7 +4,6 @@ import GoogleMaps import Testing -import google_maps_flutter_ios_objc @testable import google_maps_flutter_ios @@ -14,8 +13,8 @@ import google_maps_flutter_ios_objc let tileLayer = PropertyOrderValidatingTileLayer() TileOverlayController.update( tileLayer, - from: FGMPlatformTileOverlay.make( - withTileOverlayId: "overlay", + from: PlatformTileOverlay( + tileOverlayId: "overlay", fadeIn: false, transparency: 0.5, zIndex: 0, diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/TileProviderControllerTests.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/TileProviderControllerTests.swift index e333c633c9cb..c384ce2a5c1d 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/TileProviderControllerTests.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/example/ios/RunnerTests/TileProviderControllerTests.swift @@ -5,7 +5,6 @@ import Flutter import GoogleMaps import Testing -import google_maps_flutter_ios_objc @testable import google_maps_flutter_ios @@ -18,19 +17,18 @@ class StubTileReceiver: NSObject, GMSTileReceiver { // A tile provider that expects a single call to // tileWithOverlayIdentifier:location:zoom:completion: on the main thread, // and then confirms it. -class TestTileProvider: NSObject, TileProviderDelegate { +class TestTileProvider: TileProviderDelegate { var onTileCalled: () -> Void init(onTileCalled: @escaping () -> Void) { self.onTileCalled = onTileCalled - super.init() } func tile( withOverlayIdentifier tileOverlayId: String, - location: FGMPlatformPoint, - zoom: Int, - completion: @escaping (FGMPlatformTile?, FlutterError?) -> Void + location: PlatformPoint, + zoom: Int64, + completion: @escaping (Result) -> Void ) { #expect(Thread.isMainThread) onTileCalled() diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/CircleController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/CircleController.swift index 2c9e9125ad95..f9870af7c0a7 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/CircleController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/CircleController.swift @@ -4,20 +4,15 @@ import GoogleMaps -#if canImport(google_maps_flutter_ios_objc) - import google_maps_flutter_ios_objc -#endif - /// Defines circle controllable by Flutter. -class CircleController: NSObject { +class CircleController { let circle: GMSCircle private weak var mapView: GMSMapView? - init(circle: FGMPlatformCircle, mapView: GMSMapView) { + init(circle: PlatformCircle, mapView: GMSMapView) { self.circle = GMSCircle() self.mapView = mapView self.circle.userData = [circle.circleId] - super.init() CircleController.update(self.circle, from: circle, with: mapView) } @@ -25,20 +20,20 @@ class CircleController: NSObject { circle.map = nil } - /// Updates the controller's circle with the properties from a FGMPlatformCircle. + /// Updates the controller's circle with the properties from a PlatformCircle. /// /// Setting the circle to visible will set its map to the given mapView. - func update(from platformCircle: FGMPlatformCircle) { + func update(from platformCircle: PlatformCircle) { if let mapView = mapView { CircleController.update(circle, from: platformCircle, with: mapView) } } - /// Updates the given GMSCircle with the properties from a FGMPlatformCircle. + /// Updates the given GMSCircle with the properties from a PlatformCircle. /// /// Setting the circle to visible will set its map to the given mapView. static func update( - _ circle: GMSCircle, from platformCircle: FGMPlatformCircle, with mapView: GMSMapView + _ circle: GMSCircle, from platformCircle: PlatformCircle, with mapView: GMSMapView ) { circle.isTappable = platformCircle.consumeTapEvents circle.zIndex = Int32(platformCircle.zIndex) @@ -53,7 +48,7 @@ class CircleController: NSObject { } } -class CirclesController: NSObject { +class CirclesController { private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? private var circleIdToController: [String: CircleController] = [:] @@ -61,17 +56,16 @@ class CirclesController: NSObject { init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate - super.init() } - func add(_ circles: [FGMPlatformCircle]) { + func add(_ circles: [PlatformCircle]) { guard let mapView = mapView else { return } for circle in circles { circleIdToController[circle.circleId] = CircleController(circle: circle, mapView: mapView) } } - func change(_ circles: [FGMPlatformCircle]) { + func change(_ circles: [PlatformCircle]) { for circle in circles { circleIdToController[circle.circleId]?.update(from: circle) } @@ -92,7 +86,7 @@ class CirclesController: NSObject { func didTapCircle(withIdentifier identifier: String) { if hasCircle(withIdentifier: identifier) { - eventDelegate?.didTapCircle(withIdentifier: identifier) + eventDelegate?.didTapCircle(withIdentifier: identifier) { _ in } } } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/ClusterManagersController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/ClusterManagersController.swift index 50ffe6e99360..6c8bc4a417d7 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/ClusterManagersController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/ClusterManagersController.swift @@ -6,12 +6,8 @@ import Flutter import GoogleMaps import GoogleMapsUtils -#if canImport(google_maps_flutter_ios_objc) - import google_maps_flutter_ios_objc -#endif - /// A controller that manages all of the cluster managers on a map. -class ClusterManagersController: NSObject { +class ClusterManagersController { private var clusterManagerIdentifierToManagers: [String: GMUClusterManager] = [:] private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? @@ -19,10 +15,9 @@ class ClusterManagersController: NSObject { init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate - super.init() } - func add(_ clusterManagersToAdd: [FGMPlatformClusterManager]) { + func add(_ clusterManagersToAdd: [PlatformClusterManager]) { for clusterManager in clusterManagersToAdd { addClusterManager(clusterManager.identifier) } @@ -57,17 +52,13 @@ class ClusterManagersController: NSObject { clusterManagerIdentifierToManagers.values.forEach({ $0.cluster() }) } - func clusters( - withIdentifier identifier: String, - error: AutoreleasingUnsafeMutablePointer - ) -> [FGMPlatformCluster]? { + func clusters(withIdentifier identifier: String) throws -> [PlatformCluster] { guard let clusterManager = clusterManagerIdentifierToManagers[identifier] else { - error.pointee = FlutterError( + throw PigeonError( code: "Invalid clusterManagerId", message: "getClusters called with invalid clusterManagerId", details: "clusterManagerId was: '\(identifier)'" ) - return nil } guard let mapView = mapView else { return [] } @@ -75,14 +66,14 @@ class ClusterManagersController: NSObject { // https://github.com/googlemaps/google-maps-ios-utils/blob/0e7ed81f1bbd9d29e4529c40ae39b0791b0a0eb8/src/Clustering/GMUClusterManager.m#L94. let integralZoom = floorf(Float(mapView.camera.zoom) + 0.5) let clusters = clusterManager.algorithm.clusters(atZoom: integralZoom) - return clusters.map { FGMPlatformCluster.make(from: $0, clusterManagerIdentifier: identifier) } + return clusters.map { PlatformCluster.make(from: $0, clusterManagerIdentifier: identifier) } } func didTap(_ cluster: GMUStaticCluster) { guard let clusterManagerId = clusterManagerIdentifier(for: cluster) else { return } - let platformCluster = FGMPlatformCluster.make( + let platformCluster = PlatformCluster.make( from: cluster, clusterManagerIdentifier: clusterManagerId) - eventDelegate?.didTapCluster(platformCluster) + eventDelegate?.didTapCluster(platformCluster) { _ in } } /// Returns the cluster manager identifier for given cluster. diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/ConversionUtils.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/ConversionUtils.swift index 5f00cac392c1..05d91b0bda0a 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/ConversionUtils.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/ConversionUtils.swift @@ -6,14 +6,10 @@ import Flutter import GoogleMaps import GoogleMapsUtils -#if canImport(google_maps_flutter_ios_objc) - import google_maps_flutter_ios_objc -#endif - -extension FGMPlatformPoint { +extension PlatformPoint { /// Converts a CGPoint to its Pigeon equivalent. - static func make(from point: CGPoint) -> FGMPlatformPoint { - return FGMPlatformPoint.makeWith(x: point.x, y: point.y) + static func make(from point: CGPoint) -> PlatformPoint { + return PlatformPoint(x: point.x, y: point.y) } /// Returns the equivalent CGPoint. @@ -22,11 +18,10 @@ extension FGMPlatformPoint { } } -extension FGMPlatformLatLng { +extension PlatformLatLng { /// Converts a CLLocationCoordinate2D to its Pigeon representation. - static func make(from coordinate: CLLocationCoordinate2D) -> FGMPlatformLatLng { - return FGMPlatformLatLng.make( - withLatitude: coordinate.latitude, longitude: coordinate.longitude) + static func make(from coordinate: CLLocationCoordinate2D) -> PlatformLatLng { + return PlatformLatLng(latitude: coordinate.latitude, longitude: coordinate.longitude) } /// Returns the equivalent CLLocationCoordinate2D. @@ -35,12 +30,12 @@ extension FGMPlatformLatLng { } } -extension FGMPlatformLatLngBounds { +extension PlatformLatLngBounds { /// Converts a GMSCoordinateBounds to its Pigeon representation. - static func make(from bounds: GMSCoordinateBounds) -> FGMPlatformLatLngBounds { - return FGMPlatformLatLngBounds.make( - withNortheast: FGMPlatformLatLng.make(from: bounds.northEast), - southwest: FGMPlatformLatLng.make(from: bounds.southWest) + static func make(from bounds: GMSCoordinateBounds) -> PlatformLatLngBounds { + return PlatformLatLngBounds( + northeast: PlatformLatLng.make(from: bounds.northEast), + southwest: PlatformLatLng.make(from: bounds.southWest) ) } @@ -53,12 +48,12 @@ extension FGMPlatformLatLngBounds { } } -extension FGMPlatformCameraPosition { +extension PlatformCameraPosition { /// Converts a GMSCameraPosition to its Pigeon representation. - static func make(from position: GMSCameraPosition) -> FGMPlatformCameraPosition { - return FGMPlatformCameraPosition.make( - withBearing: position.bearing, - target: FGMPlatformLatLng.make(from: position.target), + static func make(from position: GMSCameraPosition) -> PlatformCameraPosition { + return PlatformCameraPosition( + bearing: position.bearing, + target: PlatformLatLng.make(from: position.target), tilt: position.viewingAngle, zoom: Double(position.zoom) ) @@ -84,7 +79,7 @@ func makePath(from points: [CLLocationCoordinate2D]) -> GMSMutablePath { return path } -extension FGMPlatformMapType { +extension PlatformMapType { /// The corresponding GMSMapViewType. var gmsMapViewType: GMSMapViewType { switch self { @@ -98,7 +93,7 @@ extension FGMPlatformMapType { } } -extension FGMPlatformMarkerCollisionBehavior { +extension PlatformMarkerCollisionBehavior { /// The corresponding GMSCollisionBehavior. var gmsCollisionBehavior: GMSCollisionBehavior { switch self { @@ -114,40 +109,39 @@ extension FGMPlatformMarkerCollisionBehavior { } } -extension FGMPlatformGroundOverlay { +extension PlatformGroundOverlay { /// Converts a GMSGroundOverlay to its Pigeon representation. static func make( from groundOverlay: GMSGroundOverlay, overlayId: String, isCreatedWithBounds: Bool, - zoomLevel: NSNumber? - ) -> FGMPlatformGroundOverlay { - let placeholderImage = FGMPlatformBitmap.make( - withBitmap: FGMPlatformBitmapDefaultMarker.make(withHue: nil)) + zoomLevel: Double? + ) -> PlatformGroundOverlay { + let placeholderImage = PlatformBitmapDefaultMarker(hue: nil) if isCreatedWithBounds, let bounds = groundOverlay.bounds { - return FGMPlatformGroundOverlay.make( - withGroundOverlayId: overlayId, + return PlatformGroundOverlay( + groundOverlayId: overlayId, image: placeholderImage, position: nil, - bounds: FGMPlatformLatLngBounds.make(from: bounds), - anchor: FGMPlatformPoint.make(from: groundOverlay.anchor), + bounds: PlatformLatLngBounds.make(from: bounds), + anchor: PlatformPoint.make(from: groundOverlay.anchor), transparency: 1.0 - Double(groundOverlay.opacity), bearing: groundOverlay.bearing, - zIndex: Int(groundOverlay.zIndex), + zIndex: Int64(groundOverlay.zIndex), visible: groundOverlay.map != nil, clickable: groundOverlay.isTappable, zoomLevel: zoomLevel ) } else { - return FGMPlatformGroundOverlay.make( - withGroundOverlayId: overlayId, + return PlatformGroundOverlay( + groundOverlayId: overlayId, image: placeholderImage, - position: FGMPlatformLatLng.make(from: groundOverlay.position), + position: PlatformLatLng.make(from: groundOverlay.position), bounds: nil, - anchor: FGMPlatformPoint.make(from: groundOverlay.anchor), + anchor: PlatformPoint.make(from: groundOverlay.anchor), transparency: 1.0 - Double(groundOverlay.opacity), bearing: groundOverlay.bearing, - zIndex: Int(groundOverlay.zIndex), + zIndex: Int64(groundOverlay.zIndex), visible: groundOverlay.map != nil, clickable: groundOverlay.isTappable, zoomLevel: zoomLevel @@ -156,14 +150,14 @@ extension FGMPlatformGroundOverlay { } } -extension FGMPlatformHeatmapGradient { +extension PlatformHeatmapGradient { /// Converts a GMUGradient to its Pigeon representation. - static func make(from gradient: GMUGradient) -> FGMPlatformHeatmapGradient { - let colors = gradient.colors.map { FGMPlatformColor.make(from: $0) } - return FGMPlatformHeatmapGradient.make( - with: colors, - startPoints: gradient.startPoints, - colorMapSize: Int(gradient.mapSize) + static func make(from gradient: GMUGradient) -> PlatformHeatmapGradient { + let colors = gradient.colors.map { PlatformColor.make(from: $0) } + return PlatformHeatmapGradient( + colors: colors, + startPoints: gradient.startPoints.map({ $0.doubleValue }), + colorMapSize: Int64(gradient.mapSize) ) } @@ -172,18 +166,18 @@ extension FGMPlatformHeatmapGradient { let colors = colors.map { $0.toUIColor() } return GMUGradient( colors: colors, - startPoints: startPoints, + startPoints: startPoints.map({ $0 as NSNumber }), colorMapSize: UInt(colorMapSize) ) } } -extension FGMPlatformWeightedLatLng { +extension PlatformWeightedLatLng { /// Converts a GMUWeightedLatLng to its Pigeon representation. - static func make(from weightedLatLng: GMUWeightedLatLng) -> FGMPlatformWeightedLatLng { + static func make(from weightedLatLng: GMUWeightedLatLng) -> PlatformWeightedLatLng { let point = GMSMapPoint(x: weightedLatLng.point().x, y: weightedLatLng.point().y) - return FGMPlatformWeightedLatLng.make( - withPoint: FGMPlatformLatLng.make(from: GMSUnproject(point)), + return PlatformWeightedLatLng( + point: PlatformLatLng.make(from: GMSUnproject(point)), weight: Double(weightedLatLng.intensity) ) } @@ -194,36 +188,35 @@ extension FGMPlatformWeightedLatLng { } } -extension FGMPlatformCameraUpdate { +extension PlatformCameraUpdate { /// Creates a GMSCameraUpdate from its Pigeon equivalent. func toGMSCameraUpdate() -> GMSCameraUpdate? { - // See note in messages.dart for why this is so loosely typed. - switch cameraUpdate { - case let newCameraPosition as FGMPlatformCameraUpdateNewCameraPosition: + switch self { + case let newCameraPosition as PlatformCameraUpdateNewCameraPosition: return GMSCameraUpdate.setCamera(newCameraPosition.cameraPosition.toGMSCameraPosition()) - case let newLatLng as FGMPlatformCameraUpdateNewLatLng: + case let newLatLng as PlatformCameraUpdateNewLatLng: return GMSCameraUpdate.setTarget(newLatLng.latLng.toCLLocationCoordinate2D()) - case let newLatLngBounds as FGMPlatformCameraUpdateNewLatLngBounds: + case let newLatLngBounds as PlatformCameraUpdateNewLatLngBounds: return GMSCameraUpdate.fit( newLatLngBounds.bounds.toGMSCoordinateBounds(), withPadding: CGFloat(newLatLngBounds.padding) ) - case let newLatLngZoom as FGMPlatformCameraUpdateNewLatLngZoom: + case let newLatLngZoom as PlatformCameraUpdateNewLatLngZoom: return GMSCameraUpdate.setTarget( newLatLngZoom.latLng.toCLLocationCoordinate2D(), zoom: Float(newLatLngZoom.zoom) ) - case let scrollBy as FGMPlatformCameraUpdateScrollBy: + case let scrollBy as PlatformCameraUpdateScrollBy: return GMSCameraUpdate.scrollBy(x: scrollBy.dx, y: scrollBy.dy) - case let zoomBy as FGMPlatformCameraUpdateZoomBy: + case let zoomBy as PlatformCameraUpdateZoomBy: if let focus = zoomBy.focus { return GMSCameraUpdate.zoom(by: Float(zoomBy.amount), at: focus.toCGPoint()) } else { return GMSCameraUpdate.zoom(by: Float(zoomBy.amount)) } - case let zoom as FGMPlatformCameraUpdateZoom: + case let zoom as PlatformCameraUpdateZoom: return zoom.out ? GMSCameraUpdate.zoomOut() : GMSCameraUpdate.zoomIn() - case let zoomTo as FGMPlatformCameraUpdateZoomTo: + case let zoomTo as PlatformCameraUpdateZoomTo: return GMSCameraUpdate.zoom(to: Float(zoomTo.zoom)) default: return nil @@ -231,16 +224,16 @@ extension FGMPlatformCameraUpdate { } } -extension FGMPlatformColor { +extension PlatformColor { /// Converts a UIColor to its Pigeon representation. - static func make(from color: UIColor) -> FGMPlatformColor { + static func make(from color: UIColor) -> PlatformColor { var red: CGFloat = 0 var green: CGFloat = 0 var blue: CGFloat = 0 var alpha: CGFloat = 0 color.getRed(&red, green: &green, blue: &blue, alpha: &alpha) - return FGMPlatformColor.make( - withRed: Double(red), green: Double(green), blue: Double(blue), alpha: Double(alpha)) + return PlatformColor( + red: Double(red), green: Double(green), blue: Double(blue), alpha: Double(alpha)) } /// Returns the equivalent UIColor. @@ -249,7 +242,7 @@ extension FGMPlatformColor { } } -extension FGMPlatformPatternItem { +extension PlatformPatternItem { /// The GMSStrokeStyle expression of this pattern, using the given stroke color. func gmsStrokeStyle(strokeColor: UIColor) -> GMSStrokeStyle { let color = type == .gap ? UIColor.clear : strokeColor @@ -258,16 +251,16 @@ extension FGMPlatformPatternItem { /// The span length for this pattern, in the form expected by GMSStyleSpans. func gmsStyleSpanLength() -> NSNumber { - return length ?? 0 + return (length ?? 0) as NSNumber } } -extension FGMPlatformCluster { +extension PlatformCluster { /// Converts a GMUCluster to its Pigeon representation. static func make( from cluster: GMUCluster, clusterManagerIdentifier: String - ) -> FGMPlatformCluster { + ) -> PlatformCluster { var bounds = GMSCoordinateBounds() for item in cluster.items { bounds = bounds.includingCoordinate(item.position) @@ -277,10 +270,10 @@ extension FGMPlatformCluster { markerIdentifierFromMarker($0) } - return FGMPlatformCluster.make( - withClusterManagerId: clusterManagerIdentifier, - position: FGMPlatformLatLng.make(from: cluster.position), - bounds: FGMPlatformLatLngBounds.make(from: bounds), + return PlatformCluster( + clusterManagerId: clusterManagerIdentifier, + position: PlatformLatLng.make(from: cluster.position), + bounds: PlatformLatLngBounds.make(from: bounds), markerIds: markerIds ) } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/GoogleMapController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/GoogleMapController.swift index 61795d6b6e16..524bd6383b69 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/GoogleMapController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/GoogleMapController.swift @@ -6,10 +6,6 @@ import Flutter import GoogleMaps import GoogleMapsUtils -#if canImport(google_maps_flutter_ios_objc) - import google_maps_flutter_ios_objc -#endif - /// Protocol for CATransaction to allow mocking in tests. protocol MapAnimationCATransactionProtocol { func begin() @@ -17,6 +13,12 @@ protocol MapAnimationCATransactionProtocol { func setAnimationDuration(_ duration: CFTimeInterval) } +/// Add the AnyObject-required protocol to MapsCallbackApi to allow it to be passed to sub-controllers. +extension MapsCallbackApi: MapEventDelegate {} + +/// Add TileProviderDelegate to avoid needing to pass the entire API surface to TileOverlayController. +extension MapsCallbackApi: TileProviderDelegate {} + /// Non-test implementation of MapAnimationCATransactionProtocol. class DefaultMapAnimationCATransaction: MapAnimationCATransactionProtocol { func begin() { @@ -53,90 +55,15 @@ class DefaultAssetProvider: AssetProvider { } } -/// Non-test implementation of MapEventDelegate, wrapping a FGMMapsCallbackApi instance. -class DefaultMapEventHandler: MapEventDelegate { - let callbackHandler: FGMMapsCallbackApi - - init(callbackHandler: FGMMapsCallbackApi) { - self.callbackHandler = callbackHandler - } - - func didStartCameraMove() { - callbackHandler.didStartCameraMove { _ in } - } - - func didMoveCamera(to cameraPosition: FGMPlatformCameraPosition) { - callbackHandler.didMoveCamera(to: cameraPosition) { _ in } - } - - func didIdleCamera() { - callbackHandler.didIdleCamera { _ in } - } - - func didTap(at position: FGMPlatformLatLng) { - callbackHandler.didTap(atPosition: position) { _ in } - } - - func didLongPress(at position: FGMPlatformLatLng) { - callbackHandler.didLongPress(atPosition: position) { _ in } - } - - func didTapMarker(withIdentifier markerId: String) { - callbackHandler.didTapMarker(withIdentifier: markerId) { _ in } - } - - func didStartDragForMarker( - withIdentifier markerId: String, at position: FGMPlatformLatLng - ) { - callbackHandler.didStartDragForMarker(withIdentifier: markerId, atPosition: position) { _ in } - } - - func didDragMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) { - callbackHandler.didDragMarker(withIdentifier: markerId, atPosition: position) { _ in } - } - - func didEndDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) { - callbackHandler.didEndDragForMarker(withIdentifier: markerId, atPosition: position) { _ in } - } - - func didTapInfoWindowOfMarker(withIdentifier markerId: String) { - callbackHandler.didTapInfoWindowOfMarker(withIdentifier: markerId) { _ in } - } - - func didTapCircle(withIdentifier circleId: String) { - callbackHandler.didTapCircle(withIdentifier: circleId) { _ in } - } - - func didTapCluster(_ cluster: FGMPlatformCluster) { - callbackHandler.didTap(cluster) { _ in } - } - - func didTapPolygon(withIdentifier polygonId: String) { - callbackHandler.didTapPolygon(withIdentifier: polygonId) { _ in } - } - - func didTapPolyline(withIdentifier polylineId: String) { - callbackHandler.didTapPolyline(withIdentifier: polylineId) { _ in } - } - - func didTapGroundOverlay(withIdentifier groundOverlayId: String) { - callbackHandler.didTapGroundOverlay(withIdentifier: groundOverlayId) { _ in } - } -} - public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformView { /// The Google Maps SDK map view managed by this controller. let mapView: GMSMapView /// The Pigeon callback API implementation, used to send events to the Dart side. - let dartCallbackHandler: FGMMapsCallbackApi - /// The map SDK event handler, which routes events to the Dart callback handler. - let mapEventHandler: DefaultMapEventHandler + let dartCallbackHandler: MapsCallbackApi /// The main Pigeon API implementation, separate to avoid lifetime extension. let callHandler: MapCallHandler /// The inspector API implementation, separate to avoid lifetime extension. let inspector: MapInspector - /// A shim to pass tile requests to `dartCallbackHandler`. This is a separate object to avoid init ordering issues. - private let tileProvider: ConcreteTileProvider /// Whether to send notifications about camera position changes to Dart. var trackCameraPosition = false @@ -159,10 +86,10 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV /// that the observer is removed before the controller is deallocated. private var isObservingFrame = false - public convenience init( + convenience init( frame: CGRect, viewIdentifier viewId: Int64, - creationParameters: FGMPlatformMapViewCreationParams, + creationParameters: PlatformMapViewCreationParams, registrar: FlutterPluginRegistrar ) { let camera = creationParameters.initialCameraPosition.toGMSCameraPosition() @@ -186,7 +113,7 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV init( mapView: GMSMapView, viewIdentifier viewId: Int64, - creationParameters: FGMPlatformMapViewCreationParams, + creationParameters: PlatformMapViewCreationParams, assetProvider: AssetProvider, binaryMessenger: FlutterBinaryMessenger ) { @@ -202,52 +129,49 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV styleError = errorString } if let trackCameraPosition = creationParameters.mapConfiguration.trackCameraPosition { - self.trackCameraPosition = trackCameraPosition.boolValue + self.trackCameraPosition = trackCameraPosition } // End duplicate code. let pigeonSuffix = String(format: "%lld", viewId) - dartCallbackHandler = FGMMapsCallbackApi( + dartCallbackHandler = MapsCallbackApi( binaryMessenger: binaryMessenger, messageChannelSuffix: pigeonSuffix ) - mapEventHandler = DefaultMapEventHandler(callbackHandler: dartCallbackHandler) - let markerType = creationParameters.mapConfiguration.markerType clusterManagersController = ClusterManagersController( mapView: mapView, - eventDelegate: mapEventHandler + eventDelegate: dartCallbackHandler ) markersController = MarkersController( mapView: mapView, - eventDelegate: mapEventHandler, + eventDelegate: dartCallbackHandler, clusterManagersController: clusterManagersController, assetProvider: assetProvider, markerType: markerType ) polygonsController = PolygonsController( mapView: mapView, - eventDelegate: mapEventHandler + eventDelegate: dartCallbackHandler ) polylinesController = PolylinesController( mapView: mapView, - eventDelegate: mapEventHandler + eventDelegate: dartCallbackHandler ) circlesController = CirclesController( mapView: mapView, - eventDelegate: mapEventHandler + eventDelegate: dartCallbackHandler ) heatmapsController = HeatmapsController(mapView: mapView) - tileProvider = ConcreteTileProvider(dartCallbackHandler: dartCallbackHandler) tileOverlaysController = TileOverlaysController( mapView: mapView, - tileProvider: tileProvider + tileProvider: dartCallbackHandler ) groundOverlaysController = GroundOverlaysController( mapView: mapView, - eventDelegate: mapEventHandler, + eventDelegate: dartCallbackHandler, assetProvider: assetProvider ) @@ -272,9 +196,17 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV super.init() callHandler.controller = self - SetUpFGMMapsApiWithSuffix(binaryMessenger, callHandler, pigeonSuffix) + MapsApiSetup.setUp( + binaryMessenger: binaryMessenger, + api: callHandler, + messageChannelSuffix: pigeonSuffix + ) inspector.controller = self - SetUpFGMMapsInspectorApiWithSuffix(binaryMessenger, inspector, pigeonSuffix) + MapsInspectorApiSetup.setUp( + binaryMessenger: binaryMessenger, + api: inspector, + messageChannelSuffix: pigeonSuffix + ) mapView.delegate = self isObservingFrame = true @@ -288,8 +220,15 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV if isObservingFrame { mapView.removeObserver(self, forKeyPath: "frame") } - SetUpFGMMapsApiWithSuffix(callHandler.messenger, nil, callHandler.pigeonSuffix) - SetUpFGMMapsInspectorApiWithSuffix(inspector.messenger, nil, inspector.pigeonSuffix) + MapsApiSetup.setUp( + binaryMessenger: callHandler.messenger, + api: nil, + messageChannelSuffix: callHandler.pigeonSuffix + ) + MapsInspectorApiSetup.setUp( + binaryMessenger: inspector.messenger, + api: nil, + messageChannelSuffix: inspector.pigeonSuffix) } public func view() -> UIView { @@ -374,17 +313,17 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV // MARK: - GMSMapViewDelegate methods public func mapView(_ mapView: GMSMapView, willMove gesture: Bool) { - mapEventHandler.didStartCameraMove() + dartCallbackHandler.didStartCameraMove { _ in } } public func mapView(_ mapView: GMSMapView, didChange position: GMSCameraPosition) { if trackCameraPosition { - mapEventHandler.didMoveCamera(to: FGMPlatformCameraPosition.make(from: position)) + dartCallbackHandler.didMoveCamera(to: PlatformCameraPosition.make(from: position)) { _ in } } } public func mapView(_ mapView: GMSMapView, idleAt position: GMSCameraPosition) { - mapEventHandler.didIdleCamera() + dartCallbackHandler.didIdleCamera { _ in } } public func mapView(_ mapView: GMSMapView, didTap marker: GMSMarker) -> Bool { @@ -440,14 +379,14 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV } public func mapView(_ mapView: GMSMapView, didTapAt coordinate: CLLocationCoordinate2D) { - mapEventHandler.didTap(at: FGMPlatformLatLng.make(from: coordinate)) + dartCallbackHandler.didTap(at: PlatformLatLng.make(from: coordinate)) { _ in } } public func mapView(_ mapView: GMSMapView, didLongPressAt coordinate: CLLocationCoordinate2D) { - mapEventHandler.didLongPress(at: FGMPlatformLatLng.make(from: coordinate)) + dartCallbackHandler.didLongPress(at: PlatformLatLng.make(from: coordinate)) { _ in } } - func interpretMapConfiguration(_ config: FGMPlatformMapConfiguration) { + func interpretMapConfiguration(_ config: PlatformMapConfiguration) { // Any changes here must also be made to the `init` method above. See the comment there for // details. let (styleUpdateAttempted, errorString) = GoogleMapController.updateMapView( @@ -456,7 +395,7 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV styleError = errorString } if let trackCameraPosition = config.trackCameraPosition { - self.trackCameraPosition = trackCameraPosition.boolValue + self.trackCameraPosition = trackCameraPosition } } @@ -466,7 +405,7 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV /// describing any error interpreting the style in `config`. If the boolean is true, the error /// string should be stored in `styleError` for later access. static func updateMapView( - _ mapView: GMSMapView, fromConfiguration config: FGMPlatformMapConfiguration + _ mapView: GMSMapView, fromConfiguration config: PlatformMapConfiguration ) -> (Bool, String?) { if let cameraTargetBounds = config.cameraTargetBounds { if let bounds = cameraTargetBounds.bounds { @@ -476,23 +415,23 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV } } if let compassEnabled = config.compassEnabled { - mapView.settings.compassButton = compassEnabled.boolValue + mapView.settings.compassButton = compassEnabled } if let indoorEnabled = config.indoorViewEnabled { - mapView.isIndoorEnabled = indoorEnabled.boolValue + mapView.isIndoorEnabled = indoorEnabled } if let trafficEnabled = config.trafficEnabled { - mapView.isTrafficEnabled = trafficEnabled.boolValue + mapView.isTrafficEnabled = trafficEnabled } if let buildingsEnabled = config.buildingsEnabled { - mapView.isBuildingsEnabled = buildingsEnabled.boolValue + mapView.isBuildingsEnabled = buildingsEnabled } if let mapType = config.mapType { - mapView.mapType = mapType.value.gmsMapViewType + mapView.mapType = mapType.gmsMapViewType } if let zoomData = config.minMaxZoomPreference { - let minZoom = zoomData.min?.floatValue ?? kGMSMinZoomLevel - let maxZoom = zoomData.max?.floatValue ?? kGMSMaxZoomLevel + let minZoom = zoomData.min.map({ Float($0) }) ?? kGMSMinZoomLevel + let maxZoom = zoomData.max.map({ Float($0) }) ?? kGMSMaxZoomLevel mapView.setMinZoom(minZoom, maxZoom: maxZoom) } if let padding = config.padding { @@ -504,22 +443,22 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV ) } if let rotateGesturesEnabled = config.rotateGesturesEnabled { - mapView.settings.rotateGestures = rotateGesturesEnabled.boolValue + mapView.settings.rotateGestures = rotateGesturesEnabled } if let scrollGesturesEnabled = config.scrollGesturesEnabled { - mapView.settings.scrollGestures = scrollGesturesEnabled.boolValue + mapView.settings.scrollGestures = scrollGesturesEnabled } if let tiltGesturesEnabled = config.tiltGesturesEnabled { - mapView.settings.tiltGestures = tiltGesturesEnabled.boolValue + mapView.settings.tiltGestures = tiltGesturesEnabled } if let zoomGesturesEnabled = config.zoomGesturesEnabled { - mapView.settings.zoomGestures = zoomGesturesEnabled.boolValue + mapView.settings.zoomGestures = zoomGesturesEnabled } if let myLocationEnabled = config.myLocationEnabled { - mapView.isMyLocationEnabled = myLocationEnabled.boolValue + mapView.isMyLocationEnabled = myLocationEnabled } if let myLocationButtonEnabled = config.myLocationButtonEnabled { - mapView.settings.myLocationButton = myLocationButtonEnabled.boolValue + mapView.settings.myLocationButton = myLocationButtonEnabled } if let mapStyle = config.style { let (style, errorString) = GoogleMapController.parseMapStyle(mapStyle) @@ -532,32 +471,7 @@ public class GoogleMapController: NSObject, GMSMapViewDelegate, FlutterPlatformV } } -// TODO(stuartmorgan): Remove this in favor of an extension to add FGMTileProviderDelegate to -// the Pigeon Flutter API object once this plugin has switched to Swift Pigeon generation -// (adjusting the protocol to match the Swift version of the signature). -private class ConcreteTileProvider: NSObject, TileProviderDelegate { - let handler: FGMMapsCallbackApi - - init(dartCallbackHandler: FGMMapsCallbackApi) { - handler = dartCallbackHandler - } - - public func tile( - withOverlayIdentifier tileOverlayId: String, - location: FGMPlatformPoint, - zoom: Int, - completion: @escaping (FGMPlatformTile?, FlutterError?) -> Void - ) { - handler.tile( - withOverlayIdentifier: tileOverlayId, - location: location, - zoom: zoom, - completion: completion - ) - } -} - -class MapCallHandler: NSObject, FGMMapsApi { +class MapCallHandler: MapsApi { weak var controller: GoogleMapController? let messenger: FlutterBinaryMessenger let pigeonSuffix: String @@ -570,16 +484,16 @@ class MapCallHandler: NSObject, FGMMapsApi { self.messenger = messenger self.pigeonSuffix = suffix self.transactionWrapper = DefaultMapAnimationCATransaction() - super.init() } - func waitForMapWithError(_ error: AutoreleasingUnsafeMutablePointer) { + func waitForMap() { // No-op; this call just ensures synchronization with the platform thread. } func updateCircles( - byAdding toAdd: [FGMPlatformCircle], changing toChange: [FGMPlatformCircle], - removing idsToRemove: [String], error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformCircle], + changing toChange: [PlatformCircle], + removing idsToRemove: [String] ) { controller?.circlesController.add(toAdd) controller?.circlesController.change(toChange) @@ -587,24 +501,23 @@ class MapCallHandler: NSObject, FGMMapsApi { } func updateHeatmaps( - byAdding toAdd: [FGMPlatformHeatmap], changing toChange: [FGMPlatformHeatmap], - removing idsToRemove: [String], error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformHeatmap], + changing toChange: [PlatformHeatmap], + removing idsToRemove: [String] ) { controller?.heatmapsController.add(toAdd) controller?.heatmapsController.change(toChange) controller?.heatmapsController.removeHeatmaps(withIdentifiers: idsToRemove) } - func update( - with configuration: FGMPlatformMapConfiguration, - error: AutoreleasingUnsafeMutablePointer - ) { + func updateWithMapConfiguration(_ configuration: PlatformMapConfiguration) { controller?.interpretMapConfiguration(configuration) } func updateMarkers( - byAdding toAdd: [FGMPlatformMarker], changing toChange: [FGMPlatformMarker], - removing idsToRemove: [String], error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformMarker], + changing toChange: [PlatformMarker], + removing idsToRemove: [String] ) { controller?.markersController.add(toAdd) controller?.markersController.change(toChange) @@ -614,16 +527,17 @@ class MapCallHandler: NSObject, FGMMapsApi { } func updateClusterManagers( - byAdding toAdd: [FGMPlatformClusterManager], removing idsToRemove: [String], - error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformClusterManager], + removing idsToRemove: [String] ) { controller?.clusterManagersController.add(toAdd) controller?.clusterManagersController.removeClusterManagers(withIdentifiers: idsToRemove) } func updatePolygons( - byAdding toAdd: [FGMPlatformPolygon], changing toChange: [FGMPlatformPolygon], - removing idsToRemove: [String], error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformPolygon], + changing toChange: [PlatformPolygon], + removing idsToRemove: [String] ) { controller?.polygonsController.add(toAdd) controller?.polygonsController.change(toChange) @@ -631,8 +545,9 @@ class MapCallHandler: NSObject, FGMMapsApi { } func updatePolylines( - byAdding toAdd: [FGMPlatformPolyline], changing toChange: [FGMPlatformPolyline], - removing idsToRemove: [String], error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformPolyline], + changing toChange: [PlatformPolyline], + removing idsToRemove: [String] ) { controller?.polylinesController.add(toAdd) controller?.polylinesController.change(toChange) @@ -640,8 +555,9 @@ class MapCallHandler: NSObject, FGMMapsApi { } func updateTileOverlays( - byAdding toAdd: [FGMPlatformTileOverlay], changing toChange: [FGMPlatformTileOverlay], - removing idsToRemove: [String], error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformTileOverlay], + changing toChange: [PlatformTileOverlay], + removing idsToRemove: [String] ) { controller?.tileOverlaysController.add(toAdd) controller?.tileOverlaysController.change(toChange) @@ -649,150 +565,128 @@ class MapCallHandler: NSObject, FGMMapsApi { } func updateGroundOverlays( - byAdding toAdd: [FGMPlatformGroundOverlay], changing toChange: [FGMPlatformGroundOverlay], - removing idsToRemove: [String], error: AutoreleasingUnsafeMutablePointer + adding toAdd: [PlatformGroundOverlay], + changing toChange: [PlatformGroundOverlay], + removing idsToRemove: [String] ) { controller?.groundOverlaysController.add(toAdd) controller?.groundOverlaysController.change(toChange) controller?.groundOverlaysController.removeGroundOverlays(withIdentifiers: idsToRemove) } - func latLng( - forScreenCoordinate screenCoordinate: FGMPlatformPoint, - error: AutoreleasingUnsafeMutablePointer - ) -> FGMPlatformLatLng? { + func latLng(for screenCoordinate: PlatformPoint) throws -> PlatformLatLng { guard let mapView = controller?.mapView else { - error.pointee = FlutterError( + throw PigeonError( code: "GoogleMap uninitialized", message: "getLatLng called prior to map initialization", details: nil ) - return nil } let point = screenCoordinate.toCGPoint() let latlng = mapView.projection.coordinate(for: point) - return FGMPlatformLatLng.make(from: latlng) + return PlatformLatLng.make(from: latlng) } - func screenCoordinates( - for latLng: FGMPlatformLatLng, error: AutoreleasingUnsafeMutablePointer - ) -> FGMPlatformPoint? { + func screenCoordinates(for latLng: PlatformLatLng) throws -> PlatformPoint { guard let mapView = controller?.mapView else { - error.pointee = FlutterError( + throw PigeonError( code: "GoogleMap uninitialized", message: "getScreenCoordinate called prior to map initialization", details: nil ) - return nil } let location = latLng.toCLLocationCoordinate2D() let point = mapView.projection.point(for: location) - return FGMPlatformPoint.make(from: point) + return PlatformPoint.make(from: point) } - func visibleMapRegion(_ error: AutoreleasingUnsafeMutablePointer) - -> FGMPlatformLatLngBounds? - { + func visibleMapRegion() throws -> PlatformLatLngBounds { guard let mapView = controller?.mapView else { - error.pointee = FlutterError( + throw PigeonError( code: "GoogleMap uninitialized", message: "getVisibleRegion called prior to map initialization", details: nil ) - return nil } let visibleRegion = mapView.projection.visibleRegion() let bounds = GMSCoordinateBounds(region: visibleRegion) - return FGMPlatformLatLngBounds.make(from: bounds) + return PlatformLatLngBounds.make(from: bounds) } - func moveCamera( - with cameraUpdate: FGMPlatformCameraUpdate, - error: AutoreleasingUnsafeMutablePointer - ) { + func moveCamera(_ cameraUpdate: PlatformCameraUpdate) throws { guard let update = cameraUpdate.toGMSCameraUpdate() else { - error.pointee = FlutterError( + throw PigeonError( code: "Invalid update", message: "Unrecognized camera update", details: nil ) - return } controller?.mapView.moveCamera(update) } func animateCamera( - with cameraUpdate: FGMPlatformCameraUpdate, duration durationMilliseconds: NSNumber?, - error: AutoreleasingUnsafeMutablePointer - ) { + _ cameraUpdate: PlatformCameraUpdate, + duration durationMilliseconds: Int64? + ) throws { guard let update = cameraUpdate.toGMSCameraUpdate() else { - error.pointee = FlutterError( + throw PigeonError( code: "Invalid update", message: "Unrecognized camera update", details: nil ) - return } let transaction = durationMilliseconds != nil ? transactionWrapper : nil transaction?.begin() if let duration = durationMilliseconds { - transaction?.setAnimationDuration(duration.doubleValue / 1000.0) + transaction?.setAnimationDuration(Double(duration) / 1000.0) } controller?.mapView.animate(with: update) transaction?.commit() } - func currentZoomLevel(_ error: AutoreleasingUnsafeMutablePointer) -> NSNumber? { + func zoomLevel() throws -> Double { guard let mapView = controller?.mapView else { - return nil + throw PigeonError( + code: "GoogleMap uninitialized", + message: "getZoomLevel called prior to map initialization", + details: nil + ) } - return NSNumber(value: mapView.camera.zoom) + return Double(mapView.camera.zoom) } - func showInfoWindowForMarker( - withIdentifier markerId: String, error: AutoreleasingUnsafeMutablePointer - ) { - controller?.markersController.showMarkerInfoWindow(withIdentifier: markerId, error: error) + func showInfoWindowForMarker(withIdentifier markerId: String) throws { + try controller?.markersController.showMarkerInfoWindow(withIdentifier: markerId) } - func hideInfoWindowForMarker( - withIdentifier markerId: String, error: AutoreleasingUnsafeMutablePointer - ) { - controller?.markersController.hideMarkerInfoWindow(withIdentifier: markerId, error: error) + func hideInfoWindowForMarker(withIdentifier markerId: String) throws { + try controller?.markersController.hideMarkerInfoWindow(withIdentifier: markerId) } - func isShowingInfoWindowForMarker( - withIdentifier markerId: String, error: AutoreleasingUnsafeMutablePointer - ) -> NSNumber? { - return controller?.markersController.isInfoWindowShownForMarker( - withIdentifier: markerId, error: error) + func isShowingInfoWindowForMarker(withIdentifier markerId: String) throws -> Bool { + return try controller?.markersController.isInfoWindowShownForMarker(withIdentifier: markerId) + ?? false } - func setStyle(_ style: String, error: AutoreleasingUnsafeMutablePointer) -> String? - { + func setStyle(_ style: String) -> String? { return controller?.setMapStyle(style) } - func lastStyleError(_ error: AutoreleasingUnsafeMutablePointer) -> String? { + func lastStyleError() -> String? { return controller?.styleError } - func clearTileCacheForOverlay( - withIdentifier tileOverlayId: String, error: AutoreleasingUnsafeMutablePointer - ) { + func clearTileCacheForOverlay(withIdentifier tileOverlayId: String) { controller?.tileOverlaysController.clearTileCache(withIdentifier: tileOverlayId) } - func takeSnapshotWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> FlutterStandardTypedData? - { + func takeSnapshot() throws -> FlutterStandardTypedData? { guard let mapView = controller?.mapView else { - error.pointee = FlutterError( + throw PigeonError( code: "GoogleMap uninitialized", message: "takeSnapshot called prior to map initialization", details: nil ) - return nil } let renderer = UIGraphicsImageRenderer(size: mapView.bounds.size) let image = renderer.image { context in @@ -804,17 +698,12 @@ class MapCallHandler: NSObject, FGMMapsApi { return nil } - func isAdvancedMarkersAvailable(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return false - } - return NSNumber(value: mapView.mapCapabilities.contains(.advancedMarkers)) + func isAdvancedMarkersAvailable() -> Bool { + return controller?.mapView.mapCapabilities.contains(.advancedMarkers) ?? false } } -class MapInspector: NSObject, FGMMapsInspectorApi { +class MapInspector: MapsInspectorApi { weak var controller: GoogleMapController? let messenger: FlutterBinaryMessenger let pigeonSuffix: String @@ -825,134 +714,87 @@ class MapInspector: NSObject, FGMMapsInspectorApi { ) { self.messenger = messenger self.pigeonSuffix = suffix - super.init() } - func areBuildingsEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.isBuildingsEnabled) + func areBuildingsEnabled() -> Bool { + return controller?.mapView.isBuildingsEnabled ?? false } - func areRotateGesturesEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.settings.rotateGestures) + func areRotateGesturesEnabled() -> Bool { + return controller?.mapView.settings.rotateGestures ?? false } - func areScrollGesturesEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.settings.scrollGestures) + func areScrollGesturesEnabled() -> Bool { + return controller?.mapView.settings.scrollGestures ?? false } - func areTiltGesturesEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.settings.tiltGestures) + func areTiltGesturesEnabled() -> Bool { + return controller?.mapView.settings.tiltGestures ?? false } - func areZoomGesturesEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.settings.zoomGestures) + func areZoomGesturesEnabled() -> Bool { + return controller?.mapView.settings.zoomGestures ?? false } - func tileOverlay( - withIdentifier tileOverlayId: String, error: AutoreleasingUnsafeMutablePointer - ) -> FGMPlatformTileLayer? { + func isCompassEnabled() -> Bool { + return controller?.mapView.settings.compassButton ?? false + } + + func isMyLocationButtonEnabled() -> Bool { + return controller?.mapView.settings.myLocationButton ?? false + } + + func isTrafficEnabled() -> Bool { + return controller?.mapView.isTrafficEnabled ?? false + } + + func tileOverlay(withIdentifier tileOverlayId: String) -> PlatformTileLayer? { guard let controller = controller, let layer = controller.tileOverlaysController.tileOverlay(withIdentifier: tileOverlayId)? .layer else { return nil } - return FGMPlatformTileLayer.make( - withVisible: layer.map != nil, + return PlatformTileLayer( + visible: layer.map != nil, fadeIn: layer.fadeIn, opacity: Double(layer.opacity), - zIndex: Int(layer.zIndex) + zIndex: Int64(layer.zIndex) ) } - func heatmap( - withIdentifier heatmapId: String, error: AutoreleasingUnsafeMutablePointer - ) -> FGMPlatformHeatmap? { + func heatmap(withIdentifier heatmapId: String) -> PlatformHeatmap? { return controller?.heatmapsController.heatmap(withIdentifier: heatmapId) } - func clusters( - withIdentifier clusterManagerId: String, error: AutoreleasingUnsafeMutablePointer - ) -> [FGMPlatformCluster]? { - return controller?.clusterManagersController.clusters( - withIdentifier: clusterManagerId, error: error) - } - - func isCompassEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.settings.compassButton) - } - - func isMyLocationButtonEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.settings.myLocationButton) - } - - func isTrafficEnabledWithError(_ error: AutoreleasingUnsafeMutablePointer) - -> NSNumber? - { - guard let mapView = controller?.mapView else { - return nil - } - return NSNumber(value: mapView.isTrafficEnabled) + func clusters(withIdentifier clusterManagerId: String) throws -> [PlatformCluster] { + return try controller?.clusterManagersController.clusters(withIdentifier: clusterManagerId) + ?? [] } - func zoomRange(_ error: AutoreleasingUnsafeMutablePointer) -> FGMPlatformZoomRange? - { + func zoomRange() throws -> PlatformZoomRange { guard let mapView = controller?.mapView else { - return nil + throw PigeonError( + code: "GoogleMap uninitialized", + message: "zoomRange called prior to map initialization", + details: nil + ) } - return FGMPlatformZoomRange.make( - withMin: NSNumber(value: mapView.minZoom), - max: NSNumber(value: mapView.maxZoom) - ) + return PlatformZoomRange(min: Double(mapView.minZoom), max: Double(mapView.maxZoom)) } - func groundOverlay( - withIdentifier groundOverlayId: String, error: AutoreleasingUnsafeMutablePointer - ) -> FGMPlatformGroundOverlay? { + func groundOverlay(withIdentifier groundOverlayId: String) -> PlatformGroundOverlay? { return controller?.groundOverlaysController.groundOverlay(withIdentifier: groundOverlayId) } - func cameraPosition(_ error: AutoreleasingUnsafeMutablePointer) - -> FGMPlatformCameraPosition? - { + func cameraPosition() throws -> PlatformCameraPosition { guard let mapView = controller?.mapView else { - return nil + throw PigeonError( + code: "GoogleMap uninitialized", + message: "cameraPosition called prior to map initialization", + details: nil + ) } - return FGMPlatformCameraPosition.make(from: mapView.camera) + return PlatformCameraPosition.make(from: mapView.camera) } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/GoogleMapFactory.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/GoogleMapFactory.swift index 516f79834efa..5e263d2cff79 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/GoogleMapFactory.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/GoogleMapFactory.swift @@ -5,10 +5,6 @@ import Flutter import GoogleMaps -#if canImport(google_maps_flutter_ios_objc) - import google_maps_flutter_ios_objc -#endif - class GoogleMapFactory: NSObject, FlutterPlatformViewFactory { weak var registrar: FlutterPluginRegistrar? static var sharedMapServices = GMSServices.sharedServices() @@ -25,10 +21,10 @@ class GoogleMapFactory: NSObject, FlutterPlatformViewFactory { return GoogleMapController( frame: frame, viewIdentifier: viewId, - creationParameters: args as! FGMPlatformMapViewCreationParams, registrar: registrar!) + creationParameters: args as! PlatformMapViewCreationParams, registrar: registrar!) } func createArgsCodec() -> any FlutterMessageCodec & NSObjectProtocol { - return FGMGetGoogleMapsFlutterPigeonMessagesCodec() + return MessagesPigeonCodec.shared } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/GroundOverlayController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/GroundOverlayController.swift index 6b3ccf9acdf5..58fc2830a383 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/GroundOverlayController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/GroundOverlayController.swift @@ -6,16 +6,12 @@ import GoogleMaps import GoogleMapsUtils import UIKit -#if canImport(google_maps_flutter_ios_objc) - import google_maps_flutter_ios_objc -#endif - /// Controller of a single ground overlay on the map. -class GroundOverlayController: NSObject { +class GroundOverlayController { let groundOverlay: GMSGroundOverlay private weak var mapView: GMSMapView? let createdWithBounds: Bool - var zoomLevel: NSNumber? + var zoomLevel: Double? init( groundOverlay: GMSGroundOverlay, identifier: String, mapView: GMSMapView, @@ -25,18 +21,18 @@ class GroundOverlayController: NSObject { self.mapView = mapView self.groundOverlay.userData = [identifier] self.createdWithBounds = isCreatedWithBounds - super.init() } func removeGroundOverlay() { groundOverlay.map = nil } - /// Updates the controller's ground overlay with the properties from a FGMPlatformGroundOverlay. + /// Updates the controller's ground overlay with the properties from a PlatformGroundOverlay. /// /// Setting the ground overlay to visible will set its map to the controller's mapView. func update( - from platformGroundOverlay: FGMPlatformGroundOverlay, assetProvider: AssetProvider, + from platformGroundOverlay: PlatformGroundOverlay, + assetProvider: AssetProvider, screenScale: CGFloat ) { if let mapView = mapView { @@ -51,12 +47,12 @@ class GroundOverlayController: NSObject { } } - /// Updates the given GMSGroundOverlay with the properties from a FGMPlatformGroundOverlay. + /// Updates the given GMSGroundOverlay with the properties from a PlatformGroundOverlay. /// /// Setting the ground overlay to visible will set its map to the given mapView. static func update( _ groundOverlay: GMSGroundOverlay, - from platformGroundOverlay: FGMPlatformGroundOverlay, + from platformGroundOverlay: PlatformGroundOverlay, mapView: GMSMapView, assetProvider: AssetProvider, screenScale: CGFloat, @@ -101,7 +97,7 @@ class GroundOverlayController: NSObject { } /// Controller of multiple ground overlays on the map. -class GroundOverlaysController: NSObject { +class GroundOverlaysController { private var groundOverlayControllerByIdentifier: [String: GroundOverlayController] = [:] private weak var eventDelegate: MapEventDelegate? private let assetProvider: AssetProvider @@ -111,10 +107,9 @@ class GroundOverlaysController: NSObject { self.mapView = mapView self.eventDelegate = eventDelegate self.assetProvider = assetProvider - super.init() } - func add(_ groundOverlaysToAdd: [FGMPlatformGroundOverlay]) { + func add(_ groundOverlaysToAdd: [PlatformGroundOverlay]) { guard let mapView = mapView else { return } let screenScale = getScreenScale() for groundOverlay in groundOverlaysToAdd { @@ -136,7 +131,7 @@ class GroundOverlaysController: NSObject { ), // The actual icon will be set in the update() call below. icon: nil, - zoomLevel: CGFloat(zoomLevel.doubleValue) + zoomLevel: CGFloat(zoomLevel) ) } else { isCreatedWithBounds = true @@ -179,7 +174,7 @@ class GroundOverlaysController: NSObject { } } - func change(_ groundOverlaysToChange: [FGMPlatformGroundOverlay]) { + func change(_ groundOverlaysToChange: [PlatformGroundOverlay]) { let screenScale = getScreenScale() for groundOverlay in groundOverlaysToChange { let identifier = groundOverlay.groundOverlayId @@ -202,7 +197,7 @@ class GroundOverlaysController: NSObject { func didTapGroundOverlay(withIdentifier identifier: String) { if hasGroundOverlays(withIdentifier: identifier) { - eventDelegate?.didTapGroundOverlay(withIdentifier: identifier) + eventDelegate?.didTapGroundOverlay(withIdentifier: identifier) { _ in } } } @@ -220,11 +215,11 @@ class GroundOverlaysController: NSObject { return mapView?.traitCollection.displayScale ?? 1.0 } - func groundOverlay(withIdentifier identifier: String) -> FGMPlatformGroundOverlay? { + func groundOverlay(withIdentifier identifier: String) -> PlatformGroundOverlay? { guard let controller = groundOverlayControllerByIdentifier[identifier] else { return nil } - return FGMPlatformGroundOverlay.make( + return PlatformGroundOverlay.make( from: controller.groundOverlay, overlayId: identifier, isCreatedWithBounds: controller.createdWithBounds, diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/HeatmapController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/HeatmapController.swift index 65cd5dc7a64f..bda3a2199e9e 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/HeatmapController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/HeatmapController.swift @@ -5,19 +5,14 @@ import GoogleMaps import GoogleMapsUtils -#if canImport(google_maps_flutter_ios_objc) - import google_maps_flutter_ios_objc -#endif - /// Controller of a single Heatmap on the map. -class HeatmapController: NSObject { +class HeatmapController { let heatmapTileLayer: GMUHeatmapTileLayer private weak var mapView: GMSMapView? - init(heatmap: FGMPlatformHeatmap, tileLayer: GMUHeatmapTileLayer, mapView: GMSMapView) { + init(heatmap: PlatformHeatmap, tileLayer: GMUHeatmapTileLayer, mapView: GMSMapView) { self.heatmapTileLayer = tileLayer self.mapView = mapView - super.init() HeatmapController.update(tileLayer, from: heatmap, mapView: mapView) } @@ -29,7 +24,7 @@ class HeatmapController: NSObject { heatmapTileLayer.clearTileCache() } - func update(from platformHeatmap: FGMPlatformHeatmap) { + func update(from platformHeatmap: PlatformHeatmap) { if let mapView = mapView { HeatmapController.update(heatmapTileLayer, from: platformHeatmap, mapView: mapView) } @@ -40,7 +35,7 @@ class HeatmapController: NSObject { /// Setting the heatmap to visible will set its map to the given mapView. static func update( _ heatmapTileLayer: GMUHeatmapTileLayer, - from platformHeatmap: FGMPlatformHeatmap, + from platformHeatmap: PlatformHeatmap, mapView: GMSMapView ) { heatmapTileLayer.weightedData = platformHeatmap.data.map({ $0.toGMUWeightedLatLng() }) @@ -59,16 +54,15 @@ class HeatmapController: NSObject { } /// Controller of multiple Heatmaps on the map. -class HeatmapsController: NSObject { +class HeatmapsController { private var heatmapIdToController: [String: HeatmapController] = [:] private weak var mapView: GMSMapView? init(mapView: GMSMapView) { self.mapView = mapView - super.init() } - func add(_ heatmapsToAdd: [FGMPlatformHeatmap]) { + func add(_ heatmapsToAdd: [PlatformHeatmap]) { guard let mapView = mapView else { return } for heatmap in heatmapsToAdd { let heatmapTileLayer = GMUHeatmapTileLayer() @@ -81,7 +75,7 @@ class HeatmapsController: NSObject { } } - func change(_ heatmapsToChange: [FGMPlatformHeatmap]) { + func change(_ heatmapsToChange: [PlatformHeatmap]) { for heatmap in heatmapsToChange { if let controller = heatmapIdToController[heatmap.heatmapId] { controller.update(from: heatmap) @@ -103,17 +97,17 @@ class HeatmapsController: NSObject { return heatmapIdToController[identifier] != nil } - func heatmap(withIdentifier identifier: String) -> FGMPlatformHeatmap? { + func heatmap(withIdentifier identifier: String) -> PlatformHeatmap? { guard let controller = heatmapIdToController[identifier] else { return nil } let heatmap = controller.heatmapTileLayer - return FGMPlatformHeatmap.make( - withHeatmapId: identifier, - data: heatmap.weightedData.map { FGMPlatformWeightedLatLng.make(from: $0) }, - gradient: FGMPlatformHeatmapGradient.make(from: heatmap.gradient), + return PlatformHeatmap( + heatmapId: identifier, + data: heatmap.weightedData.map { PlatformWeightedLatLng.make(from: $0) }, + gradient: PlatformHeatmapGradient.make(from: heatmap.gradient), opacity: Double(heatmap.opacity), - radius: Int(heatmap.radius), - minimumZoomIntensity: Int(heatmap.minimumZoomIntensity), - maximumZoomIntensity: Int(heatmap.maximumZoomIntensity) + radius: Int64(heatmap.radius), + minimumZoomIntensity: Int64(heatmap.minimumZoomIntensity), + maximumZoomIntensity: Int64(heatmap.maximumZoomIntensity) ) } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/ImageUtils.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/ImageUtils.swift index 636ab730ebc9..de6a4797ce3f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/ImageUtils.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/ImageUtils.swift @@ -6,11 +6,7 @@ import Flutter import GoogleMaps import UIKit -#if canImport(google_maps_flutter_ios_objc) - import google_maps_flutter_ios_objc -#endif - -extension FGMPlatformBitmap { +extension PlatformBitmap { /// Creates a UIImage from the Pigeon bitmap representation, suitable for use as a marker icon. func createIcon( assetProvider: AssetProvider, @@ -20,18 +16,15 @@ extension FGMPlatformBitmap { var image: UIImage? - // See comment in messages.dart for why this is so loosely typed. See also - // https://github.com/flutter/flutter/issues/117819. - switch bitmap { - case let bitmap as FGMPlatformBitmapDefaultMarker: - let hue = bitmap.hue?.doubleValue ?? 0 + switch self { + case let bitmap as PlatformBitmapDefaultMarker: image = GMSMarker.markerImage( with: UIColor( - hue: CGFloat(hue) / 360.0, + hue: CGFloat(bitmap.hue ?? 0) / 360.0, saturation: 1.0, brightness: 0.7, alpha: 1.0)) - case let bitmap as FGMPlatformBitmapAsset: + case let bitmap as PlatformBitmapAsset: // Deprecated: This message handling for 'fromAsset' has been replaced by 'asset'. // Refer to the flutter google_maps_flutter_platform_interface package for details. if let pkg = bitmap.pkg { @@ -43,7 +36,7 @@ extension FGMPlatformBitmap { image = assetProvider.imageNamed(key) } } - case let bitmap as FGMPlatformBitmapAssetImage: + case let bitmap as PlatformBitmapAssetImage: // Deprecated: This message handling for 'fromAssetImage' has been replaced by 'asset'. // Refer to the flutter google_maps_flutter_platform_interface package for details. if let key = assetProvider.lookupKey(forAsset: bitmap.name) { @@ -51,11 +44,11 @@ extension FGMPlatformBitmap { image = scaledImage(assetImage, scale: bitmap.scale) } } - case let bitmap as FGMPlatformBitmapBytes: + case let bitmap as PlatformBitmapBytes: // Deprecated: This message handling for 'fromBytes' has been replaced by 'bytes'. // Refer to the flutter google_maps_flutter_platform_interface package for details. image = UIImage(data: bitmap.byteData.data, scale: screenScale) - case let bitmap as FGMPlatformBitmapAssetMap: + case let bitmap as PlatformBitmapAssetMap: if let key = assetProvider.lookupKey(forAsset: bitmap.assetName) { image = assetProvider.imageNamed(key) } @@ -69,7 +62,7 @@ extension FGMPlatformBitmap { image = scaledImage(currentImage, scale: CGFloat(bitmap.imagePixelRatio)) } } - case let bitmap as FGMPlatformBitmapBytesMap: + case let bitmap as PlatformBitmapBytesMap: let bytes = bitmap.byteData image = UIImage(data: bytes.data, scale: screenScale) if let currentImage = image { @@ -88,7 +81,7 @@ extension FGMPlatformBitmap { image = UIImage(data: bytes.data) } } - case let bitmap as FGMPlatformBitmapPinConfig: + case let bitmap as PlatformBitmapPinConfig: let options = GMSPinImageOptions() if let backgroundColor = bitmap.backgroundColor { options.backgroundColor = backgroundColor.toUIColor() @@ -209,16 +202,16 @@ private func scaledImage(_ image: UIImage, to size: CGSize) -> UIImage { /// widht and height are not given. private func scaledImage( _ image: UIImage, - width: NSNumber?, - height: NSNumber?, + width: Double?, + height: Double?, screenScale: CGFloat ) -> UIImage { if width == nil && height == nil { return image } - let targetWidth = width == nil ? image.size.width : CGFloat(width!.doubleValue) - let targetHeight = height == nil ? image.size.height : CGFloat(height!.doubleValue) + let targetWidth = width ?? image.size.width + let targetHeight = height ?? image.size.height var calculatedWidth = targetWidth var calculatedHeight = targetHeight diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/MapEventDelegate.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/MapEventDelegate.swift index 3fdde6b712ef..71eff89d7a73 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/MapEventDelegate.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/MapEventDelegate.swift @@ -6,54 +6,7 @@ import google_maps_flutter_ios_objc #endif -/// Delegate for map event notifications. +/// Delegate for map callbacks that need Dart handling. /// -/// This is abstraction of the map event portions of FGMMapsCallbackApi, to -/// avoid coupling all the individual controllers to the Pigeon implementation -/// of event handling, and to allow for mocks/fakes in unit tests. -protocol MapEventDelegate: AnyObject { - /// Called when the map camera starts moving. - func didStartCameraMove() - - /// Called when the map camera moves. - func didMoveCamera(to cameraPosition: FGMPlatformCameraPosition) - - /// Called when the map camera stops moving. - func didIdleCamera() - - /// Called when the map, not a specifc map object, is tapped. - func didTap(at position: FGMPlatformLatLng) - - /// Called when the map, not a specifc map object, is long pressed. - func didLongPress(at position: FGMPlatformLatLng) - - /// Called when a marker is tapped. - func didTapMarker(withIdentifier markerId: String) - - /// Called when a marker drag starts. - func didStartDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) - - /// Called when a marker drag updates. - func didDragMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) - - /// Called when a marker drag ends. - func didEndDragForMarker(withIdentifier markerId: String, at position: FGMPlatformLatLng) - - /// Called when a marker's info window is tapped. - func didTapInfoWindowOfMarker(withIdentifier markerId: String) - - /// Called when a circle is tapped. - func didTapCircle(withIdentifier circleId: String) - - /// Called when a marker cluster is tapped. - func didTapCluster(_ cluster: FGMPlatformCluster) - - /// Called when a polygon is tapped. - func didTapPolygon(withIdentifier polygonId: String) - - /// Called when a polyline is tapped. - func didTapPolyline(withIdentifier polylineId: String) - - /// Called when a ground overlay is tapped. - func didTapGroundOverlay(withIdentifier groundOverlayId: String) -} +/// This exists to add AnyObject to the requirements, so that references to it can be weak. +protocol MapEventDelegate: AnyObject, MapsCallbackApiProtocol {} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/MarkerController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/MarkerController.swift index 28cb05d5e260..8ca280bc2a29 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/MarkerController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/MarkerController.swift @@ -6,12 +6,8 @@ import Flutter import GoogleMaps import UIKit -#if canImport(google_maps_flutter_ios_objc) - import google_maps_flutter_ios_objc -#endif - /// Defines marker controllable by Flutter. -class MarkerController: NSObject { +class MarkerController { let marker: GMSMarker private weak var mapView: GMSMapView? private(set) var consumeTapEvents: Bool = false @@ -22,7 +18,6 @@ class MarkerController: NSObject { self.marker = marker self.markerIdentifier = markerIdentifier self.mapView = mapView - super.init() } func showInfoWindow() { @@ -43,11 +38,11 @@ class MarkerController: NSObject { marker.map = nil } - /// Updates the controller's marker with the properties from a FGMPlatformMarker. + /// Updates the controller's marker with the properties from a PlatformMarker. /// /// Setting the marker to visible will set its map to the controller's mapView. func update( - from platformMarker: FGMPlatformMarker, + from platformMarker: PlatformMarker, assetProvider: AssetProvider, screenScale: CGFloat ) { @@ -71,12 +66,12 @@ class MarkerController: NSObject { ) } - /// Updates the given GMSMarker with the properties from a FGMPlatformMarker. + /// Updates the given GMSMarker with the properties from a PlatformMarker. /// /// Setting the marker to visible will set its map to the given mapView. static func update( _ marker: GMSMarker, - from platformMarker: FGMPlatformMarker, + from platformMarker: PlatformMarker, mapView: GMSMapView?, assetProvider: AssetProvider, screenScale: CGFloat, @@ -102,7 +97,7 @@ class MarkerController: NSObject { if let advancedMarker = marker as? GMSAdvancedMarker, let collisionBehaviorValue = platformMarker.collisionBehavior { - advancedMarker.collisionBehavior = collisionBehaviorValue.value.gmsCollisionBehavior + advancedMarker.collisionBehavior = collisionBehaviorValue.gmsCollisionBehavior } // This must be done last, to avoid visual flickers of default property values. @@ -116,36 +111,35 @@ class MarkerController: NSObject { } /// Controller of multiple markers on the map. -class MarkersController: NSObject { +class MarkersController { private(set) var markerIdentifierToController: [String: MarkerController] = [:] private weak var eventDelegate: MapEventDelegate? private weak var clusterManagersController: ClusterManagersController? private let assetProvider: AssetProvider private weak var mapView: GMSMapView? - private let markerType: FGMPlatformMarkerType + private let markerType: PlatformMarkerType init( mapView: GMSMapView, eventDelegate: MapEventDelegate, clusterManagersController: ClusterManagersController?, assetProvider: AssetProvider, - markerType: FGMPlatformMarkerType + markerType: PlatformMarkerType ) { self.mapView = mapView self.eventDelegate = eventDelegate self.clusterManagersController = clusterManagersController self.assetProvider = assetProvider self.markerType = markerType - super.init() } - func add(_ markersToAdd: [FGMPlatformMarker]) { + func add(_ markersToAdd: [PlatformMarker]) { for marker in markersToAdd { addMarker(marker) } } - private func addMarker(_ markerToAdd: FGMPlatformMarker) { + private func addMarker(_ markerToAdd: PlatformMarker) { guard let mapView = mapView else { return } let position = markerToAdd.position.toCLLocationCoordinate2D() let markerIdentifier = markerToAdd.markerId @@ -175,13 +169,13 @@ class MarkersController: NSObject { markerIdentifierToController[markerIdentifier] = controller } - func change(_ markersToChange: [FGMPlatformMarker]) { + func change(_ markersToChange: [PlatformMarker]) { for marker in markersToChange { changeMarker(marker) } } - private func changeMarker(_ markerToChange: FGMPlatformMarker) { + private func changeMarker(_ markerToChange: PlatformMarker) { let markerIdentifier = markerToChange.markerId guard let controller = markerIdentifierToController[markerIdentifier] else { return } @@ -223,7 +217,7 @@ class MarkersController: NSObject { func didTapMarker(withIdentifier identifier: String) -> Bool { guard let controller = markerIdentifierToController[identifier] else { return false } - eventDelegate?.didTapMarker(withIdentifier: identifier) + eventDelegate?.didTapMarker(withIdentifier: identifier) { _ in } return controller.consumeTapEvents } @@ -231,76 +225,63 @@ class MarkersController: NSObject { guard markerIdentifierToController[identifier] != nil else { return } eventDelegate?.didStartDragForMarker( withIdentifier: identifier, - at: FGMPlatformLatLng.make(from: location) - ) + at: PlatformLatLng.make(from: location) + ) { _ in } } func didDragMarker(withIdentifier identifier: String, location: CLLocationCoordinate2D) { guard markerIdentifierToController[identifier] != nil else { return } eventDelegate?.didDragMarker( withIdentifier: identifier, - at: FGMPlatformLatLng.make(from: location) - ) + at: PlatformLatLng.make(from: location) + ) { _ in } } func didEndDraggingMarker(withIdentifier identifier: String, location: CLLocationCoordinate2D) { guard markerIdentifierToController[identifier] != nil else { return } eventDelegate?.didEndDragForMarker( withIdentifier: identifier, - at: FGMPlatformLatLng.make(from: location) - ) + at: PlatformLatLng.make(from: location) + ) { _ in } } func didTapInfoWindowOfMarker(withIdentifier identifier: String) { if markerIdentifierToController[identifier] != nil { - eventDelegate?.didTapInfoWindowOfMarker(withIdentifier: identifier) + eventDelegate?.didTapInfoWindowOfMarker(withIdentifier: identifier) { _ in } } } - func showMarkerInfoWindow( - withIdentifier identifier: String, - error: AutoreleasingUnsafeMutablePointer - ) { - if let controller = markerIdentifierToController[identifier] { - controller.showInfoWindow() - } else { - error.pointee = FlutterError( + func showMarkerInfoWindow(withIdentifier identifier: String) throws { + guard let controller = markerIdentifierToController[identifier] else { + throw PigeonError( code: "Invalid markerId", message: "showInfoWindow called with invalid markerId", details: nil ) } + controller.showInfoWindow() } - func hideMarkerInfoWindow( - withIdentifier identifier: String, - error: AutoreleasingUnsafeMutablePointer - ) { - if let controller = markerIdentifierToController[identifier] { - controller.hideInfoWindow() - } else { - error.pointee = FlutterError( + func hideMarkerInfoWindow(withIdentifier identifier: String) throws { + guard let controller = markerIdentifierToController[identifier] else { + throw PigeonError( code: "Invalid markerId", message: "hideInfoWindow called with invalid markerId", details: nil ) } + controller.hideInfoWindow() } - func isInfoWindowShownForMarker( - withIdentifier identifier: String, - error: AutoreleasingUnsafeMutablePointer - ) -> NSNumber? { - if let controller = markerIdentifierToController[identifier] { - return NSNumber(value: controller.isInfoWindowShown()) - } else { - error.pointee = FlutterError( + func isInfoWindowShownForMarker(withIdentifier identifier: String) throws -> Bool { + guard let controller = markerIdentifierToController[identifier] else { + throw PigeonError( code: "Invalid markerId", message: "isInfoWindowShown called with invalid markerId", details: nil ) - return nil } + return controller.isInfoWindowShown() } func getScreenScale() -> CGFloat { diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/Messages.g.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/Messages.g.swift new file mode 100644 index 000000000000..76dd15c5e9e7 --- /dev/null +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/Messages.g.swift @@ -0,0 +1,4174 @@ +// Copyright 2013 The Flutter Authors +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// Autogenerated from Pigeon (v27.3.2), do not edit directly. +// See also: https://pub.dev/packages/pigeon + +import Foundation + +#if os(iOS) + import Flutter +#elseif os(macOS) + import FlutterMacOS +#else + #error("Unsupported platform.") +#endif + +/// Error class for passing custom error details to Dart side. +final class PigeonError: Error { + let code: String + let message: String? + let details: Sendable? + + init(code: String, message: String?, details: Sendable?) { + self.code = code + self.message = message + self.details = details + } + + var localizedDescription: String { + return + "PigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" + } +} + +private func wrapResult(_ result: Any?) -> [Any?] { + return [result] +} + +private func wrapError(_ error: Any) -> [Any?] { + if let pigeonError = error as? PigeonError { + return [ + pigeonError.code, + pigeonError.message, + pigeonError.details, + ] + } + if let flutterError = error as? FlutterError { + return [ + flutterError.code, + flutterError.message, + flutterError.details, + ] + } + return [ + "\(error)", + "\(Swift.type(of: error))", + "Stacktrace: \(Thread.callStackSymbols)", + ] +} + +private func createConnectionError(withChannelName channelName: String) -> PigeonError { + return PigeonError( + code: "channel-error", message: "Unable to establish connection on channel: '\(channelName)'.", + details: "") +} + +enum MessagesPigeonInternal { + static func isNullish(_ value: Any?) -> Bool { + guard let innerValue = value else { + return true + } + + if case Optional.some(Optional.none) = value { + return true + } + + return innerValue is NSNull + } + static func doubleEquals(_ lhs: Double, _ rhs: Double) -> Bool { + return (lhs.isNaN && rhs.isNaN) || lhs == rhs + } + + static func doubleHash(_ value: Double, _ hasher: inout Hasher) { + if value.isNaN { + hasher.combine(0x7FF8_0000_0000_0000) + } else { + // Normalize -0.0 to 0.0 + hasher.combine(value == 0 ? 0 : value) + } + } + + static func deepEquals(_ lhs: Any?, _ rhs: Any?) -> Bool { + let cleanLhs = nilOrValue(lhs) as Any? + let cleanRhs = nilOrValue(rhs) as Any? + switch (cleanLhs, cleanRhs) { + case (nil, nil): + return true + + case (nil, _), (_, nil): + return false + + case (let lhs as AnyObject, let rhs as AnyObject) where lhs === rhs: + return true + + case is (Void, Void): + return true + + case (let lhsArray, let rhsArray) as ([Any?], [Any?]): + guard lhsArray.count == rhsArray.count else { return false } + for (index, element) in lhsArray.enumerated() { + if !deepEquals(element, rhsArray[index]) { + return false + } + } + return true + + case (let lhsArray, let rhsArray) as ([Double], [Double]): + guard lhsArray.count == rhsArray.count else { return false } + for (index, element) in lhsArray.enumerated() { + if !doubleEquals(element, rhsArray[index]) { + return false + } + } + return true + + case (let lhsDictionary, let rhsDictionary) as ([AnyHashable: Any?], [AnyHashable: Any?]): + guard lhsDictionary.count == rhsDictionary.count else { return false } + for (lhsKey, lhsValue) in lhsDictionary { + var found = false + for (rhsKey, rhsValue) in rhsDictionary { + if deepEquals(lhsKey, rhsKey) { + if deepEquals(lhsValue, rhsValue) { + found = true + break + } else { + return false + } + } + } + if !found { return false } + } + return true + + case (let lhs as Double, let rhs as Double): + return doubleEquals(lhs, rhs) + + case (let lhsHashable, let rhsHashable) as (AnyHashable, AnyHashable): + return lhsHashable == rhsHashable + + default: + return false + } + } + + static func deepHash(value: Any?, hasher: inout Hasher) { + let cleanValue = nilOrValue(value) as Any? + if let cleanValue = cleanValue { + if let doubleValue = cleanValue as? Double { + doubleHash(doubleValue, &hasher) + } else if let valueList = cleanValue as? [Any?] { + for item in valueList { + deepHash(value: item, hasher: &hasher) + } + } else if let valueList = cleanValue as? [Double] { + for item in valueList { + doubleHash(item, &hasher) + } + } else if let valueDict = cleanValue as? [AnyHashable: Any?] { + var result = 0 + for (key, value) in valueDict { + var entryKeyHasher = Hasher() + deepHash(value: key, hasher: &entryKeyHasher) + var entryValueHasher = Hasher() + deepHash(value: value, hasher: &entryValueHasher) + result = result &+ ((entryKeyHasher.finalize() &* 31) ^ entryValueHasher.finalize()) + } + hasher.combine(result) + } else if let hashableValue = cleanValue as? AnyHashable { + hasher.combine(hashableValue) + } else { + hasher.combine(String(describing: cleanValue)) + } + } else { + hasher.combine(0) + } + } + +} + +private func nilOrValue(_ value: Any?) -> T? { + if value is NSNull { return nil } + return value as! T? +} + +/// Pigeon equivalent of MapType +enum PlatformMapType: Int, CaseIterable { + case none = 0 + case normal = 1 + case satellite = 2 + case terrain = 3 + case hybrid = 4 +} + +/// Pigeon equivalent of the MarkerCollisionBehavior enum. +enum PlatformMarkerCollisionBehavior: Int, CaseIterable { + case requiredDisplay = 0 + case optionalAndHidesLowerPriority = 1 + case requiredAndHidesOptional = 2 +} + +/// Join types for polyline joints. +enum PlatformJointType: Int, CaseIterable { + case mitered = 0 + case bevel = 1 + case round = 2 +} + +/// Enumeration of possible types for PatternItem. +enum PlatformPatternItemType: Int, CaseIterable { + case dot = 0 + case dash = 1 + case gap = 2 +} + +enum PlatformMarkerType: Int, CaseIterable { + case marker = 0 + case advancedMarker = 1 +} + +/// Pigeon equivalent of [MapBitmapScaling]. +enum PlatformMapBitmapScaling: Int, CaseIterable { + case auto = 0 + case none = 1 +} + +/// Pigeon representatation of a CameraPosition. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraPosition: Hashable, CustomStringConvertible { + var bearing: Double + var target: PlatformLatLng + var tilt: Double + var zoom: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraPosition? { + let bearing = pigeonVar_list[0] as! Double + let target = pigeonVar_list[1] as! PlatformLatLng + let tilt = pigeonVar_list[2] as! Double + let zoom = pigeonVar_list[3] as! Double + + return PlatformCameraPosition( + bearing: bearing, + target: target, + tilt: tilt, + zoom: zoom + ) + } + func toList() -> [Any?] { + return [ + bearing, + target, + tilt, + zoom, + ] + } + static func == (lhs: PlatformCameraPosition, rhs: PlatformCameraPosition) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.bearing, rhs.bearing) + && MessagesPigeonInternal.deepEquals(lhs.target, rhs.target) + && MessagesPigeonInternal.deepEquals(lhs.tilt, rhs.tilt) + && MessagesPigeonInternal.deepEquals(lhs.zoom, rhs.zoom) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraPosition") + MessagesPigeonInternal.deepHash(value: bearing, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: target, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: tilt, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zoom, hasher: &hasher) + } + + public var description: String { + return + "PlatformCameraPosition(bearing: \(String(describing: bearing)), target: \(String(describing: target)), tilt: \(String(describing: tilt)), zoom: \(String(describing: zoom)))" + } +} + +/// Pigeon representation of a CameraUpdate. +/// +/// Generated class from Pigeon that represents data sent in messages. +/// This protocol should not be extended by any user class outside of the generated file. +protocol PlatformCameraUpdate { + +} + +/// Pigeon equivalent of NewCameraPosition +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateNewCameraPosition: PlatformCameraUpdate { + var cameraPosition: PlatformCameraPosition + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateNewCameraPosition? { + let cameraPosition = pigeonVar_list[0] as! PlatformCameraPosition + + return PlatformCameraUpdateNewCameraPosition( + cameraPosition: cameraPosition + ) + } + func toList() -> [Any?] { + return [ + cameraPosition + ] + } + static func == ( + lhs: PlatformCameraUpdateNewCameraPosition, rhs: PlatformCameraUpdateNewCameraPosition + ) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.cameraPosition, rhs.cameraPosition) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateNewCameraPosition") + MessagesPigeonInternal.deepHash(value: cameraPosition, hasher: &hasher) + } + + public var description: String { + return + "PlatformCameraUpdateNewCameraPosition(cameraPosition: \(String(describing: cameraPosition)))" + } +} + +/// Pigeon equivalent of NewLatLng +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateNewLatLng: PlatformCameraUpdate { + var latLng: PlatformLatLng + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateNewLatLng? { + let latLng = pigeonVar_list[0] as! PlatformLatLng + + return PlatformCameraUpdateNewLatLng( + latLng: latLng + ) + } + func toList() -> [Any?] { + return [ + latLng + ] + } + static func == (lhs: PlatformCameraUpdateNewLatLng, rhs: PlatformCameraUpdateNewLatLng) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.latLng, rhs.latLng) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateNewLatLng") + MessagesPigeonInternal.deepHash(value: latLng, hasher: &hasher) + } + + public var description: String { + return "PlatformCameraUpdateNewLatLng(latLng: \(String(describing: latLng)))" + } +} + +/// Pigeon equivalent of NewLatLngBounds +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateNewLatLngBounds: PlatformCameraUpdate { + var bounds: PlatformLatLngBounds + var padding: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateNewLatLngBounds? { + let bounds = pigeonVar_list[0] as! PlatformLatLngBounds + let padding = pigeonVar_list[1] as! Double + + return PlatformCameraUpdateNewLatLngBounds( + bounds: bounds, + padding: padding + ) + } + func toList() -> [Any?] { + return [ + bounds, + padding, + ] + } + static func == ( + lhs: PlatformCameraUpdateNewLatLngBounds, rhs: PlatformCameraUpdateNewLatLngBounds + ) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.bounds, rhs.bounds) + && MessagesPigeonInternal.deepEquals(lhs.padding, rhs.padding) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateNewLatLngBounds") + MessagesPigeonInternal.deepHash(value: bounds, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: padding, hasher: &hasher) + } + + public var description: String { + return + "PlatformCameraUpdateNewLatLngBounds(bounds: \(String(describing: bounds)), padding: \(String(describing: padding)))" + } +} + +/// Pigeon equivalent of NewLatLngZoom +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateNewLatLngZoom: PlatformCameraUpdate { + var latLng: PlatformLatLng + var zoom: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateNewLatLngZoom? { + let latLng = pigeonVar_list[0] as! PlatformLatLng + let zoom = pigeonVar_list[1] as! Double + + return PlatformCameraUpdateNewLatLngZoom( + latLng: latLng, + zoom: zoom + ) + } + func toList() -> [Any?] { + return [ + latLng, + zoom, + ] + } + static func == (lhs: PlatformCameraUpdateNewLatLngZoom, rhs: PlatformCameraUpdateNewLatLngZoom) + -> Bool + { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.latLng, rhs.latLng) + && MessagesPigeonInternal.deepEquals(lhs.zoom, rhs.zoom) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateNewLatLngZoom") + MessagesPigeonInternal.deepHash(value: latLng, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zoom, hasher: &hasher) + } + + public var description: String { + return + "PlatformCameraUpdateNewLatLngZoom(latLng: \(String(describing: latLng)), zoom: \(String(describing: zoom)))" + } +} + +/// Pigeon equivalent of ScrollBy +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateScrollBy: PlatformCameraUpdate { + var dx: Double + var dy: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateScrollBy? { + let dx = pigeonVar_list[0] as! Double + let dy = pigeonVar_list[1] as! Double + + return PlatformCameraUpdateScrollBy( + dx: dx, + dy: dy + ) + } + func toList() -> [Any?] { + return [ + dx, + dy, + ] + } + static func == (lhs: PlatformCameraUpdateScrollBy, rhs: PlatformCameraUpdateScrollBy) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.dx, rhs.dx) + && MessagesPigeonInternal.deepEquals(lhs.dy, rhs.dy) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateScrollBy") + MessagesPigeonInternal.deepHash(value: dx, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: dy, hasher: &hasher) + } + + public var description: String { + return + "PlatformCameraUpdateScrollBy(dx: \(String(describing: dx)), dy: \(String(describing: dy)))" + } +} + +/// Pigeon equivalent of ZoomBy +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateZoomBy: PlatformCameraUpdate { + var amount: Double + var focus: PlatformPoint? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateZoomBy? { + let amount = pigeonVar_list[0] as! Double + let focus: PlatformPoint? = nilOrValue(pigeonVar_list[1]) + + return PlatformCameraUpdateZoomBy( + amount: amount, + focus: focus + ) + } + func toList() -> [Any?] { + return [ + amount, + focus, + ] + } + static func == (lhs: PlatformCameraUpdateZoomBy, rhs: PlatformCameraUpdateZoomBy) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.amount, rhs.amount) + && MessagesPigeonInternal.deepEquals(lhs.focus, rhs.focus) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateZoomBy") + MessagesPigeonInternal.deepHash(value: amount, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: focus, hasher: &hasher) + } + + public var description: String { + return + "PlatformCameraUpdateZoomBy(amount: \(String(describing: amount)), focus: \(String(describing: focus)))" + } +} + +/// Pigeon equivalent of ZoomIn/ZoomOut +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateZoom: PlatformCameraUpdate { + var out: Bool + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateZoom? { + let out = pigeonVar_list[0] as! Bool + + return PlatformCameraUpdateZoom( + out: out + ) + } + func toList() -> [Any?] { + return [ + out + ] + } + static func == (lhs: PlatformCameraUpdateZoom, rhs: PlatformCameraUpdateZoom) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.out, rhs.out) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateZoom") + MessagesPigeonInternal.deepHash(value: out, hasher: &hasher) + } + + public var description: String { + return "PlatformCameraUpdateZoom(out: \(String(describing: out)))" + } +} + +/// Pigeon equivalent of ZoomTo +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraUpdateZoomTo: PlatformCameraUpdate { + var zoom: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraUpdateZoomTo? { + let zoom = pigeonVar_list[0] as! Double + + return PlatformCameraUpdateZoomTo( + zoom: zoom + ) + } + func toList() -> [Any?] { + return [ + zoom + ] + } + static func == (lhs: PlatformCameraUpdateZoomTo, rhs: PlatformCameraUpdateZoomTo) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.zoom, rhs.zoom) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraUpdateZoomTo") + MessagesPigeonInternal.deepHash(value: zoom, hasher: &hasher) + } + + public var description: String { + return "PlatformCameraUpdateZoomTo(zoom: \(String(describing: zoom)))" + } +} + +/// Pigeon equivalent of the Circle class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCircle: Hashable, CustomStringConvertible { + var consumeTapEvents: Bool + var fillColor: PlatformColor + var strokeColor: PlatformColor + var visible: Bool + var strokeWidth: Int64 + var zIndex: Double + var center: PlatformLatLng + var radius: Double + var circleId: String + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCircle? { + let consumeTapEvents = pigeonVar_list[0] as! Bool + let fillColor = pigeonVar_list[1] as! PlatformColor + let strokeColor = pigeonVar_list[2] as! PlatformColor + let visible = pigeonVar_list[3] as! Bool + let strokeWidth = pigeonVar_list[4] as! Int64 + let zIndex = pigeonVar_list[5] as! Double + let center = pigeonVar_list[6] as! PlatformLatLng + let radius = pigeonVar_list[7] as! Double + let circleId = pigeonVar_list[8] as! String + + return PlatformCircle( + consumeTapEvents: consumeTapEvents, + fillColor: fillColor, + strokeColor: strokeColor, + visible: visible, + strokeWidth: strokeWidth, + zIndex: zIndex, + center: center, + radius: radius, + circleId: circleId + ) + } + func toList() -> [Any?] { + return [ + consumeTapEvents, + fillColor, + strokeColor, + visible, + strokeWidth, + zIndex, + center, + radius, + circleId, + ] + } + static func == (lhs: PlatformCircle, rhs: PlatformCircle) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.consumeTapEvents, rhs.consumeTapEvents) + && MessagesPigeonInternal.deepEquals(lhs.fillColor, rhs.fillColor) + && MessagesPigeonInternal.deepEquals(lhs.strokeColor, rhs.strokeColor) + && MessagesPigeonInternal.deepEquals(lhs.visible, rhs.visible) + && MessagesPigeonInternal.deepEquals(lhs.strokeWidth, rhs.strokeWidth) + && MessagesPigeonInternal.deepEquals(lhs.zIndex, rhs.zIndex) + && MessagesPigeonInternal.deepEquals(lhs.center, rhs.center) + && MessagesPigeonInternal.deepEquals(lhs.radius, rhs.radius) + && MessagesPigeonInternal.deepEquals(lhs.circleId, rhs.circleId) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCircle") + MessagesPigeonInternal.deepHash(value: consumeTapEvents, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: fillColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: strokeColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: visible, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: strokeWidth, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zIndex, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: center, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: radius, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: circleId, hasher: &hasher) + } + + public var description: String { + return + "PlatformCircle(consumeTapEvents: \(String(describing: consumeTapEvents)), fillColor: \(String(describing: fillColor)), strokeColor: \(String(describing: strokeColor)), visible: \(String(describing: visible)), strokeWidth: \(String(describing: strokeWidth)), zIndex: \(String(describing: zIndex)), center: \(String(describing: center)), radius: \(String(describing: radius)), circleId: \(String(describing: circleId)))" + } +} + +/// Pigeon equivalent of the Heatmap class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformHeatmap: Hashable, CustomStringConvertible { + var heatmapId: String + var data: [PlatformWeightedLatLng] + var gradient: PlatformHeatmapGradient? = nil + var opacity: Double + var radius: Int64 + var minimumZoomIntensity: Int64 + var maximumZoomIntensity: Int64 + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformHeatmap? { + let heatmapId = pigeonVar_list[0] as! String + let data = pigeonVar_list[1] as! [PlatformWeightedLatLng] + let gradient: PlatformHeatmapGradient? = nilOrValue(pigeonVar_list[2]) + let opacity = pigeonVar_list[3] as! Double + let radius = pigeonVar_list[4] as! Int64 + let minimumZoomIntensity = pigeonVar_list[5] as! Int64 + let maximumZoomIntensity = pigeonVar_list[6] as! Int64 + + return PlatformHeatmap( + heatmapId: heatmapId, + data: data, + gradient: gradient, + opacity: opacity, + radius: radius, + minimumZoomIntensity: minimumZoomIntensity, + maximumZoomIntensity: maximumZoomIntensity + ) + } + func toList() -> [Any?] { + return [ + heatmapId, + data, + gradient, + opacity, + radius, + minimumZoomIntensity, + maximumZoomIntensity, + ] + } + static func == (lhs: PlatformHeatmap, rhs: PlatformHeatmap) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.heatmapId, rhs.heatmapId) + && MessagesPigeonInternal.deepEquals(lhs.data, rhs.data) + && MessagesPigeonInternal.deepEquals(lhs.gradient, rhs.gradient) + && MessagesPigeonInternal.deepEquals(lhs.opacity, rhs.opacity) + && MessagesPigeonInternal.deepEquals(lhs.radius, rhs.radius) + && MessagesPigeonInternal.deepEquals(lhs.minimumZoomIntensity, rhs.minimumZoomIntensity) + && MessagesPigeonInternal.deepEquals(lhs.maximumZoomIntensity, rhs.maximumZoomIntensity) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformHeatmap") + MessagesPigeonInternal.deepHash(value: heatmapId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: data, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: gradient, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: opacity, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: radius, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: minimumZoomIntensity, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: maximumZoomIntensity, hasher: &hasher) + } + + public var description: String { + return + "PlatformHeatmap(heatmapId: \(String(describing: heatmapId)), data: \(String(describing: data)), gradient: \(String(describing: gradient)), opacity: \(String(describing: opacity)), radius: \(String(describing: radius)), minimumZoomIntensity: \(String(describing: minimumZoomIntensity)), maximumZoomIntensity: \(String(describing: maximumZoomIntensity)))" + } +} + +/// Pigeon equivalent of the HeatmapGradient class. +/// +/// The GMUGradient structure is slightly different from HeatmapGradient, so +/// this matches the iOS API so that conversion can be done on the Dart side +/// where the structures are easier to work with. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformHeatmapGradient: Hashable, CustomStringConvertible { + var colors: [PlatformColor] + var startPoints: [Double] + var colorMapSize: Int64 + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformHeatmapGradient? { + let colors = pigeonVar_list[0] as! [PlatformColor] + let startPoints = pigeonVar_list[1] as! [Double] + let colorMapSize = pigeonVar_list[2] as! Int64 + + return PlatformHeatmapGradient( + colors: colors, + startPoints: startPoints, + colorMapSize: colorMapSize + ) + } + func toList() -> [Any?] { + return [ + colors, + startPoints, + colorMapSize, + ] + } + static func == (lhs: PlatformHeatmapGradient, rhs: PlatformHeatmapGradient) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.colors, rhs.colors) + && MessagesPigeonInternal.deepEquals(lhs.startPoints, rhs.startPoints) + && MessagesPigeonInternal.deepEquals(lhs.colorMapSize, rhs.colorMapSize) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformHeatmapGradient") + MessagesPigeonInternal.deepHash(value: colors, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: startPoints, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: colorMapSize, hasher: &hasher) + } + + public var description: String { + return + "PlatformHeatmapGradient(colors: \(String(describing: colors)), startPoints: \(String(describing: startPoints)), colorMapSize: \(String(describing: colorMapSize)))" + } +} + +/// Pigeon equivalent of the WeightedLatLng class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformWeightedLatLng: Hashable, CustomStringConvertible { + var point: PlatformLatLng + var weight: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformWeightedLatLng? { + let point = pigeonVar_list[0] as! PlatformLatLng + let weight = pigeonVar_list[1] as! Double + + return PlatformWeightedLatLng( + point: point, + weight: weight + ) + } + func toList() -> [Any?] { + return [ + point, + weight, + ] + } + static func == (lhs: PlatformWeightedLatLng, rhs: PlatformWeightedLatLng) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.point, rhs.point) + && MessagesPigeonInternal.deepEquals(lhs.weight, rhs.weight) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformWeightedLatLng") + MessagesPigeonInternal.deepHash(value: point, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: weight, hasher: &hasher) + } + + public var description: String { + return + "PlatformWeightedLatLng(point: \(String(describing: point)), weight: \(String(describing: weight)))" + } +} + +/// Pigeon equivalent of the InfoWindow class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformInfoWindow: Hashable, CustomStringConvertible { + var title: String? = nil + var snippet: String? = nil + var anchor: PlatformPoint + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformInfoWindow? { + let title: String? = nilOrValue(pigeonVar_list[0]) + let snippet: String? = nilOrValue(pigeonVar_list[1]) + let anchor = pigeonVar_list[2] as! PlatformPoint + + return PlatformInfoWindow( + title: title, + snippet: snippet, + anchor: anchor + ) + } + func toList() -> [Any?] { + return [ + title, + snippet, + anchor, + ] + } + static func == (lhs: PlatformInfoWindow, rhs: PlatformInfoWindow) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.title, rhs.title) + && MessagesPigeonInternal.deepEquals(lhs.snippet, rhs.snippet) + && MessagesPigeonInternal.deepEquals(lhs.anchor, rhs.anchor) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformInfoWindow") + MessagesPigeonInternal.deepHash(value: title, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: snippet, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: anchor, hasher: &hasher) + } + + public var description: String { + return + "PlatformInfoWindow(title: \(String(describing: title)), snippet: \(String(describing: snippet)), anchor: \(String(describing: anchor)))" + } +} + +/// Pigeon equivalent of Cluster. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCluster: Hashable, CustomStringConvertible { + var clusterManagerId: String + var position: PlatformLatLng + var bounds: PlatformLatLngBounds + var markerIds: [String] + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCluster? { + let clusterManagerId = pigeonVar_list[0] as! String + let position = pigeonVar_list[1] as! PlatformLatLng + let bounds = pigeonVar_list[2] as! PlatformLatLngBounds + let markerIds = pigeonVar_list[3] as! [String] + + return PlatformCluster( + clusterManagerId: clusterManagerId, + position: position, + bounds: bounds, + markerIds: markerIds + ) + } + func toList() -> [Any?] { + return [ + clusterManagerId, + position, + bounds, + markerIds, + ] + } + static func == (lhs: PlatformCluster, rhs: PlatformCluster) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.clusterManagerId, rhs.clusterManagerId) + && MessagesPigeonInternal.deepEquals(lhs.position, rhs.position) + && MessagesPigeonInternal.deepEquals(lhs.bounds, rhs.bounds) + && MessagesPigeonInternal.deepEquals(lhs.markerIds, rhs.markerIds) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCluster") + MessagesPigeonInternal.deepHash(value: clusterManagerId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: position, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: bounds, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: markerIds, hasher: &hasher) + } + + public var description: String { + return + "PlatformCluster(clusterManagerId: \(String(describing: clusterManagerId)), position: \(String(describing: position)), bounds: \(String(describing: bounds)), markerIds: \(String(describing: markerIds)))" + } +} + +/// Pigeon equivalent of the ClusterManager class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformClusterManager: Hashable, CustomStringConvertible { + var identifier: String + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformClusterManager? { + let identifier = pigeonVar_list[0] as! String + + return PlatformClusterManager( + identifier: identifier + ) + } + func toList() -> [Any?] { + return [ + identifier + ] + } + static func == (lhs: PlatformClusterManager, rhs: PlatformClusterManager) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.identifier, rhs.identifier) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformClusterManager") + MessagesPigeonInternal.deepHash(value: identifier, hasher: &hasher) + } + + public var description: String { + return "PlatformClusterManager(identifier: \(String(describing: identifier)))" + } +} + +/// Pigeon equivalent of the Marker class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformMarker: Hashable, CustomStringConvertible { + var alpha: Double + var anchor: PlatformPoint + var consumeTapEvents: Bool + var draggable: Bool + var flat: Bool + var icon: PlatformBitmap + var infoWindow: PlatformInfoWindow + var position: PlatformLatLng + var rotation: Double + var visible: Bool + var zIndex: Int64 + var markerId: String + var clusterManagerId: String? = nil + var collisionBehavior: PlatformMarkerCollisionBehavior? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformMarker? { + let alpha = pigeonVar_list[0] as! Double + let anchor = pigeonVar_list[1] as! PlatformPoint + let consumeTapEvents = pigeonVar_list[2] as! Bool + let draggable = pigeonVar_list[3] as! Bool + let flat = pigeonVar_list[4] as! Bool + let icon = pigeonVar_list[5] as! PlatformBitmap + let infoWindow = pigeonVar_list[6] as! PlatformInfoWindow + let position = pigeonVar_list[7] as! PlatformLatLng + let rotation = pigeonVar_list[8] as! Double + let visible = pigeonVar_list[9] as! Bool + let zIndex = pigeonVar_list[10] as! Int64 + let markerId = pigeonVar_list[11] as! String + let clusterManagerId: String? = nilOrValue(pigeonVar_list[12]) + let collisionBehavior: PlatformMarkerCollisionBehavior? = nilOrValue(pigeonVar_list[13]) + + return PlatformMarker( + alpha: alpha, + anchor: anchor, + consumeTapEvents: consumeTapEvents, + draggable: draggable, + flat: flat, + icon: icon, + infoWindow: infoWindow, + position: position, + rotation: rotation, + visible: visible, + zIndex: zIndex, + markerId: markerId, + clusterManagerId: clusterManagerId, + collisionBehavior: collisionBehavior + ) + } + func toList() -> [Any?] { + return [ + alpha, + anchor, + consumeTapEvents, + draggable, + flat, + icon, + infoWindow, + position, + rotation, + visible, + zIndex, + markerId, + clusterManagerId, + collisionBehavior, + ] + } + static func == (lhs: PlatformMarker, rhs: PlatformMarker) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.alpha, rhs.alpha) + && MessagesPigeonInternal.deepEquals(lhs.anchor, rhs.anchor) + && MessagesPigeonInternal.deepEquals(lhs.consumeTapEvents, rhs.consumeTapEvents) + && MessagesPigeonInternal.deepEquals(lhs.draggable, rhs.draggable) + && MessagesPigeonInternal.deepEquals(lhs.flat, rhs.flat) + && MessagesPigeonInternal.deepEquals(lhs.icon, rhs.icon) + && MessagesPigeonInternal.deepEquals(lhs.infoWindow, rhs.infoWindow) + && MessagesPigeonInternal.deepEquals(lhs.position, rhs.position) + && MessagesPigeonInternal.deepEquals(lhs.rotation, rhs.rotation) + && MessagesPigeonInternal.deepEquals(lhs.visible, rhs.visible) + && MessagesPigeonInternal.deepEquals(lhs.zIndex, rhs.zIndex) + && MessagesPigeonInternal.deepEquals(lhs.markerId, rhs.markerId) + && MessagesPigeonInternal.deepEquals(lhs.clusterManagerId, rhs.clusterManagerId) + && MessagesPigeonInternal.deepEquals(lhs.collisionBehavior, rhs.collisionBehavior) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformMarker") + MessagesPigeonInternal.deepHash(value: alpha, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: anchor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: consumeTapEvents, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: draggable, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: flat, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: icon, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: infoWindow, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: position, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: rotation, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: visible, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zIndex, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: markerId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: clusterManagerId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: collisionBehavior, hasher: &hasher) + } + + public var description: String { + return + "PlatformMarker(alpha: \(String(describing: alpha)), anchor: \(String(describing: anchor)), consumeTapEvents: \(String(describing: consumeTapEvents)), draggable: \(String(describing: draggable)), flat: \(String(describing: flat)), icon: \(String(describing: icon)), infoWindow: \(String(describing: infoWindow)), position: \(String(describing: position)), rotation: \(String(describing: rotation)), visible: \(String(describing: visible)), zIndex: \(String(describing: zIndex)), markerId: \(String(describing: markerId)), clusterManagerId: \(String(describing: clusterManagerId)), collisionBehavior: \(String(describing: collisionBehavior)))" + } +} + +/// Pigeon equivalent of the Polygon class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformPolygon: Hashable, CustomStringConvertible { + var polygonId: String + var consumesTapEvents: Bool + var fillColor: PlatformColor + var geodesic: Bool + var points: [PlatformLatLng] + var holes: [[PlatformLatLng]] + var visible: Bool + var strokeColor: PlatformColor + var strokeWidth: Int64 + var zIndex: Int64 + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformPolygon? { + let polygonId = pigeonVar_list[0] as! String + let consumesTapEvents = pigeonVar_list[1] as! Bool + let fillColor = pigeonVar_list[2] as! PlatformColor + let geodesic = pigeonVar_list[3] as! Bool + let points = pigeonVar_list[4] as! [PlatformLatLng] + let holes = pigeonVar_list[5] as! [[PlatformLatLng]] + let visible = pigeonVar_list[6] as! Bool + let strokeColor = pigeonVar_list[7] as! PlatformColor + let strokeWidth = pigeonVar_list[8] as! Int64 + let zIndex = pigeonVar_list[9] as! Int64 + + return PlatformPolygon( + polygonId: polygonId, + consumesTapEvents: consumesTapEvents, + fillColor: fillColor, + geodesic: geodesic, + points: points, + holes: holes, + visible: visible, + strokeColor: strokeColor, + strokeWidth: strokeWidth, + zIndex: zIndex + ) + } + func toList() -> [Any?] { + return [ + polygonId, + consumesTapEvents, + fillColor, + geodesic, + points, + holes, + visible, + strokeColor, + strokeWidth, + zIndex, + ] + } + static func == (lhs: PlatformPolygon, rhs: PlatformPolygon) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.polygonId, rhs.polygonId) + && MessagesPigeonInternal.deepEquals(lhs.consumesTapEvents, rhs.consumesTapEvents) + && MessagesPigeonInternal.deepEquals(lhs.fillColor, rhs.fillColor) + && MessagesPigeonInternal.deepEquals(lhs.geodesic, rhs.geodesic) + && MessagesPigeonInternal.deepEquals(lhs.points, rhs.points) + && MessagesPigeonInternal.deepEquals(lhs.holes, rhs.holes) + && MessagesPigeonInternal.deepEquals(lhs.visible, rhs.visible) + && MessagesPigeonInternal.deepEquals(lhs.strokeColor, rhs.strokeColor) + && MessagesPigeonInternal.deepEquals(lhs.strokeWidth, rhs.strokeWidth) + && MessagesPigeonInternal.deepEquals(lhs.zIndex, rhs.zIndex) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformPolygon") + MessagesPigeonInternal.deepHash(value: polygonId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: consumesTapEvents, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: fillColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: geodesic, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: points, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: holes, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: visible, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: strokeColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: strokeWidth, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zIndex, hasher: &hasher) + } + + public var description: String { + return + "PlatformPolygon(polygonId: \(String(describing: polygonId)), consumesTapEvents: \(String(describing: consumesTapEvents)), fillColor: \(String(describing: fillColor)), geodesic: \(String(describing: geodesic)), points: \(String(describing: points)), holes: \(String(describing: holes)), visible: \(String(describing: visible)), strokeColor: \(String(describing: strokeColor)), strokeWidth: \(String(describing: strokeWidth)), zIndex: \(String(describing: zIndex)))" + } +} + +/// Pigeon equivalent of the Polyline class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformPolyline: Hashable, CustomStringConvertible { + var polylineId: String + var consumesTapEvents: Bool + var color: PlatformColor + var geodesic: Bool + /// The joint type. + var jointType: PlatformJointType + /// The pattern data, as a list of pattern items. + var patterns: [PlatformPatternItem] + var points: [PlatformLatLng] + var visible: Bool + var width: Int64 + var zIndex: Int64 + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformPolyline? { + let polylineId = pigeonVar_list[0] as! String + let consumesTapEvents = pigeonVar_list[1] as! Bool + let color = pigeonVar_list[2] as! PlatformColor + let geodesic = pigeonVar_list[3] as! Bool + let jointType = pigeonVar_list[4] as! PlatformJointType + let patterns = pigeonVar_list[5] as! [PlatformPatternItem] + let points = pigeonVar_list[6] as! [PlatformLatLng] + let visible = pigeonVar_list[7] as! Bool + let width = pigeonVar_list[8] as! Int64 + let zIndex = pigeonVar_list[9] as! Int64 + + return PlatformPolyline( + polylineId: polylineId, + consumesTapEvents: consumesTapEvents, + color: color, + geodesic: geodesic, + jointType: jointType, + patterns: patterns, + points: points, + visible: visible, + width: width, + zIndex: zIndex + ) + } + func toList() -> [Any?] { + return [ + polylineId, + consumesTapEvents, + color, + geodesic, + jointType, + patterns, + points, + visible, + width, + zIndex, + ] + } + static func == (lhs: PlatformPolyline, rhs: PlatformPolyline) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.polylineId, rhs.polylineId) + && MessagesPigeonInternal.deepEquals(lhs.consumesTapEvents, rhs.consumesTapEvents) + && MessagesPigeonInternal.deepEquals(lhs.color, rhs.color) + && MessagesPigeonInternal.deepEquals(lhs.geodesic, rhs.geodesic) + && MessagesPigeonInternal.deepEquals(lhs.jointType, rhs.jointType) + && MessagesPigeonInternal.deepEquals(lhs.patterns, rhs.patterns) + && MessagesPigeonInternal.deepEquals(lhs.points, rhs.points) + && MessagesPigeonInternal.deepEquals(lhs.visible, rhs.visible) + && MessagesPigeonInternal.deepEquals(lhs.width, rhs.width) + && MessagesPigeonInternal.deepEquals(lhs.zIndex, rhs.zIndex) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformPolyline") + MessagesPigeonInternal.deepHash(value: polylineId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: consumesTapEvents, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: color, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: geodesic, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: jointType, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: patterns, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: points, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: visible, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: width, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zIndex, hasher: &hasher) + } + + public var description: String { + return + "PlatformPolyline(polylineId: \(String(describing: polylineId)), consumesTapEvents: \(String(describing: consumesTapEvents)), color: \(String(describing: color)), geodesic: \(String(describing: geodesic)), jointType: \(String(describing: jointType)), patterns: \(String(describing: patterns)), points: \(String(describing: points)), visible: \(String(describing: visible)), width: \(String(describing: width)), zIndex: \(String(describing: zIndex)))" + } +} + +/// Pigeon equivalent of the PatternItem class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformPatternItem: Hashable, CustomStringConvertible { + var type: PlatformPatternItemType + var length: Double? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformPatternItem? { + let type = pigeonVar_list[0] as! PlatformPatternItemType + let length: Double? = nilOrValue(pigeonVar_list[1]) + + return PlatformPatternItem( + type: type, + length: length + ) + } + func toList() -> [Any?] { + return [ + type, + length, + ] + } + static func == (lhs: PlatformPatternItem, rhs: PlatformPatternItem) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.type, rhs.type) + && MessagesPigeonInternal.deepEquals(lhs.length, rhs.length) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformPatternItem") + MessagesPigeonInternal.deepHash(value: type, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: length, hasher: &hasher) + } + + public var description: String { + return + "PlatformPatternItem(type: \(String(describing: type)), length: \(String(describing: length)))" + } +} + +/// Pigeon equivalent of the Tile class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformTile: Hashable, CustomStringConvertible { + var width: Int64 + var height: Int64 + var data: FlutterStandardTypedData? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformTile? { + let width = pigeonVar_list[0] as! Int64 + let height = pigeonVar_list[1] as! Int64 + let data: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[2]) + + return PlatformTile( + width: width, + height: height, + data: data + ) + } + func toList() -> [Any?] { + return [ + width, + height, + data, + ] + } + static func == (lhs: PlatformTile, rhs: PlatformTile) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.width, rhs.width) + && MessagesPigeonInternal.deepEquals(lhs.height, rhs.height) + && MessagesPigeonInternal.deepEquals(lhs.data, rhs.data) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformTile") + MessagesPigeonInternal.deepHash(value: width, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: height, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: data, hasher: &hasher) + } + + public var description: String { + return + "PlatformTile(width: \(String(describing: width)), height: \(String(describing: height)), data: \(String(describing: data)))" + } +} + +/// Pigeon equivalent of the TileOverlay class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformTileOverlay: Hashable, CustomStringConvertible { + var tileOverlayId: String + var fadeIn: Bool + var transparency: Double + var zIndex: Int64 + var visible: Bool + var tileSize: Int64 + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformTileOverlay? { + let tileOverlayId = pigeonVar_list[0] as! String + let fadeIn = pigeonVar_list[1] as! Bool + let transparency = pigeonVar_list[2] as! Double + let zIndex = pigeonVar_list[3] as! Int64 + let visible = pigeonVar_list[4] as! Bool + let tileSize = pigeonVar_list[5] as! Int64 + + return PlatformTileOverlay( + tileOverlayId: tileOverlayId, + fadeIn: fadeIn, + transparency: transparency, + zIndex: zIndex, + visible: visible, + tileSize: tileSize + ) + } + func toList() -> [Any?] { + return [ + tileOverlayId, + fadeIn, + transparency, + zIndex, + visible, + tileSize, + ] + } + static func == (lhs: PlatformTileOverlay, rhs: PlatformTileOverlay) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.tileOverlayId, rhs.tileOverlayId) + && MessagesPigeonInternal.deepEquals(lhs.fadeIn, rhs.fadeIn) + && MessagesPigeonInternal.deepEquals(lhs.transparency, rhs.transparency) + && MessagesPigeonInternal.deepEquals(lhs.zIndex, rhs.zIndex) + && MessagesPigeonInternal.deepEquals(lhs.visible, rhs.visible) + && MessagesPigeonInternal.deepEquals(lhs.tileSize, rhs.tileSize) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformTileOverlay") + MessagesPigeonInternal.deepHash(value: tileOverlayId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: fadeIn, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: transparency, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zIndex, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: visible, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: tileSize, hasher: &hasher) + } + + public var description: String { + return + "PlatformTileOverlay(tileOverlayId: \(String(describing: tileOverlayId)), fadeIn: \(String(describing: fadeIn)), transparency: \(String(describing: transparency)), zIndex: \(String(describing: zIndex)), visible: \(String(describing: visible)), tileSize: \(String(describing: tileSize)))" + } +} + +/// Pigeon equivalent of Flutter's EdgeInsets. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformEdgeInsets: Hashable, CustomStringConvertible { + var top: Double + var bottom: Double + var left: Double + var right: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformEdgeInsets? { + let top = pigeonVar_list[0] as! Double + let bottom = pigeonVar_list[1] as! Double + let left = pigeonVar_list[2] as! Double + let right = pigeonVar_list[3] as! Double + + return PlatformEdgeInsets( + top: top, + bottom: bottom, + left: left, + right: right + ) + } + func toList() -> [Any?] { + return [ + top, + bottom, + left, + right, + ] + } + static func == (lhs: PlatformEdgeInsets, rhs: PlatformEdgeInsets) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.top, rhs.top) + && MessagesPigeonInternal.deepEquals(lhs.bottom, rhs.bottom) + && MessagesPigeonInternal.deepEquals(lhs.left, rhs.left) + && MessagesPigeonInternal.deepEquals(lhs.right, rhs.right) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformEdgeInsets") + MessagesPigeonInternal.deepHash(value: top, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: bottom, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: left, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: right, hasher: &hasher) + } + + public var description: String { + return + "PlatformEdgeInsets(top: \(String(describing: top)), bottom: \(String(describing: bottom)), left: \(String(describing: left)), right: \(String(describing: right)))" + } +} + +/// Pigeon equivalent of LatLng. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformLatLng: Hashable, CustomStringConvertible { + var latitude: Double + var longitude: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformLatLng? { + let latitude = pigeonVar_list[0] as! Double + let longitude = pigeonVar_list[1] as! Double + + return PlatformLatLng( + latitude: latitude, + longitude: longitude + ) + } + func toList() -> [Any?] { + return [ + latitude, + longitude, + ] + } + static func == (lhs: PlatformLatLng, rhs: PlatformLatLng) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.latitude, rhs.latitude) + && MessagesPigeonInternal.deepEquals(lhs.longitude, rhs.longitude) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformLatLng") + MessagesPigeonInternal.deepHash(value: latitude, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: longitude, hasher: &hasher) + } + + public var description: String { + return + "PlatformLatLng(latitude: \(String(describing: latitude)), longitude: \(String(describing: longitude)))" + } +} + +/// Pigeon equivalent of LatLngBounds. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformLatLngBounds: Hashable, CustomStringConvertible { + var northeast: PlatformLatLng + var southwest: PlatformLatLng + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformLatLngBounds? { + let northeast = pigeonVar_list[0] as! PlatformLatLng + let southwest = pigeonVar_list[1] as! PlatformLatLng + + return PlatformLatLngBounds( + northeast: northeast, + southwest: southwest + ) + } + func toList() -> [Any?] { + return [ + northeast, + southwest, + ] + } + static func == (lhs: PlatformLatLngBounds, rhs: PlatformLatLngBounds) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.northeast, rhs.northeast) + && MessagesPigeonInternal.deepEquals(lhs.southwest, rhs.southwest) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformLatLngBounds") + MessagesPigeonInternal.deepHash(value: northeast, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: southwest, hasher: &hasher) + } + + public var description: String { + return + "PlatformLatLngBounds(northeast: \(String(describing: northeast)), southwest: \(String(describing: southwest)))" + } +} + +/// Pigeon equivalent of CameraTargetBounds. +/// +/// As with the Dart version, it exists to distinguish between not setting a +/// a target, and having an explicitly unbounded target (null [bounds]). +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformCameraTargetBounds: Hashable, CustomStringConvertible { + var bounds: PlatformLatLngBounds? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformCameraTargetBounds? { + let bounds: PlatformLatLngBounds? = nilOrValue(pigeonVar_list[0]) + + return PlatformCameraTargetBounds( + bounds: bounds + ) + } + func toList() -> [Any?] { + return [ + bounds + ] + } + static func == (lhs: PlatformCameraTargetBounds, rhs: PlatformCameraTargetBounds) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.bounds, rhs.bounds) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformCameraTargetBounds") + MessagesPigeonInternal.deepHash(value: bounds, hasher: &hasher) + } + + public var description: String { + return "PlatformCameraTargetBounds(bounds: \(String(describing: bounds)))" + } +} + +/// Pigeon equivalent of the GroundOverlay class. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformGroundOverlay: Hashable, CustomStringConvertible { + var groundOverlayId: String + var image: PlatformBitmap + var position: PlatformLatLng? = nil + var bounds: PlatformLatLngBounds? = nil + var anchor: PlatformPoint? = nil + var transparency: Double + var bearing: Double + var zIndex: Int64 + var visible: Bool + var clickable: Bool + var zoomLevel: Double? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformGroundOverlay? { + let groundOverlayId = pigeonVar_list[0] as! String + let image = pigeonVar_list[1] as! PlatformBitmap + let position: PlatformLatLng? = nilOrValue(pigeonVar_list[2]) + let bounds: PlatformLatLngBounds? = nilOrValue(pigeonVar_list[3]) + let anchor: PlatformPoint? = nilOrValue(pigeonVar_list[4]) + let transparency = pigeonVar_list[5] as! Double + let bearing = pigeonVar_list[6] as! Double + let zIndex = pigeonVar_list[7] as! Int64 + let visible = pigeonVar_list[8] as! Bool + let clickable = pigeonVar_list[9] as! Bool + let zoomLevel: Double? = nilOrValue(pigeonVar_list[10]) + + return PlatformGroundOverlay( + groundOverlayId: groundOverlayId, + image: image, + position: position, + bounds: bounds, + anchor: anchor, + transparency: transparency, + bearing: bearing, + zIndex: zIndex, + visible: visible, + clickable: clickable, + zoomLevel: zoomLevel + ) + } + func toList() -> [Any?] { + return [ + groundOverlayId, + image, + position, + bounds, + anchor, + transparency, + bearing, + zIndex, + visible, + clickable, + zoomLevel, + ] + } + static func == (lhs: PlatformGroundOverlay, rhs: PlatformGroundOverlay) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.groundOverlayId, rhs.groundOverlayId) + && MessagesPigeonInternal.deepEquals(lhs.image, rhs.image) + && MessagesPigeonInternal.deepEquals(lhs.position, rhs.position) + && MessagesPigeonInternal.deepEquals(lhs.bounds, rhs.bounds) + && MessagesPigeonInternal.deepEquals(lhs.anchor, rhs.anchor) + && MessagesPigeonInternal.deepEquals(lhs.transparency, rhs.transparency) + && MessagesPigeonInternal.deepEquals(lhs.bearing, rhs.bearing) + && MessagesPigeonInternal.deepEquals(lhs.zIndex, rhs.zIndex) + && MessagesPigeonInternal.deepEquals(lhs.visible, rhs.visible) + && MessagesPigeonInternal.deepEquals(lhs.clickable, rhs.clickable) + && MessagesPigeonInternal.deepEquals(lhs.zoomLevel, rhs.zoomLevel) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformGroundOverlay") + MessagesPigeonInternal.deepHash(value: groundOverlayId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: image, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: position, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: bounds, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: anchor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: transparency, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: bearing, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zIndex, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: visible, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: clickable, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zoomLevel, hasher: &hasher) + } + + public var description: String { + return + "PlatformGroundOverlay(groundOverlayId: \(String(describing: groundOverlayId)), image: \(String(describing: image)), position: \(String(describing: position)), bounds: \(String(describing: bounds)), anchor: \(String(describing: anchor)), transparency: \(String(describing: transparency)), bearing: \(String(describing: bearing)), zIndex: \(String(describing: zIndex)), visible: \(String(describing: visible)), clickable: \(String(describing: clickable)), zoomLevel: \(String(describing: zoomLevel)))" + } +} + +/// Information passed to the platform view creation. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformMapViewCreationParams: Hashable, CustomStringConvertible { + var initialCameraPosition: PlatformCameraPosition + var mapConfiguration: PlatformMapConfiguration + var initialCircles: [PlatformCircle] + var initialMarkers: [PlatformMarker] + var initialPolygons: [PlatformPolygon] + var initialPolylines: [PlatformPolyline] + var initialHeatmaps: [PlatformHeatmap] + var initialTileOverlays: [PlatformTileOverlay] + var initialClusterManagers: [PlatformClusterManager] + var initialGroundOverlays: [PlatformGroundOverlay] + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformMapViewCreationParams? { + let initialCameraPosition = pigeonVar_list[0] as! PlatformCameraPosition + let mapConfiguration = pigeonVar_list[1] as! PlatformMapConfiguration + let initialCircles = pigeonVar_list[2] as! [PlatformCircle] + let initialMarkers = pigeonVar_list[3] as! [PlatformMarker] + let initialPolygons = pigeonVar_list[4] as! [PlatformPolygon] + let initialPolylines = pigeonVar_list[5] as! [PlatformPolyline] + let initialHeatmaps = pigeonVar_list[6] as! [PlatformHeatmap] + let initialTileOverlays = pigeonVar_list[7] as! [PlatformTileOverlay] + let initialClusterManagers = pigeonVar_list[8] as! [PlatformClusterManager] + let initialGroundOverlays = pigeonVar_list[9] as! [PlatformGroundOverlay] + + return PlatformMapViewCreationParams( + initialCameraPosition: initialCameraPosition, + mapConfiguration: mapConfiguration, + initialCircles: initialCircles, + initialMarkers: initialMarkers, + initialPolygons: initialPolygons, + initialPolylines: initialPolylines, + initialHeatmaps: initialHeatmaps, + initialTileOverlays: initialTileOverlays, + initialClusterManagers: initialClusterManagers, + initialGroundOverlays: initialGroundOverlays + ) + } + func toList() -> [Any?] { + return [ + initialCameraPosition, + mapConfiguration, + initialCircles, + initialMarkers, + initialPolygons, + initialPolylines, + initialHeatmaps, + initialTileOverlays, + initialClusterManagers, + initialGroundOverlays, + ] + } + static func == (lhs: PlatformMapViewCreationParams, rhs: PlatformMapViewCreationParams) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.initialCameraPosition, rhs.initialCameraPosition) + && MessagesPigeonInternal.deepEquals(lhs.mapConfiguration, rhs.mapConfiguration) + && MessagesPigeonInternal.deepEquals(lhs.initialCircles, rhs.initialCircles) + && MessagesPigeonInternal.deepEquals(lhs.initialMarkers, rhs.initialMarkers) + && MessagesPigeonInternal.deepEquals(lhs.initialPolygons, rhs.initialPolygons) + && MessagesPigeonInternal.deepEquals(lhs.initialPolylines, rhs.initialPolylines) + && MessagesPigeonInternal.deepEquals(lhs.initialHeatmaps, rhs.initialHeatmaps) + && MessagesPigeonInternal.deepEquals(lhs.initialTileOverlays, rhs.initialTileOverlays) + && MessagesPigeonInternal.deepEquals(lhs.initialClusterManagers, rhs.initialClusterManagers) + && MessagesPigeonInternal.deepEquals(lhs.initialGroundOverlays, rhs.initialGroundOverlays) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformMapViewCreationParams") + MessagesPigeonInternal.deepHash(value: initialCameraPosition, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: mapConfiguration, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialCircles, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialMarkers, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialPolygons, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialPolylines, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialHeatmaps, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialTileOverlays, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialClusterManagers, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: initialGroundOverlays, hasher: &hasher) + } + + public var description: String { + return + "PlatformMapViewCreationParams(initialCameraPosition: \(String(describing: initialCameraPosition)), mapConfiguration: \(String(describing: mapConfiguration)), initialCircles: \(String(describing: initialCircles)), initialMarkers: \(String(describing: initialMarkers)), initialPolygons: \(String(describing: initialPolygons)), initialPolylines: \(String(describing: initialPolylines)), initialHeatmaps: \(String(describing: initialHeatmaps)), initialTileOverlays: \(String(describing: initialTileOverlays)), initialClusterManagers: \(String(describing: initialClusterManagers)), initialGroundOverlays: \(String(describing: initialGroundOverlays)))" + } +} + +/// Pigeon equivalent of MapConfiguration. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformMapConfiguration: Hashable, CustomStringConvertible { + var compassEnabled: Bool? = nil + var cameraTargetBounds: PlatformCameraTargetBounds? = nil + var mapType: PlatformMapType? = nil + var minMaxZoomPreference: PlatformZoomRange? = nil + var rotateGesturesEnabled: Bool? = nil + var scrollGesturesEnabled: Bool? = nil + var tiltGesturesEnabled: Bool? = nil + var trackCameraPosition: Bool? = nil + var zoomGesturesEnabled: Bool? = nil + var myLocationEnabled: Bool? = nil + var myLocationButtonEnabled: Bool? = nil + var padding: PlatformEdgeInsets? = nil + var indoorViewEnabled: Bool? = nil + var trafficEnabled: Bool? = nil + var buildingsEnabled: Bool? = nil + var markerType: PlatformMarkerType + var mapId: String? = nil + var style: String? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformMapConfiguration? { + let compassEnabled: Bool? = nilOrValue(pigeonVar_list[0]) + let cameraTargetBounds: PlatformCameraTargetBounds? = nilOrValue(pigeonVar_list[1]) + let mapType: PlatformMapType? = nilOrValue(pigeonVar_list[2]) + let minMaxZoomPreference: PlatformZoomRange? = nilOrValue(pigeonVar_list[3]) + let rotateGesturesEnabled: Bool? = nilOrValue(pigeonVar_list[4]) + let scrollGesturesEnabled: Bool? = nilOrValue(pigeonVar_list[5]) + let tiltGesturesEnabled: Bool? = nilOrValue(pigeonVar_list[6]) + let trackCameraPosition: Bool? = nilOrValue(pigeonVar_list[7]) + let zoomGesturesEnabled: Bool? = nilOrValue(pigeonVar_list[8]) + let myLocationEnabled: Bool? = nilOrValue(pigeonVar_list[9]) + let myLocationButtonEnabled: Bool? = nilOrValue(pigeonVar_list[10]) + let padding: PlatformEdgeInsets? = nilOrValue(pigeonVar_list[11]) + let indoorViewEnabled: Bool? = nilOrValue(pigeonVar_list[12]) + let trafficEnabled: Bool? = nilOrValue(pigeonVar_list[13]) + let buildingsEnabled: Bool? = nilOrValue(pigeonVar_list[14]) + let markerType = pigeonVar_list[15] as! PlatformMarkerType + let mapId: String? = nilOrValue(pigeonVar_list[16]) + let style: String? = nilOrValue(pigeonVar_list[17]) + + return PlatformMapConfiguration( + compassEnabled: compassEnabled, + cameraTargetBounds: cameraTargetBounds, + mapType: mapType, + minMaxZoomPreference: minMaxZoomPreference, + rotateGesturesEnabled: rotateGesturesEnabled, + scrollGesturesEnabled: scrollGesturesEnabled, + tiltGesturesEnabled: tiltGesturesEnabled, + trackCameraPosition: trackCameraPosition, + zoomGesturesEnabled: zoomGesturesEnabled, + myLocationEnabled: myLocationEnabled, + myLocationButtonEnabled: myLocationButtonEnabled, + padding: padding, + indoorViewEnabled: indoorViewEnabled, + trafficEnabled: trafficEnabled, + buildingsEnabled: buildingsEnabled, + markerType: markerType, + mapId: mapId, + style: style + ) + } + func toList() -> [Any?] { + return [ + compassEnabled, + cameraTargetBounds, + mapType, + minMaxZoomPreference, + rotateGesturesEnabled, + scrollGesturesEnabled, + tiltGesturesEnabled, + trackCameraPosition, + zoomGesturesEnabled, + myLocationEnabled, + myLocationButtonEnabled, + padding, + indoorViewEnabled, + trafficEnabled, + buildingsEnabled, + markerType, + mapId, + style, + ] + } + static func == (lhs: PlatformMapConfiguration, rhs: PlatformMapConfiguration) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.compassEnabled, rhs.compassEnabled) + && MessagesPigeonInternal.deepEquals(lhs.cameraTargetBounds, rhs.cameraTargetBounds) + && MessagesPigeonInternal.deepEquals(lhs.mapType, rhs.mapType) + && MessagesPigeonInternal.deepEquals(lhs.minMaxZoomPreference, rhs.minMaxZoomPreference) + && MessagesPigeonInternal.deepEquals(lhs.rotateGesturesEnabled, rhs.rotateGesturesEnabled) + && MessagesPigeonInternal.deepEquals(lhs.scrollGesturesEnabled, rhs.scrollGesturesEnabled) + && MessagesPigeonInternal.deepEquals(lhs.tiltGesturesEnabled, rhs.tiltGesturesEnabled) + && MessagesPigeonInternal.deepEquals(lhs.trackCameraPosition, rhs.trackCameraPosition) + && MessagesPigeonInternal.deepEquals(lhs.zoomGesturesEnabled, rhs.zoomGesturesEnabled) + && MessagesPigeonInternal.deepEquals(lhs.myLocationEnabled, rhs.myLocationEnabled) + && MessagesPigeonInternal.deepEquals(lhs.myLocationButtonEnabled, rhs.myLocationButtonEnabled) + && MessagesPigeonInternal.deepEquals(lhs.padding, rhs.padding) + && MessagesPigeonInternal.deepEquals(lhs.indoorViewEnabled, rhs.indoorViewEnabled) + && MessagesPigeonInternal.deepEquals(lhs.trafficEnabled, rhs.trafficEnabled) + && MessagesPigeonInternal.deepEquals(lhs.buildingsEnabled, rhs.buildingsEnabled) + && MessagesPigeonInternal.deepEquals(lhs.markerType, rhs.markerType) + && MessagesPigeonInternal.deepEquals(lhs.mapId, rhs.mapId) + && MessagesPigeonInternal.deepEquals(lhs.style, rhs.style) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformMapConfiguration") + MessagesPigeonInternal.deepHash(value: compassEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: cameraTargetBounds, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: mapType, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: minMaxZoomPreference, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: rotateGesturesEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: scrollGesturesEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: tiltGesturesEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: trackCameraPosition, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zoomGesturesEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: myLocationEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: myLocationButtonEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: padding, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: indoorViewEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: trafficEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: buildingsEnabled, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: markerType, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: mapId, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: style, hasher: &hasher) + } + + public var description: String { + return + "PlatformMapConfiguration(compassEnabled: \(String(describing: compassEnabled)), cameraTargetBounds: \(String(describing: cameraTargetBounds)), mapType: \(String(describing: mapType)), minMaxZoomPreference: \(String(describing: minMaxZoomPreference)), rotateGesturesEnabled: \(String(describing: rotateGesturesEnabled)), scrollGesturesEnabled: \(String(describing: scrollGesturesEnabled)), tiltGesturesEnabled: \(String(describing: tiltGesturesEnabled)), trackCameraPosition: \(String(describing: trackCameraPosition)), zoomGesturesEnabled: \(String(describing: zoomGesturesEnabled)), myLocationEnabled: \(String(describing: myLocationEnabled)), myLocationButtonEnabled: \(String(describing: myLocationButtonEnabled)), padding: \(String(describing: padding)), indoorViewEnabled: \(String(describing: indoorViewEnabled)), trafficEnabled: \(String(describing: trafficEnabled)), buildingsEnabled: \(String(describing: buildingsEnabled)), markerType: \(String(describing: markerType)), mapId: \(String(describing: mapId)), style: \(String(describing: style)))" + } +} + +/// Pigeon representation of an x,y coordinate. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformPoint: Hashable, CustomStringConvertible { + var x: Double + var y: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformPoint? { + let x = pigeonVar_list[0] as! Double + let y = pigeonVar_list[1] as! Double + + return PlatformPoint( + x: x, + y: y + ) + } + func toList() -> [Any?] { + return [ + x, + y, + ] + } + static func == (lhs: PlatformPoint, rhs: PlatformPoint) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.x, rhs.x) + && MessagesPigeonInternal.deepEquals(lhs.y, rhs.y) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformPoint") + MessagesPigeonInternal.deepHash(value: x, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: y, hasher: &hasher) + } + + public var description: String { + return "PlatformPoint(x: \(String(describing: x)), y: \(String(describing: y)))" + } +} + +/// Pigeon representation of a size. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformSize: Hashable, CustomStringConvertible { + var width: Double + var height: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformSize? { + let width = pigeonVar_list[0] as! Double + let height = pigeonVar_list[1] as! Double + + return PlatformSize( + width: width, + height: height + ) + } + func toList() -> [Any?] { + return [ + width, + height, + ] + } + static func == (lhs: PlatformSize, rhs: PlatformSize) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.width, rhs.width) + && MessagesPigeonInternal.deepEquals(lhs.height, rhs.height) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformSize") + MessagesPigeonInternal.deepHash(value: width, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: height, hasher: &hasher) + } + + public var description: String { + return + "PlatformSize(width: \(String(describing: width)), height: \(String(describing: height)))" + } +} + +/// Pigeon representation of a color. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformColor: Hashable, CustomStringConvertible { + var red: Double + var green: Double + var blue: Double + var alpha: Double + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformColor? { + let red = pigeonVar_list[0] as! Double + let green = pigeonVar_list[1] as! Double + let blue = pigeonVar_list[2] as! Double + let alpha = pigeonVar_list[3] as! Double + + return PlatformColor( + red: red, + green: green, + blue: blue, + alpha: alpha + ) + } + func toList() -> [Any?] { + return [ + red, + green, + blue, + alpha, + ] + } + static func == (lhs: PlatformColor, rhs: PlatformColor) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.red, rhs.red) + && MessagesPigeonInternal.deepEquals(lhs.green, rhs.green) + && MessagesPigeonInternal.deepEquals(lhs.blue, rhs.blue) + && MessagesPigeonInternal.deepEquals(lhs.alpha, rhs.alpha) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformColor") + MessagesPigeonInternal.deepHash(value: red, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: green, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: blue, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: alpha, hasher: &hasher) + } + + public var description: String { + return + "PlatformColor(red: \(String(describing: red)), green: \(String(describing: green)), blue: \(String(describing: blue)), alpha: \(String(describing: alpha)))" + } +} + +/// Pigeon equivalent of GMSTileLayer properties. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformTileLayer: Hashable, CustomStringConvertible { + var visible: Bool + var fadeIn: Bool + var opacity: Double + var zIndex: Int64 + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformTileLayer? { + let visible = pigeonVar_list[0] as! Bool + let fadeIn = pigeonVar_list[1] as! Bool + let opacity = pigeonVar_list[2] as! Double + let zIndex = pigeonVar_list[3] as! Int64 + + return PlatformTileLayer( + visible: visible, + fadeIn: fadeIn, + opacity: opacity, + zIndex: zIndex + ) + } + func toList() -> [Any?] { + return [ + visible, + fadeIn, + opacity, + zIndex, + ] + } + static func == (lhs: PlatformTileLayer, rhs: PlatformTileLayer) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.visible, rhs.visible) + && MessagesPigeonInternal.deepEquals(lhs.fadeIn, rhs.fadeIn) + && MessagesPigeonInternal.deepEquals(lhs.opacity, rhs.opacity) + && MessagesPigeonInternal.deepEquals(lhs.zIndex, rhs.zIndex) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformTileLayer") + MessagesPigeonInternal.deepHash(value: visible, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: fadeIn, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: opacity, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: zIndex, hasher: &hasher) + } + + public var description: String { + return + "PlatformTileLayer(visible: \(String(describing: visible)), fadeIn: \(String(describing: fadeIn)), opacity: \(String(describing: opacity)), zIndex: \(String(describing: zIndex)))" + } +} + +/// Pigeon equivalent of MinMaxZoomPreference. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformZoomRange: Hashable, CustomStringConvertible { + var min: Double? = nil + var max: Double? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformZoomRange? { + let min: Double? = nilOrValue(pigeonVar_list[0]) + let max: Double? = nilOrValue(pigeonVar_list[1]) + + return PlatformZoomRange( + min: min, + max: max + ) + } + func toList() -> [Any?] { + return [ + min, + max, + ] + } + static func == (lhs: PlatformZoomRange, rhs: PlatformZoomRange) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.min, rhs.min) + && MessagesPigeonInternal.deepEquals(lhs.max, rhs.max) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformZoomRange") + MessagesPigeonInternal.deepHash(value: min, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: max, hasher: &hasher) + } + + public var description: String { + return "PlatformZoomRange(min: \(String(describing: min)), max: \(String(describing: max)))" + } +} + +/// Pigeon equivalent of [BitmapDescriptor]. +/// +/// Generated class from Pigeon that represents data sent in messages. +/// This protocol should not be extended by any user class outside of the generated file. +protocol PlatformBitmap { + +} + +/// Pigeon equivalent of [DefaultMarker]. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformBitmapDefaultMarker: PlatformBitmap { + var hue: Double? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmapDefaultMarker? { + let hue: Double? = nilOrValue(pigeonVar_list[0]) + + return PlatformBitmapDefaultMarker( + hue: hue + ) + } + func toList() -> [Any?] { + return [ + hue + ] + } + static func == (lhs: PlatformBitmapDefaultMarker, rhs: PlatformBitmapDefaultMarker) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.hue, rhs.hue) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformBitmapDefaultMarker") + MessagesPigeonInternal.deepHash(value: hue, hasher: &hasher) + } + + public var description: String { + return "PlatformBitmapDefaultMarker(hue: \(String(describing: hue)))" + } +} + +/// Pigeon equivalent of [BytesBitmap]. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformBitmapBytes: PlatformBitmap { + var byteData: FlutterStandardTypedData + var size: PlatformSize? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmapBytes? { + let byteData = pigeonVar_list[0] as! FlutterStandardTypedData + let size: PlatformSize? = nilOrValue(pigeonVar_list[1]) + + return PlatformBitmapBytes( + byteData: byteData, + size: size + ) + } + func toList() -> [Any?] { + return [ + byteData, + size, + ] + } + static func == (lhs: PlatformBitmapBytes, rhs: PlatformBitmapBytes) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.byteData, rhs.byteData) + && MessagesPigeonInternal.deepEquals(lhs.size, rhs.size) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformBitmapBytes") + MessagesPigeonInternal.deepHash(value: byteData, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: size, hasher: &hasher) + } + + public var description: String { + return + "PlatformBitmapBytes(byteData: \(String(describing: byteData)), size: \(String(describing: size)))" + } +} + +/// Pigeon equivalent of [AssetBitmap]. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformBitmapAsset: PlatformBitmap { + var name: String + var pkg: String? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmapAsset? { + let name = pigeonVar_list[0] as! String + let pkg: String? = nilOrValue(pigeonVar_list[1]) + + return PlatformBitmapAsset( + name: name, + pkg: pkg + ) + } + func toList() -> [Any?] { + return [ + name, + pkg, + ] + } + static func == (lhs: PlatformBitmapAsset, rhs: PlatformBitmapAsset) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.name, rhs.name) + && MessagesPigeonInternal.deepEquals(lhs.pkg, rhs.pkg) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformBitmapAsset") + MessagesPigeonInternal.deepHash(value: name, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: pkg, hasher: &hasher) + } + + public var description: String { + return "PlatformBitmapAsset(name: \(String(describing: name)), pkg: \(String(describing: pkg)))" + } +} + +/// Pigeon equivalent of [AssetImageBitmap]. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformBitmapAssetImage: PlatformBitmap { + var name: String + var scale: Double + var size: PlatformSize? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmapAssetImage? { + let name = pigeonVar_list[0] as! String + let scale = pigeonVar_list[1] as! Double + let size: PlatformSize? = nilOrValue(pigeonVar_list[2]) + + return PlatformBitmapAssetImage( + name: name, + scale: scale, + size: size + ) + } + func toList() -> [Any?] { + return [ + name, + scale, + size, + ] + } + static func == (lhs: PlatformBitmapAssetImage, rhs: PlatformBitmapAssetImage) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.name, rhs.name) + && MessagesPigeonInternal.deepEquals(lhs.scale, rhs.scale) + && MessagesPigeonInternal.deepEquals(lhs.size, rhs.size) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformBitmapAssetImage") + MessagesPigeonInternal.deepHash(value: name, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: scale, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: size, hasher: &hasher) + } + + public var description: String { + return + "PlatformBitmapAssetImage(name: \(String(describing: name)), scale: \(String(describing: scale)), size: \(String(describing: size)))" + } +} + +/// Pigeon equivalent of [AssetMapBitmap]. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformBitmapAssetMap: PlatformBitmap { + var assetName: String + var bitmapScaling: PlatformMapBitmapScaling + var imagePixelRatio: Double + var width: Double? = nil + var height: Double? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmapAssetMap? { + let assetName = pigeonVar_list[0] as! String + let bitmapScaling = pigeonVar_list[1] as! PlatformMapBitmapScaling + let imagePixelRatio = pigeonVar_list[2] as! Double + let width: Double? = nilOrValue(pigeonVar_list[3]) + let height: Double? = nilOrValue(pigeonVar_list[4]) + + return PlatformBitmapAssetMap( + assetName: assetName, + bitmapScaling: bitmapScaling, + imagePixelRatio: imagePixelRatio, + width: width, + height: height + ) + } + func toList() -> [Any?] { + return [ + assetName, + bitmapScaling, + imagePixelRatio, + width, + height, + ] + } + static func == (lhs: PlatformBitmapAssetMap, rhs: PlatformBitmapAssetMap) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.assetName, rhs.assetName) + && MessagesPigeonInternal.deepEquals(lhs.bitmapScaling, rhs.bitmapScaling) + && MessagesPigeonInternal.deepEquals(lhs.imagePixelRatio, rhs.imagePixelRatio) + && MessagesPigeonInternal.deepEquals(lhs.width, rhs.width) + && MessagesPigeonInternal.deepEquals(lhs.height, rhs.height) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformBitmapAssetMap") + MessagesPigeonInternal.deepHash(value: assetName, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: bitmapScaling, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: imagePixelRatio, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: width, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: height, hasher: &hasher) + } + + public var description: String { + return + "PlatformBitmapAssetMap(assetName: \(String(describing: assetName)), bitmapScaling: \(String(describing: bitmapScaling)), imagePixelRatio: \(String(describing: imagePixelRatio)), width: \(String(describing: width)), height: \(String(describing: height)))" + } +} + +/// Pigeon equivalent of [BytesMapBitmap]. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformBitmapBytesMap: PlatformBitmap { + var byteData: FlutterStandardTypedData + var bitmapScaling: PlatformMapBitmapScaling + var imagePixelRatio: Double + var width: Double? = nil + var height: Double? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmapBytesMap? { + let byteData = pigeonVar_list[0] as! FlutterStandardTypedData + let bitmapScaling = pigeonVar_list[1] as! PlatformMapBitmapScaling + let imagePixelRatio = pigeonVar_list[2] as! Double + let width: Double? = nilOrValue(pigeonVar_list[3]) + let height: Double? = nilOrValue(pigeonVar_list[4]) + + return PlatformBitmapBytesMap( + byteData: byteData, + bitmapScaling: bitmapScaling, + imagePixelRatio: imagePixelRatio, + width: width, + height: height + ) + } + func toList() -> [Any?] { + return [ + byteData, + bitmapScaling, + imagePixelRatio, + width, + height, + ] + } + static func == (lhs: PlatformBitmapBytesMap, rhs: PlatformBitmapBytesMap) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.byteData, rhs.byteData) + && MessagesPigeonInternal.deepEquals(lhs.bitmapScaling, rhs.bitmapScaling) + && MessagesPigeonInternal.deepEquals(lhs.imagePixelRatio, rhs.imagePixelRatio) + && MessagesPigeonInternal.deepEquals(lhs.width, rhs.width) + && MessagesPigeonInternal.deepEquals(lhs.height, rhs.height) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformBitmapBytesMap") + MessagesPigeonInternal.deepHash(value: byteData, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: bitmapScaling, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: imagePixelRatio, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: width, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: height, hasher: &hasher) + } + + public var description: String { + return + "PlatformBitmapBytesMap(byteData: \(String(describing: byteData)), bitmapScaling: \(String(describing: bitmapScaling)), imagePixelRatio: \(String(describing: imagePixelRatio)), width: \(String(describing: width)), height: \(String(describing: height)))" + } +} + +/// Pigeon equivalent of [PinConfig]. +/// +/// Generated class from Pigeon that represents data sent in messages. +struct PlatformBitmapPinConfig: PlatformBitmap { + var backgroundColor: PlatformColor? = nil + var borderColor: PlatformColor? = nil + var glyphColor: PlatformColor? = nil + var glyphTextColor: PlatformColor? = nil + var glyphText: String? = nil + var glyphBitmap: PlatformBitmap? = nil + + // swift-format-ignore: AlwaysUseLowerCamelCase + static func fromList(_ pigeonVar_list: [Any?]) -> PlatformBitmapPinConfig? { + let backgroundColor: PlatformColor? = nilOrValue(pigeonVar_list[0]) + let borderColor: PlatformColor? = nilOrValue(pigeonVar_list[1]) + let glyphColor: PlatformColor? = nilOrValue(pigeonVar_list[2]) + let glyphTextColor: PlatformColor? = nilOrValue(pigeonVar_list[3]) + let glyphText: String? = nilOrValue(pigeonVar_list[4]) + let glyphBitmap: PlatformBitmap? = nilOrValue(pigeonVar_list[5]) + + return PlatformBitmapPinConfig( + backgroundColor: backgroundColor, + borderColor: borderColor, + glyphColor: glyphColor, + glyphTextColor: glyphTextColor, + glyphText: glyphText, + glyphBitmap: glyphBitmap + ) + } + func toList() -> [Any?] { + return [ + backgroundColor, + borderColor, + glyphColor, + glyphTextColor, + glyphText, + glyphBitmap, + ] + } + static func == (lhs: PlatformBitmapPinConfig, rhs: PlatformBitmapPinConfig) -> Bool { + if Swift.type(of: lhs) != Swift.type(of: rhs) { + return false + } + return MessagesPigeonInternal.deepEquals(lhs.backgroundColor, rhs.backgroundColor) + && MessagesPigeonInternal.deepEquals(lhs.borderColor, rhs.borderColor) + && MessagesPigeonInternal.deepEquals(lhs.glyphColor, rhs.glyphColor) + && MessagesPigeonInternal.deepEquals(lhs.glyphTextColor, rhs.glyphTextColor) + && MessagesPigeonInternal.deepEquals(lhs.glyphText, rhs.glyphText) + && MessagesPigeonInternal.deepEquals(lhs.glyphBitmap, rhs.glyphBitmap) + } + + func hash(into hasher: inout Hasher) { + hasher.combine("PlatformBitmapPinConfig") + MessagesPigeonInternal.deepHash(value: backgroundColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: borderColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: glyphColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: glyphTextColor, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: glyphText, hasher: &hasher) + MessagesPigeonInternal.deepHash(value: glyphBitmap, hasher: &hasher) + } + + public var description: String { + return + "PlatformBitmapPinConfig(backgroundColor: \(String(describing: backgroundColor)), borderColor: \(String(describing: borderColor)), glyphColor: \(String(describing: glyphColor)), glyphTextColor: \(String(describing: glyphTextColor)), glyphText: \(String(describing: glyphText)), glyphBitmap: \(String(describing: glyphBitmap)))" + } +} + +private class MessagesPigeonCodecReader: FlutterStandardReader { + override func readValue(ofType type: UInt8) -> Any? { + switch type { + case 129: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return PlatformMapType(rawValue: enumResultAsInt) + } + return nil + case 130: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return PlatformMarkerCollisionBehavior(rawValue: enumResultAsInt) + } + return nil + case 131: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return PlatformJointType(rawValue: enumResultAsInt) + } + return nil + case 132: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return PlatformPatternItemType(rawValue: enumResultAsInt) + } + return nil + case 133: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return PlatformMarkerType(rawValue: enumResultAsInt) + } + return nil + case 134: + let enumResultAsInt: Int? = nilOrValue(self.readValue() as! Int?) + if let enumResultAsInt = enumResultAsInt { + return PlatformMapBitmapScaling(rawValue: enumResultAsInt) + } + return nil + case 135: + return PlatformCameraPosition.fromList(self.readValue() as! [Any?]) + case 136: + return PlatformCameraUpdateNewCameraPosition.fromList(self.readValue() as! [Any?]) + case 137: + return PlatformCameraUpdateNewLatLng.fromList(self.readValue() as! [Any?]) + case 138: + return PlatformCameraUpdateNewLatLngBounds.fromList(self.readValue() as! [Any?]) + case 139: + return PlatformCameraUpdateNewLatLngZoom.fromList(self.readValue() as! [Any?]) + case 140: + return PlatformCameraUpdateScrollBy.fromList(self.readValue() as! [Any?]) + case 141: + return PlatformCameraUpdateZoomBy.fromList(self.readValue() as! [Any?]) + case 142: + return PlatformCameraUpdateZoom.fromList(self.readValue() as! [Any?]) + case 143: + return PlatformCameraUpdateZoomTo.fromList(self.readValue() as! [Any?]) + case 144: + return PlatformCircle.fromList(self.readValue() as! [Any?]) + case 145: + return PlatformHeatmap.fromList(self.readValue() as! [Any?]) + case 146: + return PlatformHeatmapGradient.fromList(self.readValue() as! [Any?]) + case 147: + return PlatformWeightedLatLng.fromList(self.readValue() as! [Any?]) + case 148: + return PlatformInfoWindow.fromList(self.readValue() as! [Any?]) + case 149: + return PlatformCluster.fromList(self.readValue() as! [Any?]) + case 150: + return PlatformClusterManager.fromList(self.readValue() as! [Any?]) + case 151: + return PlatformMarker.fromList(self.readValue() as! [Any?]) + case 152: + return PlatformPolygon.fromList(self.readValue() as! [Any?]) + case 153: + return PlatformPolyline.fromList(self.readValue() as! [Any?]) + case 154: + return PlatformPatternItem.fromList(self.readValue() as! [Any?]) + case 155: + return PlatformTile.fromList(self.readValue() as! [Any?]) + case 156: + return PlatformTileOverlay.fromList(self.readValue() as! [Any?]) + case 157: + return PlatformEdgeInsets.fromList(self.readValue() as! [Any?]) + case 158: + return PlatformLatLng.fromList(self.readValue() as! [Any?]) + case 159: + return PlatformLatLngBounds.fromList(self.readValue() as! [Any?]) + case 160: + return PlatformCameraTargetBounds.fromList(self.readValue() as! [Any?]) + case 161: + return PlatformGroundOverlay.fromList(self.readValue() as! [Any?]) + case 162: + return PlatformMapViewCreationParams.fromList(self.readValue() as! [Any?]) + case 163: + return PlatformMapConfiguration.fromList(self.readValue() as! [Any?]) + case 164: + return PlatformPoint.fromList(self.readValue() as! [Any?]) + case 165: + return PlatformSize.fromList(self.readValue() as! [Any?]) + case 166: + return PlatformColor.fromList(self.readValue() as! [Any?]) + case 167: + return PlatformTileLayer.fromList(self.readValue() as! [Any?]) + case 168: + return PlatformZoomRange.fromList(self.readValue() as! [Any?]) + case 169: + return PlatformBitmapDefaultMarker.fromList(self.readValue() as! [Any?]) + case 170: + return PlatformBitmapBytes.fromList(self.readValue() as! [Any?]) + case 171: + return PlatformBitmapAsset.fromList(self.readValue() as! [Any?]) + case 172: + return PlatformBitmapAssetImage.fromList(self.readValue() as! [Any?]) + case 173: + return PlatformBitmapAssetMap.fromList(self.readValue() as! [Any?]) + case 174: + return PlatformBitmapBytesMap.fromList(self.readValue() as! [Any?]) + case 175: + return PlatformBitmapPinConfig.fromList(self.readValue() as! [Any?]) + default: + return super.readValue(ofType: type) + } + } +} + +private class MessagesPigeonCodecWriter: FlutterStandardWriter { + override func writeValue(_ value: Any) { + if let value = value as? PlatformMapType { + super.writeByte(129) + super.writeValue(value.rawValue) + } else if let value = value as? PlatformMarkerCollisionBehavior { + super.writeByte(130) + super.writeValue(value.rawValue) + } else if let value = value as? PlatformJointType { + super.writeByte(131) + super.writeValue(value.rawValue) + } else if let value = value as? PlatformPatternItemType { + super.writeByte(132) + super.writeValue(value.rawValue) + } else if let value = value as? PlatformMarkerType { + super.writeByte(133) + super.writeValue(value.rawValue) + } else if let value = value as? PlatformMapBitmapScaling { + super.writeByte(134) + super.writeValue(value.rawValue) + } else if let value = value as? PlatformCameraPosition { + super.writeByte(135) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateNewCameraPosition { + super.writeByte(136) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateNewLatLng { + super.writeByte(137) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateNewLatLngBounds { + super.writeByte(138) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateNewLatLngZoom { + super.writeByte(139) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateScrollBy { + super.writeByte(140) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateZoomBy { + super.writeByte(141) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateZoom { + super.writeByte(142) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraUpdateZoomTo { + super.writeByte(143) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCircle { + super.writeByte(144) + super.writeValue(value.toList()) + } else if let value = value as? PlatformHeatmap { + super.writeByte(145) + super.writeValue(value.toList()) + } else if let value = value as? PlatformHeatmapGradient { + super.writeByte(146) + super.writeValue(value.toList()) + } else if let value = value as? PlatformWeightedLatLng { + super.writeByte(147) + super.writeValue(value.toList()) + } else if let value = value as? PlatformInfoWindow { + super.writeByte(148) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCluster { + super.writeByte(149) + super.writeValue(value.toList()) + } else if let value = value as? PlatformClusterManager { + super.writeByte(150) + super.writeValue(value.toList()) + } else if let value = value as? PlatformMarker { + super.writeByte(151) + super.writeValue(value.toList()) + } else if let value = value as? PlatformPolygon { + super.writeByte(152) + super.writeValue(value.toList()) + } else if let value = value as? PlatformPolyline { + super.writeByte(153) + super.writeValue(value.toList()) + } else if let value = value as? PlatformPatternItem { + super.writeByte(154) + super.writeValue(value.toList()) + } else if let value = value as? PlatformTile { + super.writeByte(155) + super.writeValue(value.toList()) + } else if let value = value as? PlatformTileOverlay { + super.writeByte(156) + super.writeValue(value.toList()) + } else if let value = value as? PlatformEdgeInsets { + super.writeByte(157) + super.writeValue(value.toList()) + } else if let value = value as? PlatformLatLng { + super.writeByte(158) + super.writeValue(value.toList()) + } else if let value = value as? PlatformLatLngBounds { + super.writeByte(159) + super.writeValue(value.toList()) + } else if let value = value as? PlatformCameraTargetBounds { + super.writeByte(160) + super.writeValue(value.toList()) + } else if let value = value as? PlatformGroundOverlay { + super.writeByte(161) + super.writeValue(value.toList()) + } else if let value = value as? PlatformMapViewCreationParams { + super.writeByte(162) + super.writeValue(value.toList()) + } else if let value = value as? PlatformMapConfiguration { + super.writeByte(163) + super.writeValue(value.toList()) + } else if let value = value as? PlatformPoint { + super.writeByte(164) + super.writeValue(value.toList()) + } else if let value = value as? PlatformSize { + super.writeByte(165) + super.writeValue(value.toList()) + } else if let value = value as? PlatformColor { + super.writeByte(166) + super.writeValue(value.toList()) + } else if let value = value as? PlatformTileLayer { + super.writeByte(167) + super.writeValue(value.toList()) + } else if let value = value as? PlatformZoomRange { + super.writeByte(168) + super.writeValue(value.toList()) + } else if let value = value as? PlatformBitmapDefaultMarker { + super.writeByte(169) + super.writeValue(value.toList()) + } else if let value = value as? PlatformBitmapBytes { + super.writeByte(170) + super.writeValue(value.toList()) + } else if let value = value as? PlatformBitmapAsset { + super.writeByte(171) + super.writeValue(value.toList()) + } else if let value = value as? PlatformBitmapAssetImage { + super.writeByte(172) + super.writeValue(value.toList()) + } else if let value = value as? PlatformBitmapAssetMap { + super.writeByte(173) + super.writeValue(value.toList()) + } else if let value = value as? PlatformBitmapBytesMap { + super.writeByte(174) + super.writeValue(value.toList()) + } else if let value = value as? PlatformBitmapPinConfig { + super.writeByte(175) + super.writeValue(value.toList()) + } else { + super.writeValue(value) + } + } +} + +private class MessagesPigeonCodecReaderWriter: FlutterStandardReaderWriter { + override func reader(with data: Data) -> FlutterStandardReader { + return MessagesPigeonCodecReader(data: data) + } + + override func writer(with data: NSMutableData) -> FlutterStandardWriter { + return MessagesPigeonCodecWriter(data: data) + } +} + +class MessagesPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { + static let shared = MessagesPigeonCodec(readerWriter: MessagesPigeonCodecReaderWriter()) +} + +/// Interface for non-test interactions with the native SDK. +/// +/// For test-only state queries, see [MapsInspectorApi]. +/// +/// Generated protocol from Pigeon that represents a handler of messages from Flutter. +protocol MapsApi { + /// Returns once the map instance is available. + func waitForMap() throws + /// Updates the map's configuration options. + /// + /// Only non-null configuration values will result in updates; options with + /// null values will remain unchanged. + func updateWithMapConfiguration(_ configuration: PlatformMapConfiguration) throws + /// Updates the set of circles on the map. + func updateCircles( + adding toAdd: [PlatformCircle], changing toChange: [PlatformCircle], + removing idsToRemove: [String]) throws + /// Updates the set of heatmaps on the map. + func updateHeatmaps( + adding toAdd: [PlatformHeatmap], changing toChange: [PlatformHeatmap], + removing idsToRemove: [String]) throws + /// Updates the set of custer managers for clusters on the map. + func updateClusterManagers(adding toAdd: [PlatformClusterManager], removing idsToRemove: [String]) + throws + /// Updates the set of markers on the map. + func updateMarkers( + adding toAdd: [PlatformMarker], changing toChange: [PlatformMarker], + removing idsToRemove: [String]) throws + /// Updates the set of polygonss on the map. + func updatePolygons( + adding toAdd: [PlatformPolygon], changing toChange: [PlatformPolygon], + removing idsToRemove: [String]) throws + /// Updates the set of polylines on the map. + func updatePolylines( + adding toAdd: [PlatformPolyline], changing toChange: [PlatformPolyline], + removing idsToRemove: [String]) throws + /// Updates the set of tile overlays on the map. + func updateTileOverlays( + adding toAdd: [PlatformTileOverlay], changing toChange: [PlatformTileOverlay], + removing idsToRemove: [String]) throws + /// Updates the set of ground overlays on the map. + func updateGroundOverlays( + adding toAdd: [PlatformGroundOverlay], changing toChange: [PlatformGroundOverlay], + removing idsToRemove: [String]) throws + /// Gets the screen coordinate for the given map location. + func screenCoordinates(for latLng: PlatformLatLng) throws -> PlatformPoint + /// Gets the map location for the given screen coordinate. + func latLng(for screenCoordinate: PlatformPoint) throws -> PlatformLatLng + /// Gets the map region currently displayed on the map. + func visibleMapRegion() throws -> PlatformLatLngBounds + /// Moves the camera according to [cameraUpdate] immediately, with no + /// animation. + func moveCamera(_ cameraUpdate: PlatformCameraUpdate) throws + /// Moves the camera according to [cameraUpdate], animating the update using a + /// duration in milliseconds if provided. + func animateCamera(_ cameraUpdate: PlatformCameraUpdate, duration durationMilliseconds: Int64?) + throws + /// Gets the current map zoom level. + func zoomLevel() throws -> Double + /// Show the info window for the marker with the given ID. + func showInfoWindowForMarker(withIdentifier markerId: String) throws + /// Hide the info window for the marker with the given ID. + func hideInfoWindowForMarker(withIdentifier markerId: String) throws + /// Returns true if the marker with the given ID is currently displaying its + /// info window. + func isShowingInfoWindowForMarker(withIdentifier markerId: String) throws -> Bool + /// Sets the style to the given map style string, where an empty string + /// indicates that the style should be cleared. + /// + /// If there was an error setting the style, such as an invalid style string, + /// returns the error message. + func setStyle(_ style: String) throws -> String? + /// Returns the error string from the last attempt to set the map style, if + /// any. + /// + /// This allows checking asynchronously for initial style failures, as there + /// is no way to return failures from map initialization. + func lastStyleError() throws -> String? + /// Clears the cache of tiles previously requseted from the tile provider. + func clearTileCacheForOverlay(withIdentifier tileOverlayId: String) throws + /// Takes a snapshot of the map and returns its image data. + func takeSnapshot() throws -> FlutterStandardTypedData? + /// Returns true if the map supports advanced markers. + func isAdvancedMarkersAvailable() throws -> Bool +} + +/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. +class MapsApiSetup { + static var codec: FlutterStandardMessageCodec { MessagesPigeonCodec.shared } + /// Sets up an instance of `MapsApi` to handle messages through the `binaryMessenger`. + static func setUp( + binaryMessenger: FlutterBinaryMessenger, api: MapsApi?, messageChannelSuffix: String = "" + ) { + let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + /// Returns once the map instance is available. + let waitForMapChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.waitForMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + waitForMapChannel.setMessageHandler { _, reply in + do { + try api.waitForMap() + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + waitForMapChannel.setMessageHandler(nil) + } + /// Updates the map's configuration options. + /// + /// Only non-null configuration values will result in updates; options with + /// null values will remain unchanged. + let updateMapConfigurationChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateMapConfiguration\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateMapConfigurationChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let configurationArg = args[0] as! PlatformMapConfiguration + do { + try api.updateWithMapConfiguration(configurationArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updateMapConfigurationChannel.setMessageHandler(nil) + } + /// Updates the set of circles on the map. + let updateCirclesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateCircles\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateCirclesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformCircle] + let toChangeArg = args[1] as! [PlatformCircle] + let idsToRemoveArg = args[2] as! [String] + do { + try api.updateCircles(adding: toAddArg, changing: toChangeArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updateCirclesChannel.setMessageHandler(nil) + } + /// Updates the set of heatmaps on the map. + let updateHeatmapsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateHeatmaps\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateHeatmapsChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformHeatmap] + let toChangeArg = args[1] as! [PlatformHeatmap] + let idsToRemoveArg = args[2] as! [String] + do { + try api.updateHeatmaps(adding: toAddArg, changing: toChangeArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updateHeatmapsChannel.setMessageHandler(nil) + } + /// Updates the set of custer managers for clusters on the map. + let updateClusterManagersChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateClusterManagers\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateClusterManagersChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformClusterManager] + let idsToRemoveArg = args[1] as! [String] + do { + try api.updateClusterManagers(adding: toAddArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updateClusterManagersChannel.setMessageHandler(nil) + } + /// Updates the set of markers on the map. + let updateMarkersChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateMarkers\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateMarkersChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformMarker] + let toChangeArg = args[1] as! [PlatformMarker] + let idsToRemoveArg = args[2] as! [String] + do { + try api.updateMarkers(adding: toAddArg, changing: toChangeArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updateMarkersChannel.setMessageHandler(nil) + } + /// Updates the set of polygonss on the map. + let updatePolygonsChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updatePolygons\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updatePolygonsChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformPolygon] + let toChangeArg = args[1] as! [PlatformPolygon] + let idsToRemoveArg = args[2] as! [String] + do { + try api.updatePolygons(adding: toAddArg, changing: toChangeArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updatePolygonsChannel.setMessageHandler(nil) + } + /// Updates the set of polylines on the map. + let updatePolylinesChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updatePolylines\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updatePolylinesChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformPolyline] + let toChangeArg = args[1] as! [PlatformPolyline] + let idsToRemoveArg = args[2] as! [String] + do { + try api.updatePolylines(adding: toAddArg, changing: toChangeArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updatePolylinesChannel.setMessageHandler(nil) + } + /// Updates the set of tile overlays on the map. + let updateTileOverlaysChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateTileOverlays\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateTileOverlaysChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformTileOverlay] + let toChangeArg = args[1] as! [PlatformTileOverlay] + let idsToRemoveArg = args[2] as! [String] + do { + try api.updateTileOverlays( + adding: toAddArg, changing: toChangeArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updateTileOverlaysChannel.setMessageHandler(nil) + } + /// Updates the set of ground overlays on the map. + let updateGroundOverlaysChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateGroundOverlays\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + updateGroundOverlaysChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let toAddArg = args[0] as! [PlatformGroundOverlay] + let toChangeArg = args[1] as! [PlatformGroundOverlay] + let idsToRemoveArg = args[2] as! [String] + do { + try api.updateGroundOverlays( + adding: toAddArg, changing: toChangeArg, removing: idsToRemoveArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + updateGroundOverlaysChannel.setMessageHandler(nil) + } + /// Gets the screen coordinate for the given map location. + let getScreenCoordinateChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getScreenCoordinate\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getScreenCoordinateChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let latLngArg = args[0] as! PlatformLatLng + do { + let result = try api.screenCoordinates(for: latLngArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getScreenCoordinateChannel.setMessageHandler(nil) + } + /// Gets the map location for the given screen coordinate. + let getLatLngChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getLatLng\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getLatLngChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let screenCoordinateArg = args[0] as! PlatformPoint + do { + let result = try api.latLng(for: screenCoordinateArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getLatLngChannel.setMessageHandler(nil) + } + /// Gets the map region currently displayed on the map. + let getVisibleRegionChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getVisibleRegion\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getVisibleRegionChannel.setMessageHandler { _, reply in + do { + let result = try api.visibleMapRegion() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getVisibleRegionChannel.setMessageHandler(nil) + } + /// Moves the camera according to [cameraUpdate] immediately, with no + /// animation. + let moveCameraChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.moveCamera\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + moveCameraChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let cameraUpdateArg = args[0] as! PlatformCameraUpdate + do { + try api.moveCamera(cameraUpdateArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + moveCameraChannel.setMessageHandler(nil) + } + /// Moves the camera according to [cameraUpdate], animating the update using a + /// duration in milliseconds if provided. + let animateCameraChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.animateCamera\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + animateCameraChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let cameraUpdateArg = args[0] as! PlatformCameraUpdate + let durationMillisecondsArg: Int64? = nilOrValue(args[1]) + do { + try api.animateCamera(cameraUpdateArg, duration: durationMillisecondsArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + animateCameraChannel.setMessageHandler(nil) + } + /// Gets the current map zoom level. + let getZoomLevelChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getZoomLevel\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getZoomLevelChannel.setMessageHandler { _, reply in + do { + let result = try api.zoomLevel() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getZoomLevelChannel.setMessageHandler(nil) + } + /// Show the info window for the marker with the given ID. + let showInfoWindowChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.showInfoWindow\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + showInfoWindowChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let markerIdArg = args[0] as! String + do { + try api.showInfoWindowForMarker(withIdentifier: markerIdArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + showInfoWindowChannel.setMessageHandler(nil) + } + /// Hide the info window for the marker with the given ID. + let hideInfoWindowChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.hideInfoWindow\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + hideInfoWindowChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let markerIdArg = args[0] as! String + do { + try api.hideInfoWindowForMarker(withIdentifier: markerIdArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + hideInfoWindowChannel.setMessageHandler(nil) + } + /// Returns true if the marker with the given ID is currently displaying its + /// info window. + let isInfoWindowShownChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.isInfoWindowShown\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + isInfoWindowShownChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let markerIdArg = args[0] as! String + do { + let result = try api.isShowingInfoWindowForMarker(withIdentifier: markerIdArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + isInfoWindowShownChannel.setMessageHandler(nil) + } + /// Sets the style to the given map style string, where an empty string + /// indicates that the style should be cleared. + /// + /// If there was an error setting the style, such as an invalid style string, + /// returns the error message. + let setStyleChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.setStyle\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + setStyleChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let styleArg = args[0] as! String + do { + let result = try api.setStyle(styleArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + setStyleChannel.setMessageHandler(nil) + } + /// Returns the error string from the last attempt to set the map style, if + /// any. + /// + /// This allows checking asynchronously for initial style failures, as there + /// is no way to return failures from map initialization. + let getLastStyleErrorChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getLastStyleError\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getLastStyleErrorChannel.setMessageHandler { _, reply in + do { + let result = try api.lastStyleError() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getLastStyleErrorChannel.setMessageHandler(nil) + } + /// Clears the cache of tiles previously requseted from the tile provider. + let clearTileCacheChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.clearTileCache\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + clearTileCacheChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let tileOverlayIdArg = args[0] as! String + do { + try api.clearTileCacheForOverlay(withIdentifier: tileOverlayIdArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + clearTileCacheChannel.setMessageHandler(nil) + } + /// Takes a snapshot of the map and returns its image data. + let takeSnapshotChannel = FlutterBasicMessageChannel( + name: "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.takeSnapshot\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + takeSnapshotChannel.setMessageHandler { _, reply in + do { + let result = try api.takeSnapshot() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + takeSnapshotChannel.setMessageHandler(nil) + } + /// Returns true if the map supports advanced markers. + let isAdvancedMarkersAvailableChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.isAdvancedMarkersAvailable\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + isAdvancedMarkersAvailableChannel.setMessageHandler { _, reply in + do { + let result = try api.isAdvancedMarkersAvailable() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + isAdvancedMarkersAvailableChannel.setMessageHandler(nil) + } + } +} + +/// Interface for calls from the native SDK to Dart. +/// +/// Generated protocol from Pigeon that represents Flutter messages that can be called from Swift. +protocol MapsCallbackApiProtocol { + /// Called when the map camera starts moving. + func didStartCameraMove(completion: @escaping (Result) -> Void) + /// Called when the map camera moves. + func didMoveCamera( + to cameraPositionArg: PlatformCameraPosition, + completion: @escaping (Result) -> Void) + /// Called when the map camera stops moving. + func didIdleCamera(completion: @escaping (Result) -> Void) + /// Called when the map, not a specifc map object, is tapped. + func didTap( + at positionArg: PlatformLatLng, completion: @escaping (Result) -> Void) + /// Called when the map, not a specifc map object, is long pressed. + func didLongPress( + at positionArg: PlatformLatLng, completion: @escaping (Result) -> Void) + /// Called when a marker is tapped. + func didTapMarker( + withIdentifier markerIdArg: String, completion: @escaping (Result) -> Void) + /// Called when a marker drag starts. + func didStartDragForMarker( + withIdentifier markerIdArg: String, at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void) + /// Called when a marker drag updates. + func didDragMarker( + withIdentifier markerIdArg: String, at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void) + /// Called when a marker drag ends. + func didEndDragForMarker( + withIdentifier markerIdArg: String, at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void) + /// Called when a marker's info window is tapped. + func didTapInfoWindowOfMarker( + withIdentifier markerIdArg: String, completion: @escaping (Result) -> Void) + /// Called when a circle is tapped. + func didTapCircle( + withIdentifier circleIdArg: String, completion: @escaping (Result) -> Void) + /// Called when a marker cluster is tapped. + func didTapCluster( + _ clusterArg: PlatformCluster, completion: @escaping (Result) -> Void) + /// Called when a polygon is tapped. + func didTapPolygon( + withIdentifier polygonIdArg: String, completion: @escaping (Result) -> Void) + /// Called when a polyline is tapped. + func didTapPolyline( + withIdentifier polylineIdArg: String, completion: @escaping (Result) -> Void) + /// Called when a ground overlay is tapped. + func didTapGroundOverlay( + withIdentifier groundOverlayIdArg: String, + completion: @escaping (Result) -> Void) + /// Called to get data for a map tile. + func tile( + withOverlayIdentifier tileOverlayIdArg: String, location locationArg: PlatformPoint, + zoom zoomArg: Int64, completion: @escaping (Result) -> Void) +} +class MapsCallbackApi: MapsCallbackApiProtocol { + private let binaryMessenger: FlutterBinaryMessenger + private let messageChannelSuffix: String + init(binaryMessenger: FlutterBinaryMessenger, messageChannelSuffix: String = "") { + self.binaryMessenger = binaryMessenger + self.messageChannelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + } + var codec: MessagesPigeonCodec { + return MessagesPigeonCodec.shared + } + /// Called when the map camera starts moving. + func didStartCameraMove(completion: @escaping (Result) -> Void) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCameraMoveStarted\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage(nil) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when the map camera moves. + func didMoveCamera( + to cameraPositionArg: PlatformCameraPosition, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCameraMove\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([cameraPositionArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when the map camera stops moving. + func didIdleCamera(completion: @escaping (Result) -> Void) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCameraIdle\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage(nil) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when the map, not a specifc map object, is tapped. + func didTap( + at positionArg: PlatformLatLng, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([positionArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when the map, not a specifc map object, is long pressed. + func didLongPress( + at positionArg: PlatformLatLng, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onLongPress\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([positionArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a marker is tapped. + func didTapMarker( + withIdentifier markerIdArg: String, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([markerIdArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a marker drag starts. + func didStartDragForMarker( + withIdentifier markerIdArg: String, at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDragStart\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([markerIdArg, positionArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a marker drag updates. + func didDragMarker( + withIdentifier markerIdArg: String, at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDrag\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([markerIdArg, positionArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a marker drag ends. + func didEndDragForMarker( + withIdentifier markerIdArg: String, at positionArg: PlatformLatLng, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDragEnd\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([markerIdArg, positionArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a marker's info window is tapped. + func didTapInfoWindowOfMarker( + withIdentifier markerIdArg: String, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onInfoWindowTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([markerIdArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a circle is tapped. + func didTapCircle( + withIdentifier circleIdArg: String, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCircleTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([circleIdArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a marker cluster is tapped. + func didTapCluster( + _ clusterArg: PlatformCluster, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onClusterTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([clusterArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a polygon is tapped. + func didTapPolygon( + withIdentifier polygonIdArg: String, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onPolygonTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([polygonIdArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a polyline is tapped. + func didTapPolyline( + withIdentifier polylineIdArg: String, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onPolylineTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([polylineIdArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called when a ground overlay is tapped. + func didTapGroundOverlay( + withIdentifier groundOverlayIdArg: String, + completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onGroundOverlayTap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([groundOverlayIdArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + completion(.success(())) + } + } + } + /// Called to get data for a map tile. + func tile( + withOverlayIdentifier tileOverlayIdArg: String, location locationArg: PlatformPoint, + zoom zoomArg: Int64, completion: @escaping (Result) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.getTileOverlayTile\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([tileOverlayIdArg, locationArg, zoomArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! PlatformTile + completion(.success(result)) + } + } + } +} +/// Dummy interface to force generation of the platform view creation params, +/// which are not used in any Pigeon calls, only the platform view creation +/// call made internally by Flutter. +/// +/// Generated protocol from Pigeon that represents a handler of messages from Flutter. +protocol MapsPlatformViewApi { + func createView(type: PlatformMapViewCreationParams?) throws +} + +/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. +class MapsPlatformViewApiSetup { + static var codec: FlutterStandardMessageCodec { MessagesPigeonCodec.shared } + /// Sets up an instance of `MapsPlatformViewApi` to handle messages through the `binaryMessenger`. + static func setUp( + binaryMessenger: FlutterBinaryMessenger, api: MapsPlatformViewApi?, + messageChannelSuffix: String = "" + ) { + let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + let createViewChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsPlatformViewApi.createView\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + createViewChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let typeArg: PlatformMapViewCreationParams? = nilOrValue(args[0]) + do { + try api.createView(type: typeArg) + reply(wrapResult(nil)) + } catch { + reply(wrapError(error)) + } + } + } else { + createViewChannel.setMessageHandler(nil) + } + } +} +/// Inspector API only intended for use in integration tests. +/// +/// Generated protocol from Pigeon that represents a handler of messages from Flutter. +protocol MapsInspectorApi { + func areBuildingsEnabled() throws -> Bool + func areRotateGesturesEnabled() throws -> Bool + func areScrollGesturesEnabled() throws -> Bool + func areTiltGesturesEnabled() throws -> Bool + func areZoomGesturesEnabled() throws -> Bool + func isCompassEnabled() throws -> Bool + func isMyLocationButtonEnabled() throws -> Bool + func isTrafficEnabled() throws -> Bool + func tileOverlay(withIdentifier tileOverlayId: String) throws -> PlatformTileLayer? + func groundOverlay(withIdentifier groundOverlayId: String) throws -> PlatformGroundOverlay? + func heatmap(withIdentifier heatmapId: String) throws -> PlatformHeatmap? + func zoomRange() throws -> PlatformZoomRange + func clusters(withIdentifier clusterManagerId: String) throws -> [PlatformCluster] + func cameraPosition() throws -> PlatformCameraPosition +} + +/// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. +class MapsInspectorApiSetup { + static var codec: FlutterStandardMessageCodec { MessagesPigeonCodec.shared } + /// Sets up an instance of `MapsInspectorApi` to handle messages through the `binaryMessenger`. + static func setUp( + binaryMessenger: FlutterBinaryMessenger, api: MapsInspectorApi?, + messageChannelSuffix: String = "" + ) { + let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" + let areBuildingsEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areBuildingsEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + areBuildingsEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.areBuildingsEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + areBuildingsEnabledChannel.setMessageHandler(nil) + } + let areRotateGesturesEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areRotateGesturesEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + areRotateGesturesEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.areRotateGesturesEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + areRotateGesturesEnabledChannel.setMessageHandler(nil) + } + let areScrollGesturesEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areScrollGesturesEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + areScrollGesturesEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.areScrollGesturesEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + areScrollGesturesEnabledChannel.setMessageHandler(nil) + } + let areTiltGesturesEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areTiltGesturesEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + areTiltGesturesEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.areTiltGesturesEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + areTiltGesturesEnabledChannel.setMessageHandler(nil) + } + let areZoomGesturesEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.areZoomGesturesEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + areZoomGesturesEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.areZoomGesturesEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + areZoomGesturesEnabledChannel.setMessageHandler(nil) + } + let isCompassEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.isCompassEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + isCompassEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.isCompassEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + isCompassEnabledChannel.setMessageHandler(nil) + } + let isMyLocationButtonEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.isMyLocationButtonEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + isMyLocationButtonEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.isMyLocationButtonEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + isMyLocationButtonEnabledChannel.setMessageHandler(nil) + } + let isTrafficEnabledChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.isTrafficEnabled\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + isTrafficEnabledChannel.setMessageHandler { _, reply in + do { + let result = try api.isTrafficEnabled() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + isTrafficEnabledChannel.setMessageHandler(nil) + } + let getTileOverlayInfoChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getTileOverlayInfo\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getTileOverlayInfoChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let tileOverlayIdArg = args[0] as! String + do { + let result = try api.tileOverlay(withIdentifier: tileOverlayIdArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getTileOverlayInfoChannel.setMessageHandler(nil) + } + let getGroundOverlayInfoChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getGroundOverlayInfo\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getGroundOverlayInfoChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let groundOverlayIdArg = args[0] as! String + do { + let result = try api.groundOverlay(withIdentifier: groundOverlayIdArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getGroundOverlayInfoChannel.setMessageHandler(nil) + } + let getHeatmapInfoChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getHeatmapInfo\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getHeatmapInfoChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let heatmapIdArg = args[0] as! String + do { + let result = try api.heatmap(withIdentifier: heatmapIdArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getHeatmapInfoChannel.setMessageHandler(nil) + } + let getZoomRangeChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getZoomRange\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getZoomRangeChannel.setMessageHandler { _, reply in + do { + let result = try api.zoomRange() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getZoomRangeChannel.setMessageHandler(nil) + } + let getClustersChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getClusters\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getClustersChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let clusterManagerIdArg = args[0] as! String + do { + let result = try api.clusters(withIdentifier: clusterManagerIdArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getClustersChannel.setMessageHandler(nil) + } + let getCameraPositionChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.google_maps_flutter_ios.MapsInspectorApi.getCameraPosition\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + getCameraPositionChannel.setMessageHandler { _, reply in + do { + let result = try api.cameraPosition() + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + getCameraPositionChannel.setMessageHandler(nil) + } + } +} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/PolygonController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/PolygonController.swift index 8e643a904002..40d771fbbea5 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/PolygonController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/PolygonController.swift @@ -4,12 +4,8 @@ import GoogleMaps -#if canImport(google_maps_flutter_ios_objc) - import google_maps_flutter_ios_objc -#endif - /// Defines polygon controllable by Flutter. -class PolygonController: NSObject { +class PolygonController { let polygon: GMSPolygon private weak var mapView: GMSMapView? @@ -17,27 +13,28 @@ class PolygonController: NSObject { self.polygon = GMSPolygon() self.mapView = mapView self.polygon.userData = [identifier] - super.init() } func removePolygon() { polygon.map = nil } - /// Updates the controller's polygon with the properties from a FGMPlatformPolygon. + /// Updates the controller's polygon with the properties from a PlatformPolygon. /// /// Setting the polygon to visible will set its map to the controller's mapView. - func update(from platformPolygon: FGMPlatformPolygon) { + func update(from platformPolygon: PlatformPolygon) { if let mapView = mapView { PolygonController.update(polygon, from: platformPolygon, with: mapView) } } - /// Updates the given GMSPolygon with the properties from a FGMPlatformPolygon. + /// Updates the given GMSPolygon with the properties from a PlatformPolygon. /// /// Setting the polygon to visible will set its map to the given mapView. static func update( - _ polygon: GMSPolygon, from platformPolygon: FGMPlatformPolygon, with mapView: GMSMapView + _ polygon: GMSPolygon, + from platformPolygon: PlatformPolygon, + with mapView: GMSMapView ) { polygon.isTappable = platformPolygon.consumesTapEvents polygon.zIndex = Int32(platformPolygon.zIndex) @@ -54,7 +51,7 @@ class PolygonController: NSObject { } } -class PolygonsController: NSObject { +class PolygonsController { private var polygonIdentifierToController: [String: PolygonController] = [:] private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? @@ -62,10 +59,9 @@ class PolygonsController: NSObject { init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate - super.init() } - func add(_ polygons: [FGMPlatformPolygon]) { + func add(_ polygons: [PlatformPolygon]) { guard let mapView = mapView else { return } for polygon in polygons { let identifier = polygon.polygonId @@ -77,7 +73,7 @@ class PolygonsController: NSObject { } } - func change(_ polygons: [FGMPlatformPolygon]) { + func change(_ polygons: [PlatformPolygon]) { for polygon in polygons { let identifier = polygon.polygonId polygonIdentifierToController[identifier]?.update(from: polygon) @@ -95,7 +91,7 @@ class PolygonsController: NSObject { func didTapPolygon(withIdentifier identifier: String) { if hasPolygon(withIdentifier: identifier) { - eventDelegate?.didTapPolygon(withIdentifier: identifier) + eventDelegate?.didTapPolygon(withIdentifier: identifier) { _ in } } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/PolylineController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/PolylineController.swift index db7e3fc02715..9b00b37f34ee 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/PolylineController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/PolylineController.swift @@ -4,12 +4,8 @@ import GoogleMaps -#if canImport(google_maps_flutter_ios_objc) - import google_maps_flutter_ios_objc -#endif - /// Defines polyline controllable by Flutter. -class PolylineController: NSObject { +class PolylineController { let polyline: GMSPolyline private weak var mapView: GMSMapView? @@ -17,27 +13,28 @@ class PolylineController: NSObject { self.polyline = GMSPolyline() self.mapView = mapView self.polyline.userData = [identifier] - super.init() } func removePolyline() { polyline.map = nil } - /// Updates the controller's polyline with the properties from a FGMPlatformPolyline. + /// Updates the controller's polyline with the properties from a PlatformPolyline. /// /// Setting the polyline to visible will set its map to the controller's mapView. - func update(from platformPolyline: FGMPlatformPolyline) { + func update(from platformPolyline: PlatformPolyline) { if let mapView = mapView { PolylineController.update(polyline, from: platformPolyline, with: mapView) } } - /// Updates the given GMSPolyline with the properties from a FGMPlatformPolyline. + /// Updates the given GMSPolyline with the properties from a PlatformPolyline. /// /// Setting the polyline to visible will set its map to the given mapView. static func update( - _ polyline: GMSPolyline, from platformPolyline: FGMPlatformPolyline, with mapView: GMSMapView + _ polyline: GMSPolyline, + from platformPolyline: PlatformPolyline, + with mapView: GMSMapView ) { polyline.isTappable = platformPolyline.consumesTapEvents polyline.zIndex = Int32(platformPolyline.zIndex) @@ -59,7 +56,7 @@ class PolylineController: NSObject { } } -class PolylinesController: NSObject { +class PolylinesController { private var polylineIdentifierToController: [String: PolylineController] = [:] private weak var eventDelegate: MapEventDelegate? private weak var mapView: GMSMapView? @@ -67,10 +64,9 @@ class PolylinesController: NSObject { init(mapView: GMSMapView, eventDelegate: MapEventDelegate) { self.mapView = mapView self.eventDelegate = eventDelegate - super.init() } - func add(_ polylines: [FGMPlatformPolyline]) { + func add(_ polylines: [PlatformPolyline]) { guard let mapView = mapView else { return } for polyline in polylines { let identifier = polyline.polylineId @@ -82,7 +78,7 @@ class PolylinesController: NSObject { } } - func change(_ polylines: [FGMPlatformPolyline]) { + func change(_ polylines: [PlatformPolyline]) { for polyline in polylines { let identifier = polyline.polylineId polylineIdentifierToController[identifier]?.update(from: polyline) @@ -100,7 +96,7 @@ class PolylinesController: NSObject { func didTapPolyline(withIdentifier identifier: String) { if hasPolyline(withIdentifier: identifier) { - eventDelegate?.didTapPolyline(withIdentifier: identifier) + eventDelegate?.didTapPolyline(withIdentifier: identifier) { _ in } } } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/TileOverlayController.swift b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/TileOverlayController.swift index c45ea4c2c01d..3dc37d4314ae 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/TileOverlayController.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/TileOverlayController.swift @@ -6,31 +6,24 @@ import Flutter import GoogleMaps import UIKit -#if canImport(google_maps_flutter_ios_objc) - import google_maps_flutter_ios_objc -#endif - /// Protocol for requesting tiles from the Dart side. -// TODO(stuartmorgan): Adjust this to match the Swift API once the Pigeon -// generation is switched to Swift. protocol TileProviderDelegate: AnyObject { func tile( withOverlayIdentifier tileOverlayId: String, - location: FGMPlatformPoint, - zoom: Int, - completion: @escaping (FGMPlatformTile?, FlutterError?) -> Void + location: PlatformPoint, + zoom: Int64, + completion: @escaping (Result) -> Void ) } /// Controller of a single tile overlay on the map. -class TileOverlayController: NSObject { +class TileOverlayController { let layer: GMSTileLayer private weak var mapView: GMSMapView? - init(tileOverlay: FGMPlatformTileOverlay, tileLayer: GMSTileLayer, mapView: GMSMapView) { + init(tileOverlay: PlatformTileOverlay, tileLayer: GMSTileLayer, mapView: GMSMapView) { self.layer = tileLayer self.mapView = mapView - super.init() TileOverlayController.update(tileLayer, from: tileOverlay, with: mapView) } @@ -42,21 +35,21 @@ class TileOverlayController: NSObject { layer.clearTileCache() } - /// Updates the controller's tile overlay with the properties from a FGMPlatformTileOverlay. + /// Updates the controller's tile overlay with the properties from a PlatformTileOverlay. /// /// Setting the tile overlay to visible will set its map to the controller's mapView. - func update(from overlay: FGMPlatformTileOverlay) { + func update(from overlay: PlatformTileOverlay) { if let mapView = mapView { TileOverlayController.update(layer, from: overlay, with: mapView) } } - /// Updates the given GMSTileLayer with the properties from a FGMPlatformTileOverlay. + /// Updates the given GMSTileLayer with the properties from a PlatformTileOverlay. /// /// Setting the tile overlay to visible will set its map to the given mapView. static func update( _ tileLayer: GMSTileLayer, - from platformOverlay: FGMPlatformTileOverlay, + from platformOverlay: PlatformTileOverlay, with mapView: GMSMapView ) { tileLayer.opacity = Float(1.0 - platformOverlay.transparency) @@ -121,21 +114,20 @@ class TileProviderController: GMSTileLayer { } tileProviderDelegate.tile( withOverlayIdentifier: self.tileOverlayIdentifier, - location: FGMPlatformPoint.makeWith(x: Double(x), y: Double(y)), - zoom: Int(zoom) - ) { [weak self] tile, error in + location: PlatformPoint(x: Double(x), y: Double(y)), + zoom: Int64(zoom) + ) { [weak self] result in guard let self = self else { receiver.receiveTileWith(x: x, y: y, zoom: zoom, image: kGMSTileLayerNoTile) return } - let typedData = tile?.data - let tileImage: UIImage - if let data = typedData?.data { - tileImage = self.handleResultTile(UIImage(data: data)) ?? kGMSTileLayerNoTile - } else { - tileImage = kGMSTileLayerNoTile - } - if let error = error { + var tileImage = kGMSTileLayerNoTile + switch result { + case .success(let tile): + if let data = tile.data?.data { + tileImage = self.handleResultTile(UIImage(data: data)) ?? kGMSTileLayerNoTile + } + case .failure(let error): NSLog( "Can't get tile: errorCode = \(error.code), errorMessage = \(error.message ?? "nil"), details = \(error.details ?? "nil")" ) @@ -147,7 +139,7 @@ class TileProviderController: GMSTileLayer { } /// Controller of multiple tile overlays on the map. -class TileOverlaysController: NSObject { +class TileOverlaysController { private var tileOverlayIdentifierToController: [String: TileOverlayController] = [:] private weak var tileProviderDelegate: TileProviderDelegate? private weak var mapView: GMSMapView? @@ -155,10 +147,9 @@ class TileOverlaysController: NSObject { init(mapView: GMSMapView, tileProvider: TileProviderDelegate) { self.mapView = mapView self.tileProviderDelegate = tileProvider - super.init() } - func add(_ tileOverlaysToAdd: [FGMPlatformTileOverlay]) { + func add(_ tileOverlaysToAdd: [PlatformTileOverlay]) { guard let mapView = mapView, let tileProviderDelegate = tileProviderDelegate else { return } for tileOverlay in tileOverlaysToAdd { let identifier = tileOverlay.tileOverlayId @@ -175,7 +166,7 @@ class TileOverlaysController: NSObject { } } - func change(_ tileOverlaysToChange: [FGMPlatformTileOverlay]) { + func change(_ tileOverlaysToChange: [PlatformTileOverlay]) { for tileOverlay in tileOverlaysToChange { let identifier = tileOverlay.tileOverlayId tileOverlayIdentifierToController[identifier]?.update(from: tileOverlay) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/google_maps_flutter_pigeon_messages.g.m b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/google_maps_flutter_pigeon_messages.g.m deleted file mode 100644 index 205bc2a3ccad..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/google_maps_flutter_pigeon_messages.g.m +++ /dev/null @@ -1,4849 +0,0 @@ -// Copyright 2013 The Flutter Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// Autogenerated from Pigeon (v27.3.2), do not edit directly. -// See also: https://pub.dev/packages/pigeon - -#import "google_maps_flutter_pigeon_messages.g.h" - -#if TARGET_OS_OSX -@import FlutterMacOS; -#else -@import Flutter; -#endif - -static BOOL __attribute__((unused)) FLTPigeonDeepEquals(id _Nullable a, id _Nullable b) { - if (a == b) { - return YES; - } - if (a == nil) { - return b == [NSNull null]; - } - if (b == nil) { - return a == [NSNull null]; - } - if ([a isKindOfClass:[NSNumber class]] && [b isKindOfClass:[NSNumber class]]) { - return - [a isEqual:b] || (isnan([(NSNumber *)a doubleValue]) && isnan([(NSNumber *)b doubleValue])); - } - if ([a isKindOfClass:[NSArray class]] && [b isKindOfClass:[NSArray class]]) { - NSArray *arrayA = (NSArray *)a; - NSArray *arrayB = (NSArray *)b; - if (arrayA.count != arrayB.count) { - return NO; - } - for (NSUInteger i = 0; i < arrayA.count; i++) { - if (!FLTPigeonDeepEquals(arrayA[i], arrayB[i])) { - return NO; - } - } - return YES; - } - if ([a isKindOfClass:[NSDictionary class]] && [b isKindOfClass:[NSDictionary class]]) { - NSDictionary *dictA = (NSDictionary *)a; - NSDictionary *dictB = (NSDictionary *)b; - if (dictA.count != dictB.count) { - return NO; - } - for (id keyA in dictA) { - id valueA = dictA[keyA]; - BOOL found = NO; - for (id keyB in dictB) { - if (FLTPigeonDeepEquals(keyA, keyB)) { - id valueB = dictB[keyB]; - if (FLTPigeonDeepEquals(valueA, valueB)) { - found = YES; - break; - } else { - return NO; - } - } - } - if (!found) { - return NO; - } - } - return YES; - } - return [a isEqual:b]; -} - -static NSUInteger __attribute__((unused)) FLTPigeonDeepHash(id _Nullable value) { - if (value == nil || value == (id)[NSNull null]) { - return 0; - } - if ([value isKindOfClass:[NSNumber class]]) { - NSNumber *n = (NSNumber *)value; - double d = n.doubleValue; - if (isnan(d)) { - // Normalize NaN to a consistent hash. - return (NSUInteger)0x7FF8000000000000; - } - if (d == 0.0) { - // Normalize -0.0 to 0.0 so they have the same hash code. - d = 0.0; - } - return @(d).hash; - } - if ([value isKindOfClass:[NSArray class]]) { - NSUInteger result = 1; - for (id item in (NSArray *)value) { - result = result * 31 + FLTPigeonDeepHash(item); - } - return result; - } - if ([value isKindOfClass:[NSDictionary class]]) { - NSUInteger result = 0; - NSDictionary *dict = (NSDictionary *)value; - for (id key in dict) { - result += ((FLTPigeonDeepHash(key) * 31) ^ FLTPigeonDeepHash(dict[key])); - } - return result; - } - return [value hash]; -} - -static NSArray *wrapResult(id result, FlutterError *error) { - if (error) { - return @[ - error.code ?: [NSNull null], error.message ?: [NSNull null], error.details ?: [NSNull null] - ]; - } - return @[ result ?: [NSNull null] ]; -} - -static FlutterError *createConnectionError(NSString *channelName) { - return [FlutterError - errorWithCode:@"channel-error" - message:[NSString stringWithFormat:@"%@/%@/%@", - @"Unable to establish connection on channel: '", - channelName, @"'."] - details:@""]; -} - -static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { - id result = array[key]; - return (result == [NSNull null]) ? nil : result; -} - -/// Pigeon equivalent of MapType -@implementation FGMPlatformMapTypeBox -- (instancetype)initWithValue:(FGMPlatformMapType)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Pigeon equivalent of the MarkerCollisionBehavior enum. -@implementation FGMPlatformMarkerCollisionBehaviorBox -- (instancetype)initWithValue:(FGMPlatformMarkerCollisionBehavior)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Join types for polyline joints. -@implementation FGMPlatformJointTypeBox -- (instancetype)initWithValue:(FGMPlatformJointType)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Enumeration of possible types for PatternItem. -@implementation FGMPlatformPatternItemTypeBox -- (instancetype)initWithValue:(FGMPlatformPatternItemType)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -@implementation FGMPlatformMarkerTypeBox -- (instancetype)initWithValue:(FGMPlatformMarkerType)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -/// Pigeon equivalent of [MapBitmapScaling]. -@implementation FGMPlatformMapBitmapScalingBox -- (instancetype)initWithValue:(FGMPlatformMapBitmapScaling)value { - self = [super init]; - if (self) { - _value = value; - } - return self; -} -@end - -@interface FGMPlatformCameraPosition () -+ (FGMPlatformCameraPosition *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraPosition *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdate () -+ (FGMPlatformCameraUpdate *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdate *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateNewCameraPosition () -+ (FGMPlatformCameraUpdateNewCameraPosition *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateNewCameraPosition *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateNewLatLng () -+ (FGMPlatformCameraUpdateNewLatLng *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateNewLatLng *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateNewLatLngBounds () -+ (FGMPlatformCameraUpdateNewLatLngBounds *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateNewLatLngBounds *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateNewLatLngZoom () -+ (FGMPlatformCameraUpdateNewLatLngZoom *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateNewLatLngZoom *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateScrollBy () -+ (FGMPlatformCameraUpdateScrollBy *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateScrollBy *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateZoomBy () -+ (FGMPlatformCameraUpdateZoomBy *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateZoomBy *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateZoom () -+ (FGMPlatformCameraUpdateZoom *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateZoom *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraUpdateZoomTo () -+ (FGMPlatformCameraUpdateZoomTo *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraUpdateZoomTo *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCircle () -+ (FGMPlatformCircle *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCircle *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformHeatmap () -+ (FGMPlatformHeatmap *)fromList:(NSArray *)list; -+ (nullable FGMPlatformHeatmap *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformHeatmapGradient () -+ (FGMPlatformHeatmapGradient *)fromList:(NSArray *)list; -+ (nullable FGMPlatformHeatmapGradient *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformWeightedLatLng () -+ (FGMPlatformWeightedLatLng *)fromList:(NSArray *)list; -+ (nullable FGMPlatformWeightedLatLng *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformInfoWindow () -+ (FGMPlatformInfoWindow *)fromList:(NSArray *)list; -+ (nullable FGMPlatformInfoWindow *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCluster () -+ (FGMPlatformCluster *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCluster *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformClusterManager () -+ (FGMPlatformClusterManager *)fromList:(NSArray *)list; -+ (nullable FGMPlatformClusterManager *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformMarker () -+ (FGMPlatformMarker *)fromList:(NSArray *)list; -+ (nullable FGMPlatformMarker *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformPolygon () -+ (FGMPlatformPolygon *)fromList:(NSArray *)list; -+ (nullable FGMPlatformPolygon *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformPolyline () -+ (FGMPlatformPolyline *)fromList:(NSArray *)list; -+ (nullable FGMPlatformPolyline *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformPatternItem () -+ (FGMPlatformPatternItem *)fromList:(NSArray *)list; -+ (nullable FGMPlatformPatternItem *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformTile () -+ (FGMPlatformTile *)fromList:(NSArray *)list; -+ (nullable FGMPlatformTile *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformTileOverlay () -+ (FGMPlatformTileOverlay *)fromList:(NSArray *)list; -+ (nullable FGMPlatformTileOverlay *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformEdgeInsets () -+ (FGMPlatformEdgeInsets *)fromList:(NSArray *)list; -+ (nullable FGMPlatformEdgeInsets *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformLatLng () -+ (FGMPlatformLatLng *)fromList:(NSArray *)list; -+ (nullable FGMPlatformLatLng *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformLatLngBounds () -+ (FGMPlatformLatLngBounds *)fromList:(NSArray *)list; -+ (nullable FGMPlatformLatLngBounds *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformCameraTargetBounds () -+ (FGMPlatformCameraTargetBounds *)fromList:(NSArray *)list; -+ (nullable FGMPlatformCameraTargetBounds *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformGroundOverlay () -+ (FGMPlatformGroundOverlay *)fromList:(NSArray *)list; -+ (nullable FGMPlatformGroundOverlay *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformMapViewCreationParams () -+ (FGMPlatformMapViewCreationParams *)fromList:(NSArray *)list; -+ (nullable FGMPlatformMapViewCreationParams *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformMapConfiguration () -+ (FGMPlatformMapConfiguration *)fromList:(NSArray *)list; -+ (nullable FGMPlatformMapConfiguration *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformPoint () -+ (FGMPlatformPoint *)fromList:(NSArray *)list; -+ (nullable FGMPlatformPoint *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformSize () -+ (FGMPlatformSize *)fromList:(NSArray *)list; -+ (nullable FGMPlatformSize *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformColor () -+ (FGMPlatformColor *)fromList:(NSArray *)list; -+ (nullable FGMPlatformColor *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformTileLayer () -+ (FGMPlatformTileLayer *)fromList:(NSArray *)list; -+ (nullable FGMPlatformTileLayer *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformZoomRange () -+ (FGMPlatformZoomRange *)fromList:(NSArray *)list; -+ (nullable FGMPlatformZoomRange *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmap () -+ (FGMPlatformBitmap *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmap *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmapDefaultMarker () -+ (FGMPlatformBitmapDefaultMarker *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmapDefaultMarker *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmapBytes () -+ (FGMPlatformBitmapBytes *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmapBytes *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmapAsset () -+ (FGMPlatformBitmapAsset *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmapAsset *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmapAssetImage () -+ (FGMPlatformBitmapAssetImage *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmapAssetImage *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmapAssetMap () -+ (FGMPlatformBitmapAssetMap *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmapAssetMap *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmapBytesMap () -+ (FGMPlatformBitmapBytesMap *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmapBytesMap *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@interface FGMPlatformBitmapPinConfig () -+ (FGMPlatformBitmapPinConfig *)fromList:(NSArray *)list; -+ (nullable FGMPlatformBitmapPinConfig *)nullableFromList:(NSArray *)list; -- (NSArray *)toList; -@end - -@implementation FGMPlatformCameraPosition -+ (instancetype)makeWithBearing:(double)bearing - target:(FGMPlatformLatLng *)target - tilt:(double)tilt - zoom:(double)zoom { - FGMPlatformCameraPosition *pigeonResult = [[FGMPlatformCameraPosition alloc] init]; - pigeonResult.bearing = bearing; - pigeonResult.target = target; - pigeonResult.tilt = tilt; - pigeonResult.zoom = zoom; - return pigeonResult; -} -+ (FGMPlatformCameraPosition *)fromList:(NSArray *)list { - FGMPlatformCameraPosition *pigeonResult = [[FGMPlatformCameraPosition alloc] init]; - pigeonResult.bearing = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.target = GetNullableObjectAtIndex(list, 1); - pigeonResult.tilt = [GetNullableObjectAtIndex(list, 2) doubleValue]; - pigeonResult.zoom = [GetNullableObjectAtIndex(list, 3) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformCameraPosition *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraPosition fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.bearing), - self.target ?: [NSNull null], - @(self.tilt), - @(self.zoom), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraPosition *other = (FGMPlatformCameraPosition *)object; - return (self.bearing == other.bearing || (isnan(self.bearing) && isnan(other.bearing))) && - FLTPigeonDeepEquals(self.target, other.target) && - (self.tilt == other.tilt || (isnan(self.tilt) && isnan(other.tilt))) && - (self.zoom == other.zoom || (isnan(self.zoom) && isnan(other.zoom))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = - result * 31 + (isnan(self.bearing) ? (NSUInteger)0x7FF8000000000000 : @(self.bearing).hash); - result = result * 31 + FLTPigeonDeepHash(self.target); - result = result * 31 + (isnan(self.tilt) ? (NSUInteger)0x7FF8000000000000 : @(self.tilt).hash); - result = result * 31 + (isnan(self.zoom) ? (NSUInteger)0x7FF8000000000000 : @(self.zoom).hash); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformCameraPosition(bearing: %f, target: %@, tilt: %f, zoom: %f)", - self.bearing, self.target, self.tilt, self.zoom]; -} -@end - -@implementation FGMPlatformCameraUpdate -+ (instancetype)makeWithCameraUpdate:(id)cameraUpdate { - FGMPlatformCameraUpdate *pigeonResult = [[FGMPlatformCameraUpdate alloc] init]; - pigeonResult.cameraUpdate = cameraUpdate; - return pigeonResult; -} -+ (FGMPlatformCameraUpdate *)fromList:(NSArray *)list { - FGMPlatformCameraUpdate *pigeonResult = [[FGMPlatformCameraUpdate alloc] init]; - pigeonResult.cameraUpdate = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdate *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdate fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.cameraUpdate ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdate *other = (FGMPlatformCameraUpdate *)object; - return FLTPigeonDeepEquals(self.cameraUpdate, other.cameraUpdate); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.cameraUpdate); - return result; -} -- (NSString *)description { - return - [NSString stringWithFormat:@"FGMPlatformCameraUpdate(cameraUpdate: %@)", self.cameraUpdate]; -} -@end - -@implementation FGMPlatformCameraUpdateNewCameraPosition -+ (instancetype)makeWithCameraPosition:(FGMPlatformCameraPosition *)cameraPosition { - FGMPlatformCameraUpdateNewCameraPosition *pigeonResult = - [[FGMPlatformCameraUpdateNewCameraPosition alloc] init]; - pigeonResult.cameraPosition = cameraPosition; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateNewCameraPosition *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateNewCameraPosition *pigeonResult = - [[FGMPlatformCameraUpdateNewCameraPosition alloc] init]; - pigeonResult.cameraPosition = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateNewCameraPosition *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateNewCameraPosition fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.cameraPosition ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateNewCameraPosition *other = - (FGMPlatformCameraUpdateNewCameraPosition *)object; - return FLTPigeonDeepEquals(self.cameraPosition, other.cameraPosition); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.cameraPosition); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformCameraUpdateNewCameraPosition(cameraPosition: %@)", - self.cameraPosition]; -} -@end - -@implementation FGMPlatformCameraUpdateNewLatLng -+ (instancetype)makeWithLatLng:(FGMPlatformLatLng *)latLng { - FGMPlatformCameraUpdateNewLatLng *pigeonResult = [[FGMPlatformCameraUpdateNewLatLng alloc] init]; - pigeonResult.latLng = latLng; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateNewLatLng *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateNewLatLng *pigeonResult = [[FGMPlatformCameraUpdateNewLatLng alloc] init]; - pigeonResult.latLng = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateNewLatLng *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateNewLatLng fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.latLng ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateNewLatLng *other = (FGMPlatformCameraUpdateNewLatLng *)object; - return FLTPigeonDeepEquals(self.latLng, other.latLng); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.latLng); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformCameraUpdateNewLatLng(latLng: %@)", self.latLng]; -} -@end - -@implementation FGMPlatformCameraUpdateNewLatLngBounds -+ (instancetype)makeWithBounds:(FGMPlatformLatLngBounds *)bounds padding:(double)padding { - FGMPlatformCameraUpdateNewLatLngBounds *pigeonResult = - [[FGMPlatformCameraUpdateNewLatLngBounds alloc] init]; - pigeonResult.bounds = bounds; - pigeonResult.padding = padding; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateNewLatLngBounds *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateNewLatLngBounds *pigeonResult = - [[FGMPlatformCameraUpdateNewLatLngBounds alloc] init]; - pigeonResult.bounds = GetNullableObjectAtIndex(list, 0); - pigeonResult.padding = [GetNullableObjectAtIndex(list, 1) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateNewLatLngBounds *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateNewLatLngBounds fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.bounds ?: [NSNull null], - @(self.padding), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateNewLatLngBounds *other = (FGMPlatformCameraUpdateNewLatLngBounds *)object; - return FLTPigeonDeepEquals(self.bounds, other.bounds) && - (self.padding == other.padding || (isnan(self.padding) && isnan(other.padding))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.bounds); - result = - result * 31 + (isnan(self.padding) ? (NSUInteger)0x7FF8000000000000 : @(self.padding).hash); - return result; -} -- (NSString *)description { - return - [NSString stringWithFormat:@"FGMPlatformCameraUpdateNewLatLngBounds(bounds: %@, padding: %f)", - self.bounds, self.padding]; -} -@end - -@implementation FGMPlatformCameraUpdateNewLatLngZoom -+ (instancetype)makeWithLatLng:(FGMPlatformLatLng *)latLng zoom:(double)zoom { - FGMPlatformCameraUpdateNewLatLngZoom *pigeonResult = - [[FGMPlatformCameraUpdateNewLatLngZoom alloc] init]; - pigeonResult.latLng = latLng; - pigeonResult.zoom = zoom; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateNewLatLngZoom *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateNewLatLngZoom *pigeonResult = - [[FGMPlatformCameraUpdateNewLatLngZoom alloc] init]; - pigeonResult.latLng = GetNullableObjectAtIndex(list, 0); - pigeonResult.zoom = [GetNullableObjectAtIndex(list, 1) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateNewLatLngZoom *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateNewLatLngZoom fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.latLng ?: [NSNull null], - @(self.zoom), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateNewLatLngZoom *other = (FGMPlatformCameraUpdateNewLatLngZoom *)object; - return FLTPigeonDeepEquals(self.latLng, other.latLng) && - (self.zoom == other.zoom || (isnan(self.zoom) && isnan(other.zoom))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.latLng); - result = result * 31 + (isnan(self.zoom) ? (NSUInteger)0x7FF8000000000000 : @(self.zoom).hash); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformCameraUpdateNewLatLngZoom(latLng: %@, zoom: %f)", - self.latLng, self.zoom]; -} -@end - -@implementation FGMPlatformCameraUpdateScrollBy -+ (instancetype)makeWithDx:(double)dx dy:(double)dy { - FGMPlatformCameraUpdateScrollBy *pigeonResult = [[FGMPlatformCameraUpdateScrollBy alloc] init]; - pigeonResult.dx = dx; - pigeonResult.dy = dy; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateScrollBy *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateScrollBy *pigeonResult = [[FGMPlatformCameraUpdateScrollBy alloc] init]; - pigeonResult.dx = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.dy = [GetNullableObjectAtIndex(list, 1) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateScrollBy *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateScrollBy fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.dx), - @(self.dy), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateScrollBy *other = (FGMPlatformCameraUpdateScrollBy *)object; - return (self.dx == other.dx || (isnan(self.dx) && isnan(other.dx))) && - (self.dy == other.dy || (isnan(self.dy) && isnan(other.dy))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + (isnan(self.dx) ? (NSUInteger)0x7FF8000000000000 : @(self.dx).hash); - result = result * 31 + (isnan(self.dy) ? (NSUInteger)0x7FF8000000000000 : @(self.dy).hash); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformCameraUpdateScrollBy(dx: %f, dy: %f)", self.dx, self.dy]; -} -@end - -@implementation FGMPlatformCameraUpdateZoomBy -+ (instancetype)makeWithAmount:(double)amount focus:(nullable FGMPlatformPoint *)focus { - FGMPlatformCameraUpdateZoomBy *pigeonResult = [[FGMPlatformCameraUpdateZoomBy alloc] init]; - pigeonResult.amount = amount; - pigeonResult.focus = focus; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateZoomBy *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateZoomBy *pigeonResult = [[FGMPlatformCameraUpdateZoomBy alloc] init]; - pigeonResult.amount = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.focus = GetNullableObjectAtIndex(list, 1); - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateZoomBy *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateZoomBy fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.amount), - self.focus ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateZoomBy *other = (FGMPlatformCameraUpdateZoomBy *)object; - return (self.amount == other.amount || (isnan(self.amount) && isnan(other.amount))) && - FLTPigeonDeepEquals(self.focus, other.focus); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = - result * 31 + (isnan(self.amount) ? (NSUInteger)0x7FF8000000000000 : @(self.amount).hash); - result = result * 31 + FLTPigeonDeepHash(self.focus); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformCameraUpdateZoomBy(amount: %f, focus: %@)", - self.amount, self.focus]; -} -@end - -@implementation FGMPlatformCameraUpdateZoom -+ (instancetype)makeWithOut:(BOOL)out { - FGMPlatformCameraUpdateZoom *pigeonResult = [[FGMPlatformCameraUpdateZoom alloc] init]; - pigeonResult.out = out; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateZoom *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateZoom *pigeonResult = [[FGMPlatformCameraUpdateZoom alloc] init]; - pigeonResult.out = [GetNullableObjectAtIndex(list, 0) boolValue]; - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateZoom *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateZoom fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.out), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateZoom *other = (FGMPlatformCameraUpdateZoom *)object; - return self.out == other.out; -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + @(self.out).hash; - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformCameraUpdateZoom(out: %@)", self.out ? @"true" : @"false"]; -} -@end - -@implementation FGMPlatformCameraUpdateZoomTo -+ (instancetype)makeWithZoom:(double)zoom { - FGMPlatformCameraUpdateZoomTo *pigeonResult = [[FGMPlatformCameraUpdateZoomTo alloc] init]; - pigeonResult.zoom = zoom; - return pigeonResult; -} -+ (FGMPlatformCameraUpdateZoomTo *)fromList:(NSArray *)list { - FGMPlatformCameraUpdateZoomTo *pigeonResult = [[FGMPlatformCameraUpdateZoomTo alloc] init]; - pigeonResult.zoom = [GetNullableObjectAtIndex(list, 0) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformCameraUpdateZoomTo *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraUpdateZoomTo fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.zoom), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraUpdateZoomTo *other = (FGMPlatformCameraUpdateZoomTo *)object; - return (self.zoom == other.zoom || (isnan(self.zoom) && isnan(other.zoom))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + (isnan(self.zoom) ? (NSUInteger)0x7FF8000000000000 : @(self.zoom).hash); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformCameraUpdateZoomTo(zoom: %f)", self.zoom]; -} -@end - -@implementation FGMPlatformCircle -+ (instancetype)makeWithConsumeTapEvents:(BOOL)consumeTapEvents - fillColor:(FGMPlatformColor *)fillColor - strokeColor:(FGMPlatformColor *)strokeColor - visible:(BOOL)visible - strokeWidth:(NSInteger)strokeWidth - zIndex:(double)zIndex - center:(FGMPlatformLatLng *)center - radius:(double)radius - circleId:(NSString *)circleId { - FGMPlatformCircle *pigeonResult = [[FGMPlatformCircle alloc] init]; - pigeonResult.consumeTapEvents = consumeTapEvents; - pigeonResult.fillColor = fillColor; - pigeonResult.strokeColor = strokeColor; - pigeonResult.visible = visible; - pigeonResult.strokeWidth = strokeWidth; - pigeonResult.zIndex = zIndex; - pigeonResult.center = center; - pigeonResult.radius = radius; - pigeonResult.circleId = circleId; - return pigeonResult; -} -+ (FGMPlatformCircle *)fromList:(NSArray *)list { - FGMPlatformCircle *pigeonResult = [[FGMPlatformCircle alloc] init]; - pigeonResult.consumeTapEvents = [GetNullableObjectAtIndex(list, 0) boolValue]; - pigeonResult.fillColor = GetNullableObjectAtIndex(list, 1); - pigeonResult.strokeColor = GetNullableObjectAtIndex(list, 2); - pigeonResult.visible = [GetNullableObjectAtIndex(list, 3) boolValue]; - pigeonResult.strokeWidth = [GetNullableObjectAtIndex(list, 4) integerValue]; - pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 5) doubleValue]; - pigeonResult.center = GetNullableObjectAtIndex(list, 6); - pigeonResult.radius = [GetNullableObjectAtIndex(list, 7) doubleValue]; - pigeonResult.circleId = GetNullableObjectAtIndex(list, 8); - return pigeonResult; -} -+ (nullable FGMPlatformCircle *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCircle fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.consumeTapEvents), - self.fillColor ?: [NSNull null], - self.strokeColor ?: [NSNull null], - @(self.visible), - @(self.strokeWidth), - @(self.zIndex), - self.center ?: [NSNull null], - @(self.radius), - self.circleId ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCircle *other = (FGMPlatformCircle *)object; - return self.consumeTapEvents == other.consumeTapEvents && - FLTPigeonDeepEquals(self.fillColor, other.fillColor) && - FLTPigeonDeepEquals(self.strokeColor, other.strokeColor) && - self.visible == other.visible && self.strokeWidth == other.strokeWidth && - (self.zIndex == other.zIndex || (isnan(self.zIndex) && isnan(other.zIndex))) && - FLTPigeonDeepEquals(self.center, other.center) && - (self.radius == other.radius || (isnan(self.radius) && isnan(other.radius))) && - FLTPigeonDeepEquals(self.circleId, other.circleId); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + @(self.consumeTapEvents).hash; - result = result * 31 + FLTPigeonDeepHash(self.fillColor); - result = result * 31 + FLTPigeonDeepHash(self.strokeColor); - result = result * 31 + @(self.visible).hash; - result = result * 31 + @(self.strokeWidth).hash; - result = - result * 31 + (isnan(self.zIndex) ? (NSUInteger)0x7FF8000000000000 : @(self.zIndex).hash); - result = result * 31 + FLTPigeonDeepHash(self.center); - result = - result * 31 + (isnan(self.radius) ? (NSUInteger)0x7FF8000000000000 : @(self.radius).hash); - result = result * 31 + FLTPigeonDeepHash(self.circleId); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat: - @"FGMPlatformCircle(consumeTapEvents: %@, fillColor: %@, strokeColor: %@, visible: %@, " - @"strokeWidth: %ld, zIndex: %f, center: %@, radius: %f, circleId: %@)", - self.consumeTapEvents ? @"true" : @"false", self.fillColor, self.strokeColor, - self.visible ? @"true" : @"false", (long)self.strokeWidth, self.zIndex, self.center, - self.radius, self.circleId]; -} -@end - -@implementation FGMPlatformHeatmap -+ (instancetype)makeWithHeatmapId:(NSString *)heatmapId - data:(NSArray *)data - gradient:(nullable FGMPlatformHeatmapGradient *)gradient - opacity:(double)opacity - radius:(NSInteger)radius - minimumZoomIntensity:(NSInteger)minimumZoomIntensity - maximumZoomIntensity:(NSInteger)maximumZoomIntensity { - FGMPlatformHeatmap *pigeonResult = [[FGMPlatformHeatmap alloc] init]; - pigeonResult.heatmapId = heatmapId; - pigeonResult.data = data; - pigeonResult.gradient = gradient; - pigeonResult.opacity = opacity; - pigeonResult.radius = radius; - pigeonResult.minimumZoomIntensity = minimumZoomIntensity; - pigeonResult.maximumZoomIntensity = maximumZoomIntensity; - return pigeonResult; -} -+ (FGMPlatformHeatmap *)fromList:(NSArray *)list { - FGMPlatformHeatmap *pigeonResult = [[FGMPlatformHeatmap alloc] init]; - pigeonResult.heatmapId = GetNullableObjectAtIndex(list, 0); - pigeonResult.data = GetNullableObjectAtIndex(list, 1); - pigeonResult.gradient = GetNullableObjectAtIndex(list, 2); - pigeonResult.opacity = [GetNullableObjectAtIndex(list, 3) doubleValue]; - pigeonResult.radius = [GetNullableObjectAtIndex(list, 4) integerValue]; - pigeonResult.minimumZoomIntensity = [GetNullableObjectAtIndex(list, 5) integerValue]; - pigeonResult.maximumZoomIntensity = [GetNullableObjectAtIndex(list, 6) integerValue]; - return pigeonResult; -} -+ (nullable FGMPlatformHeatmap *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformHeatmap fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.heatmapId ?: [NSNull null], - self.data ?: [NSNull null], - self.gradient ?: [NSNull null], - @(self.opacity), - @(self.radius), - @(self.minimumZoomIntensity), - @(self.maximumZoomIntensity), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformHeatmap *other = (FGMPlatformHeatmap *)object; - return FLTPigeonDeepEquals(self.heatmapId, other.heatmapId) && - FLTPigeonDeepEquals(self.data, other.data) && - FLTPigeonDeepEquals(self.gradient, other.gradient) && - (self.opacity == other.opacity || (isnan(self.opacity) && isnan(other.opacity))) && - self.radius == other.radius && self.minimumZoomIntensity == other.minimumZoomIntensity && - self.maximumZoomIntensity == other.maximumZoomIntensity; -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.heatmapId); - result = result * 31 + FLTPigeonDeepHash(self.data); - result = result * 31 + FLTPigeonDeepHash(self.gradient); - result = - result * 31 + (isnan(self.opacity) ? (NSUInteger)0x7FF8000000000000 : @(self.opacity).hash); - result = result * 31 + @(self.radius).hash; - result = result * 31 + @(self.minimumZoomIntensity).hash; - result = result * 31 + @(self.maximumZoomIntensity).hash; - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformHeatmap(heatmapId: %@, data: %@, gradient: %@, opacity: %f, " - @"radius: %ld, minimumZoomIntensity: %ld, maximumZoomIntensity: %ld)", - self.heatmapId, self.data, self.gradient, self.opacity, (long)self.radius, - (long)self.minimumZoomIntensity, (long)self.maximumZoomIntensity]; -} -@end - -@implementation FGMPlatformHeatmapGradient -+ (instancetype)makeWithColors:(NSArray *)colors - startPoints:(NSArray *)startPoints - colorMapSize:(NSInteger)colorMapSize { - FGMPlatformHeatmapGradient *pigeonResult = [[FGMPlatformHeatmapGradient alloc] init]; - pigeonResult.colors = colors; - pigeonResult.startPoints = startPoints; - pigeonResult.colorMapSize = colorMapSize; - return pigeonResult; -} -+ (FGMPlatformHeatmapGradient *)fromList:(NSArray *)list { - FGMPlatformHeatmapGradient *pigeonResult = [[FGMPlatformHeatmapGradient alloc] init]; - pigeonResult.colors = GetNullableObjectAtIndex(list, 0); - pigeonResult.startPoints = GetNullableObjectAtIndex(list, 1); - pigeonResult.colorMapSize = [GetNullableObjectAtIndex(list, 2) integerValue]; - return pigeonResult; -} -+ (nullable FGMPlatformHeatmapGradient *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformHeatmapGradient fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.colors ?: [NSNull null], - self.startPoints ?: [NSNull null], - @(self.colorMapSize), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformHeatmapGradient *other = (FGMPlatformHeatmapGradient *)object; - return FLTPigeonDeepEquals(self.colors, other.colors) && - FLTPigeonDeepEquals(self.startPoints, other.startPoints) && - self.colorMapSize == other.colorMapSize; -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.colors); - result = result * 31 + FLTPigeonDeepHash(self.startPoints); - result = result * 31 + @(self.colorMapSize).hash; - return result; -} -- (NSString *)description { - return - [NSString stringWithFormat: - @"FGMPlatformHeatmapGradient(colors: %@, startPoints: %@, colorMapSize: %ld)", - self.colors, self.startPoints, (long)self.colorMapSize]; -} -@end - -@implementation FGMPlatformWeightedLatLng -+ (instancetype)makeWithPoint:(FGMPlatformLatLng *)point weight:(double)weight { - FGMPlatformWeightedLatLng *pigeonResult = [[FGMPlatformWeightedLatLng alloc] init]; - pigeonResult.point = point; - pigeonResult.weight = weight; - return pigeonResult; -} -+ (FGMPlatformWeightedLatLng *)fromList:(NSArray *)list { - FGMPlatformWeightedLatLng *pigeonResult = [[FGMPlatformWeightedLatLng alloc] init]; - pigeonResult.point = GetNullableObjectAtIndex(list, 0); - pigeonResult.weight = [GetNullableObjectAtIndex(list, 1) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformWeightedLatLng *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformWeightedLatLng fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.point ?: [NSNull null], - @(self.weight), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformWeightedLatLng *other = (FGMPlatformWeightedLatLng *)object; - return FLTPigeonDeepEquals(self.point, other.point) && - (self.weight == other.weight || (isnan(self.weight) && isnan(other.weight))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.point); - result = - result * 31 + (isnan(self.weight) ? (NSUInteger)0x7FF8000000000000 : @(self.weight).hash); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformWeightedLatLng(point: %@, weight: %f)", self.point, - self.weight]; -} -@end - -@implementation FGMPlatformInfoWindow -+ (instancetype)makeWithTitle:(nullable NSString *)title - snippet:(nullable NSString *)snippet - anchor:(FGMPlatformPoint *)anchor { - FGMPlatformInfoWindow *pigeonResult = [[FGMPlatformInfoWindow alloc] init]; - pigeonResult.title = title; - pigeonResult.snippet = snippet; - pigeonResult.anchor = anchor; - return pigeonResult; -} -+ (FGMPlatformInfoWindow *)fromList:(NSArray *)list { - FGMPlatformInfoWindow *pigeonResult = [[FGMPlatformInfoWindow alloc] init]; - pigeonResult.title = GetNullableObjectAtIndex(list, 0); - pigeonResult.snippet = GetNullableObjectAtIndex(list, 1); - pigeonResult.anchor = GetNullableObjectAtIndex(list, 2); - return pigeonResult; -} -+ (nullable FGMPlatformInfoWindow *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformInfoWindow fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.title ?: [NSNull null], - self.snippet ?: [NSNull null], - self.anchor ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformInfoWindow *other = (FGMPlatformInfoWindow *)object; - return FLTPigeonDeepEquals(self.title, other.title) && - FLTPigeonDeepEquals(self.snippet, other.snippet) && - FLTPigeonDeepEquals(self.anchor, other.anchor); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.title); - result = result * 31 + FLTPigeonDeepHash(self.snippet); - result = result * 31 + FLTPigeonDeepHash(self.anchor); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformInfoWindow(title: %@, snippet: %@, anchor: %@)", - self.title, self.snippet, self.anchor]; -} -@end - -@implementation FGMPlatformCluster -+ (instancetype)makeWithClusterManagerId:(NSString *)clusterManagerId - position:(FGMPlatformLatLng *)position - bounds:(FGMPlatformLatLngBounds *)bounds - markerIds:(NSArray *)markerIds { - FGMPlatformCluster *pigeonResult = [[FGMPlatformCluster alloc] init]; - pigeonResult.clusterManagerId = clusterManagerId; - pigeonResult.position = position; - pigeonResult.bounds = bounds; - pigeonResult.markerIds = markerIds; - return pigeonResult; -} -+ (FGMPlatformCluster *)fromList:(NSArray *)list { - FGMPlatformCluster *pigeonResult = [[FGMPlatformCluster alloc] init]; - pigeonResult.clusterManagerId = GetNullableObjectAtIndex(list, 0); - pigeonResult.position = GetNullableObjectAtIndex(list, 1); - pigeonResult.bounds = GetNullableObjectAtIndex(list, 2); - pigeonResult.markerIds = GetNullableObjectAtIndex(list, 3); - return pigeonResult; -} -+ (nullable FGMPlatformCluster *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCluster fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.clusterManagerId ?: [NSNull null], - self.position ?: [NSNull null], - self.bounds ?: [NSNull null], - self.markerIds ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCluster *other = (FGMPlatformCluster *)object; - return FLTPigeonDeepEquals(self.clusterManagerId, other.clusterManagerId) && - FLTPigeonDeepEquals(self.position, other.position) && - FLTPigeonDeepEquals(self.bounds, other.bounds) && - FLTPigeonDeepEquals(self.markerIds, other.markerIds); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.clusterManagerId); - result = result * 31 + FLTPigeonDeepHash(self.position); - result = result * 31 + FLTPigeonDeepHash(self.bounds); - result = result * 31 + FLTPigeonDeepHash(self.markerIds); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat: - @"FGMPlatformCluster(clusterManagerId: %@, position: %@, bounds: %@, markerIds: %@)", - self.clusterManagerId, self.position, self.bounds, self.markerIds]; -} -@end - -@implementation FGMPlatformClusterManager -+ (instancetype)makeWithIdentifier:(NSString *)identifier { - FGMPlatformClusterManager *pigeonResult = [[FGMPlatformClusterManager alloc] init]; - pigeonResult.identifier = identifier; - return pigeonResult; -} -+ (FGMPlatformClusterManager *)fromList:(NSArray *)list { - FGMPlatformClusterManager *pigeonResult = [[FGMPlatformClusterManager alloc] init]; - pigeonResult.identifier = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FGMPlatformClusterManager *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformClusterManager fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.identifier ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformClusterManager *other = (FGMPlatformClusterManager *)object; - return FLTPigeonDeepEquals(self.identifier, other.identifier); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.identifier); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformClusterManager(identifier: %@)", self.identifier]; -} -@end - -@implementation FGMPlatformMarker -+ (instancetype)makeWithAlpha:(double)alpha - anchor:(FGMPlatformPoint *)anchor - consumeTapEvents:(BOOL)consumeTapEvents - draggable:(BOOL)draggable - flat:(BOOL)flat - icon:(FGMPlatformBitmap *)icon - infoWindow:(FGMPlatformInfoWindow *)infoWindow - position:(FGMPlatformLatLng *)position - rotation:(double)rotation - visible:(BOOL)visible - zIndex:(NSInteger)zIndex - markerId:(NSString *)markerId - clusterManagerId:(nullable NSString *)clusterManagerId - collisionBehavior:(nullable FGMPlatformMarkerCollisionBehaviorBox *)collisionBehavior { - FGMPlatformMarker *pigeonResult = [[FGMPlatformMarker alloc] init]; - pigeonResult.alpha = alpha; - pigeonResult.anchor = anchor; - pigeonResult.consumeTapEvents = consumeTapEvents; - pigeonResult.draggable = draggable; - pigeonResult.flat = flat; - pigeonResult.icon = icon; - pigeonResult.infoWindow = infoWindow; - pigeonResult.position = position; - pigeonResult.rotation = rotation; - pigeonResult.visible = visible; - pigeonResult.zIndex = zIndex; - pigeonResult.markerId = markerId; - pigeonResult.clusterManagerId = clusterManagerId; - pigeonResult.collisionBehavior = collisionBehavior; - return pigeonResult; -} -+ (FGMPlatformMarker *)fromList:(NSArray *)list { - FGMPlatformMarker *pigeonResult = [[FGMPlatformMarker alloc] init]; - pigeonResult.alpha = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.anchor = GetNullableObjectAtIndex(list, 1); - pigeonResult.consumeTapEvents = [GetNullableObjectAtIndex(list, 2) boolValue]; - pigeonResult.draggable = [GetNullableObjectAtIndex(list, 3) boolValue]; - pigeonResult.flat = [GetNullableObjectAtIndex(list, 4) boolValue]; - pigeonResult.icon = GetNullableObjectAtIndex(list, 5); - pigeonResult.infoWindow = GetNullableObjectAtIndex(list, 6); - pigeonResult.position = GetNullableObjectAtIndex(list, 7); - pigeonResult.rotation = [GetNullableObjectAtIndex(list, 8) doubleValue]; - pigeonResult.visible = [GetNullableObjectAtIndex(list, 9) boolValue]; - pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 10) integerValue]; - pigeonResult.markerId = GetNullableObjectAtIndex(list, 11); - pigeonResult.clusterManagerId = GetNullableObjectAtIndex(list, 12); - pigeonResult.collisionBehavior = GetNullableObjectAtIndex(list, 13); - return pigeonResult; -} -+ (nullable FGMPlatformMarker *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformMarker fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.alpha), - self.anchor ?: [NSNull null], - @(self.consumeTapEvents), - @(self.draggable), - @(self.flat), - self.icon ?: [NSNull null], - self.infoWindow ?: [NSNull null], - self.position ?: [NSNull null], - @(self.rotation), - @(self.visible), - @(self.zIndex), - self.markerId ?: [NSNull null], - self.clusterManagerId ?: [NSNull null], - self.collisionBehavior ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformMarker *other = (FGMPlatformMarker *)object; - return (self.alpha == other.alpha || (isnan(self.alpha) && isnan(other.alpha))) && - FLTPigeonDeepEquals(self.anchor, other.anchor) && - self.consumeTapEvents == other.consumeTapEvents && self.draggable == other.draggable && - self.flat == other.flat && FLTPigeonDeepEquals(self.icon, other.icon) && - FLTPigeonDeepEquals(self.infoWindow, other.infoWindow) && - FLTPigeonDeepEquals(self.position, other.position) && - (self.rotation == other.rotation || (isnan(self.rotation) && isnan(other.rotation))) && - self.visible == other.visible && self.zIndex == other.zIndex && - FLTPigeonDeepEquals(self.markerId, other.markerId) && - FLTPigeonDeepEquals(self.clusterManagerId, other.clusterManagerId) && - FLTPigeonDeepEquals(self.collisionBehavior, other.collisionBehavior); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + (isnan(self.alpha) ? (NSUInteger)0x7FF8000000000000 : @(self.alpha).hash); - result = result * 31 + FLTPigeonDeepHash(self.anchor); - result = result * 31 + @(self.consumeTapEvents).hash; - result = result * 31 + @(self.draggable).hash; - result = result * 31 + @(self.flat).hash; - result = result * 31 + FLTPigeonDeepHash(self.icon); - result = result * 31 + FLTPigeonDeepHash(self.infoWindow); - result = result * 31 + FLTPigeonDeepHash(self.position); - result = - result * 31 + (isnan(self.rotation) ? (NSUInteger)0x7FF8000000000000 : @(self.rotation).hash); - result = result * 31 + @(self.visible).hash; - result = result * 31 + @(self.zIndex).hash; - result = result * 31 + FLTPigeonDeepHash(self.markerId); - result = result * 31 + FLTPigeonDeepHash(self.clusterManagerId); - result = result * 31 + FLTPigeonDeepHash(self.collisionBehavior); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat: - @"FGMPlatformMarker(alpha: %f, anchor: %@, consumeTapEvents: %@, draggable: %@, flat: " - @"%@, icon: %@, infoWindow: %@, position: %@, rotation: %f, visible: %@, zIndex: %ld, " - @"markerId: %@, clusterManagerId: %@, collisionBehavior: %@)", - self.alpha, self.anchor, self.consumeTapEvents ? @"true" : @"false", - self.draggable ? @"true" : @"false", self.flat ? @"true" : @"false", self.icon, - self.infoWindow, self.position, self.rotation, self.visible ? @"true" : @"false", - (long)self.zIndex, self.markerId, self.clusterManagerId, self.collisionBehavior]; -} -@end - -@implementation FGMPlatformPolygon -+ (instancetype)makeWithPolygonId:(NSString *)polygonId - consumesTapEvents:(BOOL)consumesTapEvents - fillColor:(FGMPlatformColor *)fillColor - geodesic:(BOOL)geodesic - points:(NSArray *)points - holes:(NSArray *> *)holes - visible:(BOOL)visible - strokeColor:(FGMPlatformColor *)strokeColor - strokeWidth:(NSInteger)strokeWidth - zIndex:(NSInteger)zIndex { - FGMPlatformPolygon *pigeonResult = [[FGMPlatformPolygon alloc] init]; - pigeonResult.polygonId = polygonId; - pigeonResult.consumesTapEvents = consumesTapEvents; - pigeonResult.fillColor = fillColor; - pigeonResult.geodesic = geodesic; - pigeonResult.points = points; - pigeonResult.holes = holes; - pigeonResult.visible = visible; - pigeonResult.strokeColor = strokeColor; - pigeonResult.strokeWidth = strokeWidth; - pigeonResult.zIndex = zIndex; - return pigeonResult; -} -+ (FGMPlatformPolygon *)fromList:(NSArray *)list { - FGMPlatformPolygon *pigeonResult = [[FGMPlatformPolygon alloc] init]; - pigeonResult.polygonId = GetNullableObjectAtIndex(list, 0); - pigeonResult.consumesTapEvents = [GetNullableObjectAtIndex(list, 1) boolValue]; - pigeonResult.fillColor = GetNullableObjectAtIndex(list, 2); - pigeonResult.geodesic = [GetNullableObjectAtIndex(list, 3) boolValue]; - pigeonResult.points = GetNullableObjectAtIndex(list, 4); - pigeonResult.holes = GetNullableObjectAtIndex(list, 5); - pigeonResult.visible = [GetNullableObjectAtIndex(list, 6) boolValue]; - pigeonResult.strokeColor = GetNullableObjectAtIndex(list, 7); - pigeonResult.strokeWidth = [GetNullableObjectAtIndex(list, 8) integerValue]; - pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 9) integerValue]; - return pigeonResult; -} -+ (nullable FGMPlatformPolygon *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformPolygon fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.polygonId ?: [NSNull null], - @(self.consumesTapEvents), - self.fillColor ?: [NSNull null], - @(self.geodesic), - self.points ?: [NSNull null], - self.holes ?: [NSNull null], - @(self.visible), - self.strokeColor ?: [NSNull null], - @(self.strokeWidth), - @(self.zIndex), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformPolygon *other = (FGMPlatformPolygon *)object; - return FLTPigeonDeepEquals(self.polygonId, other.polygonId) && - self.consumesTapEvents == other.consumesTapEvents && - FLTPigeonDeepEquals(self.fillColor, other.fillColor) && self.geodesic == other.geodesic && - FLTPigeonDeepEquals(self.points, other.points) && - FLTPigeonDeepEquals(self.holes, other.holes) && self.visible == other.visible && - FLTPigeonDeepEquals(self.strokeColor, other.strokeColor) && - self.strokeWidth == other.strokeWidth && self.zIndex == other.zIndex; -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.polygonId); - result = result * 31 + @(self.consumesTapEvents).hash; - result = result * 31 + FLTPigeonDeepHash(self.fillColor); - result = result * 31 + @(self.geodesic).hash; - result = result * 31 + FLTPigeonDeepHash(self.points); - result = result * 31 + FLTPigeonDeepHash(self.holes); - result = result * 31 + @(self.visible).hash; - result = result * 31 + FLTPigeonDeepHash(self.strokeColor); - result = result * 31 + @(self.strokeWidth).hash; - result = result * 31 + @(self.zIndex).hash; - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat: - @"FGMPlatformPolygon(polygonId: %@, consumesTapEvents: %@, fillColor: %@, geodesic: %@, " - @"points: %@, holes: %@, visible: %@, strokeColor: %@, strokeWidth: %ld, zIndex: %ld)", - self.polygonId, self.consumesTapEvents ? @"true" : @"false", self.fillColor, - self.geodesic ? @"true" : @"false", self.points, self.holes, - self.visible ? @"true" : @"false", self.strokeColor, (long)self.strokeWidth, - (long)self.zIndex]; -} -@end - -@implementation FGMPlatformPolyline -+ (instancetype)makeWithPolylineId:(NSString *)polylineId - consumesTapEvents:(BOOL)consumesTapEvents - color:(FGMPlatformColor *)color - geodesic:(BOOL)geodesic - jointType:(FGMPlatformJointType)jointType - patterns:(NSArray *)patterns - points:(NSArray *)points - visible:(BOOL)visible - width:(NSInteger)width - zIndex:(NSInteger)zIndex { - FGMPlatformPolyline *pigeonResult = [[FGMPlatformPolyline alloc] init]; - pigeonResult.polylineId = polylineId; - pigeonResult.consumesTapEvents = consumesTapEvents; - pigeonResult.color = color; - pigeonResult.geodesic = geodesic; - pigeonResult.jointType = jointType; - pigeonResult.patterns = patterns; - pigeonResult.points = points; - pigeonResult.visible = visible; - pigeonResult.width = width; - pigeonResult.zIndex = zIndex; - return pigeonResult; -} -+ (FGMPlatformPolyline *)fromList:(NSArray *)list { - FGMPlatformPolyline *pigeonResult = [[FGMPlatformPolyline alloc] init]; - pigeonResult.polylineId = GetNullableObjectAtIndex(list, 0); - pigeonResult.consumesTapEvents = [GetNullableObjectAtIndex(list, 1) boolValue]; - pigeonResult.color = GetNullableObjectAtIndex(list, 2); - pigeonResult.geodesic = [GetNullableObjectAtIndex(list, 3) boolValue]; - FGMPlatformJointTypeBox *boxedFGMPlatformJointType = GetNullableObjectAtIndex(list, 4); - pigeonResult.jointType = boxedFGMPlatformJointType.value; - pigeonResult.patterns = GetNullableObjectAtIndex(list, 5); - pigeonResult.points = GetNullableObjectAtIndex(list, 6); - pigeonResult.visible = [GetNullableObjectAtIndex(list, 7) boolValue]; - pigeonResult.width = [GetNullableObjectAtIndex(list, 8) integerValue]; - pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 9) integerValue]; - return pigeonResult; -} -+ (nullable FGMPlatformPolyline *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformPolyline fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.polylineId ?: [NSNull null], - @(self.consumesTapEvents), - self.color ?: [NSNull null], - @(self.geodesic), - [[FGMPlatformJointTypeBox alloc] initWithValue:self.jointType], - self.patterns ?: [NSNull null], - self.points ?: [NSNull null], - @(self.visible), - @(self.width), - @(self.zIndex), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformPolyline *other = (FGMPlatformPolyline *)object; - return FLTPigeonDeepEquals(self.polylineId, other.polylineId) && - self.consumesTapEvents == other.consumesTapEvents && - FLTPigeonDeepEquals(self.color, other.color) && self.geodesic == other.geodesic && - self.jointType == other.jointType && FLTPigeonDeepEquals(self.patterns, other.patterns) && - FLTPigeonDeepEquals(self.points, other.points) && self.visible == other.visible && - self.width == other.width && self.zIndex == other.zIndex; -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.polylineId); - result = result * 31 + @(self.consumesTapEvents).hash; - result = result * 31 + FLTPigeonDeepHash(self.color); - result = result * 31 + @(self.geodesic).hash; - result = result * 31 + @(self.jointType).hash; - result = result * 31 + FLTPigeonDeepHash(self.patterns); - result = result * 31 + FLTPigeonDeepHash(self.points); - result = result * 31 + @(self.visible).hash; - result = result * 31 + @(self.width).hash; - result = result * 31 + @(self.zIndex).hash; - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat: - @"FGMPlatformPolyline(polylineId: %@, consumesTapEvents: %@, color: %@, geodesic: %@, " - @"jointType: %ld, patterns: %@, points: %@, visible: %@, width: %ld, zIndex: %ld)", - self.polylineId, self.consumesTapEvents ? @"true" : @"false", self.color, - self.geodesic ? @"true" : @"false", (long)self.jointType, self.patterns, self.points, - self.visible ? @"true" : @"false", (long)self.width, (long)self.zIndex]; -} -@end - -@implementation FGMPlatformPatternItem -+ (instancetype)makeWithType:(FGMPlatformPatternItemType)type length:(nullable NSNumber *)length { - FGMPlatformPatternItem *pigeonResult = [[FGMPlatformPatternItem alloc] init]; - pigeonResult.type = type; - pigeonResult.length = length; - return pigeonResult; -} -+ (FGMPlatformPatternItem *)fromList:(NSArray *)list { - FGMPlatformPatternItem *pigeonResult = [[FGMPlatformPatternItem alloc] init]; - FGMPlatformPatternItemTypeBox *boxedFGMPlatformPatternItemType = - GetNullableObjectAtIndex(list, 0); - pigeonResult.type = boxedFGMPlatformPatternItemType.value; - pigeonResult.length = GetNullableObjectAtIndex(list, 1); - return pigeonResult; -} -+ (nullable FGMPlatformPatternItem *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformPatternItem fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - [[FGMPlatformPatternItemTypeBox alloc] initWithValue:self.type], - self.length ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformPatternItem *other = (FGMPlatformPatternItem *)object; - return self.type == other.type && FLTPigeonDeepEquals(self.length, other.length); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + @(self.type).hash; - result = result * 31 + FLTPigeonDeepHash(self.length); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformPatternItem(type: %ld, length: %@)", - (long)self.type, self.length]; -} -@end - -@implementation FGMPlatformTile -+ (instancetype)makeWithWidth:(NSInteger)width - height:(NSInteger)height - data:(nullable FlutterStandardTypedData *)data { - FGMPlatformTile *pigeonResult = [[FGMPlatformTile alloc] init]; - pigeonResult.width = width; - pigeonResult.height = height; - pigeonResult.data = data; - return pigeonResult; -} -+ (FGMPlatformTile *)fromList:(NSArray *)list { - FGMPlatformTile *pigeonResult = [[FGMPlatformTile alloc] init]; - pigeonResult.width = [GetNullableObjectAtIndex(list, 0) integerValue]; - pigeonResult.height = [GetNullableObjectAtIndex(list, 1) integerValue]; - pigeonResult.data = GetNullableObjectAtIndex(list, 2); - return pigeonResult; -} -+ (nullable FGMPlatformTile *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformTile fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.width), - @(self.height), - self.data ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformTile *other = (FGMPlatformTile *)object; - return self.width == other.width && self.height == other.height && - FLTPigeonDeepEquals(self.data, other.data); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + @(self.width).hash; - result = result * 31 + @(self.height).hash; - result = result * 31 + FLTPigeonDeepHash(self.data); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformTile(width: %ld, height: %ld, data: %@)", - (long)self.width, (long)self.height, self.data]; -} -@end - -@implementation FGMPlatformTileOverlay -+ (instancetype)makeWithTileOverlayId:(NSString *)tileOverlayId - fadeIn:(BOOL)fadeIn - transparency:(double)transparency - zIndex:(NSInteger)zIndex - visible:(BOOL)visible - tileSize:(NSInteger)tileSize { - FGMPlatformTileOverlay *pigeonResult = [[FGMPlatformTileOverlay alloc] init]; - pigeonResult.tileOverlayId = tileOverlayId; - pigeonResult.fadeIn = fadeIn; - pigeonResult.transparency = transparency; - pigeonResult.zIndex = zIndex; - pigeonResult.visible = visible; - pigeonResult.tileSize = tileSize; - return pigeonResult; -} -+ (FGMPlatformTileOverlay *)fromList:(NSArray *)list { - FGMPlatformTileOverlay *pigeonResult = [[FGMPlatformTileOverlay alloc] init]; - pigeonResult.tileOverlayId = GetNullableObjectAtIndex(list, 0); - pigeonResult.fadeIn = [GetNullableObjectAtIndex(list, 1) boolValue]; - pigeonResult.transparency = [GetNullableObjectAtIndex(list, 2) doubleValue]; - pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 3) integerValue]; - pigeonResult.visible = [GetNullableObjectAtIndex(list, 4) boolValue]; - pigeonResult.tileSize = [GetNullableObjectAtIndex(list, 5) integerValue]; - return pigeonResult; -} -+ (nullable FGMPlatformTileOverlay *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformTileOverlay fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.tileOverlayId ?: [NSNull null], - @(self.fadeIn), - @(self.transparency), - @(self.zIndex), - @(self.visible), - @(self.tileSize), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformTileOverlay *other = (FGMPlatformTileOverlay *)object; - return FLTPigeonDeepEquals(self.tileOverlayId, other.tileOverlayId) && - self.fadeIn == other.fadeIn && - (self.transparency == other.transparency || - (isnan(self.transparency) && isnan(other.transparency))) && - self.zIndex == other.zIndex && self.visible == other.visible && - self.tileSize == other.tileSize; -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.tileOverlayId); - result = result * 31 + @(self.fadeIn).hash; - result = result * 31 + - (isnan(self.transparency) ? (NSUInteger)0x7FF8000000000000 : @(self.transparency).hash); - result = result * 31 + @(self.zIndex).hash; - result = result * 31 + @(self.visible).hash; - result = result * 31 + @(self.tileSize).hash; - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformTileOverlay(tileOverlayId: %@, fadeIn: %@, " - @"transparency: %f, zIndex: %ld, visible: %@, tileSize: %ld)", - self.tileOverlayId, self.fadeIn ? @"true" : @"false", - self.transparency, (long)self.zIndex, - self.visible ? @"true" : @"false", (long)self.tileSize]; -} -@end - -@implementation FGMPlatformEdgeInsets -+ (instancetype)makeWithTop:(double)top - bottom:(double)bottom - left:(double)left - right:(double)right { - FGMPlatformEdgeInsets *pigeonResult = [[FGMPlatformEdgeInsets alloc] init]; - pigeonResult.top = top; - pigeonResult.bottom = bottom; - pigeonResult.left = left; - pigeonResult.right = right; - return pigeonResult; -} -+ (FGMPlatformEdgeInsets *)fromList:(NSArray *)list { - FGMPlatformEdgeInsets *pigeonResult = [[FGMPlatformEdgeInsets alloc] init]; - pigeonResult.top = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.bottom = [GetNullableObjectAtIndex(list, 1) doubleValue]; - pigeonResult.left = [GetNullableObjectAtIndex(list, 2) doubleValue]; - pigeonResult.right = [GetNullableObjectAtIndex(list, 3) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformEdgeInsets *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformEdgeInsets fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.top), - @(self.bottom), - @(self.left), - @(self.right), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformEdgeInsets *other = (FGMPlatformEdgeInsets *)object; - return (self.top == other.top || (isnan(self.top) && isnan(other.top))) && - (self.bottom == other.bottom || (isnan(self.bottom) && isnan(other.bottom))) && - (self.left == other.left || (isnan(self.left) && isnan(other.left))) && - (self.right == other.right || (isnan(self.right) && isnan(other.right))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + (isnan(self.top) ? (NSUInteger)0x7FF8000000000000 : @(self.top).hash); - result = - result * 31 + (isnan(self.bottom) ? (NSUInteger)0x7FF8000000000000 : @(self.bottom).hash); - result = result * 31 + (isnan(self.left) ? (NSUInteger)0x7FF8000000000000 : @(self.left).hash); - result = result * 31 + (isnan(self.right) ? (NSUInteger)0x7FF8000000000000 : @(self.right).hash); - return result; -} -- (NSString *)description { - return - [NSString stringWithFormat:@"FGMPlatformEdgeInsets(top: %f, bottom: %f, left: %f, right: %f)", - self.top, self.bottom, self.left, self.right]; -} -@end - -@implementation FGMPlatformLatLng -+ (instancetype)makeWithLatitude:(double)latitude longitude:(double)longitude { - FGMPlatformLatLng *pigeonResult = [[FGMPlatformLatLng alloc] init]; - pigeonResult.latitude = latitude; - pigeonResult.longitude = longitude; - return pigeonResult; -} -+ (FGMPlatformLatLng *)fromList:(NSArray *)list { - FGMPlatformLatLng *pigeonResult = [[FGMPlatformLatLng alloc] init]; - pigeonResult.latitude = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.longitude = [GetNullableObjectAtIndex(list, 1) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformLatLng *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformLatLng fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.latitude), - @(self.longitude), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformLatLng *other = (FGMPlatformLatLng *)object; - return (self.latitude == other.latitude || (isnan(self.latitude) && isnan(other.latitude))) && - (self.longitude == other.longitude || (isnan(self.longitude) && isnan(other.longitude))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = - result * 31 + (isnan(self.latitude) ? (NSUInteger)0x7FF8000000000000 : @(self.latitude).hash); - result = result * 31 + - (isnan(self.longitude) ? (NSUInteger)0x7FF8000000000000 : @(self.longitude).hash); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformLatLng(latitude: %f, longitude: %f)", - self.latitude, self.longitude]; -} -@end - -@implementation FGMPlatformLatLngBounds -+ (instancetype)makeWithNortheast:(FGMPlatformLatLng *)northeast - southwest:(FGMPlatformLatLng *)southwest { - FGMPlatformLatLngBounds *pigeonResult = [[FGMPlatformLatLngBounds alloc] init]; - pigeonResult.northeast = northeast; - pigeonResult.southwest = southwest; - return pigeonResult; -} -+ (FGMPlatformLatLngBounds *)fromList:(NSArray *)list { - FGMPlatformLatLngBounds *pigeonResult = [[FGMPlatformLatLngBounds alloc] init]; - pigeonResult.northeast = GetNullableObjectAtIndex(list, 0); - pigeonResult.southwest = GetNullableObjectAtIndex(list, 1); - return pigeonResult; -} -+ (nullable FGMPlatformLatLngBounds *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformLatLngBounds fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.northeast ?: [NSNull null], - self.southwest ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformLatLngBounds *other = (FGMPlatformLatLngBounds *)object; - return FLTPigeonDeepEquals(self.northeast, other.northeast) && - FLTPigeonDeepEquals(self.southwest, other.southwest); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.northeast); - result = result * 31 + FLTPigeonDeepHash(self.southwest); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformLatLngBounds(northeast: %@, southwest: %@)", - self.northeast, self.southwest]; -} -@end - -@implementation FGMPlatformCameraTargetBounds -+ (instancetype)makeWithBounds:(nullable FGMPlatformLatLngBounds *)bounds { - FGMPlatformCameraTargetBounds *pigeonResult = [[FGMPlatformCameraTargetBounds alloc] init]; - pigeonResult.bounds = bounds; - return pigeonResult; -} -+ (FGMPlatformCameraTargetBounds *)fromList:(NSArray *)list { - FGMPlatformCameraTargetBounds *pigeonResult = [[FGMPlatformCameraTargetBounds alloc] init]; - pigeonResult.bounds = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FGMPlatformCameraTargetBounds *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformCameraTargetBounds fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.bounds ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformCameraTargetBounds *other = (FGMPlatformCameraTargetBounds *)object; - return FLTPigeonDeepEquals(self.bounds, other.bounds); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.bounds); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformCameraTargetBounds(bounds: %@)", self.bounds]; -} -@end - -@implementation FGMPlatformGroundOverlay -+ (instancetype)makeWithGroundOverlayId:(NSString *)groundOverlayId - image:(FGMPlatformBitmap *)image - position:(nullable FGMPlatformLatLng *)position - bounds:(nullable FGMPlatformLatLngBounds *)bounds - anchor:(nullable FGMPlatformPoint *)anchor - transparency:(double)transparency - bearing:(double)bearing - zIndex:(NSInteger)zIndex - visible:(BOOL)visible - clickable:(BOOL)clickable - zoomLevel:(nullable NSNumber *)zoomLevel { - FGMPlatformGroundOverlay *pigeonResult = [[FGMPlatformGroundOverlay alloc] init]; - pigeonResult.groundOverlayId = groundOverlayId; - pigeonResult.image = image; - pigeonResult.position = position; - pigeonResult.bounds = bounds; - pigeonResult.anchor = anchor; - pigeonResult.transparency = transparency; - pigeonResult.bearing = bearing; - pigeonResult.zIndex = zIndex; - pigeonResult.visible = visible; - pigeonResult.clickable = clickable; - pigeonResult.zoomLevel = zoomLevel; - return pigeonResult; -} -+ (FGMPlatformGroundOverlay *)fromList:(NSArray *)list { - FGMPlatformGroundOverlay *pigeonResult = [[FGMPlatformGroundOverlay alloc] init]; - pigeonResult.groundOverlayId = GetNullableObjectAtIndex(list, 0); - pigeonResult.image = GetNullableObjectAtIndex(list, 1); - pigeonResult.position = GetNullableObjectAtIndex(list, 2); - pigeonResult.bounds = GetNullableObjectAtIndex(list, 3); - pigeonResult.anchor = GetNullableObjectAtIndex(list, 4); - pigeonResult.transparency = [GetNullableObjectAtIndex(list, 5) doubleValue]; - pigeonResult.bearing = [GetNullableObjectAtIndex(list, 6) doubleValue]; - pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 7) integerValue]; - pigeonResult.visible = [GetNullableObjectAtIndex(list, 8) boolValue]; - pigeonResult.clickable = [GetNullableObjectAtIndex(list, 9) boolValue]; - pigeonResult.zoomLevel = GetNullableObjectAtIndex(list, 10); - return pigeonResult; -} -+ (nullable FGMPlatformGroundOverlay *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformGroundOverlay fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.groundOverlayId ?: [NSNull null], - self.image ?: [NSNull null], - self.position ?: [NSNull null], - self.bounds ?: [NSNull null], - self.anchor ?: [NSNull null], - @(self.transparency), - @(self.bearing), - @(self.zIndex), - @(self.visible), - @(self.clickable), - self.zoomLevel ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformGroundOverlay *other = (FGMPlatformGroundOverlay *)object; - return FLTPigeonDeepEquals(self.groundOverlayId, other.groundOverlayId) && - FLTPigeonDeepEquals(self.image, other.image) && - FLTPigeonDeepEquals(self.position, other.position) && - FLTPigeonDeepEquals(self.bounds, other.bounds) && - FLTPigeonDeepEquals(self.anchor, other.anchor) && - (self.transparency == other.transparency || - (isnan(self.transparency) && isnan(other.transparency))) && - (self.bearing == other.bearing || (isnan(self.bearing) && isnan(other.bearing))) && - self.zIndex == other.zIndex && self.visible == other.visible && - self.clickable == other.clickable && FLTPigeonDeepEquals(self.zoomLevel, other.zoomLevel); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.groundOverlayId); - result = result * 31 + FLTPigeonDeepHash(self.image); - result = result * 31 + FLTPigeonDeepHash(self.position); - result = result * 31 + FLTPigeonDeepHash(self.bounds); - result = result * 31 + FLTPigeonDeepHash(self.anchor); - result = result * 31 + - (isnan(self.transparency) ? (NSUInteger)0x7FF8000000000000 : @(self.transparency).hash); - result = - result * 31 + (isnan(self.bearing) ? (NSUInteger)0x7FF8000000000000 : @(self.bearing).hash); - result = result * 31 + @(self.zIndex).hash; - result = result * 31 + @(self.visible).hash; - result = result * 31 + @(self.clickable).hash; - result = result * 31 + FLTPigeonDeepHash(self.zoomLevel); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformGroundOverlay(groundOverlayId: %@, image: %@, position: %@, " - @"bounds: %@, anchor: %@, transparency: %f, bearing: %f, zIndex: %ld, " - @"visible: %@, clickable: %@, zoomLevel: %@)", - self.groundOverlayId, self.image, self.position, self.bounds, self.anchor, - self.transparency, self.bearing, (long)self.zIndex, - self.visible ? @"true" : @"false", self.clickable ? @"true" : @"false", - self.zoomLevel]; -} -@end - -@implementation FGMPlatformMapViewCreationParams -+ (instancetype) - makeWithInitialCameraPosition:(FGMPlatformCameraPosition *)initialCameraPosition - mapConfiguration:(FGMPlatformMapConfiguration *)mapConfiguration - initialCircles:(NSArray *)initialCircles - initialMarkers:(NSArray *)initialMarkers - initialPolygons:(NSArray *)initialPolygons - initialPolylines:(NSArray *)initialPolylines - initialHeatmaps:(NSArray *)initialHeatmaps - initialTileOverlays:(NSArray *)initialTileOverlays - initialClusterManagers:(NSArray *)initialClusterManagers - initialGroundOverlays:(NSArray *)initialGroundOverlays { - FGMPlatformMapViewCreationParams *pigeonResult = [[FGMPlatformMapViewCreationParams alloc] init]; - pigeonResult.initialCameraPosition = initialCameraPosition; - pigeonResult.mapConfiguration = mapConfiguration; - pigeonResult.initialCircles = initialCircles; - pigeonResult.initialMarkers = initialMarkers; - pigeonResult.initialPolygons = initialPolygons; - pigeonResult.initialPolylines = initialPolylines; - pigeonResult.initialHeatmaps = initialHeatmaps; - pigeonResult.initialTileOverlays = initialTileOverlays; - pigeonResult.initialClusterManagers = initialClusterManagers; - pigeonResult.initialGroundOverlays = initialGroundOverlays; - return pigeonResult; -} -+ (FGMPlatformMapViewCreationParams *)fromList:(NSArray *)list { - FGMPlatformMapViewCreationParams *pigeonResult = [[FGMPlatformMapViewCreationParams alloc] init]; - pigeonResult.initialCameraPosition = GetNullableObjectAtIndex(list, 0); - pigeonResult.mapConfiguration = GetNullableObjectAtIndex(list, 1); - pigeonResult.initialCircles = GetNullableObjectAtIndex(list, 2); - pigeonResult.initialMarkers = GetNullableObjectAtIndex(list, 3); - pigeonResult.initialPolygons = GetNullableObjectAtIndex(list, 4); - pigeonResult.initialPolylines = GetNullableObjectAtIndex(list, 5); - pigeonResult.initialHeatmaps = GetNullableObjectAtIndex(list, 6); - pigeonResult.initialTileOverlays = GetNullableObjectAtIndex(list, 7); - pigeonResult.initialClusterManagers = GetNullableObjectAtIndex(list, 8); - pigeonResult.initialGroundOverlays = GetNullableObjectAtIndex(list, 9); - return pigeonResult; -} -+ (nullable FGMPlatformMapViewCreationParams *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformMapViewCreationParams fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.initialCameraPosition ?: [NSNull null], - self.mapConfiguration ?: [NSNull null], - self.initialCircles ?: [NSNull null], - self.initialMarkers ?: [NSNull null], - self.initialPolygons ?: [NSNull null], - self.initialPolylines ?: [NSNull null], - self.initialHeatmaps ?: [NSNull null], - self.initialTileOverlays ?: [NSNull null], - self.initialClusterManagers ?: [NSNull null], - self.initialGroundOverlays ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformMapViewCreationParams *other = (FGMPlatformMapViewCreationParams *)object; - return FLTPigeonDeepEquals(self.initialCameraPosition, other.initialCameraPosition) && - FLTPigeonDeepEquals(self.mapConfiguration, other.mapConfiguration) && - FLTPigeonDeepEquals(self.initialCircles, other.initialCircles) && - FLTPigeonDeepEquals(self.initialMarkers, other.initialMarkers) && - FLTPigeonDeepEquals(self.initialPolygons, other.initialPolygons) && - FLTPigeonDeepEquals(self.initialPolylines, other.initialPolylines) && - FLTPigeonDeepEquals(self.initialHeatmaps, other.initialHeatmaps) && - FLTPigeonDeepEquals(self.initialTileOverlays, other.initialTileOverlays) && - FLTPigeonDeepEquals(self.initialClusterManagers, other.initialClusterManagers) && - FLTPigeonDeepEquals(self.initialGroundOverlays, other.initialGroundOverlays); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.initialCameraPosition); - result = result * 31 + FLTPigeonDeepHash(self.mapConfiguration); - result = result * 31 + FLTPigeonDeepHash(self.initialCircles); - result = result * 31 + FLTPigeonDeepHash(self.initialMarkers); - result = result * 31 + FLTPigeonDeepHash(self.initialPolygons); - result = result * 31 + FLTPigeonDeepHash(self.initialPolylines); - result = result * 31 + FLTPigeonDeepHash(self.initialHeatmaps); - result = result * 31 + FLTPigeonDeepHash(self.initialTileOverlays); - result = result * 31 + FLTPigeonDeepHash(self.initialClusterManagers); - result = result * 31 + FLTPigeonDeepHash(self.initialGroundOverlays); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat: - @"FGMPlatformMapViewCreationParams(initialCameraPosition: %@, mapConfiguration: %@, " - @"initialCircles: %@, initialMarkers: %@, initialPolygons: %@, initialPolylines: %@, " - @"initialHeatmaps: %@, initialTileOverlays: %@, initialClusterManagers: %@, " - @"initialGroundOverlays: %@)", - self.initialCameraPosition, self.mapConfiguration, self.initialCircles, - self.initialMarkers, self.initialPolygons, self.initialPolylines, self.initialHeatmaps, - self.initialTileOverlays, self.initialClusterManagers, self.initialGroundOverlays]; -} -@end - -@implementation FGMPlatformMapConfiguration -+ (instancetype)makeWithCompassEnabled:(nullable NSNumber *)compassEnabled - cameraTargetBounds:(nullable FGMPlatformCameraTargetBounds *)cameraTargetBounds - mapType:(nullable FGMPlatformMapTypeBox *)mapType - minMaxZoomPreference:(nullable FGMPlatformZoomRange *)minMaxZoomPreference - rotateGesturesEnabled:(nullable NSNumber *)rotateGesturesEnabled - scrollGesturesEnabled:(nullable NSNumber *)scrollGesturesEnabled - tiltGesturesEnabled:(nullable NSNumber *)tiltGesturesEnabled - trackCameraPosition:(nullable NSNumber *)trackCameraPosition - zoomGesturesEnabled:(nullable NSNumber *)zoomGesturesEnabled - myLocationEnabled:(nullable NSNumber *)myLocationEnabled - myLocationButtonEnabled:(nullable NSNumber *)myLocationButtonEnabled - padding:(nullable FGMPlatformEdgeInsets *)padding - indoorViewEnabled:(nullable NSNumber *)indoorViewEnabled - trafficEnabled:(nullable NSNumber *)trafficEnabled - buildingsEnabled:(nullable NSNumber *)buildingsEnabled - markerType:(FGMPlatformMarkerType)markerType - mapId:(nullable NSString *)mapId - style:(nullable NSString *)style { - FGMPlatformMapConfiguration *pigeonResult = [[FGMPlatformMapConfiguration alloc] init]; - pigeonResult.compassEnabled = compassEnabled; - pigeonResult.cameraTargetBounds = cameraTargetBounds; - pigeonResult.mapType = mapType; - pigeonResult.minMaxZoomPreference = minMaxZoomPreference; - pigeonResult.rotateGesturesEnabled = rotateGesturesEnabled; - pigeonResult.scrollGesturesEnabled = scrollGesturesEnabled; - pigeonResult.tiltGesturesEnabled = tiltGesturesEnabled; - pigeonResult.trackCameraPosition = trackCameraPosition; - pigeonResult.zoomGesturesEnabled = zoomGesturesEnabled; - pigeonResult.myLocationEnabled = myLocationEnabled; - pigeonResult.myLocationButtonEnabled = myLocationButtonEnabled; - pigeonResult.padding = padding; - pigeonResult.indoorViewEnabled = indoorViewEnabled; - pigeonResult.trafficEnabled = trafficEnabled; - pigeonResult.buildingsEnabled = buildingsEnabled; - pigeonResult.markerType = markerType; - pigeonResult.mapId = mapId; - pigeonResult.style = style; - return pigeonResult; -} -+ (FGMPlatformMapConfiguration *)fromList:(NSArray *)list { - FGMPlatformMapConfiguration *pigeonResult = [[FGMPlatformMapConfiguration alloc] init]; - pigeonResult.compassEnabled = GetNullableObjectAtIndex(list, 0); - pigeonResult.cameraTargetBounds = GetNullableObjectAtIndex(list, 1); - pigeonResult.mapType = GetNullableObjectAtIndex(list, 2); - pigeonResult.minMaxZoomPreference = GetNullableObjectAtIndex(list, 3); - pigeonResult.rotateGesturesEnabled = GetNullableObjectAtIndex(list, 4); - pigeonResult.scrollGesturesEnabled = GetNullableObjectAtIndex(list, 5); - pigeonResult.tiltGesturesEnabled = GetNullableObjectAtIndex(list, 6); - pigeonResult.trackCameraPosition = GetNullableObjectAtIndex(list, 7); - pigeonResult.zoomGesturesEnabled = GetNullableObjectAtIndex(list, 8); - pigeonResult.myLocationEnabled = GetNullableObjectAtIndex(list, 9); - pigeonResult.myLocationButtonEnabled = GetNullableObjectAtIndex(list, 10); - pigeonResult.padding = GetNullableObjectAtIndex(list, 11); - pigeonResult.indoorViewEnabled = GetNullableObjectAtIndex(list, 12); - pigeonResult.trafficEnabled = GetNullableObjectAtIndex(list, 13); - pigeonResult.buildingsEnabled = GetNullableObjectAtIndex(list, 14); - FGMPlatformMarkerTypeBox *boxedFGMPlatformMarkerType = GetNullableObjectAtIndex(list, 15); - pigeonResult.markerType = boxedFGMPlatformMarkerType.value; - pigeonResult.mapId = GetNullableObjectAtIndex(list, 16); - pigeonResult.style = GetNullableObjectAtIndex(list, 17); - return pigeonResult; -} -+ (nullable FGMPlatformMapConfiguration *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformMapConfiguration fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.compassEnabled ?: [NSNull null], - self.cameraTargetBounds ?: [NSNull null], - self.mapType ?: [NSNull null], - self.minMaxZoomPreference ?: [NSNull null], - self.rotateGesturesEnabled ?: [NSNull null], - self.scrollGesturesEnabled ?: [NSNull null], - self.tiltGesturesEnabled ?: [NSNull null], - self.trackCameraPosition ?: [NSNull null], - self.zoomGesturesEnabled ?: [NSNull null], - self.myLocationEnabled ?: [NSNull null], - self.myLocationButtonEnabled ?: [NSNull null], - self.padding ?: [NSNull null], - self.indoorViewEnabled ?: [NSNull null], - self.trafficEnabled ?: [NSNull null], - self.buildingsEnabled ?: [NSNull null], - [[FGMPlatformMarkerTypeBox alloc] initWithValue:self.markerType], - self.mapId ?: [NSNull null], - self.style ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformMapConfiguration *other = (FGMPlatformMapConfiguration *)object; - return FLTPigeonDeepEquals(self.compassEnabled, other.compassEnabled) && - FLTPigeonDeepEquals(self.cameraTargetBounds, other.cameraTargetBounds) && - FLTPigeonDeepEquals(self.mapType, other.mapType) && - FLTPigeonDeepEquals(self.minMaxZoomPreference, other.minMaxZoomPreference) && - FLTPigeonDeepEquals(self.rotateGesturesEnabled, other.rotateGesturesEnabled) && - FLTPigeonDeepEquals(self.scrollGesturesEnabled, other.scrollGesturesEnabled) && - FLTPigeonDeepEquals(self.tiltGesturesEnabled, other.tiltGesturesEnabled) && - FLTPigeonDeepEquals(self.trackCameraPosition, other.trackCameraPosition) && - FLTPigeonDeepEquals(self.zoomGesturesEnabled, other.zoomGesturesEnabled) && - FLTPigeonDeepEquals(self.myLocationEnabled, other.myLocationEnabled) && - FLTPigeonDeepEquals(self.myLocationButtonEnabled, other.myLocationButtonEnabled) && - FLTPigeonDeepEquals(self.padding, other.padding) && - FLTPigeonDeepEquals(self.indoorViewEnabled, other.indoorViewEnabled) && - FLTPigeonDeepEquals(self.trafficEnabled, other.trafficEnabled) && - FLTPigeonDeepEquals(self.buildingsEnabled, other.buildingsEnabled) && - self.markerType == other.markerType && FLTPigeonDeepEquals(self.mapId, other.mapId) && - FLTPigeonDeepEquals(self.style, other.style); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.compassEnabled); - result = result * 31 + FLTPigeonDeepHash(self.cameraTargetBounds); - result = result * 31 + FLTPigeonDeepHash(self.mapType); - result = result * 31 + FLTPigeonDeepHash(self.minMaxZoomPreference); - result = result * 31 + FLTPigeonDeepHash(self.rotateGesturesEnabled); - result = result * 31 + FLTPigeonDeepHash(self.scrollGesturesEnabled); - result = result * 31 + FLTPigeonDeepHash(self.tiltGesturesEnabled); - result = result * 31 + FLTPigeonDeepHash(self.trackCameraPosition); - result = result * 31 + FLTPigeonDeepHash(self.zoomGesturesEnabled); - result = result * 31 + FLTPigeonDeepHash(self.myLocationEnabled); - result = result * 31 + FLTPigeonDeepHash(self.myLocationButtonEnabled); - result = result * 31 + FLTPigeonDeepHash(self.padding); - result = result * 31 + FLTPigeonDeepHash(self.indoorViewEnabled); - result = result * 31 + FLTPigeonDeepHash(self.trafficEnabled); - result = result * 31 + FLTPigeonDeepHash(self.buildingsEnabled); - result = result * 31 + @(self.markerType).hash; - result = result * 31 + FLTPigeonDeepHash(self.mapId); - result = result * 31 + FLTPigeonDeepHash(self.style); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat: - @"FGMPlatformMapConfiguration(compassEnabled: %@, cameraTargetBounds: %@, mapType: %@, " - @"minMaxZoomPreference: %@, rotateGesturesEnabled: %@, scrollGesturesEnabled: %@, " - @"tiltGesturesEnabled: %@, trackCameraPosition: %@, zoomGesturesEnabled: %@, " - @"myLocationEnabled: %@, myLocationButtonEnabled: %@, padding: %@, indoorViewEnabled: " - @"%@, trafficEnabled: %@, buildingsEnabled: %@, markerType: %ld, mapId: %@, style: %@)", - self.compassEnabled, self.cameraTargetBounds, self.mapType, self.minMaxZoomPreference, - self.rotateGesturesEnabled, self.scrollGesturesEnabled, self.tiltGesturesEnabled, - self.trackCameraPosition, self.zoomGesturesEnabled, self.myLocationEnabled, - self.myLocationButtonEnabled, self.padding, self.indoorViewEnabled, self.trafficEnabled, - self.buildingsEnabled, (long)self.markerType, self.mapId, self.style]; -} -@end - -@implementation FGMPlatformPoint -+ (instancetype)makeWithX:(double)x y:(double)y { - FGMPlatformPoint *pigeonResult = [[FGMPlatformPoint alloc] init]; - pigeonResult.x = x; - pigeonResult.y = y; - return pigeonResult; -} -+ (FGMPlatformPoint *)fromList:(NSArray *)list { - FGMPlatformPoint *pigeonResult = [[FGMPlatformPoint alloc] init]; - pigeonResult.x = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.y = [GetNullableObjectAtIndex(list, 1) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformPoint *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformPoint fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.x), - @(self.y), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformPoint *other = (FGMPlatformPoint *)object; - return (self.x == other.x || (isnan(self.x) && isnan(other.x))) && - (self.y == other.y || (isnan(self.y) && isnan(other.y))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + (isnan(self.x) ? (NSUInteger)0x7FF8000000000000 : @(self.x).hash); - result = result * 31 + (isnan(self.y) ? (NSUInteger)0x7FF8000000000000 : @(self.y).hash); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformPoint(x: %f, y: %f)", self.x, self.y]; -} -@end - -@implementation FGMPlatformSize -+ (instancetype)makeWithWidth:(double)width height:(double)height { - FGMPlatformSize *pigeonResult = [[FGMPlatformSize alloc] init]; - pigeonResult.width = width; - pigeonResult.height = height; - return pigeonResult; -} -+ (FGMPlatformSize *)fromList:(NSArray *)list { - FGMPlatformSize *pigeonResult = [[FGMPlatformSize alloc] init]; - pigeonResult.width = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.height = [GetNullableObjectAtIndex(list, 1) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformSize *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformSize fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.width), - @(self.height), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformSize *other = (FGMPlatformSize *)object; - return (self.width == other.width || (isnan(self.width) && isnan(other.width))) && - (self.height == other.height || (isnan(self.height) && isnan(other.height))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + (isnan(self.width) ? (NSUInteger)0x7FF8000000000000 : @(self.width).hash); - result = - result * 31 + (isnan(self.height) ? (NSUInteger)0x7FF8000000000000 : @(self.height).hash); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformSize(width: %f, height: %f)", self.width, self.height]; -} -@end - -@implementation FGMPlatformColor -+ (instancetype)makeWithRed:(double)red green:(double)green blue:(double)blue alpha:(double)alpha { - FGMPlatformColor *pigeonResult = [[FGMPlatformColor alloc] init]; - pigeonResult.red = red; - pigeonResult.green = green; - pigeonResult.blue = blue; - pigeonResult.alpha = alpha; - return pigeonResult; -} -+ (FGMPlatformColor *)fromList:(NSArray *)list { - FGMPlatformColor *pigeonResult = [[FGMPlatformColor alloc] init]; - pigeonResult.red = [GetNullableObjectAtIndex(list, 0) doubleValue]; - pigeonResult.green = [GetNullableObjectAtIndex(list, 1) doubleValue]; - pigeonResult.blue = [GetNullableObjectAtIndex(list, 2) doubleValue]; - pigeonResult.alpha = [GetNullableObjectAtIndex(list, 3) doubleValue]; - return pigeonResult; -} -+ (nullable FGMPlatformColor *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformColor fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.red), - @(self.green), - @(self.blue), - @(self.alpha), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformColor *other = (FGMPlatformColor *)object; - return (self.red == other.red || (isnan(self.red) && isnan(other.red))) && - (self.green == other.green || (isnan(self.green) && isnan(other.green))) && - (self.blue == other.blue || (isnan(self.blue) && isnan(other.blue))) && - (self.alpha == other.alpha || (isnan(self.alpha) && isnan(other.alpha))); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + (isnan(self.red) ? (NSUInteger)0x7FF8000000000000 : @(self.red).hash); - result = result * 31 + (isnan(self.green) ? (NSUInteger)0x7FF8000000000000 : @(self.green).hash); - result = result * 31 + (isnan(self.blue) ? (NSUInteger)0x7FF8000000000000 : @(self.blue).hash); - result = result * 31 + (isnan(self.alpha) ? (NSUInteger)0x7FF8000000000000 : @(self.alpha).hash); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformColor(red: %f, green: %f, blue: %f, alpha: %f)", - self.red, self.green, self.blue, self.alpha]; -} -@end - -@implementation FGMPlatformTileLayer -+ (instancetype)makeWithVisible:(BOOL)visible - fadeIn:(BOOL)fadeIn - opacity:(double)opacity - zIndex:(NSInteger)zIndex { - FGMPlatformTileLayer *pigeonResult = [[FGMPlatformTileLayer alloc] init]; - pigeonResult.visible = visible; - pigeonResult.fadeIn = fadeIn; - pigeonResult.opacity = opacity; - pigeonResult.zIndex = zIndex; - return pigeonResult; -} -+ (FGMPlatformTileLayer *)fromList:(NSArray *)list { - FGMPlatformTileLayer *pigeonResult = [[FGMPlatformTileLayer alloc] init]; - pigeonResult.visible = [GetNullableObjectAtIndex(list, 0) boolValue]; - pigeonResult.fadeIn = [GetNullableObjectAtIndex(list, 1) boolValue]; - pigeonResult.opacity = [GetNullableObjectAtIndex(list, 2) doubleValue]; - pigeonResult.zIndex = [GetNullableObjectAtIndex(list, 3) integerValue]; - return pigeonResult; -} -+ (nullable FGMPlatformTileLayer *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformTileLayer fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - @(self.visible), - @(self.fadeIn), - @(self.opacity), - @(self.zIndex), - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformTileLayer *other = (FGMPlatformTileLayer *)object; - return self.visible == other.visible && self.fadeIn == other.fadeIn && - (self.opacity == other.opacity || (isnan(self.opacity) && isnan(other.opacity))) && - self.zIndex == other.zIndex; -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + @(self.visible).hash; - result = result * 31 + @(self.fadeIn).hash; - result = - result * 31 + (isnan(self.opacity) ? (NSUInteger)0x7FF8000000000000 : @(self.opacity).hash); - result = result * 31 + @(self.zIndex).hash; - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformTileLayer(visible: %@, fadeIn: %@, opacity: %f, zIndex: %ld)", - self.visible ? @"true" : @"false", self.fadeIn ? @"true" : @"false", - self.opacity, (long)self.zIndex]; -} -@end - -@implementation FGMPlatformZoomRange -+ (instancetype)makeWithMin:(nullable NSNumber *)min max:(nullable NSNumber *)max { - FGMPlatformZoomRange *pigeonResult = [[FGMPlatformZoomRange alloc] init]; - pigeonResult.min = min; - pigeonResult.max = max; - return pigeonResult; -} -+ (FGMPlatformZoomRange *)fromList:(NSArray *)list { - FGMPlatformZoomRange *pigeonResult = [[FGMPlatformZoomRange alloc] init]; - pigeonResult.min = GetNullableObjectAtIndex(list, 0); - pigeonResult.max = GetNullableObjectAtIndex(list, 1); - return pigeonResult; -} -+ (nullable FGMPlatformZoomRange *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformZoomRange fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.min ?: [NSNull null], - self.max ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformZoomRange *other = (FGMPlatformZoomRange *)object; - return FLTPigeonDeepEquals(self.min, other.min) && FLTPigeonDeepEquals(self.max, other.max); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.min); - result = result * 31 + FLTPigeonDeepHash(self.max); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformZoomRange(min: %@, max: %@)", self.min, self.max]; -} -@end - -@implementation FGMPlatformBitmap -+ (instancetype)makeWithBitmap:(id)bitmap { - FGMPlatformBitmap *pigeonResult = [[FGMPlatformBitmap alloc] init]; - pigeonResult.bitmap = bitmap; - return pigeonResult; -} -+ (FGMPlatformBitmap *)fromList:(NSArray *)list { - FGMPlatformBitmap *pigeonResult = [[FGMPlatformBitmap alloc] init]; - pigeonResult.bitmap = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FGMPlatformBitmap *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmap fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.bitmap ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmap *other = (FGMPlatformBitmap *)object; - return FLTPigeonDeepEquals(self.bitmap, other.bitmap); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.bitmap); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformBitmap(bitmap: %@)", self.bitmap]; -} -@end - -@implementation FGMPlatformBitmapDefaultMarker -+ (instancetype)makeWithHue:(nullable NSNumber *)hue { - FGMPlatformBitmapDefaultMarker *pigeonResult = [[FGMPlatformBitmapDefaultMarker alloc] init]; - pigeonResult.hue = hue; - return pigeonResult; -} -+ (FGMPlatformBitmapDefaultMarker *)fromList:(NSArray *)list { - FGMPlatformBitmapDefaultMarker *pigeonResult = [[FGMPlatformBitmapDefaultMarker alloc] init]; - pigeonResult.hue = GetNullableObjectAtIndex(list, 0); - return pigeonResult; -} -+ (nullable FGMPlatformBitmapDefaultMarker *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmapDefaultMarker fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.hue ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmapDefaultMarker *other = (FGMPlatformBitmapDefaultMarker *)object; - return FLTPigeonDeepEquals(self.hue, other.hue); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.hue); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformBitmapDefaultMarker(hue: %@)", self.hue]; -} -@end - -@implementation FGMPlatformBitmapBytes -+ (instancetype)makeWithByteData:(FlutterStandardTypedData *)byteData - size:(nullable FGMPlatformSize *)size { - FGMPlatformBitmapBytes *pigeonResult = [[FGMPlatformBitmapBytes alloc] init]; - pigeonResult.byteData = byteData; - pigeonResult.size = size; - return pigeonResult; -} -+ (FGMPlatformBitmapBytes *)fromList:(NSArray *)list { - FGMPlatformBitmapBytes *pigeonResult = [[FGMPlatformBitmapBytes alloc] init]; - pigeonResult.byteData = GetNullableObjectAtIndex(list, 0); - pigeonResult.size = GetNullableObjectAtIndex(list, 1); - return pigeonResult; -} -+ (nullable FGMPlatformBitmapBytes *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmapBytes fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.byteData ?: [NSNull null], - self.size ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmapBytes *other = (FGMPlatformBitmapBytes *)object; - return FLTPigeonDeepEquals(self.byteData, other.byteData) && - FLTPigeonDeepEquals(self.size, other.size); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.byteData); - result = result * 31 + FLTPigeonDeepHash(self.size); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformBitmapBytes(byteData: %@, size: %@)", self.byteData, self.size]; -} -@end - -@implementation FGMPlatformBitmapAsset -+ (instancetype)makeWithName:(NSString *)name pkg:(nullable NSString *)pkg { - FGMPlatformBitmapAsset *pigeonResult = [[FGMPlatformBitmapAsset alloc] init]; - pigeonResult.name = name; - pigeonResult.pkg = pkg; - return pigeonResult; -} -+ (FGMPlatformBitmapAsset *)fromList:(NSArray *)list { - FGMPlatformBitmapAsset *pigeonResult = [[FGMPlatformBitmapAsset alloc] init]; - pigeonResult.name = GetNullableObjectAtIndex(list, 0); - pigeonResult.pkg = GetNullableObjectAtIndex(list, 1); - return pigeonResult; -} -+ (nullable FGMPlatformBitmapAsset *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmapAsset fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.name ?: [NSNull null], - self.pkg ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmapAsset *other = (FGMPlatformBitmapAsset *)object; - return FLTPigeonDeepEquals(self.name, other.name) && FLTPigeonDeepEquals(self.pkg, other.pkg); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.name); - result = result * 31 + FLTPigeonDeepHash(self.pkg); - return result; -} -- (NSString *)description { - return - [NSString stringWithFormat:@"FGMPlatformBitmapAsset(name: %@, pkg: %@)", self.name, self.pkg]; -} -@end - -@implementation FGMPlatformBitmapAssetImage -+ (instancetype)makeWithName:(NSString *)name - scale:(double)scale - size:(nullable FGMPlatformSize *)size { - FGMPlatformBitmapAssetImage *pigeonResult = [[FGMPlatformBitmapAssetImage alloc] init]; - pigeonResult.name = name; - pigeonResult.scale = scale; - pigeonResult.size = size; - return pigeonResult; -} -+ (FGMPlatformBitmapAssetImage *)fromList:(NSArray *)list { - FGMPlatformBitmapAssetImage *pigeonResult = [[FGMPlatformBitmapAssetImage alloc] init]; - pigeonResult.name = GetNullableObjectAtIndex(list, 0); - pigeonResult.scale = [GetNullableObjectAtIndex(list, 1) doubleValue]; - pigeonResult.size = GetNullableObjectAtIndex(list, 2); - return pigeonResult; -} -+ (nullable FGMPlatformBitmapAssetImage *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmapAssetImage fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.name ?: [NSNull null], - @(self.scale), - self.size ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmapAssetImage *other = (FGMPlatformBitmapAssetImage *)object; - return FLTPigeonDeepEquals(self.name, other.name) && - (self.scale == other.scale || (isnan(self.scale) && isnan(other.scale))) && - FLTPigeonDeepEquals(self.size, other.size); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.name); - result = result * 31 + (isnan(self.scale) ? (NSUInteger)0x7FF8000000000000 : @(self.scale).hash); - result = result * 31 + FLTPigeonDeepHash(self.size); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformBitmapAssetImage(name: %@, scale: %f, size: %@)", - self.name, self.scale, self.size]; -} -@end - -@implementation FGMPlatformBitmapAssetMap -+ (instancetype)makeWithAssetName:(NSString *)assetName - bitmapScaling:(FGMPlatformMapBitmapScaling)bitmapScaling - imagePixelRatio:(double)imagePixelRatio - width:(nullable NSNumber *)width - height:(nullable NSNumber *)height { - FGMPlatformBitmapAssetMap *pigeonResult = [[FGMPlatformBitmapAssetMap alloc] init]; - pigeonResult.assetName = assetName; - pigeonResult.bitmapScaling = bitmapScaling; - pigeonResult.imagePixelRatio = imagePixelRatio; - pigeonResult.width = width; - pigeonResult.height = height; - return pigeonResult; -} -+ (FGMPlatformBitmapAssetMap *)fromList:(NSArray *)list { - FGMPlatformBitmapAssetMap *pigeonResult = [[FGMPlatformBitmapAssetMap alloc] init]; - pigeonResult.assetName = GetNullableObjectAtIndex(list, 0); - FGMPlatformMapBitmapScalingBox *boxedFGMPlatformMapBitmapScaling = - GetNullableObjectAtIndex(list, 1); - pigeonResult.bitmapScaling = boxedFGMPlatformMapBitmapScaling.value; - pigeonResult.imagePixelRatio = [GetNullableObjectAtIndex(list, 2) doubleValue]; - pigeonResult.width = GetNullableObjectAtIndex(list, 3); - pigeonResult.height = GetNullableObjectAtIndex(list, 4); - return pigeonResult; -} -+ (nullable FGMPlatformBitmapAssetMap *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmapAssetMap fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.assetName ?: [NSNull null], - [[FGMPlatformMapBitmapScalingBox alloc] initWithValue:self.bitmapScaling], - @(self.imagePixelRatio), - self.width ?: [NSNull null], - self.height ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmapAssetMap *other = (FGMPlatformBitmapAssetMap *)object; - return FLTPigeonDeepEquals(self.assetName, other.assetName) && - self.bitmapScaling == other.bitmapScaling && - (self.imagePixelRatio == other.imagePixelRatio || - (isnan(self.imagePixelRatio) && isnan(other.imagePixelRatio))) && - FLTPigeonDeepEquals(self.width, other.width) && - FLTPigeonDeepEquals(self.height, other.height); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.assetName); - result = result * 31 + @(self.bitmapScaling).hash; - result = result * 31 + (isnan(self.imagePixelRatio) ? (NSUInteger)0x7FF8000000000000 - : @(self.imagePixelRatio).hash); - result = result * 31 + FLTPigeonDeepHash(self.width); - result = result * 31 + FLTPigeonDeepHash(self.height); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformBitmapAssetMap(assetName: %@, bitmapScaling: %ld, " - @"imagePixelRatio: %f, width: %@, height: %@)", - self.assetName, (long)self.bitmapScaling, self.imagePixelRatio, - self.width, self.height]; -} -@end - -@implementation FGMPlatformBitmapBytesMap -+ (instancetype)makeWithByteData:(FlutterStandardTypedData *)byteData - bitmapScaling:(FGMPlatformMapBitmapScaling)bitmapScaling - imagePixelRatio:(double)imagePixelRatio - width:(nullable NSNumber *)width - height:(nullable NSNumber *)height { - FGMPlatformBitmapBytesMap *pigeonResult = [[FGMPlatformBitmapBytesMap alloc] init]; - pigeonResult.byteData = byteData; - pigeonResult.bitmapScaling = bitmapScaling; - pigeonResult.imagePixelRatio = imagePixelRatio; - pigeonResult.width = width; - pigeonResult.height = height; - return pigeonResult; -} -+ (FGMPlatformBitmapBytesMap *)fromList:(NSArray *)list { - FGMPlatformBitmapBytesMap *pigeonResult = [[FGMPlatformBitmapBytesMap alloc] init]; - pigeonResult.byteData = GetNullableObjectAtIndex(list, 0); - FGMPlatformMapBitmapScalingBox *boxedFGMPlatformMapBitmapScaling = - GetNullableObjectAtIndex(list, 1); - pigeonResult.bitmapScaling = boxedFGMPlatformMapBitmapScaling.value; - pigeonResult.imagePixelRatio = [GetNullableObjectAtIndex(list, 2) doubleValue]; - pigeonResult.width = GetNullableObjectAtIndex(list, 3); - pigeonResult.height = GetNullableObjectAtIndex(list, 4); - return pigeonResult; -} -+ (nullable FGMPlatformBitmapBytesMap *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmapBytesMap fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.byteData ?: [NSNull null], - [[FGMPlatformMapBitmapScalingBox alloc] initWithValue:self.bitmapScaling], - @(self.imagePixelRatio), - self.width ?: [NSNull null], - self.height ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmapBytesMap *other = (FGMPlatformBitmapBytesMap *)object; - return FLTPigeonDeepEquals(self.byteData, other.byteData) && - self.bitmapScaling == other.bitmapScaling && - (self.imagePixelRatio == other.imagePixelRatio || - (isnan(self.imagePixelRatio) && isnan(other.imagePixelRatio))) && - FLTPigeonDeepEquals(self.width, other.width) && - FLTPigeonDeepEquals(self.height, other.height); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.byteData); - result = result * 31 + @(self.bitmapScaling).hash; - result = result * 31 + (isnan(self.imagePixelRatio) ? (NSUInteger)0x7FF8000000000000 - : @(self.imagePixelRatio).hash); - result = result * 31 + FLTPigeonDeepHash(self.width); - result = result * 31 + FLTPigeonDeepHash(self.height); - return result; -} -- (NSString *)description { - return [NSString stringWithFormat:@"FGMPlatformBitmapBytesMap(byteData: %@, bitmapScaling: %ld, " - @"imagePixelRatio: %f, width: %@, height: %@)", - self.byteData, (long)self.bitmapScaling, self.imagePixelRatio, - self.width, self.height]; -} -@end - -@implementation FGMPlatformBitmapPinConfig -+ (instancetype)makeWithBackgroundColor:(nullable FGMPlatformColor *)backgroundColor - borderColor:(nullable FGMPlatformColor *)borderColor - glyphColor:(nullable FGMPlatformColor *)glyphColor - glyphTextColor:(nullable FGMPlatformColor *)glyphTextColor - glyphText:(nullable NSString *)glyphText - glyphBitmap:(nullable FGMPlatformBitmap *)glyphBitmap { - FGMPlatformBitmapPinConfig *pigeonResult = [[FGMPlatformBitmapPinConfig alloc] init]; - pigeonResult.backgroundColor = backgroundColor; - pigeonResult.borderColor = borderColor; - pigeonResult.glyphColor = glyphColor; - pigeonResult.glyphTextColor = glyphTextColor; - pigeonResult.glyphText = glyphText; - pigeonResult.glyphBitmap = glyphBitmap; - return pigeonResult; -} -+ (FGMPlatformBitmapPinConfig *)fromList:(NSArray *)list { - FGMPlatformBitmapPinConfig *pigeonResult = [[FGMPlatformBitmapPinConfig alloc] init]; - pigeonResult.backgroundColor = GetNullableObjectAtIndex(list, 0); - pigeonResult.borderColor = GetNullableObjectAtIndex(list, 1); - pigeonResult.glyphColor = GetNullableObjectAtIndex(list, 2); - pigeonResult.glyphTextColor = GetNullableObjectAtIndex(list, 3); - pigeonResult.glyphText = GetNullableObjectAtIndex(list, 4); - pigeonResult.glyphBitmap = GetNullableObjectAtIndex(list, 5); - return pigeonResult; -} -+ (nullable FGMPlatformBitmapPinConfig *)nullableFromList:(NSArray *)list { - return (list) ? [FGMPlatformBitmapPinConfig fromList:list] : nil; -} -- (NSArray *)toList { - return @[ - self.backgroundColor ?: [NSNull null], - self.borderColor ?: [NSNull null], - self.glyphColor ?: [NSNull null], - self.glyphTextColor ?: [NSNull null], - self.glyphText ?: [NSNull null], - self.glyphBitmap ?: [NSNull null], - ]; -} -- (BOOL)isEqual:(id)object { - if (self == object) { - return YES; - } - if (![object isKindOfClass:[self class]]) { - return NO; - } - FGMPlatformBitmapPinConfig *other = (FGMPlatformBitmapPinConfig *)object; - return FLTPigeonDeepEquals(self.backgroundColor, other.backgroundColor) && - FLTPigeonDeepEquals(self.borderColor, other.borderColor) && - FLTPigeonDeepEquals(self.glyphColor, other.glyphColor) && - FLTPigeonDeepEquals(self.glyphTextColor, other.glyphTextColor) && - FLTPigeonDeepEquals(self.glyphText, other.glyphText) && - FLTPigeonDeepEquals(self.glyphBitmap, other.glyphBitmap); -} - -- (NSUInteger)hash { - NSUInteger result = [self class].hash; - result = result * 31 + FLTPigeonDeepHash(self.backgroundColor); - result = result * 31 + FLTPigeonDeepHash(self.borderColor); - result = result * 31 + FLTPigeonDeepHash(self.glyphColor); - result = result * 31 + FLTPigeonDeepHash(self.glyphTextColor); - result = result * 31 + FLTPigeonDeepHash(self.glyphText); - result = result * 31 + FLTPigeonDeepHash(self.glyphBitmap); - return result; -} -- (NSString *)description { - return [NSString - stringWithFormat:@"FGMPlatformBitmapPinConfig(backgroundColor: %@, borderColor: %@, " - @"glyphColor: %@, glyphTextColor: %@, glyphText: %@, glyphBitmap: %@)", - self.backgroundColor, self.borderColor, self.glyphColor, self.glyphTextColor, - self.glyphText, self.glyphBitmap]; -} -@end - -@interface FGMGoogleMapsFlutterPigeonMessagesPigeonCodecReader : FlutterStandardReader -@end -@implementation FGMGoogleMapsFlutterPigeonMessagesPigeonCodecReader -- (nullable id)readValueOfType:(UInt8)type { - switch (type) { - case 129: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil - ? nil - : [[FGMPlatformMapTypeBox alloc] initWithValue:[enumAsNumber integerValue]]; - } - case 130: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil ? nil - : [[FGMPlatformMarkerCollisionBehaviorBox alloc] - initWithValue:[enumAsNumber integerValue]]; - } - case 131: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil - ? nil - : [[FGMPlatformJointTypeBox alloc] initWithValue:[enumAsNumber integerValue]]; - } - case 132: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil ? nil - : [[FGMPlatformPatternItemTypeBox alloc] - initWithValue:[enumAsNumber integerValue]]; - } - case 133: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil - ? nil - : [[FGMPlatformMarkerTypeBox alloc] initWithValue:[enumAsNumber integerValue]]; - } - case 134: { - NSNumber *enumAsNumber = [self readValue]; - return enumAsNumber == nil ? nil - : [[FGMPlatformMapBitmapScalingBox alloc] - initWithValue:[enumAsNumber integerValue]]; - } - case 135: - return [FGMPlatformCameraPosition fromList:[self readValue]]; - case 136: - return [FGMPlatformCameraUpdate fromList:[self readValue]]; - case 137: - return [FGMPlatformCameraUpdateNewCameraPosition fromList:[self readValue]]; - case 138: - return [FGMPlatformCameraUpdateNewLatLng fromList:[self readValue]]; - case 139: - return [FGMPlatformCameraUpdateNewLatLngBounds fromList:[self readValue]]; - case 140: - return [FGMPlatformCameraUpdateNewLatLngZoom fromList:[self readValue]]; - case 141: - return [FGMPlatformCameraUpdateScrollBy fromList:[self readValue]]; - case 142: - return [FGMPlatformCameraUpdateZoomBy fromList:[self readValue]]; - case 143: - return [FGMPlatformCameraUpdateZoom fromList:[self readValue]]; - case 144: - return [FGMPlatformCameraUpdateZoomTo fromList:[self readValue]]; - case 145: - return [FGMPlatformCircle fromList:[self readValue]]; - case 146: - return [FGMPlatformHeatmap fromList:[self readValue]]; - case 147: - return [FGMPlatformHeatmapGradient fromList:[self readValue]]; - case 148: - return [FGMPlatformWeightedLatLng fromList:[self readValue]]; - case 149: - return [FGMPlatformInfoWindow fromList:[self readValue]]; - case 150: - return [FGMPlatformCluster fromList:[self readValue]]; - case 151: - return [FGMPlatformClusterManager fromList:[self readValue]]; - case 152: - return [FGMPlatformMarker fromList:[self readValue]]; - case 153: - return [FGMPlatformPolygon fromList:[self readValue]]; - case 154: - return [FGMPlatformPolyline fromList:[self readValue]]; - case 155: - return [FGMPlatformPatternItem fromList:[self readValue]]; - case 156: - return [FGMPlatformTile fromList:[self readValue]]; - case 157: - return [FGMPlatformTileOverlay fromList:[self readValue]]; - case 158: - return [FGMPlatformEdgeInsets fromList:[self readValue]]; - case 159: - return [FGMPlatformLatLng fromList:[self readValue]]; - case 160: - return [FGMPlatformLatLngBounds fromList:[self readValue]]; - case 161: - return [FGMPlatformCameraTargetBounds fromList:[self readValue]]; - case 162: - return [FGMPlatformGroundOverlay fromList:[self readValue]]; - case 163: - return [FGMPlatformMapViewCreationParams fromList:[self readValue]]; - case 164: - return [FGMPlatformMapConfiguration fromList:[self readValue]]; - case 165: - return [FGMPlatformPoint fromList:[self readValue]]; - case 166: - return [FGMPlatformSize fromList:[self readValue]]; - case 167: - return [FGMPlatformColor fromList:[self readValue]]; - case 168: - return [FGMPlatformTileLayer fromList:[self readValue]]; - case 169: - return [FGMPlatformZoomRange fromList:[self readValue]]; - case 170: - return [FGMPlatformBitmap fromList:[self readValue]]; - case 171: - return [FGMPlatformBitmapDefaultMarker fromList:[self readValue]]; - case 172: - return [FGMPlatformBitmapBytes fromList:[self readValue]]; - case 173: - return [FGMPlatformBitmapAsset fromList:[self readValue]]; - case 174: - return [FGMPlatformBitmapAssetImage fromList:[self readValue]]; - case 175: - return [FGMPlatformBitmapAssetMap fromList:[self readValue]]; - case 176: - return [FGMPlatformBitmapBytesMap fromList:[self readValue]]; - case 177: - return [FGMPlatformBitmapPinConfig fromList:[self readValue]]; - default: - return [super readValueOfType:type]; - } -} -@end - -@interface FGMGoogleMapsFlutterPigeonMessagesPigeonCodecWriter : FlutterStandardWriter -@end -@implementation FGMGoogleMapsFlutterPigeonMessagesPigeonCodecWriter -- (void)writeValue:(id)value { - if ([value isKindOfClass:[FGMPlatformMapTypeBox class]]) { - FGMPlatformMapTypeBox *box = (FGMPlatformMapTypeBox *)value; - [self writeByte:129]; - [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[FGMPlatformMarkerCollisionBehaviorBox class]]) { - FGMPlatformMarkerCollisionBehaviorBox *box = (FGMPlatformMarkerCollisionBehaviorBox *)value; - [self writeByte:130]; - [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[FGMPlatformJointTypeBox class]]) { - FGMPlatformJointTypeBox *box = (FGMPlatformJointTypeBox *)value; - [self writeByte:131]; - [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[FGMPlatformPatternItemTypeBox class]]) { - FGMPlatformPatternItemTypeBox *box = (FGMPlatformPatternItemTypeBox *)value; - [self writeByte:132]; - [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[FGMPlatformMarkerTypeBox class]]) { - FGMPlatformMarkerTypeBox *box = (FGMPlatformMarkerTypeBox *)value; - [self writeByte:133]; - [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[FGMPlatformMapBitmapScalingBox class]]) { - FGMPlatformMapBitmapScalingBox *box = (FGMPlatformMapBitmapScalingBox *)value; - [self writeByte:134]; - [self writeValue:(value == nil ? [NSNull null] : [NSNumber numberWithInteger:box.value])]; - } else if ([value isKindOfClass:[FGMPlatformCameraPosition class]]) { - [self writeByte:135]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdate class]]) { - [self writeByte:136]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateNewCameraPosition class]]) { - [self writeByte:137]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateNewLatLng class]]) { - [self writeByte:138]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateNewLatLngBounds class]]) { - [self writeByte:139]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateNewLatLngZoom class]]) { - [self writeByte:140]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateScrollBy class]]) { - [self writeByte:141]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateZoomBy class]]) { - [self writeByte:142]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateZoom class]]) { - [self writeByte:143]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraUpdateZoomTo class]]) { - [self writeByte:144]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCircle class]]) { - [self writeByte:145]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformHeatmap class]]) { - [self writeByte:146]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformHeatmapGradient class]]) { - [self writeByte:147]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformWeightedLatLng class]]) { - [self writeByte:148]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformInfoWindow class]]) { - [self writeByte:149]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCluster class]]) { - [self writeByte:150]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformClusterManager class]]) { - [self writeByte:151]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformMarker class]]) { - [self writeByte:152]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformPolygon class]]) { - [self writeByte:153]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformPolyline class]]) { - [self writeByte:154]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformPatternItem class]]) { - [self writeByte:155]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformTile class]]) { - [self writeByte:156]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformTileOverlay class]]) { - [self writeByte:157]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformEdgeInsets class]]) { - [self writeByte:158]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformLatLng class]]) { - [self writeByte:159]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformLatLngBounds class]]) { - [self writeByte:160]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformCameraTargetBounds class]]) { - [self writeByte:161]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformGroundOverlay class]]) { - [self writeByte:162]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformMapViewCreationParams class]]) { - [self writeByte:163]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformMapConfiguration class]]) { - [self writeByte:164]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformPoint class]]) { - [self writeByte:165]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformSize class]]) { - [self writeByte:166]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformColor class]]) { - [self writeByte:167]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformTileLayer class]]) { - [self writeByte:168]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformZoomRange class]]) { - [self writeByte:169]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmap class]]) { - [self writeByte:170]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmapDefaultMarker class]]) { - [self writeByte:171]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmapBytes class]]) { - [self writeByte:172]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmapAsset class]]) { - [self writeByte:173]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmapAssetImage class]]) { - [self writeByte:174]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmapAssetMap class]]) { - [self writeByte:175]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmapBytesMap class]]) { - [self writeByte:176]; - [self writeValue:[value toList]]; - } else if ([value isKindOfClass:[FGMPlatformBitmapPinConfig class]]) { - [self writeByte:177]; - [self writeValue:[value toList]]; - } else { - [super writeValue:value]; - } -} -@end - -@interface FGMGoogleMapsFlutterPigeonMessagesPigeonCodecReaderWriter : FlutterStandardReaderWriter -@end -@implementation FGMGoogleMapsFlutterPigeonMessagesPigeonCodecReaderWriter -- (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { - return [[FGMGoogleMapsFlutterPigeonMessagesPigeonCodecWriter alloc] initWithData:data]; -} -- (FlutterStandardReader *)readerWithData:(NSData *)data { - return [[FGMGoogleMapsFlutterPigeonMessagesPigeonCodecReader alloc] initWithData:data]; -} -@end - -NSObject *FGMGetGoogleMapsFlutterPigeonMessagesCodec(void) { - static FlutterStandardMessageCodec *sSharedObject = nil; - static dispatch_once_t sPred = 0; - dispatch_once(&sPred, ^{ - FGMGoogleMapsFlutterPigeonMessagesPigeonCodecReaderWriter *readerWriter = - [[FGMGoogleMapsFlutterPigeonMessagesPigeonCodecReaderWriter alloc] init]; - sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; - }); - return sSharedObject; -} -void SetUpFGMMapsApi(id binaryMessenger, NSObject *api) { - SetUpFGMMapsApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFGMMapsApiWithSuffix(id binaryMessenger, - NSObject *api, NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - /// Returns once the map instance is available. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.waitForMap", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(waitForMapWithError:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(waitForMapWithError:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - [api waitForMapWithError:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the map's configuration options. - /// - /// Only non-null configuration values will result in updates; options with - /// null values will remain unchanged. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.updateMapConfiguration", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(updateWithMapConfiguration:error:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(updateWithMapConfiguration:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FGMPlatformMapConfiguration *arg_configuration = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - [api updateWithMapConfiguration:arg_configuration error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of circles on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateCircles", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updateCirclesByAdding:changing:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updateCirclesByAdding:changing:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_toChange = GetNullableObjectAtIndex(args, 1); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api updateCirclesByAdding:arg_toAdd - changing:arg_toChange - removing:arg_idsToRemove - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of heatmaps on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.updateHeatmaps", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updateHeatmapsByAdding:changing:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updateHeatmapsByAdding:changing:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_toChange = GetNullableObjectAtIndex(args, 1); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api updateHeatmapsByAdding:arg_toAdd - changing:arg_toChange - removing:arg_idsToRemove - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of custer managers for clusters on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.updateClusterManagers", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updateClusterManagersByAdding:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updateClusterManagersByAdding:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 1); - FlutterError *error; - [api updateClusterManagersByAdding:arg_toAdd removing:arg_idsToRemove error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of markers on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.updateMarkers", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updateMarkersByAdding:changing:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updateMarkersByAdding:changing:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_toChange = GetNullableObjectAtIndex(args, 1); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api updateMarkersByAdding:arg_toAdd - changing:arg_toChange - removing:arg_idsToRemove - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of polygonss on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.updatePolygons", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updatePolygonsByAdding:changing:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updatePolygonsByAdding:changing:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_toChange = GetNullableObjectAtIndex(args, 1); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api updatePolygonsByAdding:arg_toAdd - changing:arg_toChange - removing:arg_idsToRemove - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of polylines on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.updatePolylines", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updatePolylinesByAdding: - changing:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updatePolylinesByAdding:changing:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_toChange = GetNullableObjectAtIndex(args, 1); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api updatePolylinesByAdding:arg_toAdd - changing:arg_toChange - removing:arg_idsToRemove - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of tile overlays on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.updateTileOverlays", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updateTileOverlaysByAdding: - changing:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updateTileOverlaysByAdding:changing:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_toChange = GetNullableObjectAtIndex(args, 1); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api updateTileOverlaysByAdding:arg_toAdd - changing:arg_toChange - removing:arg_idsToRemove - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Updates the set of ground overlays on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.updateGroundOverlays", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(updateGroundOverlaysByAdding: - changing:removing:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(updateGroundOverlaysByAdding:changing:removing:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSArray *arg_toAdd = GetNullableObjectAtIndex(args, 0); - NSArray *arg_toChange = GetNullableObjectAtIndex(args, 1); - NSArray *arg_idsToRemove = GetNullableObjectAtIndex(args, 2); - FlutterError *error; - [api updateGroundOverlaysByAdding:arg_toAdd - changing:arg_toChange - removing:arg_idsToRemove - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Gets the screen coordinate for the given map location. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.getScreenCoordinate", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(screenCoordinatesForLatLng:error:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(screenCoordinatesForLatLng:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FGMPlatformLatLng *arg_latLng = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FGMPlatformPoint *output = [api screenCoordinatesForLatLng:arg_latLng error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Gets the map location for the given screen coordinate. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getLatLng", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(latLngForScreenCoordinate:error:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(latLngForScreenCoordinate:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FGMPlatformPoint *arg_screenCoordinate = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FGMPlatformLatLng *output = [api latLngForScreenCoordinate:arg_screenCoordinate - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Gets the map region currently displayed on the map. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.getVisibleRegion", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(visibleMapRegion:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(visibleMapRegion:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - FGMPlatformLatLngBounds *output = [api visibleMapRegion:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Moves the camera according to [cameraUpdate] immediately, with no - /// animation. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.moveCamera", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(moveCameraWithUpdate:error:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(moveCameraWithUpdate:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FGMPlatformCameraUpdate *arg_cameraUpdate = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - [api moveCameraWithUpdate:arg_cameraUpdate error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Moves the camera according to [cameraUpdate], animating the update using a - /// duration in milliseconds if provided. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.animateCamera", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(animateCameraWithUpdate:duration:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(animateCameraWithUpdate:duration:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FGMPlatformCameraUpdate *arg_cameraUpdate = GetNullableObjectAtIndex(args, 0); - NSNumber *arg_durationMilliseconds = GetNullableObjectAtIndex(args, 1); - FlutterError *error; - [api animateCameraWithUpdate:arg_cameraUpdate - duration:arg_durationMilliseconds - error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Gets the current map zoom level. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.getZoomLevel", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(currentZoomLevel:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(currentZoomLevel:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api currentZoomLevel:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Show the info window for the marker with the given ID. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.showInfoWindow", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(showInfoWindowForMarkerWithIdentifier:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(showInfoWindowForMarkerWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_markerId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - [api showInfoWindowForMarkerWithIdentifier:arg_markerId error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Hide the info window for the marker with the given ID. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.hideInfoWindow", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(hideInfoWindowForMarkerWithIdentifier:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(hideInfoWindowForMarkerWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_markerId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - [api hideInfoWindowForMarkerWithIdentifier:arg_markerId error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns true if the marker with the given ID is currently displaying its - /// info window. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.isInfoWindowShown", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(isShowingInfoWindowForMarkerWithIdentifier: - error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(isShowingInfoWindowForMarkerWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_markerId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSNumber *output = [api isShowingInfoWindowForMarkerWithIdentifier:arg_markerId - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Sets the style to the given map style string, where an empty string - /// indicates that the style should be cleared. - /// - /// If there was an error setting the style, such as an invalid style string, - /// returns the error message. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName: - [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.setStyle", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(setStyle:error:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(setStyle:error:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_style = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSString *output = [api setStyle:arg_style error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns the error string from the last attempt to set the map style, if - /// any. - /// - /// This allows checking asynchronously for initial style failures, as there - /// is no way to return failures from map initialization. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.getLastStyleError", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(lastStyleError:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(lastStyleError:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSString *output = [api lastStyleError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Clears the cache of tiles previously requseted from the tile provider. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.clearTileCache", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(clearTileCacheForOverlayWithIdentifier:error:)], - @"FGMMapsApi api (%@) doesn't respond to " - @"@selector(clearTileCacheForOverlayWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_tileOverlayId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - [api clearTileCacheForOverlayWithIdentifier:arg_tileOverlayId error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Takes a snapshot of the map and returns its image data. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsApi.takeSnapshot", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(takeSnapshotWithError:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(takeSnapshotWithError:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - FlutterStandardTypedData *output = [api takeSnapshotWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - /// Returns true if the map supports advanced markers. - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsApi.isAdvancedMarkersAvailable", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(isAdvancedMarkersAvailable:)], - @"FGMMapsApi api (%@) doesn't respond to @selector(isAdvancedMarkersAvailable:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api isAdvancedMarkersAvailable:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -@interface FGMMapsCallbackApi () -@property(nonatomic, strong) NSObject *binaryMessenger; -@property(nonatomic, strong) NSString *messageChannelSuffix; -@end - -@implementation FGMMapsCallbackApi - -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger { - return [self initWithBinaryMessenger:binaryMessenger messageChannelSuffix:@""]; -} -- (instancetype)initWithBinaryMessenger:(NSObject *)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix { - self = [self init]; - if (self) { - _binaryMessenger = binaryMessenger; - _messageChannelSuffix = [messageChannelSuffix length] == 0 - ? @"" - : [NSString stringWithFormat:@".%@", messageChannelSuffix]; - } - return self; -} -- (void)didStartCameraMoveWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCameraMoveStarted", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didMoveCameraToPosition:(FGMPlatformCameraPosition *)arg_cameraPosition - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCameraMove", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_cameraPosition ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didIdleCameraWithCompletion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCameraIdle", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:nil - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapAtPosition:(FGMPlatformLatLng *)arg_position - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_position ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didLongPressAtPosition:(FGMPlatformLatLng *)arg_position - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onLongPress", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_position ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapMarkerWithIdentifier:(NSString *)arg_markerId - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_markerId ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didStartDragForMarkerWithIdentifier:(NSString *)arg_markerId - atPosition:(FGMPlatformLatLng *)arg_position - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDragStart", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_markerId ?: [NSNull null], arg_position ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didDragMarkerWithIdentifier:(NSString *)arg_markerId - atPosition:(FGMPlatformLatLng *)arg_position - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDrag", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_markerId ?: [NSNull null], arg_position ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didEndDragForMarkerWithIdentifier:(NSString *)arg_markerId - atPosition:(FGMPlatformLatLng *)arg_position - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onMarkerDragEnd", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_markerId ?: [NSNull null], arg_position ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapInfoWindowOfMarkerWithIdentifier:(NSString *)arg_markerId - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onInfoWindowTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_markerId ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapCircleWithIdentifier:(NSString *)arg_circleId - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onCircleTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_circleId ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapCluster:(FGMPlatformCluster *)arg_cluster - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onClusterTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_cluster ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapPolygonWithIdentifier:(NSString *)arg_polygonId - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onPolygonTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_polygonId ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapPolylineWithIdentifier:(NSString *)arg_polylineId - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onPolylineTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_polylineId ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)didTapGroundOverlayWithIdentifier:(NSString *)arg_groundOverlayId - completion:(void (^)(FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.onGroundOverlayTap", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ arg_groundOverlayId ?: [NSNull null] ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion([FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - completion(nil); - } - } else { - completion(createConnectionError(channelName)); - } - }]; -} -- (void)tileWithOverlayIdentifier:(NSString *)arg_tileOverlayId - location:(FGMPlatformPoint *)arg_location - zoom:(NSInteger)arg_zoom - completion:(void (^)(FGMPlatformTile *_Nullable, - FlutterError *_Nullable))completion { - NSString *channelName = [NSString - stringWithFormat: - @"%@%@", @"dev.flutter.pigeon.google_maps_flutter_ios.MapsCallbackApi.getTileOverlayTile", - _messageChannelSuffix]; - FlutterBasicMessageChannel *channel = [FlutterBasicMessageChannel - messageChannelWithName:channelName - binaryMessenger:self.binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - [channel sendMessage:@[ - arg_tileOverlayId ?: [NSNull null], arg_location ?: [NSNull null], @(arg_zoom) - ] - reply:^(NSArray *reply) { - if (reply != nil) { - if (reply.count > 1) { - completion(nil, [FlutterError errorWithCode:reply[0] - message:reply[1] - details:reply[2]]); - } else { - FGMPlatformTile *output = reply[0] == [NSNull null] ? nil : reply[0]; - completion(output, nil); - } - } else { - completion(nil, createConnectionError(channelName)); - } - }]; -} -@end - -void SetUpFGMMapsPlatformViewApi(id binaryMessenger, - NSObject *api) { - SetUpFGMMapsPlatformViewApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFGMMapsPlatformViewApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsPlatformViewApi.createView", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(createViewType:error:)], - @"FGMMapsPlatformViewApi api (%@) doesn't respond to @selector(createViewType:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - FGMPlatformMapViewCreationParams *arg_type = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - [api createViewType:arg_type error:&error]; - callback(wrapResult(nil, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} -void SetUpFGMMapsInspectorApi(id binaryMessenger, - NSObject *api) { - SetUpFGMMapsInspectorApiWithSuffix(binaryMessenger, api, @""); -} - -void SetUpFGMMapsInspectorApiWithSuffix(id binaryMessenger, - NSObject *api, - NSString *messageChannelSuffix) { - messageChannelSuffix = messageChannelSuffix.length > 0 - ? [NSString stringWithFormat:@".%@", messageChannelSuffix] - : @""; - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.areBuildingsEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(areBuildingsEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(areBuildingsEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api areBuildingsEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.areRotateGesturesEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(areRotateGesturesEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(areRotateGesturesEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api areRotateGesturesEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.areScrollGesturesEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(areScrollGesturesEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(areScrollGesturesEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api areScrollGesturesEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.areTiltGesturesEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(areTiltGesturesEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(areTiltGesturesEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api areTiltGesturesEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.areZoomGesturesEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(areZoomGesturesEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(areZoomGesturesEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api areZoomGesturesEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.isCompassEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(isCompassEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to @selector(isCompassEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api isCompassEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.isMyLocationButtonEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(isMyLocationButtonEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(isMyLocationButtonEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api isMyLocationButtonEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.isTrafficEnabled", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert( - [api respondsToSelector:@selector(isTrafficEnabledWithError:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to @selector(isTrafficEnabledWithError:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - NSNumber *output = [api isTrafficEnabledWithError:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.getTileOverlayInfo", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(tileOverlayWithIdentifier:error:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(tileOverlayWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_tileOverlayId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FGMPlatformTileLayer *output = [api tileOverlayWithIdentifier:arg_tileOverlayId - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.getGroundOverlayInfo", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(groundOverlayWithIdentifier:error:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(groundOverlayWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_groundOverlayId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FGMPlatformGroundOverlay *output = [api groundOverlayWithIdentifier:arg_groundOverlayId - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.getHeatmapInfo", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(heatmapWithIdentifier:error:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(heatmapWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_heatmapId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - FGMPlatformHeatmap *output = [api heatmapWithIdentifier:arg_heatmapId error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.getZoomRange", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(zoomRange:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to @selector(zoomRange:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - FGMPlatformZoomRange *output = [api zoomRange:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.getClusters", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(clustersWithIdentifier:error:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to " - @"@selector(clustersWithIdentifier:error:)", - api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - NSArray *args = message; - NSString *arg_clusterManagerId = GetNullableObjectAtIndex(args, 0); - FlutterError *error; - NSArray *output = [api clustersWithIdentifier:arg_clusterManagerId - error:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } - { - FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] - initWithName:[NSString stringWithFormat:@"%@%@", - @"dev.flutter.pigeon.google_maps_flutter_ios." - @"MapsInspectorApi.getCameraPosition", - messageChannelSuffix] - binaryMessenger:binaryMessenger - codec:FGMGetGoogleMapsFlutterPigeonMessagesCodec()]; - if (api) { - NSCAssert([api respondsToSelector:@selector(cameraPosition:)], - @"FGMMapsInspectorApi api (%@) doesn't respond to @selector(cameraPosition:)", api); - [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { - FlutterError *error; - FGMPlatformCameraPosition *output = [api cameraPosition:&error]; - callback(wrapResult(output, error)); - }]; - } else { - [channel setMessageHandler:nil]; - } - } -} diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/include/google_maps_flutter_ios_objc/google_maps_flutter_pigeon_messages.g.h b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/include/google_maps_flutter_ios_objc/google_maps_flutter_pigeon_messages.g.h deleted file mode 100644 index fbd78a7c44a9..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/include/google_maps_flutter_ios_objc/google_maps_flutter_pigeon_messages.g.h +++ /dev/null @@ -1,991 +0,0 @@ -// Copyright 2013 The Flutter Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// Autogenerated from Pigeon (v27.3.2), do not edit directly. -// See also: https://pub.dev/packages/pigeon - -@import Foundation; - -@protocol FlutterBinaryMessenger; -@protocol FlutterMessageCodec; -@class FlutterError; -@class FlutterStandardTypedData; - -NS_ASSUME_NONNULL_BEGIN - -/// Pigeon equivalent of MapType -typedef NS_ENUM(NSUInteger, FGMPlatformMapType) { - FGMPlatformMapTypeNone = 0, - FGMPlatformMapTypeNormal = 1, - FGMPlatformMapTypeSatellite = 2, - FGMPlatformMapTypeTerrain = 3, - FGMPlatformMapTypeHybrid = 4, -}; - -/// Wrapper for FGMPlatformMapType to allow for nullability. -@interface FGMPlatformMapTypeBox : NSObject -@property(nonatomic, assign) FGMPlatformMapType value; -- (instancetype)initWithValue:(FGMPlatformMapType)value; -@end - -/// Pigeon equivalent of the MarkerCollisionBehavior enum. -typedef NS_ENUM(NSUInteger, FGMPlatformMarkerCollisionBehavior) { - FGMPlatformMarkerCollisionBehaviorRequiredDisplay = 0, - FGMPlatformMarkerCollisionBehaviorOptionalAndHidesLowerPriority = 1, - FGMPlatformMarkerCollisionBehaviorRequiredAndHidesOptional = 2, -}; - -/// Wrapper for FGMPlatformMarkerCollisionBehavior to allow for nullability. -@interface FGMPlatformMarkerCollisionBehaviorBox : NSObject -@property(nonatomic, assign) FGMPlatformMarkerCollisionBehavior value; -- (instancetype)initWithValue:(FGMPlatformMarkerCollisionBehavior)value; -@end - -/// Join types for polyline joints. -typedef NS_ENUM(NSUInteger, FGMPlatformJointType) { - FGMPlatformJointTypeMitered = 0, - FGMPlatformJointTypeBevel = 1, - FGMPlatformJointTypeRound = 2, -}; - -/// Wrapper for FGMPlatformJointType to allow for nullability. -@interface FGMPlatformJointTypeBox : NSObject -@property(nonatomic, assign) FGMPlatformJointType value; -- (instancetype)initWithValue:(FGMPlatformJointType)value; -@end - -/// Enumeration of possible types for PatternItem. -typedef NS_ENUM(NSUInteger, FGMPlatformPatternItemType) { - FGMPlatformPatternItemTypeDot = 0, - FGMPlatformPatternItemTypeDash = 1, - FGMPlatformPatternItemTypeGap = 2, -}; - -/// Wrapper for FGMPlatformPatternItemType to allow for nullability. -@interface FGMPlatformPatternItemTypeBox : NSObject -@property(nonatomic, assign) FGMPlatformPatternItemType value; -- (instancetype)initWithValue:(FGMPlatformPatternItemType)value; -@end - -typedef NS_ENUM(NSUInteger, FGMPlatformMarkerType) { - FGMPlatformMarkerTypeMarker = 0, - FGMPlatformMarkerTypeAdvancedMarker = 1, -}; - -/// Wrapper for FGMPlatformMarkerType to allow for nullability. -@interface FGMPlatformMarkerTypeBox : NSObject -@property(nonatomic, assign) FGMPlatformMarkerType value; -- (instancetype)initWithValue:(FGMPlatformMarkerType)value; -@end - -/// Pigeon equivalent of [MapBitmapScaling]. -typedef NS_ENUM(NSUInteger, FGMPlatformMapBitmapScaling) { - FGMPlatformMapBitmapScalingAuto = 0, - FGMPlatformMapBitmapScalingNone = 1, -}; - -/// Wrapper for FGMPlatformMapBitmapScaling to allow for nullability. -@interface FGMPlatformMapBitmapScalingBox : NSObject -@property(nonatomic, assign) FGMPlatformMapBitmapScaling value; -- (instancetype)initWithValue:(FGMPlatformMapBitmapScaling)value; -@end - -@class FGMPlatformCameraPosition; -@class FGMPlatformCameraUpdate; -@class FGMPlatformCameraUpdateNewCameraPosition; -@class FGMPlatformCameraUpdateNewLatLng; -@class FGMPlatformCameraUpdateNewLatLngBounds; -@class FGMPlatformCameraUpdateNewLatLngZoom; -@class FGMPlatformCameraUpdateScrollBy; -@class FGMPlatformCameraUpdateZoomBy; -@class FGMPlatformCameraUpdateZoom; -@class FGMPlatformCameraUpdateZoomTo; -@class FGMPlatformCircle; -@class FGMPlatformHeatmap; -@class FGMPlatformHeatmapGradient; -@class FGMPlatformWeightedLatLng; -@class FGMPlatformInfoWindow; -@class FGMPlatformCluster; -@class FGMPlatformClusterManager; -@class FGMPlatformMarker; -@class FGMPlatformPolygon; -@class FGMPlatformPolyline; -@class FGMPlatformPatternItem; -@class FGMPlatformTile; -@class FGMPlatformTileOverlay; -@class FGMPlatformEdgeInsets; -@class FGMPlatformLatLng; -@class FGMPlatformLatLngBounds; -@class FGMPlatformCameraTargetBounds; -@class FGMPlatformGroundOverlay; -@class FGMPlatformMapViewCreationParams; -@class FGMPlatformMapConfiguration; -@class FGMPlatformPoint; -@class FGMPlatformSize; -@class FGMPlatformColor; -@class FGMPlatformTileLayer; -@class FGMPlatformZoomRange; -@class FGMPlatformBitmap; -@class FGMPlatformBitmapDefaultMarker; -@class FGMPlatformBitmapBytes; -@class FGMPlatformBitmapAsset; -@class FGMPlatformBitmapAssetImage; -@class FGMPlatformBitmapAssetMap; -@class FGMPlatformBitmapBytesMap; -@class FGMPlatformBitmapPinConfig; - -/// Pigeon representatation of a CameraPosition. -@interface FGMPlatformCameraPosition : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithBearing:(double)bearing - target:(FGMPlatformLatLng *)target - tilt:(double)tilt - zoom:(double)zoom; -@property(nonatomic, assign) double bearing; -@property(nonatomic, strong) FGMPlatformLatLng *target; -@property(nonatomic, assign) double tilt; -@property(nonatomic, assign) double zoom; -@end - -/// Pigeon representation of a CameraUpdate. -@interface FGMPlatformCameraUpdate : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithCameraUpdate:(id)cameraUpdate; -/// This Object must be one of the classes below prefixed with -/// PlatformCameraUpdate. Each such class represents a different type of -/// camera update, and each holds a different set of data, preventing the -/// use of a single unified class. -@property(nonatomic, strong) id cameraUpdate; -@end - -/// Pigeon equivalent of NewCameraPosition -@interface FGMPlatformCameraUpdateNewCameraPosition : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithCameraPosition:(FGMPlatformCameraPosition *)cameraPosition; -@property(nonatomic, strong) FGMPlatformCameraPosition *cameraPosition; -@end - -/// Pigeon equivalent of NewLatLng -@interface FGMPlatformCameraUpdateNewLatLng : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithLatLng:(FGMPlatformLatLng *)latLng; -@property(nonatomic, strong) FGMPlatformLatLng *latLng; -@end - -/// Pigeon equivalent of NewLatLngBounds -@interface FGMPlatformCameraUpdateNewLatLngBounds : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithBounds:(FGMPlatformLatLngBounds *)bounds padding:(double)padding; -@property(nonatomic, strong) FGMPlatformLatLngBounds *bounds; -@property(nonatomic, assign) double padding; -@end - -/// Pigeon equivalent of NewLatLngZoom -@interface FGMPlatformCameraUpdateNewLatLngZoom : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithLatLng:(FGMPlatformLatLng *)latLng zoom:(double)zoom; -@property(nonatomic, strong) FGMPlatformLatLng *latLng; -@property(nonatomic, assign) double zoom; -@end - -/// Pigeon equivalent of ScrollBy -@interface FGMPlatformCameraUpdateScrollBy : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithDx:(double)dx dy:(double)dy; -@property(nonatomic, assign) double dx; -@property(nonatomic, assign) double dy; -@end - -/// Pigeon equivalent of ZoomBy -@interface FGMPlatformCameraUpdateZoomBy : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithAmount:(double)amount focus:(nullable FGMPlatformPoint *)focus; -@property(nonatomic, assign) double amount; -@property(nonatomic, strong, nullable) FGMPlatformPoint *focus; -@end - -/// Pigeon equivalent of ZoomIn/ZoomOut -@interface FGMPlatformCameraUpdateZoom : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithOut:(BOOL)out; -@property(nonatomic, assign) BOOL out; -@end - -/// Pigeon equivalent of ZoomTo -@interface FGMPlatformCameraUpdateZoomTo : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithZoom:(double)zoom; -@property(nonatomic, assign) double zoom; -@end - -/// Pigeon equivalent of the Circle class. -@interface FGMPlatformCircle : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithConsumeTapEvents:(BOOL)consumeTapEvents - fillColor:(FGMPlatformColor *)fillColor - strokeColor:(FGMPlatformColor *)strokeColor - visible:(BOOL)visible - strokeWidth:(NSInteger)strokeWidth - zIndex:(double)zIndex - center:(FGMPlatformLatLng *)center - radius:(double)radius - circleId:(NSString *)circleId; -@property(nonatomic, assign) BOOL consumeTapEvents; -@property(nonatomic, strong) FGMPlatformColor *fillColor; -@property(nonatomic, strong) FGMPlatformColor *strokeColor; -@property(nonatomic, assign) BOOL visible; -@property(nonatomic, assign) NSInteger strokeWidth; -@property(nonatomic, assign) double zIndex; -@property(nonatomic, strong) FGMPlatformLatLng *center; -@property(nonatomic, assign) double radius; -@property(nonatomic, copy) NSString *circleId; -@end - -/// Pigeon equivalent of the Heatmap class. -@interface FGMPlatformHeatmap : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithHeatmapId:(NSString *)heatmapId - data:(NSArray *)data - gradient:(nullable FGMPlatformHeatmapGradient *)gradient - opacity:(double)opacity - radius:(NSInteger)radius - minimumZoomIntensity:(NSInteger)minimumZoomIntensity - maximumZoomIntensity:(NSInteger)maximumZoomIntensity; -@property(nonatomic, copy) NSString *heatmapId; -@property(nonatomic, copy) NSArray *data; -@property(nonatomic, strong, nullable) FGMPlatformHeatmapGradient *gradient; -@property(nonatomic, assign) double opacity; -@property(nonatomic, assign) NSInteger radius; -@property(nonatomic, assign) NSInteger minimumZoomIntensity; -@property(nonatomic, assign) NSInteger maximumZoomIntensity; -@end - -/// Pigeon equivalent of the HeatmapGradient class. -/// -/// The GMUGradient structure is slightly different from HeatmapGradient, so -/// this matches the iOS API so that conversion can be done on the Dart side -/// where the structures are easier to work with. -@interface FGMPlatformHeatmapGradient : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithColors:(NSArray *)colors - startPoints:(NSArray *)startPoints - colorMapSize:(NSInteger)colorMapSize; -@property(nonatomic, copy) NSArray *colors; -@property(nonatomic, copy) NSArray *startPoints; -@property(nonatomic, assign) NSInteger colorMapSize; -@end - -/// Pigeon equivalent of the WeightedLatLng class. -@interface FGMPlatformWeightedLatLng : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithPoint:(FGMPlatformLatLng *)point weight:(double)weight; -@property(nonatomic, strong) FGMPlatformLatLng *point; -@property(nonatomic, assign) double weight; -@end - -/// Pigeon equivalent of the InfoWindow class. -@interface FGMPlatformInfoWindow : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithTitle:(nullable NSString *)title - snippet:(nullable NSString *)snippet - anchor:(FGMPlatformPoint *)anchor; -@property(nonatomic, copy, nullable) NSString *title; -@property(nonatomic, copy, nullable) NSString *snippet; -@property(nonatomic, strong) FGMPlatformPoint *anchor; -@end - -/// Pigeon equivalent of Cluster. -@interface FGMPlatformCluster : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithClusterManagerId:(NSString *)clusterManagerId - position:(FGMPlatformLatLng *)position - bounds:(FGMPlatformLatLngBounds *)bounds - markerIds:(NSArray *)markerIds; -@property(nonatomic, copy) NSString *clusterManagerId; -@property(nonatomic, strong) FGMPlatformLatLng *position; -@property(nonatomic, strong) FGMPlatformLatLngBounds *bounds; -@property(nonatomic, copy) NSArray *markerIds; -@end - -/// Pigeon equivalent of the ClusterManager class. -@interface FGMPlatformClusterManager : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithIdentifier:(NSString *)identifier; -@property(nonatomic, copy) NSString *identifier; -@end - -/// Pigeon equivalent of the Marker class. -@interface FGMPlatformMarker : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithAlpha:(double)alpha - anchor:(FGMPlatformPoint *)anchor - consumeTapEvents:(BOOL)consumeTapEvents - draggable:(BOOL)draggable - flat:(BOOL)flat - icon:(FGMPlatformBitmap *)icon - infoWindow:(FGMPlatformInfoWindow *)infoWindow - position:(FGMPlatformLatLng *)position - rotation:(double)rotation - visible:(BOOL)visible - zIndex:(NSInteger)zIndex - markerId:(NSString *)markerId - clusterManagerId:(nullable NSString *)clusterManagerId - collisionBehavior:(nullable FGMPlatformMarkerCollisionBehaviorBox *)collisionBehavior; -@property(nonatomic, assign) double alpha; -@property(nonatomic, strong) FGMPlatformPoint *anchor; -@property(nonatomic, assign) BOOL consumeTapEvents; -@property(nonatomic, assign) BOOL draggable; -@property(nonatomic, assign) BOOL flat; -@property(nonatomic, strong) FGMPlatformBitmap *icon; -@property(nonatomic, strong) FGMPlatformInfoWindow *infoWindow; -@property(nonatomic, strong) FGMPlatformLatLng *position; -@property(nonatomic, assign) double rotation; -@property(nonatomic, assign) BOOL visible; -@property(nonatomic, assign) NSInteger zIndex; -@property(nonatomic, copy) NSString *markerId; -@property(nonatomic, copy, nullable) NSString *clusterManagerId; -@property(nonatomic, strong, nullable) FGMPlatformMarkerCollisionBehaviorBox *collisionBehavior; -@end - -/// Pigeon equivalent of the Polygon class. -@interface FGMPlatformPolygon : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithPolygonId:(NSString *)polygonId - consumesTapEvents:(BOOL)consumesTapEvents - fillColor:(FGMPlatformColor *)fillColor - geodesic:(BOOL)geodesic - points:(NSArray *)points - holes:(NSArray *> *)holes - visible:(BOOL)visible - strokeColor:(FGMPlatformColor *)strokeColor - strokeWidth:(NSInteger)strokeWidth - zIndex:(NSInteger)zIndex; -@property(nonatomic, copy) NSString *polygonId; -@property(nonatomic, assign) BOOL consumesTapEvents; -@property(nonatomic, strong) FGMPlatformColor *fillColor; -@property(nonatomic, assign) BOOL geodesic; -@property(nonatomic, copy) NSArray *points; -@property(nonatomic, copy) NSArray *> *holes; -@property(nonatomic, assign) BOOL visible; -@property(nonatomic, strong) FGMPlatformColor *strokeColor; -@property(nonatomic, assign) NSInteger strokeWidth; -@property(nonatomic, assign) NSInteger zIndex; -@end - -/// Pigeon equivalent of the Polyline class. -@interface FGMPlatformPolyline : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithPolylineId:(NSString *)polylineId - consumesTapEvents:(BOOL)consumesTapEvents - color:(FGMPlatformColor *)color - geodesic:(BOOL)geodesic - jointType:(FGMPlatformJointType)jointType - patterns:(NSArray *)patterns - points:(NSArray *)points - visible:(BOOL)visible - width:(NSInteger)width - zIndex:(NSInteger)zIndex; -@property(nonatomic, copy) NSString *polylineId; -@property(nonatomic, assign) BOOL consumesTapEvents; -@property(nonatomic, strong) FGMPlatformColor *color; -@property(nonatomic, assign) BOOL geodesic; -/// The joint type. -@property(nonatomic, assign) FGMPlatformJointType jointType; -/// The pattern data, as a list of pattern items. -@property(nonatomic, copy) NSArray *patterns; -@property(nonatomic, copy) NSArray *points; -@property(nonatomic, assign) BOOL visible; -@property(nonatomic, assign) NSInteger width; -@property(nonatomic, assign) NSInteger zIndex; -@end - -/// Pigeon equivalent of the PatternItem class. -@interface FGMPlatformPatternItem : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithType:(FGMPlatformPatternItemType)type length:(nullable NSNumber *)length; -@property(nonatomic, assign) FGMPlatformPatternItemType type; -@property(nonatomic, strong, nullable) NSNumber *length; -@end - -/// Pigeon equivalent of the Tile class. -@interface FGMPlatformTile : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithWidth:(NSInteger)width - height:(NSInteger)height - data:(nullable FlutterStandardTypedData *)data; -@property(nonatomic, assign) NSInteger width; -@property(nonatomic, assign) NSInteger height; -@property(nonatomic, strong, nullable) FlutterStandardTypedData *data; -@end - -/// Pigeon equivalent of the TileOverlay class. -@interface FGMPlatformTileOverlay : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithTileOverlayId:(NSString *)tileOverlayId - fadeIn:(BOOL)fadeIn - transparency:(double)transparency - zIndex:(NSInteger)zIndex - visible:(BOOL)visible - tileSize:(NSInteger)tileSize; -@property(nonatomic, copy) NSString *tileOverlayId; -@property(nonatomic, assign) BOOL fadeIn; -@property(nonatomic, assign) double transparency; -@property(nonatomic, assign) NSInteger zIndex; -@property(nonatomic, assign) BOOL visible; -@property(nonatomic, assign) NSInteger tileSize; -@end - -/// Pigeon equivalent of Flutter's EdgeInsets. -@interface FGMPlatformEdgeInsets : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithTop:(double)top bottom:(double)bottom left:(double)left right:(double)right; -@property(nonatomic, assign) double top; -@property(nonatomic, assign) double bottom; -@property(nonatomic, assign) double left; -@property(nonatomic, assign) double right; -@end - -/// Pigeon equivalent of LatLng. -@interface FGMPlatformLatLng : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithLatitude:(double)latitude longitude:(double)longitude; -@property(nonatomic, assign) double latitude; -@property(nonatomic, assign) double longitude; -@end - -/// Pigeon equivalent of LatLngBounds. -@interface FGMPlatformLatLngBounds : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithNortheast:(FGMPlatformLatLng *)northeast - southwest:(FGMPlatformLatLng *)southwest; -@property(nonatomic, strong) FGMPlatformLatLng *northeast; -@property(nonatomic, strong) FGMPlatformLatLng *southwest; -@end - -/// Pigeon equivalent of CameraTargetBounds. -/// -/// As with the Dart version, it exists to distinguish between not setting a -/// a target, and having an explicitly unbounded target (null [bounds]). -@interface FGMPlatformCameraTargetBounds : NSObject -+ (instancetype)makeWithBounds:(nullable FGMPlatformLatLngBounds *)bounds; -@property(nonatomic, strong, nullable) FGMPlatformLatLngBounds *bounds; -@end - -/// Pigeon equivalent of the GroundOverlay class. -@interface FGMPlatformGroundOverlay : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithGroundOverlayId:(NSString *)groundOverlayId - image:(FGMPlatformBitmap *)image - position:(nullable FGMPlatformLatLng *)position - bounds:(nullable FGMPlatformLatLngBounds *)bounds - anchor:(nullable FGMPlatformPoint *)anchor - transparency:(double)transparency - bearing:(double)bearing - zIndex:(NSInteger)zIndex - visible:(BOOL)visible - clickable:(BOOL)clickable - zoomLevel:(nullable NSNumber *)zoomLevel; -@property(nonatomic, copy) NSString *groundOverlayId; -@property(nonatomic, strong) FGMPlatformBitmap *image; -@property(nonatomic, strong, nullable) FGMPlatformLatLng *position; -@property(nonatomic, strong, nullable) FGMPlatformLatLngBounds *bounds; -@property(nonatomic, strong, nullable) FGMPlatformPoint *anchor; -@property(nonatomic, assign) double transparency; -@property(nonatomic, assign) double bearing; -@property(nonatomic, assign) NSInteger zIndex; -@property(nonatomic, assign) BOOL visible; -@property(nonatomic, assign) BOOL clickable; -@property(nonatomic, strong, nullable) NSNumber *zoomLevel; -@end - -/// Information passed to the platform view creation. -@interface FGMPlatformMapViewCreationParams : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype) - makeWithInitialCameraPosition:(FGMPlatformCameraPosition *)initialCameraPosition - mapConfiguration:(FGMPlatformMapConfiguration *)mapConfiguration - initialCircles:(NSArray *)initialCircles - initialMarkers:(NSArray *)initialMarkers - initialPolygons:(NSArray *)initialPolygons - initialPolylines:(NSArray *)initialPolylines - initialHeatmaps:(NSArray *)initialHeatmaps - initialTileOverlays:(NSArray *)initialTileOverlays - initialClusterManagers:(NSArray *)initialClusterManagers - initialGroundOverlays:(NSArray *)initialGroundOverlays; -@property(nonatomic, strong) FGMPlatformCameraPosition *initialCameraPosition; -@property(nonatomic, strong) FGMPlatformMapConfiguration *mapConfiguration; -@property(nonatomic, copy) NSArray *initialCircles; -@property(nonatomic, copy) NSArray *initialMarkers; -@property(nonatomic, copy) NSArray *initialPolygons; -@property(nonatomic, copy) NSArray *initialPolylines; -@property(nonatomic, copy) NSArray *initialHeatmaps; -@property(nonatomic, copy) NSArray *initialTileOverlays; -@property(nonatomic, copy) NSArray *initialClusterManagers; -@property(nonatomic, copy) NSArray *initialGroundOverlays; -@end - -/// Pigeon equivalent of MapConfiguration. -@interface FGMPlatformMapConfiguration : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithCompassEnabled:(nullable NSNumber *)compassEnabled - cameraTargetBounds:(nullable FGMPlatformCameraTargetBounds *)cameraTargetBounds - mapType:(nullable FGMPlatformMapTypeBox *)mapType - minMaxZoomPreference:(nullable FGMPlatformZoomRange *)minMaxZoomPreference - rotateGesturesEnabled:(nullable NSNumber *)rotateGesturesEnabled - scrollGesturesEnabled:(nullable NSNumber *)scrollGesturesEnabled - tiltGesturesEnabled:(nullable NSNumber *)tiltGesturesEnabled - trackCameraPosition:(nullable NSNumber *)trackCameraPosition - zoomGesturesEnabled:(nullable NSNumber *)zoomGesturesEnabled - myLocationEnabled:(nullable NSNumber *)myLocationEnabled - myLocationButtonEnabled:(nullable NSNumber *)myLocationButtonEnabled - padding:(nullable FGMPlatformEdgeInsets *)padding - indoorViewEnabled:(nullable NSNumber *)indoorViewEnabled - trafficEnabled:(nullable NSNumber *)trafficEnabled - buildingsEnabled:(nullable NSNumber *)buildingsEnabled - markerType:(FGMPlatformMarkerType)markerType - mapId:(nullable NSString *)mapId - style:(nullable NSString *)style; -@property(nonatomic, strong, nullable) NSNumber *compassEnabled; -@property(nonatomic, strong, nullable) FGMPlatformCameraTargetBounds *cameraTargetBounds; -@property(nonatomic, strong, nullable) FGMPlatformMapTypeBox *mapType; -@property(nonatomic, strong, nullable) FGMPlatformZoomRange *minMaxZoomPreference; -@property(nonatomic, strong, nullable) NSNumber *rotateGesturesEnabled; -@property(nonatomic, strong, nullable) NSNumber *scrollGesturesEnabled; -@property(nonatomic, strong, nullable) NSNumber *tiltGesturesEnabled; -@property(nonatomic, strong, nullable) NSNumber *trackCameraPosition; -@property(nonatomic, strong, nullable) NSNumber *zoomGesturesEnabled; -@property(nonatomic, strong, nullable) NSNumber *myLocationEnabled; -@property(nonatomic, strong, nullable) NSNumber *myLocationButtonEnabled; -@property(nonatomic, strong, nullable) FGMPlatformEdgeInsets *padding; -@property(nonatomic, strong, nullable) NSNumber *indoorViewEnabled; -@property(nonatomic, strong, nullable) NSNumber *trafficEnabled; -@property(nonatomic, strong, nullable) NSNumber *buildingsEnabled; -@property(nonatomic, assign) FGMPlatformMarkerType markerType; -@property(nonatomic, copy, nullable) NSString *mapId; -@property(nonatomic, copy, nullable) NSString *style; -@end - -/// Pigeon representation of an x,y coordinate. -@interface FGMPlatformPoint : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithX:(double)x y:(double)y; -@property(nonatomic, assign) double x; -@property(nonatomic, assign) double y; -@end - -/// Pigeon representation of a size. -@interface FGMPlatformSize : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithWidth:(double)width height:(double)height; -@property(nonatomic, assign) double width; -@property(nonatomic, assign) double height; -@end - -/// Pigeon representation of a color. -@interface FGMPlatformColor : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithRed:(double)red green:(double)green blue:(double)blue alpha:(double)alpha; -@property(nonatomic, assign) double red; -@property(nonatomic, assign) double green; -@property(nonatomic, assign) double blue; -@property(nonatomic, assign) double alpha; -@end - -/// Pigeon equivalent of GMSTileLayer properties. -@interface FGMPlatformTileLayer : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithVisible:(BOOL)visible - fadeIn:(BOOL)fadeIn - opacity:(double)opacity - zIndex:(NSInteger)zIndex; -@property(nonatomic, assign) BOOL visible; -@property(nonatomic, assign) BOOL fadeIn; -@property(nonatomic, assign) double opacity; -@property(nonatomic, assign) NSInteger zIndex; -@end - -/// Pigeon equivalent of MinMaxZoomPreference. -@interface FGMPlatformZoomRange : NSObject -+ (instancetype)makeWithMin:(nullable NSNumber *)min max:(nullable NSNumber *)max; -@property(nonatomic, strong, nullable) NSNumber *min; -@property(nonatomic, strong, nullable) NSNumber *max; -@end - -/// Pigeon equivalent of [BitmapDescriptor]. As there are multiple disjoint -/// types of [BitmapDescriptor], [PlatformBitmap] contains a single field which -/// may hold the pigeon equivalent type of any of them. -@interface FGMPlatformBitmap : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithBitmap:(id)bitmap; -/// One of [PlatformBitmapAssetMap], [PlatformBitmapAsset], -/// [PlatformBitmapAssetImage], [PlatformBitmapBytesMap], -/// [PlatformBitmapBytes], or [PlatformBitmapDefaultMarker]. -/// As Pigeon does not currently support data class inheritance, this -/// approach allows for the different bitmap implementations to be valid -/// argument and return types of the API methods. See -/// https://github.com/flutter/flutter/issues/117819. -@property(nonatomic, strong) id bitmap; -@end - -/// Pigeon equivalent of [DefaultMarker]. -@interface FGMPlatformBitmapDefaultMarker : NSObject -+ (instancetype)makeWithHue:(nullable NSNumber *)hue; -@property(nonatomic, strong, nullable) NSNumber *hue; -@end - -/// Pigeon equivalent of [BytesBitmap]. -@interface FGMPlatformBitmapBytes : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithByteData:(FlutterStandardTypedData *)byteData - size:(nullable FGMPlatformSize *)size; -@property(nonatomic, strong) FlutterStandardTypedData *byteData; -@property(nonatomic, strong, nullable) FGMPlatformSize *size; -@end - -/// Pigeon equivalent of [AssetBitmap]. -@interface FGMPlatformBitmapAsset : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithName:(NSString *)name pkg:(nullable NSString *)pkg; -@property(nonatomic, copy) NSString *name; -@property(nonatomic, copy, nullable) NSString *pkg; -@end - -/// Pigeon equivalent of [AssetImageBitmap]. -@interface FGMPlatformBitmapAssetImage : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithName:(NSString *)name - scale:(double)scale - size:(nullable FGMPlatformSize *)size; -@property(nonatomic, copy) NSString *name; -@property(nonatomic, assign) double scale; -@property(nonatomic, strong, nullable) FGMPlatformSize *size; -@end - -/// Pigeon equivalent of [AssetMapBitmap]. -@interface FGMPlatformBitmapAssetMap : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithAssetName:(NSString *)assetName - bitmapScaling:(FGMPlatformMapBitmapScaling)bitmapScaling - imagePixelRatio:(double)imagePixelRatio - width:(nullable NSNumber *)width - height:(nullable NSNumber *)height; -@property(nonatomic, copy) NSString *assetName; -@property(nonatomic, assign) FGMPlatformMapBitmapScaling bitmapScaling; -@property(nonatomic, assign) double imagePixelRatio; -@property(nonatomic, strong, nullable) NSNumber *width; -@property(nonatomic, strong, nullable) NSNumber *height; -@end - -/// Pigeon equivalent of [BytesMapBitmap]. -@interface FGMPlatformBitmapBytesMap : NSObject -/// `init` unavailable to enforce nonnull fields, see the `make` class method. -- (instancetype)init NS_UNAVAILABLE; -+ (instancetype)makeWithByteData:(FlutterStandardTypedData *)byteData - bitmapScaling:(FGMPlatformMapBitmapScaling)bitmapScaling - imagePixelRatio:(double)imagePixelRatio - width:(nullable NSNumber *)width - height:(nullable NSNumber *)height; -@property(nonatomic, strong) FlutterStandardTypedData *byteData; -@property(nonatomic, assign) FGMPlatformMapBitmapScaling bitmapScaling; -@property(nonatomic, assign) double imagePixelRatio; -@property(nonatomic, strong, nullable) NSNumber *width; -@property(nonatomic, strong, nullable) NSNumber *height; -@end - -/// Pigeon equivalent of [PinConfig]. -@interface FGMPlatformBitmapPinConfig : NSObject -+ (instancetype)makeWithBackgroundColor:(nullable FGMPlatformColor *)backgroundColor - borderColor:(nullable FGMPlatformColor *)borderColor - glyphColor:(nullable FGMPlatformColor *)glyphColor - glyphTextColor:(nullable FGMPlatformColor *)glyphTextColor - glyphText:(nullable NSString *)glyphText - glyphBitmap:(nullable FGMPlatformBitmap *)glyphBitmap; -@property(nonatomic, strong, nullable) FGMPlatformColor *backgroundColor; -@property(nonatomic, strong, nullable) FGMPlatformColor *borderColor; -@property(nonatomic, strong, nullable) FGMPlatformColor *glyphColor; -@property(nonatomic, strong, nullable) FGMPlatformColor *glyphTextColor; -@property(nonatomic, copy, nullable) NSString *glyphText; -@property(nonatomic, strong, nullable) FGMPlatformBitmap *glyphBitmap; -@end - -/// The codec used by all APIs. -NSObject *FGMGetGoogleMapsFlutterPigeonMessagesCodec(void); - -/// Interface for non-test interactions with the native SDK. -/// -/// For test-only state queries, see [MapsInspectorApi]. -@protocol FGMMapsApi -/// Returns once the map instance is available. -- (void)waitForMapWithError:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the map's configuration options. -/// -/// Only non-null configuration values will result in updates; options with -/// null values will remain unchanged. -- (void)updateWithMapConfiguration:(FGMPlatformMapConfiguration *)configuration - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of circles on the map. -- (void)updateCirclesByAdding:(NSArray *)toAdd - changing:(NSArray *)toChange - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of heatmaps on the map. -- (void)updateHeatmapsByAdding:(NSArray *)toAdd - changing:(NSArray *)toChange - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of custer managers for clusters on the map. -- (void)updateClusterManagersByAdding:(NSArray *)toAdd - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of markers on the map. -- (void)updateMarkersByAdding:(NSArray *)toAdd - changing:(NSArray *)toChange - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of polygonss on the map. -- (void)updatePolygonsByAdding:(NSArray *)toAdd - changing:(NSArray *)toChange - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of polylines on the map. -- (void)updatePolylinesByAdding:(NSArray *)toAdd - changing:(NSArray *)toChange - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of tile overlays on the map. -- (void)updateTileOverlaysByAdding:(NSArray *)toAdd - changing:(NSArray *)toChange - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Updates the set of ground overlays on the map. -- (void)updateGroundOverlaysByAdding:(NSArray *)toAdd - changing:(NSArray *)toChange - removing:(NSArray *)idsToRemove - error:(FlutterError *_Nullable *_Nonnull)error; -/// Gets the screen coordinate for the given map location. -/// -/// @return `nil` only when `error != nil`. -- (nullable FGMPlatformPoint *)screenCoordinatesForLatLng:(FGMPlatformLatLng *)latLng - error:(FlutterError *_Nullable *_Nonnull)error; -/// Gets the map location for the given screen coordinate. -/// -/// @return `nil` only when `error != nil`. -- (nullable FGMPlatformLatLng *)latLngForScreenCoordinate:(FGMPlatformPoint *)screenCoordinate - error:(FlutterError *_Nullable *_Nonnull)error; -/// Gets the map region currently displayed on the map. -/// -/// @return `nil` only when `error != nil`. -- (nullable FGMPlatformLatLngBounds *)visibleMapRegion:(FlutterError *_Nullable *_Nonnull)error; -/// Moves the camera according to [cameraUpdate] immediately, with no -/// animation. -- (void)moveCameraWithUpdate:(FGMPlatformCameraUpdate *)cameraUpdate - error:(FlutterError *_Nullable *_Nonnull)error; -/// Moves the camera according to [cameraUpdate], animating the update using a -/// duration in milliseconds if provided. -- (void)animateCameraWithUpdate:(FGMPlatformCameraUpdate *)cameraUpdate - duration:(nullable NSNumber *)durationMilliseconds - error:(FlutterError *_Nullable *_Nonnull)error; -/// Gets the current map zoom level. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)currentZoomLevel:(FlutterError *_Nullable *_Nonnull)error; -/// Show the info window for the marker with the given ID. -- (void)showInfoWindowForMarkerWithIdentifier:(NSString *)markerId - error:(FlutterError *_Nullable *_Nonnull)error; -/// Hide the info window for the marker with the given ID. -- (void)hideInfoWindowForMarkerWithIdentifier:(NSString *)markerId - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns true if the marker with the given ID is currently displaying its -/// info window. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *) - isShowingInfoWindowForMarkerWithIdentifier:(NSString *)markerId - error:(FlutterError *_Nullable *_Nonnull)error; -/// Sets the style to the given map style string, where an empty string -/// indicates that the style should be cleared. -/// -/// If there was an error setting the style, such as an invalid style string, -/// returns the error message. -- (nullable NSString *)setStyle:(NSString *)style error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the error string from the last attempt to set the map style, if -/// any. -/// -/// This allows checking asynchronously for initial style failures, as there -/// is no way to return failures from map initialization. -- (nullable NSString *)lastStyleError:(FlutterError *_Nullable *_Nonnull)error; -/// Clears the cache of tiles previously requseted from the tile provider. -- (void)clearTileCacheForOverlayWithIdentifier:(NSString *)tileOverlayId - error:(FlutterError *_Nullable *_Nonnull)error; -/// Takes a snapshot of the map and returns its image data. -- (nullable FlutterStandardTypedData *)takeSnapshotWithError: - (FlutterError *_Nullable *_Nonnull)error; -/// Returns true if the map supports advanced markers. -/// -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)isAdvancedMarkersAvailable:(FlutterError *_Nullable *_Nonnull)error; -@end - -extern void SetUpFGMMapsApi(id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFGMMapsApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); - -/// Interface for calls from the native SDK to Dart. -@interface FGMMapsCallbackApi : NSObject -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger; -- (instancetype)initWithBinaryMessenger:(id)binaryMessenger - messageChannelSuffix:(nullable NSString *)messageChannelSuffix; -/// Called when the map camera starts moving. -- (void)didStartCameraMoveWithCompletion:(void (^)(FlutterError *_Nullable))completion; -/// Called when the map camera moves. -- (void)didMoveCameraToPosition:(FGMPlatformCameraPosition *)cameraPosition - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when the map camera stops moving. -- (void)didIdleCameraWithCompletion:(void (^)(FlutterError *_Nullable))completion; -/// Called when the map, not a specifc map object, is tapped. -- (void)didTapAtPosition:(FGMPlatformLatLng *)position - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when the map, not a specifc map object, is long pressed. -- (void)didLongPressAtPosition:(FGMPlatformLatLng *)position - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a marker is tapped. -- (void)didTapMarkerWithIdentifier:(NSString *)markerId - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a marker drag starts. -- (void)didStartDragForMarkerWithIdentifier:(NSString *)markerId - atPosition:(FGMPlatformLatLng *)position - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a marker drag updates. -- (void)didDragMarkerWithIdentifier:(NSString *)markerId - atPosition:(FGMPlatformLatLng *)position - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a marker drag ends. -- (void)didEndDragForMarkerWithIdentifier:(NSString *)markerId - atPosition:(FGMPlatformLatLng *)position - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a marker's info window is tapped. -- (void)didTapInfoWindowOfMarkerWithIdentifier:(NSString *)markerId - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a circle is tapped. -- (void)didTapCircleWithIdentifier:(NSString *)circleId - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a marker cluster is tapped. -- (void)didTapCluster:(FGMPlatformCluster *)cluster - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a polygon is tapped. -- (void)didTapPolygonWithIdentifier:(NSString *)polygonId - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a polyline is tapped. -- (void)didTapPolylineWithIdentifier:(NSString *)polylineId - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called when a ground overlay is tapped. -- (void)didTapGroundOverlayWithIdentifier:(NSString *)groundOverlayId - completion:(void (^)(FlutterError *_Nullable))completion; -/// Called to get data for a map tile. -- (void)tileWithOverlayIdentifier:(NSString *)tileOverlayId - location:(FGMPlatformPoint *)location - zoom:(NSInteger)zoom - completion:(void (^)(FGMPlatformTile *_Nullable, - FlutterError *_Nullable))completion; -@end - -/// Dummy interface to force generation of the platform view creation params, -/// which are not used in any Pigeon calls, only the platform view creation -/// call made internally by Flutter. -@protocol FGMMapsPlatformViewApi -- (void)createViewType:(nullable FGMPlatformMapViewCreationParams *)type - error:(FlutterError *_Nullable *_Nonnull)error; -@end - -extern void SetUpFGMMapsPlatformViewApi(id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFGMMapsPlatformViewApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); - -/// Inspector API only intended for use in integration tests. -@protocol FGMMapsInspectorApi -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)areBuildingsEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)areRotateGesturesEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)areScrollGesturesEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)areTiltGesturesEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)areZoomGesturesEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)isCompassEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)isMyLocationButtonEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSNumber *)isTrafficEnabledWithError:(FlutterError *_Nullable *_Nonnull)error; -- (nullable FGMPlatformTileLayer *)tileOverlayWithIdentifier:(NSString *)tileOverlayId - error: - (FlutterError *_Nullable *_Nonnull)error; -- (nullable FGMPlatformGroundOverlay *) - groundOverlayWithIdentifier:(NSString *)groundOverlayId - error:(FlutterError *_Nullable *_Nonnull)error; -- (nullable FGMPlatformHeatmap *)heatmapWithIdentifier:(NSString *)heatmapId - error:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable FGMPlatformZoomRange *)zoomRange:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable NSArray *) - clustersWithIdentifier:(NSString *)clusterManagerId - error:(FlutterError *_Nullable *_Nonnull)error; -/// @return `nil` only when `error != nil`. -- (nullable FGMPlatformCameraPosition *)cameraPosition:(FlutterError *_Nullable *_Nonnull)error; -@end - -extern void SetUpFGMMapsInspectorApi(id binaryMessenger, - NSObject *_Nullable api); - -extern void SetUpFGMMapsInspectorApiWithSuffix(id binaryMessenger, - NSObject *_Nullable api, - NSString *messageChannelSuffix); - -NS_ASSUME_NONNULL_END diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/lib/src/google_maps_flutter_ios.dart b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/lib/src/google_maps_flutter_ios.dart index c0c8db027c8d..11df18180a50 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/lib/src/google_maps_flutter_ios.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/lib/src/google_maps_flutter_ios.dart @@ -714,57 +714,43 @@ class GoogleMapsFlutterIOS extends GoogleMapsFlutterPlatform { switch (update.updateType) { case CameraUpdateType.newCameraPosition: update as CameraUpdateNewCameraPosition; - return PlatformCameraUpdate( - cameraUpdate: PlatformCameraUpdateNewCameraPosition( - cameraPosition: _platformCameraPositionFromCameraPosition(update.cameraPosition), - ), + return PlatformCameraUpdateNewCameraPosition( + cameraPosition: _platformCameraPositionFromCameraPosition(update.cameraPosition), ); case CameraUpdateType.newLatLng: update as CameraUpdateNewLatLng; - return PlatformCameraUpdate( - cameraUpdate: PlatformCameraUpdateNewLatLng( - latLng: _platformLatLngFromLatLng(update.latLng), - ), - ); + return PlatformCameraUpdateNewLatLng(latLng: _platformLatLngFromLatLng(update.latLng)); case CameraUpdateType.newLatLngZoom: update as CameraUpdateNewLatLngZoom; - return PlatformCameraUpdate( - cameraUpdate: PlatformCameraUpdateNewLatLngZoom( - latLng: _platformLatLngFromLatLng(update.latLng), - zoom: update.zoom, - ), + return PlatformCameraUpdateNewLatLngZoom( + latLng: _platformLatLngFromLatLng(update.latLng), + zoom: update.zoom, ); case CameraUpdateType.newLatLngBounds: update as CameraUpdateNewLatLngBounds; - return PlatformCameraUpdate( - cameraUpdate: PlatformCameraUpdateNewLatLngBounds( - bounds: _platformLatLngBoundsFromLatLngBounds(update.bounds)!, - padding: update.padding, - ), + return PlatformCameraUpdateNewLatLngBounds( + bounds: _platformLatLngBoundsFromLatLngBounds(update.bounds)!, + padding: update.padding, ); case CameraUpdateType.zoomTo: update as CameraUpdateZoomTo; - return PlatformCameraUpdate(cameraUpdate: PlatformCameraUpdateZoomTo(zoom: update.zoom)); + return PlatformCameraUpdateZoomTo(zoom: update.zoom); case CameraUpdateType.zoomBy: update as CameraUpdateZoomBy; final Offset? focus = update.focus; - return PlatformCameraUpdate( - cameraUpdate: PlatformCameraUpdateZoomBy( - amount: update.amount, - focus: focus == null ? null : _platformPointFromOffset(focus), - ), + return PlatformCameraUpdateZoomBy( + amount: update.amount, + focus: focus == null ? null : _platformPointFromOffset(focus), ); case CameraUpdateType.zoomIn: update as CameraUpdateZoomIn; - return PlatformCameraUpdate(cameraUpdate: PlatformCameraUpdateZoom(out: false)); + return PlatformCameraUpdateZoom(out: false); case CameraUpdateType.zoomOut: update as CameraUpdateZoomOut; - return PlatformCameraUpdate(cameraUpdate: PlatformCameraUpdateZoom(out: true)); + return PlatformCameraUpdateZoom(out: true); case CameraUpdateType.scrollBy: update as CameraUpdateScrollBy; - return PlatformCameraUpdate( - cameraUpdate: PlatformCameraUpdateScrollBy(dx: update.dx, dy: update.dy), - ); + return PlatformCameraUpdateScrollBy(dx: update.dx, dy: update.dy); } } @@ -816,51 +802,41 @@ class GoogleMapsFlutterIOS extends GoogleMapsFlutterPlatform { static PlatformBitmap platformBitmapFromBitmapDescriptor(BitmapDescriptor bitmap) { switch (bitmap) { case final DefaultMarker marker: - return PlatformBitmap(bitmap: PlatformBitmapDefaultMarker(hue: marker.hue?.toDouble())); + return PlatformBitmapDefaultMarker(hue: marker.hue?.toDouble()); // Clients may still use this deprecated format, so it must be supported. // ignore: deprecated_member_use case final BytesBitmap bytes: final Size? size = bytes.size; - return PlatformBitmap( - bitmap: PlatformBitmapBytes( - byteData: bytes.byteData, - size: (size == null) ? null : _platformSizeFromSize(size), - ), + return PlatformBitmapBytes( + byteData: bytes.byteData, + size: (size == null) ? null : _platformSizeFromSize(size), ); case final AssetBitmap asset: - return PlatformBitmap( - bitmap: PlatformBitmapAsset(name: asset.name, pkg: asset.package), - ); + return PlatformBitmapAsset(name: asset.name, pkg: asset.package); // Clients may still use this deprecated format, so it must be supported. // ignore: deprecated_member_use case final AssetImageBitmap asset: final Size? size = asset.size; - return PlatformBitmap( - bitmap: PlatformBitmapAssetImage( - name: asset.name, - scale: asset.scale, - size: (size == null) ? null : _platformSizeFromSize(size), - ), + return PlatformBitmapAssetImage( + name: asset.name, + scale: asset.scale, + size: (size == null) ? null : _platformSizeFromSize(size), ); case final AssetMapBitmap asset: - return PlatformBitmap( - bitmap: PlatformBitmapAssetMap( - assetName: asset.assetName, - bitmapScaling: platformMapBitmapScalingFromScaling(asset.bitmapScaling), - imagePixelRatio: asset.imagePixelRatio, - width: asset.width, - height: asset.height, - ), + return PlatformBitmapAssetMap( + assetName: asset.assetName, + bitmapScaling: platformMapBitmapScalingFromScaling(asset.bitmapScaling), + imagePixelRatio: asset.imagePixelRatio, + width: asset.width, + height: asset.height, ); case final BytesMapBitmap bytes: - return PlatformBitmap( - bitmap: PlatformBitmapBytesMap( - byteData: bytes.byteData, - bitmapScaling: platformMapBitmapScalingFromScaling(bytes.bitmapScaling), - imagePixelRatio: bytes.imagePixelRatio, - width: bytes.width, - height: bytes.height, - ), + return PlatformBitmapBytesMap( + byteData: bytes.byteData, + bitmapScaling: platformMapBitmapScalingFromScaling(bytes.bitmapScaling), + imagePixelRatio: bytes.imagePixelRatio, + width: bytes.width, + height: bytes.height, ); case final PinConfig pinConfig: final PlatformColor? backgroundColor = pinConfig.backgroundColor != null @@ -871,38 +847,30 @@ class GoogleMapsFlutterIOS extends GoogleMapsFlutterPlatform { : null; switch (pinConfig.glyph) { case final CircleGlyph circleGlyph: - return PlatformBitmap( - bitmap: PlatformBitmapPinConfig( - backgroundColor: backgroundColor, - borderColor: borderColor, - glyphColor: _platformColorFromColor(circleGlyph.color), - ), + return PlatformBitmapPinConfig( + backgroundColor: backgroundColor, + borderColor: borderColor, + glyphColor: _platformColorFromColor(circleGlyph.color), ); case final TextGlyph textGlyph: - return PlatformBitmap( - bitmap: PlatformBitmapPinConfig( - backgroundColor: backgroundColor, - borderColor: borderColor, - glyphText: textGlyph.text, - glyphTextColor: textGlyph.textColor != null - ? _platformColorFromColor(textGlyph.textColor!) - : null, - ), + return PlatformBitmapPinConfig( + backgroundColor: backgroundColor, + borderColor: borderColor, + glyphText: textGlyph.text, + glyphTextColor: textGlyph.textColor != null + ? _platformColorFromColor(textGlyph.textColor!) + : null, ); case final BitmapGlyph bitmapGlyph: - return PlatformBitmap( - bitmap: PlatformBitmapPinConfig( - backgroundColor: backgroundColor, - borderColor: borderColor, - glyphBitmap: platformBitmapFromBitmapDescriptor(bitmapGlyph.bitmap), - ), + return PlatformBitmapPinConfig( + backgroundColor: backgroundColor, + borderColor: borderColor, + glyphBitmap: platformBitmapFromBitmapDescriptor(bitmapGlyph.bitmap), ); case null: - return PlatformBitmap( - bitmap: PlatformBitmapPinConfig( - backgroundColor: backgroundColor, - borderColor: borderColor, - ), + return PlatformBitmapPinConfig( + backgroundColor: backgroundColor, + borderColor: borderColor, ); } diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/lib/src/messages.g.dart b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/lib/src/messages.g.dart index ee3002aa13ce..0d4c1db5f19f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/lib/src/messages.g.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/lib/src/messages.g.dart @@ -190,52 +190,10 @@ class PlatformCameraPosition { } /// Pigeon representation of a CameraUpdate. -class PlatformCameraUpdate { - PlatformCameraUpdate({required this.cameraUpdate}); - - /// This Object must be one of the classes below prefixed with - /// PlatformCameraUpdate. Each such class represents a different type of - /// camera update, and each holds a different set of data, preventing the - /// use of a single unified class. - Object cameraUpdate; - - List _toList() { - return [cameraUpdate]; - } - - Object encode() { - return _toList(); - } - - static PlatformCameraUpdate decode(Object result) { - result as List; - return PlatformCameraUpdate(cameraUpdate: result[0]!); - } - - @override - // ignore: avoid_equals_and_hash_code_on_mutable_classes - bool operator ==(Object other) { - if (other is! PlatformCameraUpdate || other.runtimeType != runtimeType) { - return false; - } - if (identical(this, other)) { - return true; - } - return _deepEquals(cameraUpdate, other.cameraUpdate); - } - - @override - // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => _deepHash([runtimeType, ..._toList()]); - - @override - String toString() { - return 'PlatformCameraUpdate(cameraUpdate: $cameraUpdate)'; - } -} +sealed class PlatformCameraUpdate {} /// Pigeon equivalent of NewCameraPosition -class PlatformCameraUpdateNewCameraPosition { +class PlatformCameraUpdateNewCameraPosition extends PlatformCameraUpdate { PlatformCameraUpdateNewCameraPosition({required this.cameraPosition}); PlatformCameraPosition cameraPosition; @@ -278,7 +236,7 @@ class PlatformCameraUpdateNewCameraPosition { } /// Pigeon equivalent of NewLatLng -class PlatformCameraUpdateNewLatLng { +class PlatformCameraUpdateNewLatLng extends PlatformCameraUpdate { PlatformCameraUpdateNewLatLng({required this.latLng}); PlatformLatLng latLng; @@ -319,7 +277,7 @@ class PlatformCameraUpdateNewLatLng { } /// Pigeon equivalent of NewLatLngBounds -class PlatformCameraUpdateNewLatLngBounds { +class PlatformCameraUpdateNewLatLngBounds extends PlatformCameraUpdate { PlatformCameraUpdateNewLatLngBounds({required this.bounds, required this.padding}); PlatformLatLngBounds bounds; @@ -365,7 +323,7 @@ class PlatformCameraUpdateNewLatLngBounds { } /// Pigeon equivalent of NewLatLngZoom -class PlatformCameraUpdateNewLatLngZoom { +class PlatformCameraUpdateNewLatLngZoom extends PlatformCameraUpdate { PlatformCameraUpdateNewLatLngZoom({required this.latLng, required this.zoom}); PlatformLatLng latLng; @@ -411,7 +369,7 @@ class PlatformCameraUpdateNewLatLngZoom { } /// Pigeon equivalent of ScrollBy -class PlatformCameraUpdateScrollBy { +class PlatformCameraUpdateScrollBy extends PlatformCameraUpdate { PlatformCameraUpdateScrollBy({required this.dx, required this.dy}); double dx; @@ -454,7 +412,7 @@ class PlatformCameraUpdateScrollBy { } /// Pigeon equivalent of ZoomBy -class PlatformCameraUpdateZoomBy { +class PlatformCameraUpdateZoomBy extends PlatformCameraUpdate { PlatformCameraUpdateZoomBy({required this.amount, this.focus}); double amount; @@ -500,7 +458,7 @@ class PlatformCameraUpdateZoomBy { } /// Pigeon equivalent of ZoomIn/ZoomOut -class PlatformCameraUpdateZoom { +class PlatformCameraUpdateZoom extends PlatformCameraUpdate { PlatformCameraUpdateZoom({required this.out}); bool out; @@ -541,7 +499,7 @@ class PlatformCameraUpdateZoom { } /// Pigeon equivalent of ZoomTo -class PlatformCameraUpdateZoomTo { +class PlatformCameraUpdateZoomTo extends PlatformCameraUpdate { PlatformCameraUpdateZoomTo({required this.zoom}); double zoom; @@ -2306,58 +2264,11 @@ class PlatformZoomRange { } } -/// Pigeon equivalent of [BitmapDescriptor]. As there are multiple disjoint -/// types of [BitmapDescriptor], [PlatformBitmap] contains a single field which -/// may hold the pigeon equivalent type of any of them. -class PlatformBitmap { - PlatformBitmap({required this.bitmap}); - - /// One of [PlatformBitmapAssetMap], [PlatformBitmapAsset], - /// [PlatformBitmapAssetImage], [PlatformBitmapBytesMap], - /// [PlatformBitmapBytes], or [PlatformBitmapDefaultMarker]. - /// As Pigeon does not currently support data class inheritance, this - /// approach allows for the different bitmap implementations to be valid - /// argument and return types of the API methods. See - /// https://github.com/flutter/flutter/issues/117819. - Object bitmap; - - List _toList() { - return [bitmap]; - } - - Object encode() { - return _toList(); - } - - static PlatformBitmap decode(Object result) { - result as List; - return PlatformBitmap(bitmap: result[0]!); - } - - @override - // ignore: avoid_equals_and_hash_code_on_mutable_classes - bool operator ==(Object other) { - if (other is! PlatformBitmap || other.runtimeType != runtimeType) { - return false; - } - if (identical(this, other)) { - return true; - } - return _deepEquals(bitmap, other.bitmap); - } - - @override - // ignore: avoid_equals_and_hash_code_on_mutable_classes - int get hashCode => _deepHash([runtimeType, ..._toList()]); - - @override - String toString() { - return 'PlatformBitmap(bitmap: $bitmap)'; - } -} +/// Pigeon equivalent of [BitmapDescriptor]. +sealed class PlatformBitmap {} /// Pigeon equivalent of [DefaultMarker]. -class PlatformBitmapDefaultMarker { +class PlatformBitmapDefaultMarker extends PlatformBitmap { PlatformBitmapDefaultMarker({this.hue}); double? hue; @@ -2398,7 +2309,7 @@ class PlatformBitmapDefaultMarker { } /// Pigeon equivalent of [BytesBitmap]. -class PlatformBitmapBytes { +class PlatformBitmapBytes extends PlatformBitmap { PlatformBitmapBytes({required this.byteData, this.size}); Uint8List byteData; @@ -2441,7 +2352,7 @@ class PlatformBitmapBytes { } /// Pigeon equivalent of [AssetBitmap]. -class PlatformBitmapAsset { +class PlatformBitmapAsset extends PlatformBitmap { PlatformBitmapAsset({required this.name, this.pkg}); String name; @@ -2484,7 +2395,7 @@ class PlatformBitmapAsset { } /// Pigeon equivalent of [AssetImageBitmap]. -class PlatformBitmapAssetImage { +class PlatformBitmapAssetImage extends PlatformBitmap { PlatformBitmapAssetImage({required this.name, required this.scale, this.size}); String name; @@ -2535,7 +2446,7 @@ class PlatformBitmapAssetImage { } /// Pigeon equivalent of [AssetMapBitmap]. -class PlatformBitmapAssetMap { +class PlatformBitmapAssetMap extends PlatformBitmap { PlatformBitmapAssetMap({ required this.assetName, required this.bitmapScaling, @@ -2600,7 +2511,7 @@ class PlatformBitmapAssetMap { } /// Pigeon equivalent of [BytesMapBitmap]. -class PlatformBitmapBytesMap { +class PlatformBitmapBytesMap extends PlatformBitmap { PlatformBitmapBytesMap({ required this.byteData, required this.bitmapScaling, @@ -2665,7 +2576,7 @@ class PlatformBitmapBytesMap { } /// Pigeon equivalent of [PinConfig]. -class PlatformBitmapPinConfig { +class PlatformBitmapPinConfig extends PlatformBitmap { PlatformBitmapPinConfig({ this.backgroundColor, this.borderColor, @@ -2769,131 +2680,125 @@ class _PigeonCodec extends StandardMessageCodec { } else if (value is PlatformCameraPosition) { buffer.putUint8(135); writeValue(buffer, value.encode()); - } else if (value is PlatformCameraUpdate) { - buffer.putUint8(136); - writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateNewCameraPosition) { - buffer.putUint8(137); + buffer.putUint8(136); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateNewLatLng) { - buffer.putUint8(138); + buffer.putUint8(137); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateNewLatLngBounds) { - buffer.putUint8(139); + buffer.putUint8(138); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateNewLatLngZoom) { - buffer.putUint8(140); + buffer.putUint8(139); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateScrollBy) { - buffer.putUint8(141); + buffer.putUint8(140); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateZoomBy) { - buffer.putUint8(142); + buffer.putUint8(141); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateZoom) { - buffer.putUint8(143); + buffer.putUint8(142); writeValue(buffer, value.encode()); } else if (value is PlatformCameraUpdateZoomTo) { - buffer.putUint8(144); + buffer.putUint8(143); writeValue(buffer, value.encode()); } else if (value is PlatformCircle) { - buffer.putUint8(145); + buffer.putUint8(144); writeValue(buffer, value.encode()); } else if (value is PlatformHeatmap) { - buffer.putUint8(146); + buffer.putUint8(145); writeValue(buffer, value.encode()); } else if (value is PlatformHeatmapGradient) { - buffer.putUint8(147); + buffer.putUint8(146); writeValue(buffer, value.encode()); } else if (value is PlatformWeightedLatLng) { - buffer.putUint8(148); + buffer.putUint8(147); writeValue(buffer, value.encode()); } else if (value is PlatformInfoWindow) { - buffer.putUint8(149); + buffer.putUint8(148); writeValue(buffer, value.encode()); } else if (value is PlatformCluster) { - buffer.putUint8(150); + buffer.putUint8(149); writeValue(buffer, value.encode()); } else if (value is PlatformClusterManager) { - buffer.putUint8(151); + buffer.putUint8(150); writeValue(buffer, value.encode()); } else if (value is PlatformMarker) { - buffer.putUint8(152); + buffer.putUint8(151); writeValue(buffer, value.encode()); } else if (value is PlatformPolygon) { - buffer.putUint8(153); + buffer.putUint8(152); writeValue(buffer, value.encode()); } else if (value is PlatformPolyline) { - buffer.putUint8(154); + buffer.putUint8(153); writeValue(buffer, value.encode()); } else if (value is PlatformPatternItem) { - buffer.putUint8(155); + buffer.putUint8(154); writeValue(buffer, value.encode()); } else if (value is PlatformTile) { - buffer.putUint8(156); + buffer.putUint8(155); writeValue(buffer, value.encode()); } else if (value is PlatformTileOverlay) { - buffer.putUint8(157); + buffer.putUint8(156); writeValue(buffer, value.encode()); } else if (value is PlatformEdgeInsets) { - buffer.putUint8(158); + buffer.putUint8(157); writeValue(buffer, value.encode()); } else if (value is PlatformLatLng) { - buffer.putUint8(159); + buffer.putUint8(158); writeValue(buffer, value.encode()); } else if (value is PlatformLatLngBounds) { - buffer.putUint8(160); + buffer.putUint8(159); writeValue(buffer, value.encode()); } else if (value is PlatformCameraTargetBounds) { - buffer.putUint8(161); + buffer.putUint8(160); writeValue(buffer, value.encode()); } else if (value is PlatformGroundOverlay) { - buffer.putUint8(162); + buffer.putUint8(161); writeValue(buffer, value.encode()); } else if (value is PlatformMapViewCreationParams) { - buffer.putUint8(163); + buffer.putUint8(162); writeValue(buffer, value.encode()); } else if (value is PlatformMapConfiguration) { - buffer.putUint8(164); + buffer.putUint8(163); writeValue(buffer, value.encode()); } else if (value is PlatformPoint) { - buffer.putUint8(165); + buffer.putUint8(164); writeValue(buffer, value.encode()); } else if (value is PlatformSize) { - buffer.putUint8(166); + buffer.putUint8(165); writeValue(buffer, value.encode()); } else if (value is PlatformColor) { - buffer.putUint8(167); + buffer.putUint8(166); writeValue(buffer, value.encode()); } else if (value is PlatformTileLayer) { - buffer.putUint8(168); + buffer.putUint8(167); writeValue(buffer, value.encode()); } else if (value is PlatformZoomRange) { - buffer.putUint8(169); - writeValue(buffer, value.encode()); - } else if (value is PlatformBitmap) { - buffer.putUint8(170); + buffer.putUint8(168); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapDefaultMarker) { - buffer.putUint8(171); + buffer.putUint8(169); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapBytes) { - buffer.putUint8(172); + buffer.putUint8(170); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapAsset) { - buffer.putUint8(173); + buffer.putUint8(171); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapAssetImage) { - buffer.putUint8(174); + buffer.putUint8(172); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapAssetMap) { - buffer.putUint8(175); + buffer.putUint8(173); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapBytesMap) { - buffer.putUint8(176); + buffer.putUint8(174); writeValue(buffer, value.encode()); } else if (value is PlatformBitmapPinConfig) { - buffer.putUint8(177); + buffer.putUint8(175); writeValue(buffer, value.encode()); } else { super.writeValue(buffer, value); @@ -2924,88 +2829,84 @@ class _PigeonCodec extends StandardMessageCodec { case 135: return PlatformCameraPosition.decode(readValue(buffer)!); case 136: - return PlatformCameraUpdate.decode(readValue(buffer)!); - case 137: return PlatformCameraUpdateNewCameraPosition.decode(readValue(buffer)!); - case 138: + case 137: return PlatformCameraUpdateNewLatLng.decode(readValue(buffer)!); - case 139: + case 138: return PlatformCameraUpdateNewLatLngBounds.decode(readValue(buffer)!); - case 140: + case 139: return PlatformCameraUpdateNewLatLngZoom.decode(readValue(buffer)!); - case 141: + case 140: return PlatformCameraUpdateScrollBy.decode(readValue(buffer)!); - case 142: + case 141: return PlatformCameraUpdateZoomBy.decode(readValue(buffer)!); - case 143: + case 142: return PlatformCameraUpdateZoom.decode(readValue(buffer)!); - case 144: + case 143: return PlatformCameraUpdateZoomTo.decode(readValue(buffer)!); - case 145: + case 144: return PlatformCircle.decode(readValue(buffer)!); - case 146: + case 145: return PlatformHeatmap.decode(readValue(buffer)!); - case 147: + case 146: return PlatformHeatmapGradient.decode(readValue(buffer)!); - case 148: + case 147: return PlatformWeightedLatLng.decode(readValue(buffer)!); - case 149: + case 148: return PlatformInfoWindow.decode(readValue(buffer)!); - case 150: + case 149: return PlatformCluster.decode(readValue(buffer)!); - case 151: + case 150: return PlatformClusterManager.decode(readValue(buffer)!); - case 152: + case 151: return PlatformMarker.decode(readValue(buffer)!); - case 153: + case 152: return PlatformPolygon.decode(readValue(buffer)!); - case 154: + case 153: return PlatformPolyline.decode(readValue(buffer)!); - case 155: + case 154: return PlatformPatternItem.decode(readValue(buffer)!); - case 156: + case 155: return PlatformTile.decode(readValue(buffer)!); - case 157: + case 156: return PlatformTileOverlay.decode(readValue(buffer)!); - case 158: + case 157: return PlatformEdgeInsets.decode(readValue(buffer)!); - case 159: + case 158: return PlatformLatLng.decode(readValue(buffer)!); - case 160: + case 159: return PlatformLatLngBounds.decode(readValue(buffer)!); - case 161: + case 160: return PlatformCameraTargetBounds.decode(readValue(buffer)!); - case 162: + case 161: return PlatformGroundOverlay.decode(readValue(buffer)!); - case 163: + case 162: return PlatformMapViewCreationParams.decode(readValue(buffer)!); - case 164: + case 163: return PlatformMapConfiguration.decode(readValue(buffer)!); - case 165: + case 164: return PlatformPoint.decode(readValue(buffer)!); - case 166: + case 165: return PlatformSize.decode(readValue(buffer)!); - case 167: + case 166: return PlatformColor.decode(readValue(buffer)!); - case 168: + case 167: return PlatformTileLayer.decode(readValue(buffer)!); - case 169: + case 168: return PlatformZoomRange.decode(readValue(buffer)!); - case 170: - return PlatformBitmap.decode(readValue(buffer)!); - case 171: + case 169: return PlatformBitmapDefaultMarker.decode(readValue(buffer)!); - case 172: + case 170: return PlatformBitmapBytes.decode(readValue(buffer)!); - case 173: + case 171: return PlatformBitmapAsset.decode(readValue(buffer)!); - case 174: + case 172: return PlatformBitmapAssetImage.decode(readValue(buffer)!); - case 175: + case 173: return PlatformBitmapAssetMap.decode(readValue(buffer)!); - case 176: + case 174: return PlatformBitmapBytesMap.decode(readValue(buffer)!); - case 177: + case 175: return PlatformBitmapPinConfig.decode(readValue(buffer)!); default: return super.readValueOfType(type, buffer); diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/pigeons/messages.dart b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/pigeons/messages.dart index cb2f853015a1..5a87863f002a 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/pigeons/messages.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/pigeons/messages.dart @@ -7,14 +7,8 @@ import 'package:pigeon/pigeon.dart'; @ConfigurePigeon( PigeonOptions( dartOut: 'lib/src/messages.g.dart', - // This uses a different output name to avoid conflicts with the pigeon - // files in other packages, without having to use full relative paths - // in #includes (which would make source sharing harder to manage). - objcHeaderOut: - 'ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/include/google_maps_flutter_ios_objc/google_maps_flutter_pigeon_messages.g.h', - objcSourceOut: - 'ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios_objc/google_maps_flutter_pigeon_messages.g.m', - objcOptions: ObjcOptions(prefix: 'FGM'), + swiftOut: + 'ios/google_maps_flutter_ios/Sources/google_maps_flutter_ios/Messages.g.swift', copyrightHeader: 'pigeons/copyright.txt', // Use the base package name so that the generated code can be shared // across the implementation copies. @@ -40,66 +34,56 @@ class PlatformCameraPosition { } /// Pigeon representation of a CameraUpdate. -class PlatformCameraUpdate { - PlatformCameraUpdate(this.cameraUpdate); - - /// This Object must be one of the classes below prefixed with - /// PlatformCameraUpdate. Each such class represents a different type of - /// camera update, and each holds a different set of data, preventing the - /// use of a single unified class. - // Pigeon does not support inheritance, which prevents a more strict type - // bound. See https://github.com/flutter/flutter/issues/117819. - final Object cameraUpdate; -} +sealed class PlatformCameraUpdate {} /// Pigeon equivalent of NewCameraPosition -class PlatformCameraUpdateNewCameraPosition { +class PlatformCameraUpdateNewCameraPosition extends PlatformCameraUpdate { PlatformCameraUpdateNewCameraPosition(this.cameraPosition); final PlatformCameraPosition cameraPosition; } /// Pigeon equivalent of NewLatLng -class PlatformCameraUpdateNewLatLng { +class PlatformCameraUpdateNewLatLng extends PlatformCameraUpdate { PlatformCameraUpdateNewLatLng(this.latLng); final PlatformLatLng latLng; } /// Pigeon equivalent of NewLatLngBounds -class PlatformCameraUpdateNewLatLngBounds { +class PlatformCameraUpdateNewLatLngBounds extends PlatformCameraUpdate { PlatformCameraUpdateNewLatLngBounds(this.bounds, this.padding); final PlatformLatLngBounds bounds; final double padding; } /// Pigeon equivalent of NewLatLngZoom -class PlatformCameraUpdateNewLatLngZoom { +class PlatformCameraUpdateNewLatLngZoom extends PlatformCameraUpdate { PlatformCameraUpdateNewLatLngZoom(this.latLng, this.zoom); final PlatformLatLng latLng; final double zoom; } /// Pigeon equivalent of ScrollBy -class PlatformCameraUpdateScrollBy { +class PlatformCameraUpdateScrollBy extends PlatformCameraUpdate { PlatformCameraUpdateScrollBy(this.dx, this.dy); final double dx; final double dy; } /// Pigeon equivalent of ZoomBy -class PlatformCameraUpdateZoomBy { +class PlatformCameraUpdateZoomBy extends PlatformCameraUpdate { PlatformCameraUpdateZoomBy(this.amount, [this.focus]); final double amount; final PlatformPoint? focus; } /// Pigeon equivalent of ZoomIn/ZoomOut -class PlatformCameraUpdateZoom { +class PlatformCameraUpdateZoom extends PlatformCameraUpdate { PlatformCameraUpdateZoom(this.out); final bool out; } /// Pigeon equivalent of ZoomTo -class PlatformCameraUpdateZoomTo { +class PlatformCameraUpdateZoomTo extends PlatformCameraUpdate { PlatformCameraUpdateZoomTo(this.zoom); final double zoom; } @@ -541,31 +525,18 @@ class PlatformZoomRange { final double? max; } -/// Pigeon equivalent of [BitmapDescriptor]. As there are multiple disjoint -/// types of [BitmapDescriptor], [PlatformBitmap] contains a single field which -/// may hold the pigeon equivalent type of any of them. -class PlatformBitmap { - PlatformBitmap({required this.bitmap}); - - /// One of [PlatformBitmapAssetMap], [PlatformBitmapAsset], - /// [PlatformBitmapAssetImage], [PlatformBitmapBytesMap], - /// [PlatformBitmapBytes], or [PlatformBitmapDefaultMarker]. - /// As Pigeon does not currently support data class inheritance, this - /// approach allows for the different bitmap implementations to be valid - /// argument and return types of the API methods. See - /// https://github.com/flutter/flutter/issues/117819. - final Object bitmap; -} +/// Pigeon equivalent of [BitmapDescriptor]. +sealed class PlatformBitmap {} /// Pigeon equivalent of [DefaultMarker]. -class PlatformBitmapDefaultMarker { +class PlatformBitmapDefaultMarker extends PlatformBitmap { PlatformBitmapDefaultMarker({this.hue}); final double? hue; } /// Pigeon equivalent of [BytesBitmap]. -class PlatformBitmapBytes { +class PlatformBitmapBytes extends PlatformBitmap { PlatformBitmapBytes({required this.byteData, this.size}); final Uint8List byteData; @@ -573,7 +544,7 @@ class PlatformBitmapBytes { } /// Pigeon equivalent of [AssetBitmap]. -class PlatformBitmapAsset { +class PlatformBitmapAsset extends PlatformBitmap { PlatformBitmapAsset({required this.name, this.pkg}); final String name; @@ -581,7 +552,7 @@ class PlatformBitmapAsset { } /// Pigeon equivalent of [AssetImageBitmap]. -class PlatformBitmapAssetImage { +class PlatformBitmapAssetImage extends PlatformBitmap { PlatformBitmapAssetImage({required this.name, required this.scale, this.size}); final String name; final double scale; @@ -589,7 +560,7 @@ class PlatformBitmapAssetImage { } /// Pigeon equivalent of [AssetMapBitmap]. -class PlatformBitmapAssetMap { +class PlatformBitmapAssetMap extends PlatformBitmap { PlatformBitmapAssetMap({ required this.assetName, required this.bitmapScaling, @@ -605,7 +576,7 @@ class PlatformBitmapAssetMap { } /// Pigeon equivalent of [BytesMapBitmap]. -class PlatformBitmapBytesMap { +class PlatformBitmapBytesMap extends PlatformBitmap { PlatformBitmapBytesMap({ required this.byteData, required this.bitmapScaling, @@ -624,7 +595,7 @@ class PlatformBitmapBytesMap { enum PlatformMapBitmapScaling { auto, none } /// Pigeon equivalent of [PinConfig]. -class PlatformBitmapPinConfig { +class PlatformBitmapPinConfig extends PlatformBitmap { PlatformBitmapPinConfig({ required this.backgroundColor, required this.borderColor, @@ -655,11 +626,11 @@ abstract class MapsApi { /// /// Only non-null configuration values will result in updates; options with /// null values will remain unchanged. - @ObjCSelector('updateWithMapConfiguration:') + @SwiftFunction('updateWithMapConfiguration(_:)') void updateMapConfiguration(PlatformMapConfiguration configuration); /// Updates the set of circles on the map. - @ObjCSelector('updateCirclesByAdding:changing:removing:') + @SwiftFunction('updateCircles(adding:changing:removing:)') void updateCircles( List toAdd, List toChange, @@ -667,7 +638,7 @@ abstract class MapsApi { ); /// Updates the set of heatmaps on the map. - @ObjCSelector('updateHeatmapsByAdding:changing:removing:') + @SwiftFunction('updateHeatmaps(adding:changing:removing:)') void updateHeatmaps( List toAdd, List toChange, @@ -675,11 +646,11 @@ abstract class MapsApi { ); /// Updates the set of custer managers for clusters on the map. - @ObjCSelector('updateClusterManagersByAdding:removing:') + @SwiftFunction('updateClusterManagers(adding:removing:)') void updateClusterManagers(List toAdd, List idsToRemove); /// Updates the set of markers on the map. - @ObjCSelector('updateMarkersByAdding:changing:removing:') + @SwiftFunction('updateMarkers(adding:changing:removing:)') void updateMarkers( List toAdd, List toChange, @@ -687,7 +658,7 @@ abstract class MapsApi { ); /// Updates the set of polygonss on the map. - @ObjCSelector('updatePolygonsByAdding:changing:removing:') + @SwiftFunction('updatePolygons(adding:changing:removing:)') void updatePolygons( List toAdd, List toChange, @@ -695,7 +666,7 @@ abstract class MapsApi { ); /// Updates the set of polylines on the map. - @ObjCSelector('updatePolylinesByAdding:changing:removing:') + @SwiftFunction('updatePolylines(adding:changing:removing:)') void updatePolylines( List toAdd, List toChange, @@ -703,7 +674,7 @@ abstract class MapsApi { ); /// Updates the set of tile overlays on the map. - @ObjCSelector('updateTileOverlaysByAdding:changing:removing:') + @SwiftFunction('updateTileOverlays(adding:changing:removing:)') void updateTileOverlays( List toAdd, List toChange, @@ -711,7 +682,7 @@ abstract class MapsApi { ); /// Updates the set of ground overlays on the map. - @ObjCSelector('updateGroundOverlaysByAdding:changing:removing:') + @SwiftFunction('updateGroundOverlays(adding:changing:removing:)') void updateGroundOverlays( List toAdd, List toChange, @@ -719,42 +690,42 @@ abstract class MapsApi { ); /// Gets the screen coordinate for the given map location. - @ObjCSelector('screenCoordinatesForLatLng:') + @SwiftFunction('screenCoordinates(for:)') PlatformPoint getScreenCoordinate(PlatformLatLng latLng); /// Gets the map location for the given screen coordinate. - @ObjCSelector('latLngForScreenCoordinate:') + @SwiftFunction('latLng(for:)') PlatformLatLng getLatLng(PlatformPoint screenCoordinate); /// Gets the map region currently displayed on the map. - @ObjCSelector('visibleMapRegion') + @SwiftFunction('visibleMapRegion()') PlatformLatLngBounds getVisibleRegion(); /// Moves the camera according to [cameraUpdate] immediately, with no /// animation. - @ObjCSelector('moveCameraWithUpdate:') + @SwiftFunction('moveCamera(_:)') void moveCamera(PlatformCameraUpdate cameraUpdate); /// Moves the camera according to [cameraUpdate], animating the update using a /// duration in milliseconds if provided. - @ObjCSelector('animateCameraWithUpdate:duration:') + @SwiftFunction('animateCamera(_:duration:)') void animateCamera(PlatformCameraUpdate cameraUpdate, int? durationMilliseconds); /// Gets the current map zoom level. - @ObjCSelector('currentZoomLevel') + @SwiftFunction('zoomLevel()') double getZoomLevel(); /// Show the info window for the marker with the given ID. - @ObjCSelector('showInfoWindowForMarkerWithIdentifier:') + @SwiftFunction('showInfoWindowForMarker(withIdentifier:)') void showInfoWindow(String markerId); /// Hide the info window for the marker with the given ID. - @ObjCSelector('hideInfoWindowForMarkerWithIdentifier:') + @SwiftFunction('hideInfoWindowForMarker(withIdentifier:)') void hideInfoWindow(String markerId); /// Returns true if the marker with the given ID is currently displaying its /// info window. - @ObjCSelector('isShowingInfoWindowForMarkerWithIdentifier:') + @SwiftFunction('isShowingInfoWindowForMarker(withIdentifier:)') bool isInfoWindowShown(String markerId); /// Sets the style to the given map style string, where an empty string @@ -762,7 +733,7 @@ abstract class MapsApi { /// /// If there was an error setting the style, such as an invalid style string, /// returns the error message. - @ObjCSelector('setStyle:') + @SwiftFunction('setStyle(_:)') String? setStyle(String style); /// Returns the error string from the last attempt to set the map style, if @@ -770,18 +741,18 @@ abstract class MapsApi { /// /// This allows checking asynchronously for initial style failures, as there /// is no way to return failures from map initialization. - @ObjCSelector('lastStyleError') + @SwiftFunction('lastStyleError()') String? getLastStyleError(); /// Clears the cache of tiles previously requseted from the tile provider. - @ObjCSelector('clearTileCacheForOverlayWithIdentifier:') + @SwiftFunction('clearTileCacheForOverlay(withIdentifier:)') void clearTileCache(String tileOverlayId); /// Takes a snapshot of the map and returns its image data. Uint8List? takeSnapshot(); /// Returns true if the map supports advanced markers. - @ObjCSelector('isAdvancedMarkersAvailable') + @SwiftFunction('isAdvancedMarkersAvailable()') bool isAdvancedMarkersAvailable(); } @@ -789,68 +760,68 @@ abstract class MapsApi { @FlutterApi() abstract class MapsCallbackApi { /// Called when the map camera starts moving. - @ObjCSelector('didStartCameraMoveWithCompletion') + @SwiftFunction('didStartCameraMove()') void onCameraMoveStarted(); /// Called when the map camera moves. - @ObjCSelector('didMoveCameraToPosition:') + @SwiftFunction('didMoveCamera(to:)') void onCameraMove(PlatformCameraPosition cameraPosition); /// Called when the map camera stops moving. - @ObjCSelector('didIdleCameraWithCompletion') + @SwiftFunction('didIdleCamera()') void onCameraIdle(); /// Called when the map, not a specifc map object, is tapped. - @ObjCSelector('didTapAtPosition:') + @SwiftFunction('didTap(at:)') void onTap(PlatformLatLng position); /// Called when the map, not a specifc map object, is long pressed. - @ObjCSelector('didLongPressAtPosition:') + @SwiftFunction('didLongPress(at:)') void onLongPress(PlatformLatLng position); /// Called when a marker is tapped. - @ObjCSelector('didTapMarkerWithIdentifier:') + @SwiftFunction('didTapMarker(withIdentifier:)') void onMarkerTap(String markerId); /// Called when a marker drag starts. - @ObjCSelector('didStartDragForMarkerWithIdentifier:atPosition:') + @SwiftFunction('didStartDragForMarker(withIdentifier:at:)') void onMarkerDragStart(String markerId, PlatformLatLng position); /// Called when a marker drag updates. - @ObjCSelector('didDragMarkerWithIdentifier:atPosition:') + @SwiftFunction('didDragMarker(withIdentifier:at:)') void onMarkerDrag(String markerId, PlatformLatLng position); /// Called when a marker drag ends. - @ObjCSelector('didEndDragForMarkerWithIdentifier:atPosition:') + @SwiftFunction('didEndDragForMarker(withIdentifier:at:)') void onMarkerDragEnd(String markerId, PlatformLatLng position); /// Called when a marker's info window is tapped. - @ObjCSelector('didTapInfoWindowOfMarkerWithIdentifier:') + @SwiftFunction('didTapInfoWindowOfMarker(withIdentifier:)') void onInfoWindowTap(String markerId); /// Called when a circle is tapped. - @ObjCSelector('didTapCircleWithIdentifier:') + @SwiftFunction('didTapCircle(withIdentifier:)') void onCircleTap(String circleId); /// Called when a marker cluster is tapped. - @ObjCSelector('didTapCluster:') + @SwiftFunction('didTapCluster(_:)') void onClusterTap(PlatformCluster cluster); /// Called when a polygon is tapped. - @ObjCSelector('didTapPolygonWithIdentifier:') + @SwiftFunction('didTapPolygon(withIdentifier:)') void onPolygonTap(String polygonId); /// Called when a polyline is tapped. - @ObjCSelector('didTapPolylineWithIdentifier:') + @SwiftFunction('didTapPolyline(withIdentifier:)') void onPolylineTap(String polylineId); /// Called when a ground overlay is tapped. - @ObjCSelector('didTapGroundOverlayWithIdentifier:') + @SwiftFunction('didTapGroundOverlay(withIdentifier:)') void onGroundOverlayTap(String groundOverlayId); /// Called to get data for a map tile. @async - @ObjCSelector('tileWithOverlayIdentifier:location:zoom:') + @SwiftFunction('tile(withOverlayIdentifier:location:zoom:)') PlatformTile getTileOverlayTile(String tileOverlayId, PlatformPoint location, int zoom); } @@ -874,16 +845,16 @@ abstract class MapsInspectorApi { bool isCompassEnabled(); bool isMyLocationButtonEnabled(); bool isTrafficEnabled(); - @ObjCSelector('tileOverlayWithIdentifier:') + @SwiftFunction('tileOverlay(withIdentifier:)') PlatformTileLayer? getTileOverlayInfo(String tileOverlayId); - @ObjCSelector('groundOverlayWithIdentifier:') + @SwiftFunction('groundOverlay(withIdentifier:)') PlatformGroundOverlay? getGroundOverlayInfo(String groundOverlayId); - @ObjCSelector('heatmapWithIdentifier:') + @SwiftFunction('heatmap(withIdentifier:)') PlatformHeatmap? getHeatmapInfo(String heatmapId); - @ObjCSelector('zoomRange') + @SwiftFunction('zoomRange()') PlatformZoomRange getZoomRange(); - @ObjCSelector('clustersWithIdentifier:') + @SwiftFunction('clusters(withIdentifier:)') List getClusters(String clusterManagerId); - @ObjCSelector('cameraPosition') + @SwiftFunction('cameraPosition()') PlatformCameraPosition getCameraPosition(); } From 3d3609b82291dd471646edf0779f700089353f3b Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Sat, 5 Sep 2026 11:08:28 -0400 Subject: [PATCH 10/14] Version bump --- .../google_maps_flutter_ios_sdk10/CHANGELOG.md | 4 ++++ .../google_maps_flutter_ios_sdk10/pubspec.yaml | 2 +- .../google_maps_flutter_ios_sdk9/CHANGELOG.md | 4 ++++ .../google_maps_flutter_ios_sdk9/pubspec.yaml | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/CHANGELOG.md index da4a2a3785c9..fa14994ab6bf 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.18.12 + +* Converts ramaining Objective-C code to Swift. + ## 2.18.11 * Converts heatmap controller and data conversion to Swift. diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/pubspec.yaml index 387b927e9529..541f534f98cf 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter_ios_sdk10 description: iOS implementation of the google_maps_flutter plugin using Google Maps SDK 10. repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_ios_sdk10 issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 2.18.11 +version: 2.18.12 environment: sdk: ^3.10.0 diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/CHANGELOG.md index 8918af1d9e15..0ae6b22f1d8f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/CHANGELOG.md @@ -1,3 +1,7 @@ +## 2.18.13 + +* Converts ramaining Objective-C code to Swift. + ## 2.18.12 * Converts heatmap controller and data conversion to Swift. diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/pubspec.yaml b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/pubspec.yaml index b1ad8871281e..7e0ae8b33708 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/pubspec.yaml +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/pubspec.yaml @@ -2,7 +2,7 @@ name: google_maps_flutter_ios_sdk9 description: iOS implementation of the google_maps_flutter plugin using Google Maps SDK 9. repository: https://github.com/flutter/packages/tree/main/packages/google_maps_flutter/google_maps_flutter_ios_sdk9 issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+maps%22 -version: 2.18.12 +version: 2.18.13 environment: sdk: ^3.10.0 From b8cca84f1235b2a43af63af691f1c4eb31e686ba Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Sat, 5 Sep 2026 16:00:03 -0400 Subject: [PATCH 11/14] Typo fix --- .../google_maps_flutter_ios_sdk10/CHANGELOG.md | 2 +- .../google_maps_flutter_ios_sdk9/CHANGELOG.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/CHANGELOG.md index fa14994ab6bf..9c30d78e425a 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/CHANGELOG.md @@ -1,6 +1,6 @@ ## 2.18.12 -* Converts ramaining Objective-C code to Swift. +* Converts remaining Objective-C code to Swift. ## 2.18.11 diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/CHANGELOG.md b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/CHANGELOG.md index 0ae6b22f1d8f..3fcd7def0067 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/CHANGELOG.md +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/CHANGELOG.md @@ -1,6 +1,6 @@ ## 2.18.13 -* Converts ramaining Objective-C code to Swift. +* Converts remaining Objective-C code to Swift. ## 2.18.12 From b52069a982854e1c95341c73553e409db341a12c Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Sat, 5 Sep 2026 18:46:42 -0400 Subject: [PATCH 12/14] Update Dart unit tests for class changes --- .../GoogleMapsUtilsTrampoline.h | 12 ---- .../test/google_maps_flutter_ios_test.dart | 58 +++++++++---------- .../test/google_maps_flutter_ios_test.dart | 58 +++++++++---------- .../test/google_maps_flutter_ios_test.dart | 58 +++++++++---------- 4 files changed, 87 insertions(+), 99 deletions(-) delete mode 100644 packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/google_maps_flutter_ios_sdk10_objc/GoogleMapsUtilsTrampoline.h diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/google_maps_flutter_ios_sdk10_objc/GoogleMapsUtilsTrampoline.h b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/google_maps_flutter_ios_sdk10_objc/GoogleMapsUtilsTrampoline.h deleted file mode 100644 index cf6399b5b39e..000000000000 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Sources/google_maps_flutter_ios_sdk10_objc/include/google_maps_flutter_ios_sdk10_objc/GoogleMapsUtilsTrampoline.h +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright 2013 The Flutter Authors -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// If Swift Package Manager is in use, Objective-C headers are available under the -// GoogleMapsUtilsObjC package. When using CocoaPods, the headers are provided by the -// GoogleMapsUtils package. -#ifdef FGM_USING_COCOAPODS -@import GoogleMapsUtils; -#else -@import GoogleMapsUtilsObjC; -#endif diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/test/google_maps_flutter_ios_test.dart b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/test/google_maps_flutter_ios_test.dart index da996d1b8e6e..aac05c9d9f18 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/test/google_maps_flutter_ios_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/test/google_maps_flutter_ios_test.dart @@ -115,7 +115,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final scroll = passedUpdate.cameraUpdate as PlatformCameraUpdateScrollBy; + final scroll = passedUpdate as PlatformCameraUpdateScrollBy; update as CameraUpdateScrollBy; expect(scroll.dx, update.dx); expect(scroll.dy, update.dy); @@ -130,7 +130,7 @@ void main() { final VerificationResult verification = verify(api.animateCamera(captureAny, captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final scroll = passedUpdate.cameraUpdate as PlatformCameraUpdateScrollBy; + final scroll = passedUpdate as PlatformCameraUpdateScrollBy; update as CameraUpdateScrollBy; expect(scroll.dx, update.dx); expect(scroll.dy, update.dy); @@ -148,7 +148,7 @@ void main() { final VerificationResult verification = verify(api.animateCamera(captureAny, captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final scroll = passedUpdate.cameraUpdate as PlatformCameraUpdateScrollBy; + final scroll = passedUpdate as PlatformCameraUpdateScrollBy; update as CameraUpdateScrollBy; expect(scroll.dx, update.dx); expect(scroll.dy, update.dy); @@ -415,8 +415,8 @@ void main() { expect(firstChanged.draggable, object2new.draggable); expect(firstChanged.flat, object2new.flat); expect( - firstChanged.icon.bitmap.runtimeType, - GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object2new.icon).bitmap.runtimeType, + firstChanged.icon.runtimeType, + GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object2new.icon).runtimeType, ); expect(firstChanged.infoWindow.title, object2new.infoWindow.title); expect(firstChanged.infoWindow.snippet, object2new.infoWindow.snippet); @@ -441,8 +441,8 @@ void main() { expect(firstAdded.draggable, object3.draggable); expect(firstAdded.flat, object3.flat); expect( - firstAdded.icon.bitmap.runtimeType, - GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object3.icon).bitmap.runtimeType, + firstAdded.icon.runtimeType, + GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object3.icon).runtimeType, ); expect(firstAdded.infoWindow.title, object3.infoWindow.title); expect(firstAdded.infoWindow.snippet, object3.infoWindow.snippet); @@ -500,8 +500,8 @@ void main() { expect(firstChanged.draggable, object2new.draggable); expect(firstChanged.flat, object2new.flat); expect( - firstChanged.icon.bitmap.runtimeType, - GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object2new.icon).bitmap.runtimeType, + firstChanged.icon.runtimeType, + GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object2new.icon).runtimeType, ); expect(firstChanged.infoWindow.title, object2new.infoWindow.title); expect(firstChanged.infoWindow.snippet, object2new.infoWindow.snippet); @@ -532,8 +532,8 @@ void main() { expect(firstAdded.draggable, object3.draggable); expect(firstAdded.flat, object3.flat); expect( - firstAdded.icon.bitmap.runtimeType, - GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object3.icon).bitmap.runtimeType, + firstAdded.icon.runtimeType, + GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object3.icon).runtimeType, ); expect(firstAdded.infoWindow.title, object3.infoWindow.title); expect(firstAdded.infoWindow.snippet, object3.infoWindow.snippet); @@ -789,10 +789,10 @@ void main() { expect(firstChanged.zoomLevel, object2new.zoomLevel); expect(firstChanged.transparency, object2new.transparency); expect( - firstChanged.image.bitmap.runtimeType, + firstChanged.image.runtimeType, GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor( object2new.image, - ).bitmap.runtimeType, + ).runtimeType, ); } // Object three should be added. @@ -814,8 +814,8 @@ void main() { expect(firstAdded.zoomLevel, object3.zoomLevel); expect(firstAdded.transparency, object3.transparency); expect( - firstAdded.image.bitmap.runtimeType, - GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object3.image).bitmap.runtimeType, + firstAdded.image.runtimeType, + GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object3.image).runtimeType, ); } }); @@ -997,7 +997,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateNewCameraPosition; + final typedUpdate = passedUpdate as PlatformCameraUpdateNewCameraPosition; update as CameraUpdateNewCameraPosition; expect(typedUpdate.cameraPosition.target.latitude, update.cameraPosition.target.latitude); expect(typedUpdate.cameraPosition.target.longitude, update.cameraPosition.target.longitude); @@ -1013,7 +1013,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateNewLatLng; + final typedUpdate = passedUpdate as PlatformCameraUpdateNewLatLng; update as CameraUpdateNewLatLng; expect(typedUpdate.latLng.latitude, update.latLng.latitude); expect(typedUpdate.latLng.longitude, update.latLng.longitude); @@ -1032,7 +1032,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateNewLatLngBounds; + final typedUpdate = passedUpdate as PlatformCameraUpdateNewLatLngBounds; update as CameraUpdateNewLatLngBounds; expect(typedUpdate.bounds.northeast.latitude, update.bounds.northeast.latitude); expect(typedUpdate.bounds.northeast.longitude, update.bounds.northeast.longitude); @@ -1051,7 +1051,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateNewLatLngZoom; + final typedUpdate = passedUpdate as PlatformCameraUpdateNewLatLngZoom; update as CameraUpdateNewLatLngZoom; expect(typedUpdate.latLng.latitude, update.latLng.latitude); expect(typedUpdate.latLng.longitude, update.latLng.longitude); @@ -1068,7 +1068,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateZoomBy; + final typedUpdate = passedUpdate as PlatformCameraUpdateZoomBy; update as CameraUpdateZoomBy; expect(typedUpdate.focus?.x, update.focus?.dx); expect(typedUpdate.focus?.y, update.focus?.dy); @@ -1084,7 +1084,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateZoomTo; + final typedUpdate = passedUpdate as PlatformCameraUpdateZoomTo; update as CameraUpdateZoomTo; expect(typedUpdate.zoom, update.zoom); }); @@ -1098,7 +1098,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateZoom; + final typedUpdate = passedUpdate as PlatformCameraUpdateZoom; expect(typedUpdate.out, false); }); @@ -1111,7 +1111,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateZoom; + final typedUpdate = passedUpdate as PlatformCameraUpdateZoom; expect(typedUpdate.out, true); }); @@ -1131,8 +1131,8 @@ void main() { final PlatformBitmap platformBitmap = GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor( bitmap, ); - expect(platformBitmap.bitmap, isA()); - final typedBitmap = platformBitmap.bitmap as PlatformBitmapDefaultMarker; + expect(platformBitmap, isA()); + final typedBitmap = platformBitmap as PlatformBitmapDefaultMarker; expect(typedBitmap.hue, 10.0); }); @@ -1147,8 +1147,8 @@ void main() { final PlatformBitmap platformBitmap = GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor( bitmap, ); - expect(platformBitmap.bitmap, isA()); - final typedBitmap = platformBitmap.bitmap as PlatformBitmapBytesMap; + expect(platformBitmap, isA()); + final typedBitmap = platformBitmap as PlatformBitmapBytesMap; expect(typedBitmap.byteData, data); expect(typedBitmap.bitmapScaling, PlatformMapBitmapScaling.auto); expect(typedBitmap.imagePixelRatio, 2.0); @@ -1162,8 +1162,8 @@ void main() { final PlatformBitmap platformBitmap = GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor( bitmap, ); - expect(platformBitmap.bitmap, isA()); - final typedBitmap = platformBitmap.bitmap as PlatformBitmapAssetMap; + expect(platformBitmap, isA()); + final typedBitmap = platformBitmap as PlatformBitmapAssetMap; expect(typedBitmap.assetName, assetName); expect(typedBitmap.bitmapScaling, PlatformMapBitmapScaling.auto); expect(typedBitmap.imagePixelRatio, 2.0); diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/test/google_maps_flutter_ios_test.dart b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/test/google_maps_flutter_ios_test.dart index da996d1b8e6e..aac05c9d9f18 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/test/google_maps_flutter_ios_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/test/google_maps_flutter_ios_test.dart @@ -115,7 +115,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final scroll = passedUpdate.cameraUpdate as PlatformCameraUpdateScrollBy; + final scroll = passedUpdate as PlatformCameraUpdateScrollBy; update as CameraUpdateScrollBy; expect(scroll.dx, update.dx); expect(scroll.dy, update.dy); @@ -130,7 +130,7 @@ void main() { final VerificationResult verification = verify(api.animateCamera(captureAny, captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final scroll = passedUpdate.cameraUpdate as PlatformCameraUpdateScrollBy; + final scroll = passedUpdate as PlatformCameraUpdateScrollBy; update as CameraUpdateScrollBy; expect(scroll.dx, update.dx); expect(scroll.dy, update.dy); @@ -148,7 +148,7 @@ void main() { final VerificationResult verification = verify(api.animateCamera(captureAny, captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final scroll = passedUpdate.cameraUpdate as PlatformCameraUpdateScrollBy; + final scroll = passedUpdate as PlatformCameraUpdateScrollBy; update as CameraUpdateScrollBy; expect(scroll.dx, update.dx); expect(scroll.dy, update.dy); @@ -415,8 +415,8 @@ void main() { expect(firstChanged.draggable, object2new.draggable); expect(firstChanged.flat, object2new.flat); expect( - firstChanged.icon.bitmap.runtimeType, - GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object2new.icon).bitmap.runtimeType, + firstChanged.icon.runtimeType, + GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object2new.icon).runtimeType, ); expect(firstChanged.infoWindow.title, object2new.infoWindow.title); expect(firstChanged.infoWindow.snippet, object2new.infoWindow.snippet); @@ -441,8 +441,8 @@ void main() { expect(firstAdded.draggable, object3.draggable); expect(firstAdded.flat, object3.flat); expect( - firstAdded.icon.bitmap.runtimeType, - GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object3.icon).bitmap.runtimeType, + firstAdded.icon.runtimeType, + GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object3.icon).runtimeType, ); expect(firstAdded.infoWindow.title, object3.infoWindow.title); expect(firstAdded.infoWindow.snippet, object3.infoWindow.snippet); @@ -500,8 +500,8 @@ void main() { expect(firstChanged.draggable, object2new.draggable); expect(firstChanged.flat, object2new.flat); expect( - firstChanged.icon.bitmap.runtimeType, - GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object2new.icon).bitmap.runtimeType, + firstChanged.icon.runtimeType, + GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object2new.icon).runtimeType, ); expect(firstChanged.infoWindow.title, object2new.infoWindow.title); expect(firstChanged.infoWindow.snippet, object2new.infoWindow.snippet); @@ -532,8 +532,8 @@ void main() { expect(firstAdded.draggable, object3.draggable); expect(firstAdded.flat, object3.flat); expect( - firstAdded.icon.bitmap.runtimeType, - GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object3.icon).bitmap.runtimeType, + firstAdded.icon.runtimeType, + GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object3.icon).runtimeType, ); expect(firstAdded.infoWindow.title, object3.infoWindow.title); expect(firstAdded.infoWindow.snippet, object3.infoWindow.snippet); @@ -789,10 +789,10 @@ void main() { expect(firstChanged.zoomLevel, object2new.zoomLevel); expect(firstChanged.transparency, object2new.transparency); expect( - firstChanged.image.bitmap.runtimeType, + firstChanged.image.runtimeType, GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor( object2new.image, - ).bitmap.runtimeType, + ).runtimeType, ); } // Object three should be added. @@ -814,8 +814,8 @@ void main() { expect(firstAdded.zoomLevel, object3.zoomLevel); expect(firstAdded.transparency, object3.transparency); expect( - firstAdded.image.bitmap.runtimeType, - GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object3.image).bitmap.runtimeType, + firstAdded.image.runtimeType, + GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object3.image).runtimeType, ); } }); @@ -997,7 +997,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateNewCameraPosition; + final typedUpdate = passedUpdate as PlatformCameraUpdateNewCameraPosition; update as CameraUpdateNewCameraPosition; expect(typedUpdate.cameraPosition.target.latitude, update.cameraPosition.target.latitude); expect(typedUpdate.cameraPosition.target.longitude, update.cameraPosition.target.longitude); @@ -1013,7 +1013,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateNewLatLng; + final typedUpdate = passedUpdate as PlatformCameraUpdateNewLatLng; update as CameraUpdateNewLatLng; expect(typedUpdate.latLng.latitude, update.latLng.latitude); expect(typedUpdate.latLng.longitude, update.latLng.longitude); @@ -1032,7 +1032,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateNewLatLngBounds; + final typedUpdate = passedUpdate as PlatformCameraUpdateNewLatLngBounds; update as CameraUpdateNewLatLngBounds; expect(typedUpdate.bounds.northeast.latitude, update.bounds.northeast.latitude); expect(typedUpdate.bounds.northeast.longitude, update.bounds.northeast.longitude); @@ -1051,7 +1051,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateNewLatLngZoom; + final typedUpdate = passedUpdate as PlatformCameraUpdateNewLatLngZoom; update as CameraUpdateNewLatLngZoom; expect(typedUpdate.latLng.latitude, update.latLng.latitude); expect(typedUpdate.latLng.longitude, update.latLng.longitude); @@ -1068,7 +1068,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateZoomBy; + final typedUpdate = passedUpdate as PlatformCameraUpdateZoomBy; update as CameraUpdateZoomBy; expect(typedUpdate.focus?.x, update.focus?.dx); expect(typedUpdate.focus?.y, update.focus?.dy); @@ -1084,7 +1084,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateZoomTo; + final typedUpdate = passedUpdate as PlatformCameraUpdateZoomTo; update as CameraUpdateZoomTo; expect(typedUpdate.zoom, update.zoom); }); @@ -1098,7 +1098,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateZoom; + final typedUpdate = passedUpdate as PlatformCameraUpdateZoom; expect(typedUpdate.out, false); }); @@ -1111,7 +1111,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateZoom; + final typedUpdate = passedUpdate as PlatformCameraUpdateZoom; expect(typedUpdate.out, true); }); @@ -1131,8 +1131,8 @@ void main() { final PlatformBitmap platformBitmap = GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor( bitmap, ); - expect(platformBitmap.bitmap, isA()); - final typedBitmap = platformBitmap.bitmap as PlatformBitmapDefaultMarker; + expect(platformBitmap, isA()); + final typedBitmap = platformBitmap as PlatformBitmapDefaultMarker; expect(typedBitmap.hue, 10.0); }); @@ -1147,8 +1147,8 @@ void main() { final PlatformBitmap platformBitmap = GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor( bitmap, ); - expect(platformBitmap.bitmap, isA()); - final typedBitmap = platformBitmap.bitmap as PlatformBitmapBytesMap; + expect(platformBitmap, isA()); + final typedBitmap = platformBitmap as PlatformBitmapBytesMap; expect(typedBitmap.byteData, data); expect(typedBitmap.bitmapScaling, PlatformMapBitmapScaling.auto); expect(typedBitmap.imagePixelRatio, 2.0); @@ -1162,8 +1162,8 @@ void main() { final PlatformBitmap platformBitmap = GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor( bitmap, ); - expect(platformBitmap.bitmap, isA()); - final typedBitmap = platformBitmap.bitmap as PlatformBitmapAssetMap; + expect(platformBitmap, isA()); + final typedBitmap = platformBitmap as PlatformBitmapAssetMap; expect(typedBitmap.assetName, assetName); expect(typedBitmap.bitmapScaling, PlatformMapBitmapScaling.auto); expect(typedBitmap.imagePixelRatio, 2.0); diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/test/google_maps_flutter_ios_test.dart b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/test/google_maps_flutter_ios_test.dart index da996d1b8e6e..aac05c9d9f18 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/test/google_maps_flutter_ios_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/test/google_maps_flutter_ios_test.dart @@ -115,7 +115,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final scroll = passedUpdate.cameraUpdate as PlatformCameraUpdateScrollBy; + final scroll = passedUpdate as PlatformCameraUpdateScrollBy; update as CameraUpdateScrollBy; expect(scroll.dx, update.dx); expect(scroll.dy, update.dy); @@ -130,7 +130,7 @@ void main() { final VerificationResult verification = verify(api.animateCamera(captureAny, captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final scroll = passedUpdate.cameraUpdate as PlatformCameraUpdateScrollBy; + final scroll = passedUpdate as PlatformCameraUpdateScrollBy; update as CameraUpdateScrollBy; expect(scroll.dx, update.dx); expect(scroll.dy, update.dy); @@ -148,7 +148,7 @@ void main() { final VerificationResult verification = verify(api.animateCamera(captureAny, captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final scroll = passedUpdate.cameraUpdate as PlatformCameraUpdateScrollBy; + final scroll = passedUpdate as PlatformCameraUpdateScrollBy; update as CameraUpdateScrollBy; expect(scroll.dx, update.dx); expect(scroll.dy, update.dy); @@ -415,8 +415,8 @@ void main() { expect(firstChanged.draggable, object2new.draggable); expect(firstChanged.flat, object2new.flat); expect( - firstChanged.icon.bitmap.runtimeType, - GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object2new.icon).bitmap.runtimeType, + firstChanged.icon.runtimeType, + GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object2new.icon).runtimeType, ); expect(firstChanged.infoWindow.title, object2new.infoWindow.title); expect(firstChanged.infoWindow.snippet, object2new.infoWindow.snippet); @@ -441,8 +441,8 @@ void main() { expect(firstAdded.draggable, object3.draggable); expect(firstAdded.flat, object3.flat); expect( - firstAdded.icon.bitmap.runtimeType, - GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object3.icon).bitmap.runtimeType, + firstAdded.icon.runtimeType, + GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object3.icon).runtimeType, ); expect(firstAdded.infoWindow.title, object3.infoWindow.title); expect(firstAdded.infoWindow.snippet, object3.infoWindow.snippet); @@ -500,8 +500,8 @@ void main() { expect(firstChanged.draggable, object2new.draggable); expect(firstChanged.flat, object2new.flat); expect( - firstChanged.icon.bitmap.runtimeType, - GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object2new.icon).bitmap.runtimeType, + firstChanged.icon.runtimeType, + GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object2new.icon).runtimeType, ); expect(firstChanged.infoWindow.title, object2new.infoWindow.title); expect(firstChanged.infoWindow.snippet, object2new.infoWindow.snippet); @@ -532,8 +532,8 @@ void main() { expect(firstAdded.draggable, object3.draggable); expect(firstAdded.flat, object3.flat); expect( - firstAdded.icon.bitmap.runtimeType, - GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object3.icon).bitmap.runtimeType, + firstAdded.icon.runtimeType, + GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object3.icon).runtimeType, ); expect(firstAdded.infoWindow.title, object3.infoWindow.title); expect(firstAdded.infoWindow.snippet, object3.infoWindow.snippet); @@ -789,10 +789,10 @@ void main() { expect(firstChanged.zoomLevel, object2new.zoomLevel); expect(firstChanged.transparency, object2new.transparency); expect( - firstChanged.image.bitmap.runtimeType, + firstChanged.image.runtimeType, GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor( object2new.image, - ).bitmap.runtimeType, + ).runtimeType, ); } // Object three should be added. @@ -814,8 +814,8 @@ void main() { expect(firstAdded.zoomLevel, object3.zoomLevel); expect(firstAdded.transparency, object3.transparency); expect( - firstAdded.image.bitmap.runtimeType, - GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object3.image).bitmap.runtimeType, + firstAdded.image.runtimeType, + GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object3.image).runtimeType, ); } }); @@ -997,7 +997,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateNewCameraPosition; + final typedUpdate = passedUpdate as PlatformCameraUpdateNewCameraPosition; update as CameraUpdateNewCameraPosition; expect(typedUpdate.cameraPosition.target.latitude, update.cameraPosition.target.latitude); expect(typedUpdate.cameraPosition.target.longitude, update.cameraPosition.target.longitude); @@ -1013,7 +1013,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateNewLatLng; + final typedUpdate = passedUpdate as PlatformCameraUpdateNewLatLng; update as CameraUpdateNewLatLng; expect(typedUpdate.latLng.latitude, update.latLng.latitude); expect(typedUpdate.latLng.longitude, update.latLng.longitude); @@ -1032,7 +1032,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateNewLatLngBounds; + final typedUpdate = passedUpdate as PlatformCameraUpdateNewLatLngBounds; update as CameraUpdateNewLatLngBounds; expect(typedUpdate.bounds.northeast.latitude, update.bounds.northeast.latitude); expect(typedUpdate.bounds.northeast.longitude, update.bounds.northeast.longitude); @@ -1051,7 +1051,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateNewLatLngZoom; + final typedUpdate = passedUpdate as PlatformCameraUpdateNewLatLngZoom; update as CameraUpdateNewLatLngZoom; expect(typedUpdate.latLng.latitude, update.latLng.latitude); expect(typedUpdate.latLng.longitude, update.latLng.longitude); @@ -1068,7 +1068,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateZoomBy; + final typedUpdate = passedUpdate as PlatformCameraUpdateZoomBy; update as CameraUpdateZoomBy; expect(typedUpdate.focus?.x, update.focus?.dx); expect(typedUpdate.focus?.y, update.focus?.dy); @@ -1084,7 +1084,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateZoomTo; + final typedUpdate = passedUpdate as PlatformCameraUpdateZoomTo; update as CameraUpdateZoomTo; expect(typedUpdate.zoom, update.zoom); }); @@ -1098,7 +1098,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateZoom; + final typedUpdate = passedUpdate as PlatformCameraUpdateZoom; expect(typedUpdate.out, false); }); @@ -1111,7 +1111,7 @@ void main() { final VerificationResult verification = verify(api.moveCamera(captureAny)); final passedUpdate = verification.captured[0] as PlatformCameraUpdate; - final typedUpdate = passedUpdate.cameraUpdate as PlatformCameraUpdateZoom; + final typedUpdate = passedUpdate as PlatformCameraUpdateZoom; expect(typedUpdate.out, true); }); @@ -1131,8 +1131,8 @@ void main() { final PlatformBitmap platformBitmap = GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor( bitmap, ); - expect(platformBitmap.bitmap, isA()); - final typedBitmap = platformBitmap.bitmap as PlatformBitmapDefaultMarker; + expect(platformBitmap, isA()); + final typedBitmap = platformBitmap as PlatformBitmapDefaultMarker; expect(typedBitmap.hue, 10.0); }); @@ -1147,8 +1147,8 @@ void main() { final PlatformBitmap platformBitmap = GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor( bitmap, ); - expect(platformBitmap.bitmap, isA()); - final typedBitmap = platformBitmap.bitmap as PlatformBitmapBytesMap; + expect(platformBitmap, isA()); + final typedBitmap = platformBitmap as PlatformBitmapBytesMap; expect(typedBitmap.byteData, data); expect(typedBitmap.bitmapScaling, PlatformMapBitmapScaling.auto); expect(typedBitmap.imagePixelRatio, 2.0); @@ -1162,8 +1162,8 @@ void main() { final PlatformBitmap platformBitmap = GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor( bitmap, ); - expect(platformBitmap.bitmap, isA()); - final typedBitmap = platformBitmap.bitmap as PlatformBitmapAssetMap; + expect(platformBitmap, isA()); + final typedBitmap = platformBitmap as PlatformBitmapAssetMap; expect(typedBitmap.assetName, assetName); expect(typedBitmap.bitmapScaling, PlatformMapBitmapScaling.auto); expect(typedBitmap.imagePixelRatio, 2.0); From c28f4125a38eb20e5072d90d8320bc7041f09862 Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Sat, 5 Sep 2026 18:51:14 -0400 Subject: [PATCH 13/14] Minor cleanup, autoformat --- .../ios/google_maps_flutter_ios_sdk10/Package.swift | 5 +---- .../test/google_maps_flutter_ios_test.dart | 4 +--- .../test/google_maps_flutter_ios_test.dart | 4 +--- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Package.swift b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Package.swift index 0b391c8a76fb..9cb086fe3212 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Package.swift +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/ios/google_maps_flutter_ios_sdk10/Package.swift @@ -37,10 +37,7 @@ let package = Package( ], resources: [ .process("Resources") - ], - cSettings: [ - .headerSearchPath("include/google_maps_flutter_ios_sdk10") ] - ), + ) ] ) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/test/google_maps_flutter_ios_test.dart b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/test/google_maps_flutter_ios_test.dart index aac05c9d9f18..6d21a3e81c1f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/test/google_maps_flutter_ios_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk10/test/google_maps_flutter_ios_test.dart @@ -790,9 +790,7 @@ void main() { expect(firstChanged.transparency, object2new.transparency); expect( firstChanged.image.runtimeType, - GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor( - object2new.image, - ).runtimeType, + GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object2new.image).runtimeType, ); } // Object three should be added. diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/test/google_maps_flutter_ios_test.dart b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/test/google_maps_flutter_ios_test.dart index aac05c9d9f18..6d21a3e81c1f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/test/google_maps_flutter_ios_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_sdk9/test/google_maps_flutter_ios_test.dart @@ -790,9 +790,7 @@ void main() { expect(firstChanged.transparency, object2new.transparency); expect( firstChanged.image.runtimeType, - GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor( - object2new.image, - ).runtimeType, + GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object2new.image).runtimeType, ); } // Object three should be added. From 4742205639bdfd8c21f83d299a3ef8a56f65037f Mon Sep 17 00:00:00 2001 From: Stuart Morgan Date: Mon, 7 Sep 2026 10:32:07 -0400 Subject: [PATCH 14/14] Missed format sync --- .../test/google_maps_flutter_ios_test.dart | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/test/google_maps_flutter_ios_test.dart b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/test/google_maps_flutter_ios_test.dart index aac05c9d9f18..6d21a3e81c1f 100644 --- a/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/test/google_maps_flutter_ios_test.dart +++ b/packages/google_maps_flutter/google_maps_flutter_ios_shared_code/test/google_maps_flutter_ios_test.dart @@ -790,9 +790,7 @@ void main() { expect(firstChanged.transparency, object2new.transparency); expect( firstChanged.image.runtimeType, - GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor( - object2new.image, - ).runtimeType, + GoogleMapsFlutterIOS.platformBitmapFromBitmapDescriptor(object2new.image).runtimeType, ); } // Object three should be added.