react-native-maps 1.18.4 → 1.19.1

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.
@@ -1,5 +1,5 @@
1
1
  distributionBase=GRADLE_USER_HOME
2
2
  distributionPath=wrapper/dists
3
- distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.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
package/android/gradlew CHANGED
@@ -15,6 +15,8 @@
15
15
  # See the License for the specific language governing permissions and
16
16
  # limitations under the License.
17
17
  #
18
+ # SPDX-License-Identifier: Apache-2.0
19
+ #
18
20
 
19
21
  ##############################################################################
20
22
  #
@@ -55,7 +57,7 @@
55
57
  # Darwin, MinGW, and NonStop.
56
58
  #
57
59
  # (3) This script is generated from the Groovy template
58
- # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60
+ # https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
59
61
  # within the Gradle project.
60
62
  #
61
63
  # You can find Gradle at https://github.com/gradle/gradle/.
@@ -80,13 +82,12 @@ do
80
82
  esac
81
83
  done
82
84
 
83
- APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
84
-
85
- APP_NAME="Gradle"
85
+ # This is normally unused
86
+ # shellcheck disable=SC2034
86
87
  APP_BASE_NAME=${0##*/}
87
-
88
- # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
89
- DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
88
+ # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
89
+ APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90
+ ' "$PWD" ) || exit
90
91
 
91
92
  # Use the maximum available, or set MAX_FD != -1 to use that value.
92
93
  MAX_FD=maximum
@@ -133,22 +134,29 @@ location of your Java installation."
133
134
  fi
134
135
  else
135
136
  JAVACMD=java
136
- which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137
+ if ! command -v java >/dev/null 2>&1
138
+ then
139
+ die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
137
140
 
138
141
  Please set the JAVA_HOME variable in your environment to match the
139
142
  location of your Java installation."
143
+ fi
140
144
  fi
141
145
 
142
146
  # Increase the maximum file descriptors if we can.
143
147
  if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
144
148
  case $MAX_FD in #(
145
149
  max*)
150
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
151
+ # shellcheck disable=SC2039,SC3045
146
152
  MAX_FD=$( ulimit -H -n ) ||
147
153
  warn "Could not query maximum file descriptor limit"
148
154
  esac
149
155
  case $MAX_FD in #(
150
156
  '' | soft) :;; #(
151
157
  *)
158
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
159
+ # shellcheck disable=SC2039,SC3045
152
160
  ulimit -n "$MAX_FD" ||
153
161
  warn "Could not set maximum file descriptor limit to $MAX_FD"
154
162
  esac
@@ -193,11 +201,15 @@ if "$cygwin" || "$msys" ; then
193
201
  done
194
202
  fi
195
203
 
196
- # Collect all arguments for the java command;
197
- # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
198
- # shell script including quotes and variable substitutions, so put them in
199
- # double quotes to make sure that they get re-expanded; and
200
- # * put everything else in single quotes, so that it's not re-expanded.
204
+
205
+ # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
206
+ DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
207
+
208
+ # Collect all arguments for the java command:
209
+ # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
210
+ # and any embedded shellness will be escaped.
211
+ # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
212
+ # treated as '${Hostname}' itself on the command line.
201
213
 
202
214
  set -- \
203
215
  "-Dorg.gradle.appname=$APP_BASE_NAME" \
@@ -205,6 +217,12 @@ set -- \
205
217
  org.gradle.wrapper.GradleWrapperMain \
206
218
  "$@"
207
219
 
220
+ # Stop when "xargs" is not available.
221
+ if ! command -v xargs >/dev/null 2>&1
222
+ then
223
+ die "xargs is not available"
224
+ fi
225
+
208
226
  # Use "xargs" to parse quoted args.
209
227
  #
210
228
  # With -n1 it outputs one arg per line, with the quotes and backslashes removed.
@@ -13,8 +13,10 @@
13
13
  @rem See the License for the specific language governing permissions and
14
14
  @rem limitations under the License.
15
15
  @rem
