react-native-maps 1.21.0-alpha.107 → 1.21.0-alpha.109

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.
@@ -58,7 +58,7 @@ android {
58
58
 
59
59
  defaultConfig {
60
60
  minSdkVersion safeExtGet('minSdkVersion', 21)
61
- targetSdkVersion safeExtGet('targetSdkVersion', 35)
61
+ targetSdkVersion safeExtGet('targetSdkVersion', 34)
62
62
 
63
63
  buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString()
64
64
 
@@ -1,5 +1,5 @@
1
1
  distributionBase=GRADLE_USER_HOME
2
2
  distributionPath=wrapper/dists
3
- distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-all.zip
3
+ distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
4
4
  zipStoreBase=GRADLE_USER_HOME
5
5
  zipStorePath=wrapper/dists
@@ -1747,24 +1747,20 @@ public void onCreate(LifecycleOwner owner) {
1747
1747
  levelsArray.pushMap(levelMap);
1748
1748
  index++;
1749
1749
  }
1750
- WritableMap event = Arguments.createMap();
1751
1750
  WritableMap indoorBuilding = Arguments.createMap();
1752
1751
  indoorBuilding.putArray("levels", levelsArray);
1753
1752
  indoorBuilding.putInt("activeLevelIndex", building.getActiveLevelIndex());
1754
1753
  indoorBuilding.putBoolean("underground", building.isUnderground());
1755
1754
 
1756
- event.putMap("indoorBuilding", indoorBuilding);
1757
- dispatchEvent(event, OnIndoorBuildingFocusedEvent::new);
1755
+ dispatchEvent(indoorBuilding, OnIndoorBuildingFocusedEvent::new);
1758
1756
  } else {
1759
- WritableMap event = Arguments.createMap();
1760
1757
  WritableArray levelsArray = Arguments.createArray();
1761
1758
  WritableMap indoorBuilding = Arguments.createMap();
1762
1759
  indoorBuilding.putArray("levels", levelsArray);
1763
1760
  indoorBuilding.putInt("activeLevelIndex", 0);
1764
1761
  indoorBuilding.putBoolean("underground", false);
1765
1762
 
1766
- event.putMap("indoorBuilding", indoorBuilding);
1767
- dispatchEvent(event, OnIndoorBuildingFocusedEvent::new);
1763
+ dispatchEvent(indoorBuilding, OnIndoorBuildingFocusedEvent::new);
1768
1764
  }
1769
1765
  }
1770
1766
 
@@ -1779,15 +1775,13 @@ public void onCreate(LifecycleOwner owner) {
1779
1775
  }
1780
1776
  IndoorLevel level = building.getLevels().get(activeLevelIndex);
1781
1777
 
1782
- WritableMap event = Arguments.createMap();
1783
1778
  WritableMap indoorlevel = Arguments.createMap();
1784
1779
 
1785
1780
  indoorlevel.putInt("activeLevelIndex", activeLevelIndex);
1786
1781
  indoorlevel.putString("name", level.getName());
1787
1782
  indoorlevel.putString("shortName", level.getShortName());
1788
1783
 
1789
- event.putMap("indoorLevel", indoorlevel);
1790
- dispatchEvent(event, OnIndoorLevelActivatedEvent::new);
1784
+ dispatchEvent(indoorlevel, OnIndoorLevelActivatedEvent::new);
1791
1785
  }
1792
1786
 
1793
1787
  public void setIndoorActiveLevelIndex(int activeLevelIndex) {
@@ -1172,11 +1172,9 @@ id regionAsJSON(MKCoordinateRegion region) {
1172
1172
  return;
1173
1173
  }
1174
1174
  self.onIndoorBuildingFocused(@{
1175
- @"indoorBuilding": @{
1176
- @"activeLevelIndex": @0,
1177
- @"underground": @false,
1178
- @"levels": [[NSMutableArray alloc]init]
1179
- }
1175
+ @"activeLevelIndex": @0,
1176
+ @"underground": @false,
1177
+ @"levels": [[NSMutableArray alloc]init]
1180
1178
  });
1181
1179
  }
