Skip to content

Commit b78f118

Browse files
committed
[google_maps_flutter_ios] Rename new classes to use FGM prefix
1 parent 77c78c1 commit b78f118

14 files changed

+75
-71
lines changed

packages/google_maps_flutter/google_maps_flutter_ios/example/ios14/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@
208208
children = (
209209
F269303A2BB389BF00BF17C4 /* assets */,
210210
52E9C2AF2C5CECD100078060 /* ExtractIconFromDataTests.m */,
211-
52E9C2AD2C5CEBD600078060 /* FLTClusterManagersControllerTests.m */,
211+
52E9C2AD2C5CEBD600078060 /* FGMClusterManagersControllerTests.m */,
212212
6851F3552835BC180032B7C8 /* FLTGoogleMapJSONConversionsConversionTests.m */,
213213
0DD7B6C22B744EEF00E857FD /* FLTTileProviderControllerTests.m */,
214214
F7151F12265D7ED70028CB91 /* GoogleMapsTests.m */,
@@ -512,7 +512,7 @@
512512
buildActionMask = 2147483647;
513513
files = (
514514
F7151F13265D7ED70028CB91 /* GoogleMapsTests.m in Sources */,
515-
52E9C2AE2C5CEBD600078060 /* FLTClusterManagersControllerTests.m in Sources */,
515+
52E9C2AE2C5CEBD600078060 /* FGMClusterManagersControllerTests.m in Sources */,
516516
6851F3562835BC180032B7C8 /* FLTGoogleMapJSONConversionsConversionTests.m in Sources */,
517517
982F2A6C27BADE17003C81F4 /* PartiallyMockedMapView.m in Sources */,
518518
478116522BEF8F47002F593E /* GoogleMapsPolylinesControllerTests.m in Sources */,
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
#import <OCMock/OCMock.h>
1212
#import "PartiallyMockedMapView.h"
1313

14-
@interface FLTClusterManagersControllerTests : XCTestCase
14+
@interface FGMClusterManagersControllerTests : XCTestCase
1515
@end
1616

17-
@implementation FLTClusterManagersControllerTests
17+
@implementation FGMClusterManagersControllerTests
1818

1919
- (void)testClustering {
2020
NSObject<FlutterPluginRegistrar> *registrar = OCMProtocolMock(@protocol(FlutterPluginRegistrar));
@@ -28,8 +28,8 @@ - (void)testClustering {
2828

2929
id handler = OCMClassMock([FGMMapsCallbackApi class]);
3030

31-
FLTClusterManagersController *clusterManagersController =
32-
[[FLTClusterManagersController alloc] initWithMapView:mapView callbackHandler:handler];
31+
FGMClusterManagersController *clusterManagersController =
32+
[[FGMClusterManagersController alloc] initWithMapView:mapView callbackHandler:handler];
3333

3434
FLTMarkersController *markersController =
3535
[[FLTMarkersController alloc] initWithMapView:mapView
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
1212

1313
// Defines cluster managers controller interface which
1414
// is responsible for adding/removing/returning one or more cluster managers.
15-
@interface FLTClusterManagersController : NSObject
15+
@interface FGMClusterManagersController : NSObject
1616

1717
/// Initializes FLTClusterManagersController.
1818
///
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

5-
#import "FLTClusterManagersController.h"
5+
#import "FGMClusterManagersController.h"
66

7+
#import "FGMMarkerUserData.h"
78
#import "FLTGoogleMapJSONConversions.h"
8-
#import "FLTGoogleMarkerUserData.h"
99

10-
@interface FLTClusterManagersController ()
10+
@interface FGMClusterManagersController ()
1111

1212
/// A dictionary that cluster managers unique identifiers to GMUClusterManager instances.
1313
@property(strong, nonatomic)
@@ -21,7 +21,7 @@ @interface FLTClusterManagersController ()
2121

2222
@end
2323

24-
@implementation FLTClusterManagersController
24+
@implementation FGMClusterManagersController
2525
- (instancetype)initWithMapView:(GMSMapView *)mapView
2626
callbackHandler:(FGMMapsCallbackApi *)callbackHandler {
2727
self = [super init];
@@ -128,7 +128,7 @@ - (void)didTapCluster:(GMUStaticCluster *)cluster {
128128
- (nullable NSString *)clusterManagerIdentifierForCluster:(GMUStaticCluster *)cluster {
129129
if ([cluster.items.firstObject isKindOfClass:[GMSMarker class]]) {
130130
GMSMarker *firstMarker = (GMSMarker *)cluster.items.firstObject;
131-
return FLTGetClusterManagerIdentifierFrom(firstMarker);
131+
return FGMGetClusterManagerIdentifierFromMarker(firstMarker);
132132
}
133133

134134
return nil;
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
NS_ASSUME_NONNULL_BEGIN
88

99
/// Defines user data object for markers.
10-
@interface FLTGoogleMarkerUserData : NSObject
10+
@interface FGMMarkerUserData : NSObject
1111

1212
/// The identifier of the marker.
1313
@property(nonatomic, copy) NSString *markerIdentifier;
@@ -23,20 +23,20 @@ NS_ASSUME_NONNULL_BEGIN
2323
/// @param markerIdentifier Identifier of marker.
2424
/// @param clusterManagerIdentifier Optional identifier of cluster manager.
2525
/// @param marker GMSMarker object.
26-
extern void FLTSetIdentifiersToMarkerUserData(NSString *markerIdentifier,
26+
extern void FGMSetIdentifiersToMarkerUserData(NSString *markerIdentifier,
2727
NSString *_Nullable clusterManagerIdentifier,
2828
GMSMarker *marker);
2929

3030
/// Get MarkerIdentifier from GMSMarker UserData.
3131
///
3232
/// @param marker GMSMarker object.
3333
/// @return NSString if found; otherwise, nil.
34-
extern NSString *_Nullable FLTGetMarkerIdentifierFrom(GMSMarker *marker);
34+
extern NSString *_Nullable FGMGetMarkerIdentifierFromMarker(GMSMarker *marker);
3535

3636
/// Get ClusterManagerIdentifier from GMSMarker UserData.
3737
///
3838
/// @param marker GMSMarker object.
3939
/// @return NSString if found; otherwise, nil.
40-
extern NSString *_Nullable FLTGetClusterManagerIdentifierFrom(GMSMarker *marker);
40+
extern NSString *_Nullable FGMGetClusterManagerIdentifierFromMarker(GMSMarker *marker);
4141

4242
NS_ASSUME_NONNULL_END
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright 2013 The Flutter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style license that can be
3+
// found in the LICENSE file.
4+
5+
#import "FGMMarkerUserData.h"
6+
7+
@implementation FGMMarkerUserData
8+
9+
@end
10+
11+
void FGMSetIdentifiersToMarkerUserData(NSString *markerIdentifier,
12+
NSString *_Nullable clusterManagerIdentifier,
13+
GMSMarker *marker) {
14+
FGMMarkerUserData *userData = [[FGMMarkerUserData alloc] init];
15+
userData.markerIdentifier = markerIdentifier;
16+
userData.clusterManagerIdentifier = clusterManagerIdentifier;
17+
marker.userData = userData;
18+
};
19+
20+
NSString *_Nullable FGMGetMarkerIdentifierFromMarker(GMSMarker *marker) {
21+
if ([marker.userData isKindOfClass:[FGMMarkerUserData class]]) {
22+
FGMMarkerUserData *userData = (FGMMarkerUserData *)marker.userData;
23+
return userData.markerIdentifier;
24+
}
25+
return nil;
26+
};
27+
28+
NSString *_Nullable FGMGetClusterManagerIdentifierFromMarker(GMSMarker *marker) {
29+
if ([marker.userData isKindOfClass:[FGMMarkerUserData class]]) {
30+
FGMMarkerUserData *userData = (FGMMarkerUserData *)marker.userData;
31+
return userData.clusterManagerIdentifier;
32+
}
33+
return nil;
34+
};

packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/FLTGoogleMapJSONConversions.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// found in the LICENSE file.
44

55
#import "FLTGoogleMapJSONConversions.h"
6-
#import "FLTGoogleMarkerUserData.h"
6+
#import "FGMMarkerUserData.h"
77

88
/// Returns dict[key], or nil if dict[key] is NSNull.
99
id FGMGetValueOrNilFromDict(NSDictionary *dict, NSString *key) {
@@ -46,7 +46,7 @@ CLLocationCoordinate2D FGMGetCoordinateForPigeonLatLng(FGMPlatformLatLng *latLng
4646
GMSCoordinateBounds *bounds = [[GMSCoordinateBounds alloc] init];
4747

4848
for (GMSMarker *marker in cluster.items) {
49-
[markerIDs addObject:FLTGetMarkerIdentifierFrom(marker)];
49+
[markerIDs addObject:FGMGetMarkerIdentifierFromMarker(marker)];
5050
bounds = [bounds includingCoordinate:marker.position];
5151
}
5252

packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/FLTGoogleMapsPlugin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#import <Flutter/Flutter.h>
66
#import <GoogleMaps/GoogleMaps.h>
7-
#import "FLTClusterManagersController.h"
7+
#import "FGMClusterManagersController.h"
88
#import "GoogleMapCircleController.h"
99
#import "GoogleMapController.h"
1010
#import "GoogleMapMarkerController.h"

packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/FLTGoogleMarkerUserData.m

Lines changed: 0 additions & 34 deletions
This file was deleted.

packages/google_maps_flutter/google_maps_flutter_ios/ios/Classes/GoogleMapController.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#import <Flutter/Flutter.h>
66
#import <GoogleMaps/GoogleMaps.h>
7-
#import "FLTClusterManagersController.h"
7+
#import "FGMClusterManagersController.h"
88
#import "GoogleMapCircleController.h"
99
#import "GoogleMapMarkerController.h"
1010
#import "GoogleMapPolygonController.h"

0 commit comments

Comments
 (0)