16
+ @rem SPDX-License-Identifier: Apache-2.0
17
+ @rem
16
18
 
17
- @if "%DEBUG%" == "" @echo off
19
+ @if "%DEBUG%"=="" @echo off
18
20
  @rem ##########################################################################
19
21
  @rem
20
22
  @rem Gradle startup script for Windows
@@ -25,7 +27,8 @@
25
27
  if "%OS%"=="Windows_NT" setlocal
26
28
 
27
29
  set DIRNAME=%~dp0
28
- if "%DIRNAME%" == "" set DIRNAME=.
30
+ if "%DIRNAME%"=="" set DIRNAME=.
31
+ @rem This is normally unused
29
32
  set APP_BASE_NAME=%~n0
30
33
  set APP_HOME=%DIRNAME%
31
34
 
@@ -40,13 +43,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome
40
43
 
41
44
  set JAVA_EXE=java.exe
42
45
  %JAVA_EXE% -version >NUL 2>&1
43
- if "%ERRORLEVEL%" == "0" goto execute
46
+ if %ERRORLEVEL% equ 0 goto execute
44
47
 
45
- echo.
46
- echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
47
- echo.
48
- echo Please set the JAVA_HOME variable in your environment to match the
49
- echo location of your Java installation.
48
+ echo. 1>&2
49
+ echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50
+ echo. 1>&2
51
+ echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52
+ echo location of your Java installation. 1>&2
50
53
 
51
54
  goto fail
52
55
 
@@ -56,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
56
59
 
57
60
  if exist "%JAVA_EXE%" goto execute
58
61
 
59
- echo.
60
- echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
61
- echo.
62
- echo Please set the JAVA_HOME variable in your environment to match the
63
- echo location of your Java installation.
62
+ echo. 1>&2
63
+ echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64
+ echo. 1>&2
65
+ echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66
+ echo location of your Java installation. 1>&2
64
67
 
65
68
  goto fail
66
69
 
@@ -75,13 +78,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
75
78
 
76
79
  :end
77
80
  @rem End local scope for the variables with windows NT shell
78
- if "%ERRORLEVEL%"=="0" goto mainEnd
81
+ if %ERRORLEVEL% equ 0 goto mainEnd
79
82
 
80
83
  :fail
81
84
  rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
82
85
  rem the _cmd.exe /c_ return code!
83
- if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
84
- exit /b 1
86
+ set EXIT_CODE=%ERRORLEVEL%
87
+ if %EXIT_CODE% equ 0 set EXIT_CODE=1
88
+ if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
89
+ exit /b %EXIT_CODE%
85
90
 
86
91
  :mainEnd
87
92
  if "%OS%"=="Windows_NT" endlocal
@@ -444,7 +444,8 @@ public class MapManager extends ViewGroupManager<MapView> {
444
444
  "onDoublePress", MapBuilder.of("registrationName", "onDoublePress"),
445
445
  "onMapLoaded", MapBuilder.of("registrationName", "onMapLoaded"),
446
446
  "onMarkerSelect", MapBuilder.of("registrationName", "onMarkerSelect"),
447
- "onMarkerDeselect", MapBuilder.of("registrationName", "onMarkerDeselect")
447
+ "onMarkerDeselect", MapBuilder.of("registrationName", "onMarkerDeselect"),
448
+ "onRegionChangeStart", MapBuilder.of("registrationName", "onRegionChangeStart")
448
449
  ));
449
450
 
450
451
  return map;
@@ -381,6 +381,10 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
381
381
  @Override
382
382
  public void onCameraMoveStarted(int reason) {
383
383
  cameraMoveReason = reason;
384
+ boolean isGesture = GoogleMap.OnCameraMoveStartedListener.REASON_GESTURE == reason;
385
+ WritableMap event = new WritableNativeMap();
386
+ event.putBoolean("isGesture", isGesture);
387
+ manager.pushEvent(context, view, "onRegionChangeStart", event);
384
388
  }
385
389
  });
