react-native-maps 1.21.0-alpha.144 → 1.21.0-alpha.146
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ios/AirGoogleMaps/AIRGoogleMap.h +1 -6
- package/ios/AirGoogleMaps/AIRGoogleMap.mm +6 -2
- package/ios/AirGoogleMaps/{AIRGoogleMapManager.m → AIRGoogleMapManager.mm} +5 -3
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +1 -1
- package/ios/generated/module.modulemap +15 -0
- package/package.json +2 -2
- package/react-native-maps-generated.podspec +1 -0
- package/react-native-maps.podspec +12 -5
|
@@ -16,13 +16,8 @@
|
|
|
16
16
|
|
|
17
17
|
#import "AIRGoogleMapCoordinate.h"
|
|
18
18
|
|
|
19
|
-
#if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
|
|
20
|
-
#import <ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>
|
|
21
|
-
#else
|
|
22
|
-
#import <react-native-maps-generated/RNMapsAirModuleDelegate.h>
|
|
23
|
-
#endif
|
|
24
19
|
|
|
25
|
-
@interface AIRGoogleMap : GMSMapView
|
|
20
|
+
@interface AIRGoogleMap : GMSMapView
|
|
26
21
|
|
|
27
22
|
// TODO: don't use MK region?
|
|
28
23
|
@property (nonatomic, weak) RCTBridge *bridge;
|
|
@@ -50,8 +50,12 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
50
50
|
@"longitudeDelta": [NSNumber numberWithDouble:region.span.longitudeDelta],
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
|
|
54
|
-
|
|
53
|
+
#if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
|
|
54
|
+
#import <ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>
|
|
55
|
+
#else
|
|
56
|
+
#import <react-native-maps-generated/RNMapsAirModuleDelegate.h>
|
|
57
|
+
#endif
|
|
58
|
+
@interface AIRGoogleMap () <GMSIndoorDisplayDelegate, RNMapsAirModuleDelegate>
|
|
55
59
|
|
|
56
60
|
- (id)eventFromCoordinate:(CLLocationCoordinate2D)coordinate;
|
|
57
61
|
|
|
@@ -272,10 +272,9 @@ RCT_EXPORT_METHOD(takeSnapshot:(nonnull NSNumber *)reactTag
|
|
|
272
272
|
if (![view isKindOfClass:[AIRGoogleMap class]]) {
|
|
273
273
|
RCTLogError(@"Invalid view returned from registry, expecting AIRMap, got: %@", view);
|
|
274
274
|
} else {
|
|
275
|
-
AIRGoogleMap *mapView = (AIRGoogleMap *)view;
|
|
276
275
|
NSMutableDictionary* config = [NSMutableDictionary new];
|
|
277
276
|
|
|
278
|
-
[
|
|
277
|
+
[view takeSnapshotWithConfig:config success:callback error:^(NSString *code, NSString *message, NSError *error) {
|
|
279
278
|
callback(@[error]);
|
|
280
279
|
}];
|
|
281
280
|
|
|
@@ -288,6 +287,9 @@ RCT_EXPORT_METHOD(takeSnapshot:(nonnull NSNumber *)reactTag
|
|
|
288
287
|
|
|
289
288
|
// TODO: currently we are ignoring width, height, region
|
|
290
289
|
|
|
290
|
+
AIRGoogleMap* mapView = (AIRGoogleMap *) view;
|
|
291
|
+
|
|
292
|
+
|
|
291
293
|
UIGraphicsBeginImageContextWithOptions(mapView.frame.size, YES, 0.0f);
|
|
292
294
|
[mapView.layer renderInContext:UIGraphicsGetCurrentContext()];
|
|
293
295
|
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
|
|
@@ -329,7 +331,7 @@ RCT_EXPORT_METHOD(pointForCoordinate:(nonnull NSNumber *)reactTag
|
|
|
329
331
|
if (![view isKindOfClass:[AIRGoogleMap class]]) {
|
|
330
332
|
RCTLogError(@"Invalid view returned from registry, expecting AIRMap, got: %@", view);
|
|
331
333
|
} else {
|
|
332
|
-
|
|
334
|
+
id<RNMapsAirModuleDelegate> mapView = (id<RNMapsAirModuleDelegate>) view;
|
|
333
335
|
resolve([mapView getPointForCoordinates:coord]);
|
|
334
336
|
}
|
|
335
337
|
}];
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
framework module ReactNativeMapsGenerated {
|
|
2
|
+
header "RNMapsAirModuleDelegate.h"
|
|
3
|
+
header "RNMapsHostVewDelegate.h"
|
|
4
|
+
|
|
5
|
+
explicit module RNMapsSpecs {
|
|
6
|
+
header "ComponentDescriptors.h"
|
|
7
|
+
header "EventEmitters.h"
|
|
8
|
+
header "Props.h"
|
|
9
|
+
header "RCTComponentViewHelpers.h"
|
|
10
|
+
header "RNMapsSpecs.h"
|
|
11
|
+
export *
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export *
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"main": "src/index.ts",
|
|
6
6
|
"author": "Leland Richardson <leland.m.richardson@gmail.com>",
|
|
7
7
|
"homepage": "https://github.com/react-native-maps/react-native-maps#readme",
|
|
8
|
-
"version": "1.21.0-alpha.
|
|
8
|
+
"version": "1.21.0-alpha.146",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"lint": "eslint . --max-warnings 0",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"prepare": "husky install",
|
|
17
17
|
"release": "semantic-release",
|
|
18
18
|
"bundle-install": "cd example && bundle install",
|
|
19
|
-
"pod-install": "cd example/ios && bundle exec pod install",
|
|
19
|
+
"pod-install": "cd example/ios && RCT_NEW_ARCH_ENABLED=1 bundle exec pod install",
|
|
20
20
|
"bootstrap": "yarn --cwd example && yarn && yarn bundle-install && yarn pod-install"
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
@@ -22,6 +22,7 @@ Pod::Spec.new do |s|
|
|
|
22
22
|
"ios/generated/RCTModulesConformingToProtocolsProvider.h",
|
|
23
23
|
"ios/generated/RCTModulesConformingToProtocolsProvider.mm",
|
|
24
24
|
]
|
|
25
|
+
s.module_map = 'ios/generated/module.modulemap'
|
|
25
26
|
s.public_header_files = "ios/generated/**/*.h"
|
|
26
27
|
s.module_name = 'ReactNativeMapsGenerated'
|
|
27
28
|
s.compiler_flags = folly_compiler_flags
|
|
@@ -32,15 +32,22 @@ Pod::Spec.new do |s|
|
|
|
32
32
|
:script => %(
|
|
33
33
|
set -x
|
|
34
34
|
echo "Running Google Maps detection script..."
|
|
35
|
-
GOOGLE_MAPS_HEADER_PATH="$PODS_ROOT/Headers/Public/react-native-google-maps/AIRGoogleMap.h"
|
|
36
35
|
DEFINES_DIR="${PODS_TARGET_SRCROOT}/ios/AirMaps"
|
|
37
36
|
DEFINES_FILE="${DEFINES_DIR}/RNMapsDefines.h"
|
|
38
37
|
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
# Standard path
|
|
39
|
+
GOOGLE_MAPS_STANDARD_PATH="$PODS_ROOT/Headers/Public/react-native-google-maps/AIRGoogleMap.h"
|
|
41
40
|
|
|
42
|
-
#
|
|
43
|
-
|
|
41
|
+
# Framework paths
|
|
42
|
+
GOOGLE_MAPS_FRAMEWORK_MODULE="$PODS_ROOT/Target Support Files/react-native-google-maps/react-native-google-maps.modulemap"
|
|
43
|
+
GOOGLE_MAPS_UMBRELLA_HEADER="$PODS_ROOT/Target Support Files/react-native-google-maps/react-native-google-maps-umbrella.h"
|
|
44
|
+
|
|
45
|
+
echo "Checking standard path: $GOOGLE_MAPS_STANDARD_PATH"
|
|
46
|
+
echo "Checking framework module path: $GOOGLE_MAPS_FRAMEWORK_MODULE"
|
|
47
|
+
echo "Checking umbrella header path: $GOOGLE_MAPS_UMBRELLA_HEADER"
|
|
48
|
+
|
|
49
|
+
# Check if Google Maps is available via any detection method
|
|
50
|
+
if [ -f "$GOOGLE_MAPS_STANDARD_PATH" ] || [ -f "$GOOGLE_MAPS_FRAMEWORK_MODULE" ] || [ -f "$GOOGLE_MAPS_UMBRELLA_HEADER" ]; then
|
|
44
51
|
echo "#define HAVE_GOOGLE_MAPS 1" > "$DEFINES_FILE"
|
|
45
52
|
echo "Google Maps detected. HAVE_GOOGLE_MAPS defined."
|
|
46
53
|
else
|