1182
1180
  NSInteger i = 0;
@@ -1193,11 +1191,9 @@ id regionAsJSON(MKCoordinateRegion region) {
1193
1191
  return;
1194
1192
  }
1195
1193
  self.onIndoorBuildingFocused(@{
1196
- @"indoorBuilding": @{
1197
- @"activeLevelIndex": @(building.defaultLevelIndex),
1198
- @"underground": @(building.underground),
1199
- @"levels": arrayLevels
1200
- }
1194
+ @"activeLevelIndex": @(building.defaultLevelIndex),
1195
+ @"underground": @(building.underground),
1196
+ @"levels": arrayLevels
1201
1197
  });
1202
1198
  }
1203
1199
 
@@ -1213,11 +1209,9 @@ id regionAsJSON(MKCoordinateRegion region) {
1213
1209
  i++;
1214
1210
  }
1215
1211
  self.onIndoorLevelActivated(@{
1216
- @"indoorLevel": @{
1217
- @"activeLevelIndex": @(i),
1218
- @"name": level.name,
1219
- @"shortName": level.shortName
1220
- }
1212
+ @"activeLevelIndex": @(i),
1213
+ @"name": level.name,
1214
+ @"shortName": level.shortName
1221
1215
  });
1222
1216
  }
1223
1217
  // do nothing, passed as options on initialization