386
390
 
@@ -38,6 +38,7 @@
38
38
  @property (nonatomic, copy) RCTBubblingEventBlock onMarkerDeselect;
39
39
  @property (nonatomic, copy) RCTBubblingEventBlock onChange;
40
40
  @property (nonatomic, copy) RCTBubblingEventBlock onPoiClick;
41
+ @property (nonatomic, copy) RCTDirectEventBlock onRegionChangeStart;
41
42
  @property (nonatomic, copy) RCTDirectEventBlock onRegionChange;
42
43
  @property (nonatomic, copy) RCTDirectEventBlock onRegionChangeComplete;
43
44
  @property (nonatomic, copy) RCTDirectEventBlock onIndoorLevelActivated;
@@ -72,6 +73,7 @@
72
73
  - (void)didTapPolygon:(GMSPolygon *)polygon;
73
74
  - (void)didTapAtCoordinate:(CLLocationCoordinate2D)coordinate;
74
75
  - (void)didLongPressAtCoordinate:(CLLocationCoordinate2D)coordinate;
76
+ - (void)willMove:(BOOL)gesture;
75
77
  - (void)didChangeCameraPosition:(GMSCameraPosition *)position isGesture:(BOOL)isGesture;
76
78
  - (void)idleAtCameraPosition:(GMSCameraPosition *)position isGesture:(BOOL)isGesture;
77
79
  - (void)didTapPOIWithPlaceID:(NSString *)placeID name:(NSString *) name location:(CLLocationCoordinate2D) location;
