react-native-maps 1.21.0-alpha.145 → 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.
@@ -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<RNMapsAirModuleDelegate>
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
- @interface AIRGoogleMap () <GMSIndoorDisplayDelegate>
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
- [mapView takeSnapshotWithConfig:config success:callback error:^(NSString *code, NSString *message, NSError *error) {
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
- AIRGoogleMap *mapView = (AIRGoogleMap *)view;
334
+ id<RNMapsAirModuleDelegate> mapView = (id<RNMapsAirModuleDelegate>) view;
333
335
  resolve([mapView getPointForCoordinates:coord]);
334
336
  }
335
337
  }];
@@ -52,7 +52,7 @@ using namespace facebook::react;
52
52
 
53
53
 
54
54
  - (id<RNMapsAirModuleDelegate>) mapView {
55
- return _view;
55
+ return (id<RNMapsAirModuleDelegate>)_view;
56
56
  }
57
57
 
58
58
  #pragma mark - JS Commands
@@ -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.145",
8
+ "version": "1.21.0-alpha.146",
9
9
  "license": "MIT",
10
10
  "scripts": {
11
11
  "lint": "eslint . --max-warnings 0",
@@ -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
- echo "GOOGLE_MAPS_HEADER_PATH=$GOOGLE_MAPS_HEADER_PATH"
40
- echo "DEFINES_FILE=$DEFINES_FILE"
38
+ # Standard path
39
+ GOOGLE_MAPS_STANDARD_PATH="$PODS_ROOT/Headers/Public/react-native-google-maps/AIRGoogleMap.h"
41
40
 
42
- # Check if Google Maps is available and write to the defines file
43
- if [ -f "$GOOGLE_MAPS_HEADER_PATH" ]; then
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