@maplibre/maplibre-react-native 10.1.2 → 10.1.4

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.
@@ -134,16 +134,15 @@
134
134
  }
135
135
 
136
136
  - (BOOL)_areBoundsValid:(MLNCoordinateBounds)bounds {
137
- BOOL isValid =
138
- CLLocationCoordinate2DIsValid(bounds.ne) && CLLocationCoordinate2DIsValid(bounds.sw);
139
-
140
- if (!isValid) {
141
- return NO;
137
+ if ([self _isLatitudeValid:bounds.ne.latitude] && [self _isLatitudeValid:bounds.sw.latitude]) {
138
+ return YES;
142
139
  }
143
140
 
144
- CLLocationCoordinate2D ne = bounds.ne;
145
- CLLocationCoordinate2D sw = bounds.sw;
146
- return [self _isCoordValid:ne] && [self _isCoordValid:sw];
141
+ return NO;
142
+ }
143
+
144
+ - (BOOL)_isLatitudeValid:(CLLocationDegrees)latitude {
145
+ return latitude >= -90 && latitude <= 90;
147
146
  }
148
147
 
149
148
  - (BOOL)_isCoordValid:(CLLocationCoordinate2D)coord {
@@ -188,7 +188,7 @@
188
188
  [_map setCamera:camera animated:NO];
189
189
 
190
190
  if (_map.userTrackingMode != [self _userTrackingMode]) {
191
- [_map setUserTrackingMode:[self _userTrackingMode] animated:NO completionHandler:nil];
191
+ _map.userTrackingMode = [self _userTrackingMode];
192
192
  }
193
193
  }
194
194
 
@@ -81,7 +81,7 @@
81
81
  if (newLastLocation) {
82
82
  lastKnownLocation = newLastLocation;
83
83
  }
84
- MLRNLocation *location = [self _convertToMapboxLocation:lastKnownLocation];
84
+ MLRNLocation *location = [self _convertToMLRNLocation:lastKnownLocation];
85
85
  return location;
86
86
  }
87
87
 
@@ -131,7 +131,7 @@
131
131
  return;
132
132
  }
133
133
 
134
- MLRNLocation *userLocation = [self _convertToMapboxLocation:lastKnownLocation];
134
+ MLRNLocation *userLocation = [self _convertToMLRNLocation:lastKnownLocation];
135
135
 
136
136
  if (listeners.count > 0) {
137
137
  for (int i = 0; i < listeners.count; i++) {
@@ -143,7 +143,7 @@
143
143
  [_delegate locationManager:self didUpdateLocation:userLocation];
144
144
  }
145
145
 
146
- - (MLRNLocation *)_convertToMapboxLocation:(CLLocation *)location {
146
+ - (MLRNLocation *)_convertToMLRNLocation:(CLLocation *)location {
147
147
  if (location == nil) {
148
148
  return nil;
149
149
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@maplibre/maplibre-react-native",
3
3
  "description": "React Native library for creating maps with MapLibre Native for Android & iOS",
4
- "version": "10.1.2",
4
+ "version": "10.1.4",
5
5
  "publishConfig": {
6
6
  "access": "public",
7
7
  "provenance": true