@@ -97,7 +97,6 @@ id regionAsJSON(MKCoordinateRegion region) {
97
97
  _tiles = [NSMutableArray array];
98
98
  _overlays = [NSMutableArray array];
99
99
  _initialCamera = nil;
100
- _cameraProp = nil;
101
100
  _initialRegion = MKCoordinateRegionMake(CLLocationCoordinate2DMake(0.0, 0.0), MKCoordinateSpanMake(0.0, 0.0));
102
101
  _region = MKCoordinateRegionMake(CLLocationCoordinate2DMake(0.0, 0.0), MKCoordinateSpanMake(0.0, 0.0));
103
102
  _initialRegionSet = false;
@@ -315,9 +314,19 @@ id regionAsJSON(MKCoordinateRegion region) {
315
314
  _googleMapId = googleMapId;
316
315
  }
317
316
 
317
+ - (GMSCameraPosition *)cameraProp {
318
+ if(_didLayoutSubviews) {
319
+ return self.camera;
320
+ } else {
321
+ return _initialCamera;
322
+ }
323
+ }
324
+
318
325
  - (void)setCameraProp:(GMSCameraPosition*)camera {
319
326
  _initialCamera = camera;
320
- self.camera = camera;
327
+ if(_didLayoutSubviews) {
328
+ self.camera = camera;
329
+ }
321
330
  }
322
331
 
323
332
  - (void)setOnMapReady:(RCTBubblingEventBlock)onMapReady {
@@ -394,6 +403,11 @@ id regionAsJSON(MKCoordinateRegion region) {
394
403
  self.onLongPress([self eventFromCoordinate:coordinate]);
395
404
  }
396
405
 
406
+ - (void)willMove:(BOOL)gesture {
407
+ id event = @{@"isGesture": [NSNumber numberWithBool:gesture]};
408
+ if (self.onRegionChangeStart) self.onRegionChangeStart(event);
409
+ }
410
+
397
411
  - (void)didChangeCameraPosition:(GMSCameraPosition *)position isGesture:(BOOL)isGesture{
398
412
  id event = @{@"continuous": @YES,
399
413
  @"region": regionAsJSON([AIRGoogleMap makeGMSCameraPositionFromMap:self andGMSCameraPosition:position]),
@@ -117,6 +117,7 @@ RCT_EXPORT_VIEW_PROPERTY(onChange, RCTBubblingEventBlock)
117
117
  RCT_EXPORT_VIEW_PROPERTY(onMarkerPress, RCTDirectEventBlock)
118
118
  RCT_EXPORT_VIEW_PROPERTY(onMarkerSelect, RCTDirectEventBlock)
119
119
  RCT_EXPORT_VIEW_PROPERTY(onMarkerDeselect, RCTDirectEventBlock)
120
+ RCT_EXPORT_VIEW_PROPERTY(onRegionChangeStart, RCTDirectEventBlock)
120
121
  RCT_EXPORT_VIEW_PROPERTY(onRegionChange, RCTDirectEventBlock)
121
122
  RCT_EXPORT_VIEW_PROPERTY(onRegionChangeComplete, RCTDirectEventBlock)
122
123
  RCT_EXPORT_VIEW_PROPERTY(onPoiClick, RCTDirectEventBlock)
@@ -160,8 +161,8 @@ RCT_EXPORT_METHOD(setCamera:(nonnull NSNumber *)reactTag
160
161
  RCTLogError(@"Invalid view returned from registry, expecting AIRGoogleMap, got: %@", view);
161
162
  } else {
162
163
  AIRGoogleMap *mapView = (AIRGoogleMap *)view;
163
- GMSCameraPosition *camera = [RCTConvert GMSCameraPositionWithDefaults:json existingCamera:[mapView camera]];
164
- [mapView setCamera:camera];
164
+ GMSCameraPosition *camera = [RCTConvert GMSCameraPositionWithDefaults:json existingCamera:[mapView cameraProp]];
165
+ [mapView setCameraProp:camera];
165
166
  }
166
167
  }];
167
168
  }
@@ -179,7 +180,7 @@ RCT_EXPORT_METHOD(animateCamera:(nonnull NSNumber *)reactTag
179
180
  [CATransaction begin];
180
181
  [CATransaction setAnimationDuration:duration/1000];
181
182
  AIRGoogleMap *mapView = (AIRGoogleMap *)view;
182
- GMSCameraPosition *camera = [RCTConvert GMSCameraPositionWithDefaults:json existingCamera:[mapView camera]];
183
+ GMSCameraPosition *camera = [RCTConvert GMSCameraPositionWithDefaults:json existingCamera:[mapView cameraProp]];
183
184
  [mapView animateToCameraPosition:camera];
184
185
  [CATransaction commit];
185
186
  }
@@ -511,8 +512,10 @@ RCT_EXPORT_METHOD(setIndoorActiveLevelIndex:(nonnull NSNumber *)reactTag
511
512
  return @{ @"legalNotice": [GMSServices openSourceLicenseInfo] };
512
513
  }
513
514
 
514
- - (void)mapView:(GMSMapView *)mapView willMove:(BOOL)gesture{
515
- self.isGesture = gesture;
515
+ - (void)mapView:(GMSMapView *)mapView willMove:(BOOL)gesture {
516
+ self.isGesture = gesture;
517
+ AIRGoogleMap *googleMapView = (AIRGoogleMap *)mapView;
518
+ [googleMapView willMove:gesture];
516
519
  }
517
520
 
518
521
  - (void)mapViewDidStartTileRendering:(GMSMapView *)mapView {
@@ -67,6 +67,7 @@ extern const NSInteger AIRMapMaxZoomLevel;
67
67
  @property (nonatomic, copy) RCTDirectEventBlock onMarkerDragEnd;
68
68
 
69
69
  @property (nonatomic, copy) RCTDirectEventBlock onCalloutPress;
70
+ @property (nonatomic, copy) RCTDirectEventBlock onRegionChangeStart;
70
71
  @property (nonatomic, copy) RCTDirectEventBlock onRegionChange;
71
72
  @property (nonatomic, copy) RCTBubblingEventBlock onUserLocationChange;
72
73
 
@@ -113,6 +113,7 @@ RCT_EXPORT_VIEW_PROPERTY(mapType, MKMapType)
113
113
  RCT_EXPORT_VIEW_PROPERTY(cameraZoomRange, NSDictionary)
114
114
  RCT_EXPORT_VIEW_PROPERTY(onMapReady, RCTBubblingEventBlock)
115
115
  RCT_EXPORT_VIEW_PROPERTY(onChange, RCTBubblingEventBlock)
116
+ RCT_EXPORT_VIEW_PROPERTY(onRegionChangeStart, RCTDirectEventBlock)
116
117
  RCT_EXPORT_VIEW_PROPERTY(onPanDrag, RCTBubblingEventBlock)
117
118
  RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
118
119
  RCT_EXPORT_VIEW_PROPERTY(onLongPress, RCTBubblingEventBlock)
@@ -935,6 +936,11 @@ static int kDragCenterContext;
935
936
 
936
937
  }
937
938
 
939
+ - (void)mapView:(AIRMap *)mapView regionWillChangeAnimated:(BOOL)animated
940
+ {
941
+ if (mapView.onRegionChangeStart) mapView.onRegionChangeStart(@{});
942
+ }
943
+
938
944
  - (void)mapViewDidChangeVisibleRegion:(AIRMap *)mapView
939
945
  {
940
946
  [self _regionChanged:mapView];
package/lib/MapView.d.ts CHANGED
@@ -314,6 +314,15 @@ export type MapViewProps = ViewProps & {
314
314
  * @platform Android: Supported
315
315
  */
316
316
  onPress?: (event: MapPressEvent) => void;
317
+ /**
318
+ * Callback that is called once before the region changes, such as when the user starts moving the map.
319
+ * `isGesture` property indicates if the move was from the user (true) or an animation (false).
320
+ * **Note**: `isGesture` is supported by Google Maps only.
321
+ *
322
+ * @platform iOS: Supported
323
+ * @platform Android: Supported
324
+ */
325
+ onRegionChangeStart?: (event: NativeSyntheticEvent<Details>) => void;
317
326
  /**
318
327
  * Callback that is called continuously when the region changes, such as when a user is dragging the map.
319
328
  * `isGesture` property indicates if the move was from the user (true) or an animation (false).
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.18.4",
8
+ "version": "1.19.1",
9
9
  "license": "MIT",
10
10
  "scripts": {
11
11
  "lint": "eslint . --max-warnings 0",
@@ -57,20 +57,28 @@
57
57
  "devDependencies": {
58
58
  "@commitlint/cli": "17.6.1",
59
59
  "@commitlint/config-conventional": "17.6.1",
60
- "@react-native/eslint-config": "^0.73.1",
61
60
  "@semantic-release/changelog": "6.0.3",
62
61
  "@semantic-release/git": "10.0.1",
63
- "@types/jest": "29.5.1",
62
+ "semantic-release": "24.2.0",
63
+ "husky": "8.0.3",
64
64
  "@types/react-native": "0.72.8",
65
+ "@babel/core": "^7.25.2",
66
+ "@babel/preset-env": "^7.25.3",
67
+ "@babel/runtime": "^7.25.0",
68
+ "react-native": "^0.76.1",
69
+ "react": "^18.3.1",
70
+ "@react-native/babel-preset": "0.76.1",
71
+ "@react-native/eslint-config": "0.76.1",
72
+ "@react-native/metro-config": "0.76.1",
73
+ "@react-native/typescript-config": "0.76.1",
74
+ "@types/react": "^18.2.6",
75
+ "@types/react-test-renderer": "^18.0.0",
65
76
  "babel-jest": "^29.6.3",
66
- "detox": "20.7.0",
67
- "eslint": "8.38.0",
68
- "husky": "8.0.3",
77
+ "eslint": "^8.19.0",
78
+ "@types/jest": "29.5.1",
69
79
  "jest": "^29.6.3",
70
80
  "prettier": "2.8.8",
71
- "react": "18.2.0",
72
- "react-native": "0.73.0",
73
- "semantic-release": "21.1.2",
81
+ "react-test-renderer": "18.3.1",
74
82
  "typescript": "5.0.4"
75
83
  },
76
84
  "dependencies": {