react-native-maps 1.11.1 → 1.11.2

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/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.2",
9
9
  "license": "MIT",
10
10
  "scripts": {
11
11
  "lint": "eslint . --max-warnings 0",