@@ -29,8 +29,8 @@ CGRect unionRect(CGRect a, CGRect b) {
29
29
  @implementation AIRGoogleMapMarker {
30
30
  RCTImageLoaderCancellationBlock _reloadImageCancellationBlock;
31
31
  RCTBubblingEventBlock _onPress;
32
- RCTBubblingEventBlock _onSelect;
33
- RCTBubblingEventBlock _onDeselect;
32
+ RCTDirectEventBlock _onSelect;
33
+ RCTDirectEventBlock _onDeselect;
34
34
  __weak UIImageView *_iconImageView;
35
35
  UIView *_iconView;
36
36
  UIColor *_pinColor;
@@ -18,6 +18,7 @@
18
18
  #import <react/renderer/components/RNMapsSpecs/RCTComponentViewHelpers.h>
19
19
  #import "RCTFabricComponentsPlugins.h"
20
20
  #import <React/RCTConversions.h>
21
+ #import <React/RCTUtils.h>
21
22
  #import "RCTConvert+GMSMapViewType.h"
22
23
  #import "RCTConvert+AirMap.h"
23
24
  #import "UIView+AirMap.h"
@@ -195,17 +196,14 @@ using namespace facebook::react;
195
196
 
196
197
  _view.onIndoorLevelActivated = [self](NSDictionary* dictionary) {
197
198
  if (_eventEmitter) {
199
+
198
200
  auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
199
-
200
- facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorLevelActivatedIndoorLevel level = {
201
+
202
+ facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorLevelActivated data = {
201
203
  .activeLevelIndex= (int) [dictionary[@"activeLevelIndex"] integerValue],
202
204
  .name = [dictionary[@"name"] UTF8String],
203
205
  .shortName = [dictionary[@"shortName"] UTF8String],
204
206
  };
205
-
206
- facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorLevelActivated data = {
207
- .indoorLevel = level,
208
- };
209
207
  mapViewEventEmitter->onIndoorLevelActivated(data);
210
208
  }
211
209
  };
@@ -214,13 +212,13 @@ using namespace facebook::react;
214
212
  if (_eventEmitter) {
215
213
  auto mapViewEventEmitter = std::static_pointer_cast<RNMapsGoogleMapViewEventEmitter const>(_eventEmitter);
216
214
 
217
- facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorBuildingFocusedIndoorBuilding indoorBuilding = {
218
- .underground = [dictionary[@"underground"] boolValue],
219
- .activeLevelIndex = (int) [dictionary[@"activeLevelIndex"] integerValue]
220
- };
221
-
215
+ NSError *jsError = nil;
216
+ NSString *levelsStr = RCTJSONStringify(dictionary[@"levels"], &jsError);
217
+
222
218
  facebook::react::RNMapsGoogleMapViewEventEmitter::OnIndoorBuildingFocused data = {
223
- .indoorBuilding = indoorBuilding
219
+ .underground = [dictionary[@"underground"] boolValue],
220
+ .activeLevelIndex = (int) [dictionary[@"activeLevelIndex"] integerValue],
221
+ .levels = [levelsStr UTF8String]
224
222
  };
225
223
  mapViewEventEmitter->onIndoorBuildingFocused(data);
226
224
  }
@@ -18,6 +18,7 @@
18
18
 
19
19
  RCT_EXPORT_MODULE(RNMapsGooglePolygonViewManager)
20
20
 
21
+ RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
21
22
 
22
23
 
23
24
  @end
@@ -20,13 +20,8 @@
20
20
  if (!existingClass) {
21
21
  // If the class does not exist, create a new class that is a subclass of NSObject
22
22
  Class newClass = objc_allocateClassPair([NSObject class], className, 0);
23
-
24
23
  // Register the new class with the runtime
25
24
  objc_registerClassPair(newClass);
26
-
27
- NSLog(@"Class %s created successfully.", className);
28
- } else {
29
- NSLog(@"Class %s already exists.", className);
30
25
  }
31
26
  }
32
27
 
@@ -17,5 +17,12 @@
17
17
 
18
18
  RCT_EXPORT_MODULE(RNMapsMarkerViewManager)
19
19
 
20
+ RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
21
+ RCT_EXPORT_VIEW_PROPERTY(onSelect, RCTDirectEventBlock)
22
+ RCT_EXPORT_VIEW_PROPERTY(onDeselect, RCTDirectEventBlock)
23
+ RCT_EXPORT_VIEW_PROPERTY(onCalloutPress, RCTDirectEventBlock)
24
+ RCT_EXPORT_VIEW_PROPERTY(onDragStart, RCTDirectEventBlock)
25
+ RCT_EXPORT_VIEW_PROPERTY(onDrag, RCTDirectEventBlock)
26
+ RCT_EXPORT_VIEW_PROPERTY(onDragEnd, RCTDirectEventBlock)
20
27
 
21
28
  @end
package/lib/MapView.js CHANGED
@@ -52,7 +52,7 @@ exports.MAP_TYPES = {
52
52
  class MapView extends React.Component {
53
53
  static Animated;
54
54
  map;
55
- fabricMap;
55
+ fabricMap = React.createRef();
56
56
  constructor(props) {
57
57
  super(props);
58
58
  this.map = React.createRef();
@@ -333,6 +333,9 @@ class MapView extends React.Component {
333
333
  };
334
334
  handleIndoorBuildingFocused = (event) => {
335
335
  if (this.props.onIndoorBuildingFocused) {
336
+ if (typeof event.nativeEvent.levels === 'string') {
337
+ event.nativeEvent.levels = JSON.parse(event.nativeEvent.levels);
338
+ }
336
339
  this.props.onIndoorBuildingFocused(event);
337
340
  }
338
341
  };
@@ -133,11 +133,9 @@ export type IndoorLevel = Readonly<{
133
133
  shortName: string;
134
134
  }>;
135
135
  export type IndoorLevelActivatedEventHandler = DirectEventHandler<Readonly<{
136
- indoorLevel: {
137
- activeLevelIndex: Int32;
138
- name: string;
139
- shortName: string;
140
- };
136
+ activeLevelIndex: Int32;
137
+ name: string;
138
+ shortName: string;
141
139
  }>>;
142
140
  export type IndoorBuilding = Readonly<{
143
141
  underground: boolean;
@@ -145,10 +143,9 @@ export type IndoorBuilding = Readonly<{
145
143
  levels: ReadonlyArray<IndoorLevel>;
146
144
  }>;
147
145
  export type IndoorBuildingEventHandler = DirectEventHandler<Readonly<{
148
- indoorBuilding: {
149
- underground: boolean;
150
- activeLevelIndex: Int32;
151
- };
146
+ underground: boolean;
147
+ activeLevelIndex: Int32;
148
+ levels: string;
152
149
  }>>;
153
150
  export type KmlMapEventHandler = DirectEventHandler<Readonly<{}>>;
154
151
  export type MapLoadedEventHandler = DirectEventHandler<Readonly<{}>>;
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "main": "lib/index.js",
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.107",
8
+ "version": "1.21.0-alpha.109",
9
9
  "license": "MIT",
10
10
  "scripts": {
11
11
  "lint": "eslint . --max-warnings 0",
@@ -46,8 +46,8 @@
46
46
  "mapkit"
47
47
  ],
48
48
  "peerDependencies": {
49
- "react": ">= 19.0.0",
50
- "react-native": ">= 0.78.0",
49
+ "react": ">= 18.3.1",
50
+ "react-native": ">= 0.77.1",
51
51
  "react-native-web": ">= 0.11"
52
52
  },
53
53
  "peerDependenciesMeta": {
@@ -62,23 +62,23 @@
62
62
  "@commitlint/cli": "17.6.1",
63
63
  "@commitlint/config-conventional": "17.6.1",
64
64
  "@react-native-community/cli": "15.1.3",
65
- "@react-native/babel-preset": "0.78.0",
66
- "@react-native/eslint-config": "0.78.0",
67
- "@react-native/metro-config": "0.78.0",
68
- "@react-native/typescript-config": "0.78.0",
65
+ "@react-native/babel-preset": "0.77.1",
66
+ "@react-native/eslint-config": "0.77.1",
67
+ "@react-native/metro-config": "0.77.1",
68
+ "@react-native/typescript-config": "0.77.1",
69
69
  "@semantic-release/changelog": "6.0.3",
70
70
  "@semantic-release/git": "10.0.1",
71
71
  "@types/jest": "29.5.14",
72
- "@types/react": "^19.0.10",
72
+ "@types/react": "^18.2.6",
73
73
  "@types/react-native": "0.73.0",
74
- "@types/react-test-renderer": "^19.0.0",
74
+ "@types/react-test-renderer": "^18.0.0",
75
75
  "eslint": "^8.19.0",
76
76
  "husky": "8.0.3",
77
77
  "jest": "^29.6.3",
78
78
  "prettier": "2.8.8",
79
- "react": "^19.0.0",
80
- "react-native": "^0.78.0",
81
- "react-test-renderer": "19.0.0",
79
+ "react": "^18.3.1",
80
+ "react-native": "^0.77.1",
81
+ "react-test-renderer": "18.3.1",
82
82
  "semantic-release": "24.2.0",
83
83
  "typescript": "5.0.4"
84
84
  },
@@ -181,11 +181,9 @@ export type IndoorLevel = Readonly<{
181
181
 
182
182
  export type IndoorLevelActivatedEventHandler = DirectEventHandler<
183
183
  Readonly<{
184
- indoorLevel: {
185
- activeLevelIndex: Int32; // Int32 for integers
186
- name: string; // Non-nullable string
187
- shortName: string; // Non-nullable string
188
- }; // Nested ActiveIndoorLevel type
184
+ activeLevelIndex: Int32; // Int32 for integers
185
+ name: string; // Non-nullable string
186
+ shortName: string; // Non-nullable string
189
187
  }>
190
188
  >;
191
189
 
@@ -197,10 +195,9 @@ export type IndoorBuilding = Readonly<{
197
195
 
198
196
  export type IndoorBuildingEventHandler = DirectEventHandler<
199
197
  Readonly<{
200
- indoorBuilding: {
201
- underground: boolean; // Non-nullable boolean
202
- activeLevelIndex: Int32; // Int32 for integers
203
- };
198
+ underground: boolean; // Non-nullable boolean
199
+ activeLevelIndex: Int32; // Int32 for integers
200
+ levels: string; // Immutable array of IndoorLevel
204
201
  }>
205
202
  >;
206
203