-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(googleMaps): add support for the new Google's cloud based maps /…
… styling via googleMapId prop * GoogleMapConfig as initialProps for MapView - Android: LiteMode and mapID as InitProps - Android: remove unnecessary module for MapLite - Examples: LiteMode working with initialProps formatting: whitespace cleanup * GoogleMapConfig as initialProps for MapView - iOS: code works to pass mapID to googleMaps - iOS: swizzling RCTComponentData to add support for initialProps - iOS: Any RCTViewManager will automatically have initialProps autofilled if property is available * GoogleMapConfig as initialProps for MapView - remove unused import from MapView --------- authored-by: salah ghanim <salah.ghanim@gmail.com>
- Loading branch information
1 parent
5843641
commit 77610e9
Showing
14 changed files
with
144 additions
and
148 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -114,56 +114,4 @@ - (BOOL)canReplaceMapContent | |
return NO; | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
@end | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,5 @@ | |
#import "AIRMapCoordinate.h" | ||
|
||
|
||
@implementation AIRMapCoordinate { | ||
|
||
} | ||
@end | ||
@implementation AIRMapCoordinate | ||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -123,56 +123,4 @@ - (BOOL)canReplaceMapContent | |
return NO; | ||
} | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
// | ||
// RCTComponentData+Maps.h | ||
// AirMaps | ||
// | ||
// Created by Salah Ghanim on 24.12.23. | ||
// Copyright © 2023 Christopher. All rights reserved. | ||
// | ||
|
||
#import <React/RCTComponentData.h> | ||
|
||
@interface RCTComponentData (Maps) | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// RCTComponentData+Maps.m | ||
// AirMaps | ||
// | ||
// Created by Salah Ghanim on 24.12.23. | ||
// Copyright © 2023 Christopher. All rights reserved. | ||
// | ||
|
||
#import "RCTComponentData+Maps.h" | ||
#import <objc/runtime.h> | ||
#import <Foundation/NSObjCRuntime.h> | ||
|
||
@implementation RCTComponentData (Maps) | ||
|
||
|
||
- (void) myCustom_setProps:(NSDictionary<NSString *, id> *)props forShadowView:(RCTShadowView *)shadowView{ | ||
// Pass initialProps to any manager that supports initialProps | ||
id manager = [self manager]; | ||
if ([manager respondsToSelector:@selector(setInitialProps:)]) { | ||
[manager performSelector:@selector(setInitialProps:) withObject:props]; | ||
} | ||
|
||
// Call the original method | ||
[self myCustom_setProps:props forShadowView:shadowView]; | ||
} | ||
|
||
+ (void)load { | ||
static dispatch_once_t onceToken; | ||
dispatch_once(&onceToken, ^{ | ||
Class class = [RCTComponentData class]; // Or the class where the method is defined | ||
|
||
SEL originalSelector = @selector(setProps:forShadowView:); | ||
SEL swizzledSelector = @selector(myCustom_setProps:forShadowView:); | ||
|
||
Method originalMethod = class_getInstanceMethod(class, originalSelector); | ||
Method swizzledMethod = class_getInstanceMethod(class, swizzledSelector); | ||
|
||
BOOL didAddMethod = class_addMethod(class, | ||
originalSelector, | ||
method_getImplementation(swizzledMethod), | ||
method_getTypeEncoding(swizzledMethod)); | ||
|
||
if (didAddMethod) { | ||
class_replaceMethod(class, | ||
swizzledSelector, | ||
method_getImplementation(originalMethod), | ||
method_getTypeEncoding(originalMethod)); | ||
} else { | ||
method_exchangeImplementations(originalMethod, swizzledMethod); | ||
} | ||
}); | ||
} | ||
|
||
|
||
@end |
Oops, something went wrong.