react-native-maps 1.11.1 → 1.11.3

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.
@@ -19,6 +19,7 @@
19
19
  @property (nonatomic, strong) AIRGMSPolyline *polyline;
20
20
  @property (nonatomic, strong) NSArray<AIRMapCoordinate *> *coordinates;
21
21
  @property (nonatomic, copy) RCTBubblingEventBlock onPress;
22
+ @property (nonatomic, strong) GMSMapView *originalMap;
22
23
 
23
24
  @property (nonatomic, strong) UIColor *strokeColor;
24
25
  @property (nonatomic, strong) NSArray<UIColor *> *strokeColors;
@@ -29,11 +29,25 @@
29
29
  _coordinates = coordinates;
30
30
 
31
31
  GMSMutablePath *path = [GMSMutablePath path];
32
- for(int i = 0; i < coordinates.count; i++)
32
+
33
+ if (!coordinates || coordinates.count == 0)
33
34
  {
35
+ _polyline.map = nil; // Remove polyline from the map
36
+ return;
37
+ }
38
+
39
+ for (int i = 0; i < coordinates.count; i++) {
34
40
  [path addCoordinate:coordinates[i].coordinate];
35
41
  }
36
42
 
43
+ if (!_originalMap) {
44
+ _originalMap = _polyline.map; // Store the original map
45
+ }
46
+
47
+ if (!_polyline.map) {
48
+ _polyline.map = _originalMap;
49
+ }
50
+
37
51
  _polyline.path = path;
38
52
 
39
53
  [self configureStyleSpansIfNeeded];
package/lib/MapView.d.ts CHANGED
@@ -4,6 +4,7 @@ import { CalloutPressEvent, ClickEvent, Frame, LatLng, MarkerDeselectEvent, Mark
4
4
  import { Address, BoundingBox, Camera, CameraZoomRange, ChangeEvent, Details, EdgePadding, FitToOptions, IndoorBuildingEvent, IndoorLevelActivatedEvent, KmlMapEvent, LongPressEvent, MapPressEvent, MapStyleElement, MapType, MapTypes, PanDragEvent, PoiClickEvent, SnapshotOptions, UserLocationChangeEvent } from './MapView.types';
5
5
  import { Modify } from './sharedTypesInternal';
6
6
  import { MapViewNativeComponentType } from './MapViewNativeComponent';
7
+ import AnimatedRegion from './AnimatedRegion';
7
8
  export declare const MAP_TYPES: MapTypes;
8
9
  export type MapViewProps = ViewProps & {
9
10
  /**
@@ -362,7 +363,7 @@ export type MapViewProps = ViewProps & {
362
363
  * @platform iOS: Supported
363
364
  * @platform Android: Supported
364
365
  */
365
- region?: Region;
366
+ region?: Region | AnimatedRegion;
366
367
  /**
367
368
  * If `false` the user won't be able to adjust the camera’s pitch angle.
368
369
  *
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.11.1",
8
+ "version": "1.11.3",
9
9
  "license": "MIT",
10
10
  "scripts": {
11
11
  "lint": "eslint . --max-warnings 0",