react-native-radar 3.31.0-beta.1 → 3.31.0

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.
@@ -143,7 +143,7 @@ class RadarModule(reactContext: ReactApplicationContext) :
143
143
  override fun initialize(publishableKey: String, fraud: Boolean): Unit {
144
144
  val editor = reactApplicationContext.getSharedPreferences("RadarSDK", Context.MODE_PRIVATE).edit()
145
145
  editor.putString("x_platform_sdk_type", "ReactNative")
146
- editor.putString("x_platform_sdk_version", "3.31.0-beta.1")
146
+ editor.putString("x_platform_sdk_version", "3.31.0")
147
147
  editor.apply()
148
148
 
149
149
  Radar.initialize(reactApplicationContext, publishableKey, radarReceiver, Radar.RadarLocationServicesProvider.GOOGLE, fraud, null, radarInAppMessageReceiver, currentActivity)
@@ -102,7 +102,7 @@ public class RadarModule extends ReactContextBaseJavaModule implements Permissio
102
102
  this.fraud = fraud;
103
103
  SharedPreferences.Editor editor = getReactApplicationContext().getSharedPreferences("RadarSDK", Context.MODE_PRIVATE).edit();
104
104
  editor.putString("x_platform_sdk_type", "ReactNative");
105
- editor.putString("x_platform_sdk_version", "3.31.0-beta.1");
105
+ editor.putString("x_platform_sdk_version", "3.31.0");
106
106
  editor.apply();
107
107
  Radar.initialize(getReactApplicationContext(), publishableKey, receiver, Radar.RadarLocationServicesProvider.GOOGLE, fraud, null, inAppMessageReceiver, getCurrentActivity());
108
108
  if (fraud) {
@@ -1,5 +1,3 @@
1
- import React from "react";
2
- import type { MapRef } from "@maplibre/maplibre-react-native";
3
1
  export type RadarMetadata = Record<string, string | number | boolean>;
4
2
  export interface RadarTrackOnceOptions {
5
3
  location?: Location;
@@ -546,8 +544,7 @@ export type RadarTripStatus = "unknown" | "started" | "approaching" | "arrived"
546
544
  export interface RadarMapOptions {
547
545
  mapStyle?: string;
548
546
  showUserLocation?: boolean;
549
- mapRef?: React.Ref<MapRef>;
550
- onRegionDidChange?: (event: RadarMapRegionChangeEvent) => void;
547
+ onRegionDidChange?: (feature: RadarMapRegionChangeEvent) => void;
551
548
  onDidFinishLoadingMap?: () => void;
552
549
  onWillStartLoadingMap?: () => void;
553
550
  onDidFailLoadingMap?: () => void;
@@ -555,9 +552,7 @@ export interface RadarMapOptions {
555
552
  export interface RadarMapRegionChangeEvent {
556
553
  center: [number, number];
557
554
  zoom: number;
558
- bounds?: [[number, number], [number, number]];
555
+ bounds?: [number, number, number, number];
559
556
  bearing?: number;
560
557
  pitch?: number;
561
- animated: boolean;
562
- userInteraction: boolean;
563
558
  }
@@ -48,7 +48,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
48
48
  // Autocomplete.js
49
49
  const react_1 = __importStar(require("react"));
50
50
  const react_native_1 = require("react-native");
51
- const react_native_safe_area_context_1 = require("react-native-safe-area-context");
52
51
  const index_native_1 = __importDefault(require("../index.native"));
53
52
  const images_1 = require("./images");
54
53
  const styles_1 = __importDefault(require("./styles"));
@@ -184,7 +183,7 @@ const autocompleteUI = ({ options = {} }) => {
184
183
  </react_native_1.Animated.View>
185
184
  <react_native_1.Modal animationType="slide" transparent={false} visible={isOpen} onRequestClose={() => setIsOpen(false)}>
186
185
  <react_native_1.Animated.View style={{ flex: 1, opacity: modalOpacity }}>
187
- <react_native_safe_area_context_1.SafeAreaView>
186
+ <react_native_1.SafeAreaView>
188
187
  <react_native_1.KeyboardAvoidingView behavior={react_native_1.Platform.OS === "ios" ? "padding" : "height"} keyboardVerticalOffset={50} style={styles.container}>
189
188
  <react_native_1.View style={styles.modalInputContainer}>
190
189
  <react_native_1.TouchableOpacity onPress={() => {
@@ -209,7 +208,7 @@ const autocompleteUI = ({ options = {} }) => {
209
208
  {renderFooter()}
210
209
  </react_native_1.View>)}
211
210
  </react_native_1.KeyboardAvoidingView>
212
- </react_native_safe_area_context_1.SafeAreaView>
211
+ </react_native_1.SafeAreaView>
213
212
  </react_native_1.Animated.View>
214
213
  </react_native_1.Modal>
215
214
  </react_native_1.View>);
@@ -14,10 +14,10 @@ import {
14
14
  Dimensions,
15
15
  Easing,
16
16
  Keyboard,
17
+ SafeAreaView,
17
18
  Pressable,
18
19
  Platform,
19
20
  } from 'react-native';
20
- import { SafeAreaView } from 'react-native-safe-area-context';
21
21
  import Radar from '../index.native';
22
22
  import {
23
23
  BACK_ICON,
package/dist/ui/map.jsx CHANGED
@@ -5,19 +5,10 @@ import { getHost, getPublishableKey } from '../helpers';
5
5
  import styles from './styles';
6
6
 
7
7
  let MapLibreGL;
8
- let MapLibreMap;
9
- let GeoJSONSource;
10
- let Layer;
11
8
  try {
12
9
  MapLibreGL = require('@maplibre/maplibre-react-native');
13
- MapLibreMap = MapLibreGL.Map;
14
- GeoJSONSource = MapLibreGL.GeoJSONSource;
15
- Layer = MapLibreGL.Layer;
16
10
  } catch (e) {
17
11
  MapLibreGL = null;
18
- MapLibreMap = null;
19
- GeoJSONSource = null;
20
- Layer = null;
21
12
  }
22
13
 
23
14
  const DEFAULT_STYLE = 'radar-default-v1';
@@ -34,9 +25,8 @@ const createStyleURL = async (style = DEFAULT_STYLE) => {
34
25
  * @param {Object} [props.mapOptions] - Map configuration options
35
26
  * @param {string} [props.mapOptions.mapStyle] - Map style identifier (defaults to 'radar-default-v1')
36
27
  * @param {boolean} [props.mapOptions.showUserLocation] - Whether to show the user's location on the map (default: true)
37
- * @param {React.Ref} [props.mapOptions.mapRef] - Ref to the underlying MapLibre Map component
38
28
  * @param {function} [props.mapOptions.onRegionDidChange] - Callback fired when the map region changes
39
- * @param {Object} props.mapOptions.onRegionDidChange.event - The region event data
29
+ * @param {Object} props.mapOptions.onRegionDidChange.feature - The region feature data
40
30
  * @param {function} [props.mapOptions.onDidFinishLoadingMap] - Callback fired when the map finishes loading
41
31
  * @param {function} [props.mapOptions.onWillStartLoadingMap] - Callback fired when the map starts loading
42
32
  * @param {function} [props.mapOptions.onDidFailLoadingMap] - Callback fired when the map fails to load
@@ -90,61 +80,54 @@ const RadarMap = ({ mapOptions, children }) => {
90
80
  };
91
81
 
92
82
  const userLocationMapIndicator = (
93
- <GeoJSONSource
83
+ <MapLibreGL.ShapeSource
94
84
  id="user-location"
95
- data={JSON.stringify(geoJSONUserLocation)}
85
+ shape={geoJSONUserLocation}
96
86
  >
97
- <Layer
87
+ <MapLibreGL.CircleLayer
98
88
  id="user-location-inner"
99
- type="circle"
100
- paint={{
101
- 'circle-radius': 15,
102
- 'circle-color': '#000257',
103
- 'circle-opacity': 0.2,
104
- 'circle-pitch-alignment': 'map',
89
+ style={{
90
+ circleRadius: 15,
91
+ circleColor: '#000257',
92
+ circleOpacity: 0.2,
93
+ circlePitchAlignment: 'map',
105
94
  }}
106
95
  />
107
- <Layer
96
+ <MapLibreGL.CircleLayer
108
97
  id="user-location-middle"
109
- type="circle"
110
- paint={{
111
- 'circle-radius': 9,
112
- 'circle-color': '#fff',
113
- 'circle-pitch-alignment': 'map',
98
+ style={{
99
+ circleRadius: 9,
100
+ circleColor: '#fff',
101
+ circlePitchAlignment: 'map',
114
102
  }}
115
103
  />
116
- <Layer
104
+ <MapLibreGL.CircleLayer
117
105
  id="user-location-outer"
118
- type="circle"
119
- paint={{
120
- 'circle-radius': 6,
121
- 'circle-color': '#000257',
122
- 'circle-pitch-alignment': 'map',
106
+ style={{
107
+ circleRadius: 6,
108
+ circleColor: '#000257',
109
+ circlePitchAlignment: 'map',
123
110
  }}
124
111
  />
125
- </GeoJSONSource>
112
+ </MapLibreGL.ShapeSource>
126
113
  );
127
114
 
128
115
  return (
129
116
  <View style={styles.mapContainer}>
130
- <MapLibreMap
131
- ref={mapOptions?.mapRef}
117
+ <MapLibreGL.MapView
132
118
  style={styles.map}
133
- touchPitch={false}
134
- compass={false}
135
- logo={false}
136
- attribution
137
- onRegionDidChange={ mapOptions?.onRegionDidChange
138
- ? (event) => mapOptions.onRegionDidChange(event.nativeEvent)
139
- : null
140
- }
119
+ pitchEnabled={false}
120
+ compassEnabled={false}
121
+ logoEnabled={false}
122
+ attributionEnabled
123
+ onRegionDidChange={mapOptions?.onRegionDidChange ? mapOptions.onRegionDidChange : null}
141
124
  onDidFinishLoadingMap={mapOptions?.onDidFinishLoadingMap ? mapOptions.onDidFinishLoadingMap : null}
142
125
  onWillStartLoadingMap={mapOptions?.onWillStartLoadingMap ? mapOptions.onWillStartLoadingMap : null}
143
126
  onDidFailLoadingMap={mapOptions?.onDidFailLoadingMap ? mapOptions.onDidFailLoadingMap : null}
144
127
  mapStyle={styleURL}>
145
128
  {mapOptions?.showUserLocation !== false && userLocationMapIndicator}
146
129
  {children}
147
- </MapLibreMap>
130
+ </MapLibreGL.MapView>
148
131
  <Image
149
132
  source={require('./map-logo.png')}
150
133
  style={styles.mapLogo}
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const VERSION = "3.31.0-beta.1";
1
+ export declare const VERSION = "3.31.0";
package/dist/version.js CHANGED
@@ -3,4 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // This file contains the version of the react-native-radar package
5
5
  // It should be updated to match the version in package.json
6
- exports.VERSION = '3.31.0-beta.1';
6
+ exports.VERSION = '3.31.0';
package/ios/RNRadar.mm CHANGED
@@ -9,6 +9,9 @@ static NSString *_publishableKey = nil;
9
9
  CLLocationManager *locationManager;
10
10
  RCTPromiseResolveBlock permissionsRequestResolver;
11
11
  bool hasListeners;
12
+ #ifdef RCT_NEW_ARCH_ENABLED
13
+ bool jsEventEmitterReady;
14
+ #endif
12
15
  }
13
16
 
14
17
  RCT_EXPORT_MODULE()
@@ -52,12 +55,21 @@ RCT_EXPORT_MODULE()
52
55
  hasListeners = NO;
53
56
  }
54
57
 
58
+ #ifdef RCT_NEW_ARCH_ENABLED
59
+ - (void)setEventEmitterCallback:(EventEmitterCallbackWrapper *)eventEmitterCallbackWrapper {
60
+ [super setEventEmitterCallback:eventEmitterCallbackWrapper];
61
+ jsEventEmitterReady = YES;
62
+ }
63
+ #endif
64
+
55
65
  - (void)onNewInAppMessage:(RadarInAppMessage *)inAppMessage {
56
66
 
57
67
  NSMutableDictionary *body = [NSMutableDictionary new];
58
68
  [body setValue:[Radar dictionaryForInAppMessage:inAppMessage] forKey:@"inAppMessage"];
59
69
  #ifdef RCT_NEW_ARCH_ENABLED
60
- [self emitNewInAppMessageEmitter:body];
70
+ if (jsEventEmitterReady) {
71
+ [self emitNewInAppMessageEmitter:body];
72
+ }
61
73
  #else
62
74
  if (hasListeners) {
63
75
  [self sendEventWithName:@"newInAppMessageEmitter" body:body];
@@ -69,7 +81,9 @@ RCT_EXPORT_MODULE()
69
81
  NSMutableDictionary *body = [NSMutableDictionary new];
70
82
  [body setValue:[Radar dictionaryForInAppMessage:inAppMessage] forKey:@"inAppMessage"];
71
83
  #ifdef RCT_NEW_ARCH_ENABLED
72
- [self emitInAppMessageDismissedEmitter:body];
84
+ if (jsEventEmitterReady) {
85
+ [self emitInAppMessageDismissedEmitter:body];
86
+ }
73
87
  #else
74
88
  if (hasListeners) {
75
89
  [self sendEventWithName:@"inAppMessageDismissedEmitter" body:body];
@@ -81,7 +95,9 @@ RCT_EXPORT_MODULE()
81
95
  NSMutableDictionary *body = [NSMutableDictionary new];
82
96
  [body setValue:[Radar dictionaryForInAppMessage:inAppMessage] forKey:@"inAppMessage"];
83
97
  #ifdef RCT_NEW_ARCH_ENABLED
84
- [self emitInAppMessageClickedEmitter:body];
98
+ if (jsEventEmitterReady) {
99
+ [self emitInAppMessageClickedEmitter:body];
100
+ }
85
101
  #else
86
102
  if (hasListeners) {
87
103
  [self sendEventWithName:@"inAppMessageClickedEmitter" body:body];
@@ -105,7 +121,9 @@ RCT_EXPORT_MODULE()
105
121
  [body setValue:[user dictionaryValue] forKey:@"user"];
106
122
  }
107
123
  #ifdef RCT_NEW_ARCH_ENABLED
108
- [self emitEventsEmitter:body];
124
+ if (jsEventEmitterReady) {
125
+ [self emitEventsEmitter:body];
126
+ }
109
127
  #else
110
128
  if (hasListeners) {
111
129
  [self sendEventWithName:@"eventsEmitter" body:body];
@@ -115,10 +133,12 @@ RCT_EXPORT_MODULE()
115
133
 
116
134
  - (void)didUpdateLocation:(CLLocation *)location user:(RadarUser *)user {
117
135
  #ifdef RCT_NEW_ARCH_ENABLED
118
- [self emitLocationEmitter:@{
119
- @"location": [Radar dictionaryForLocation:location],
120
- @"user": [user dictionaryValue]
121
- }];
136
+ if (jsEventEmitterReady) {
137
+ [self emitLocationEmitter:@{
138
+ @"location": [Radar dictionaryForLocation:location],
139
+ @"user": [user dictionaryValue]
140
+ }];
141
+ }
122
142
  #else
123
143
  if (hasListeners) {
124
144
  [self sendEventWithName:@"locationEmitter" body:@{
@@ -131,11 +151,13 @@ RCT_EXPORT_MODULE()
131
151
 
132
152
  - (void)didUpdateClientLocation:(CLLocation *)location stopped:(BOOL)stopped source:(RadarLocationSource)source {
133
153
  #ifdef RCT_NEW_ARCH_ENABLED
134
- [self emitClientLocationEmitter:@{
135
- @"location": [Radar dictionaryForLocation:location],
136
- @"stopped": @(stopped),
137
- @"source": [Radar stringForLocationSource:source]
138
- }];
154
+ if (jsEventEmitterReady) {
155
+ [self emitClientLocationEmitter:@{
156
+ @"location": [Radar dictionaryForLocation:location],
157
+ @"stopped": @(stopped),
158
+ @"source": [Radar stringForLocationSource:source]
159
+ }];
160
+ }
139
161
  #else
140
162
  if (hasListeners) {
141
163
  [self sendEventWithName:@"clientLocationEmitter" body:@{
@@ -152,7 +174,9 @@ RCT_EXPORT_MODULE()
152
174
  @"status": [Radar stringForStatus:status]
153
175
  };
154
176
  #ifdef RCT_NEW_ARCH_ENABLED
155
- [self emitErrorEmitter:body];
177
+ if (jsEventEmitterReady) {
178
+ [self emitErrorEmitter:body];
179
+ }
156
180
  #else
157
181
  if (hasListeners) {
158
182
  [self sendEventWithName:@"errorEmitter" body:body];
@@ -165,7 +189,9 @@ RCT_EXPORT_MODULE()
165
189
  @"message": message
166
190
  };
167
191
  #ifdef RCT_NEW_ARCH_ENABLED
168
- [self emitLogEmitter:body];
192
+ if (jsEventEmitterReady) {
193
+ [self emitLogEmitter:body];
194
+ }
169
195
  #else
170
196
  if (hasListeners) {
171
197
  [self sendEventWithName:@"logEmitter" body:body];
@@ -178,7 +204,9 @@ RCT_EXPORT_MODULE()
178
204
  @"token": [token dictionaryValue]
179
205
  };
180
206
  #ifdef RCT_NEW_ARCH_ENABLED
181
- [self emitTokenEmitter:body];
207
+ if (jsEventEmitterReady) {
208
+ [self emitTokenEmitter:body];
209
+ }
182
210
  #else
183
211
  if (hasListeners) {
184
212
  [self sendEventWithName:@"tokenEmitter" body:body];
@@ -189,7 +217,7 @@ RCT_EXPORT_MODULE()
189
217
  RCT_EXPORT_METHOD(initialize:(NSString *)publishableKey fraud:(BOOL)fraud) {
190
218
  _publishableKey = publishableKey;
191
219
  [[NSUserDefaults standardUserDefaults] setObject:@"ReactNative" forKey:@"radar-xPlatformSDKType"];
192
- [[NSUserDefaults standardUserDefaults] setObject:@"3.31.0-beta.1" forKey:@"radar-xPlatformSDKVersion"];
220
+ [[NSUserDefaults standardUserDefaults] setObject:@"3.31.0" forKey:@"radar-xPlatformSDKVersion"];
193
221
  [Radar initializeWithPublishableKey:publishableKey];
194
222
  }
195
223
 
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "React Native module for Radar, the leading geofencing and location tracking platform",
4
4
  "homepage": "https://radar.com",
5
5
  "license": "Apache-2.0",
6
- "version": "3.31.0-beta.1",
6
+ "version": "3.31.0",
7
7
  "main": "dist/index.js",
8
8
  "files": [
9
9
  "dist",
@@ -56,11 +56,10 @@
56
56
  ]
57
57
  },
58
58
  "peerDependencies": {
59
- "@maplibre/maplibre-react-native": ">=11.0.0-beta.6",
59
+ "@maplibre/maplibre-react-native": ">=10.2.1",
60
60
  "expo": ">=43.0.5",
61
- "react": ">= 19.1.0",
62
- "react-native": ">= 0.80.0",
63
- "react-native-safe-area-context": "^5.6.2"
61
+ "react": ">= 16.8.6",
62
+ "react-native": ">= 0.60.0"
64
63
  },
65
64
  "peerDependenciesMeta": {
66
65
  "@maplibre/maplibre-react-native": {
@@ -1,6 +1,4 @@
1
- import React from "react";
2
1
  import { Platform } from "react-native";
3
- import type { MapRef } from "@maplibre/maplibre-react-native";
4
2
  const platform = Platform.OS;
5
3
 
6
4
  export type RadarMetadata = Record<string, string | number | boolean>;
@@ -852,8 +850,7 @@ export type RadarTripStatus =
852
850
  export interface RadarMapOptions {
853
851
  mapStyle?: string;
854
852
  showUserLocation?: boolean;
855
- mapRef?: React.Ref<MapRef>;
856
- onRegionDidChange?: (event: RadarMapRegionChangeEvent) => void;
853
+ onRegionDidChange?: (feature: RadarMapRegionChangeEvent) => void;
857
854
  onDidFinishLoadingMap?: () => void;
858
855
  onWillStartLoadingMap?: () => void;
859
856
  onDidFailLoadingMap?: () => void;
@@ -862,9 +859,7 @@ export interface RadarMapOptions {
862
859
  export interface RadarMapRegionChangeEvent {
863
860
  center: [number, number];
864
861
  zoom: number;
865
- bounds?: [[number, number], [number, number]];
862
+ bounds?: [number, number, number, number];
866
863
  bearing?: number;
867
864
  pitch?: number;
868
- animated: boolean;
869
- userInteraction: boolean;
870
865
  }
@@ -14,10 +14,10 @@ import {
14
14
  Dimensions,
15
15
  Easing,
16
16
  Keyboard,
17
+ SafeAreaView,
17
18
  Pressable,
18
19
  Platform,
19
20
  } from 'react-native';
20
- import { SafeAreaView } from 'react-native-safe-area-context';
21
21
  import Radar from '../index.native';
22
22
  import {
23
23
  BACK_ICON,
package/src/ui/map.jsx CHANGED
@@ -5,19 +5,10 @@ import { getHost, getPublishableKey } from '../helpers';
5
5
  import styles from './styles';
6
6
 
7
7
  let MapLibreGL;
8
- let MapLibreMap;
9
- let GeoJSONSource;
10
- let Layer;
11
8
  try {
12
9
  MapLibreGL = require('@maplibre/maplibre-react-native');
13
- MapLibreMap = MapLibreGL.Map;
14
- GeoJSONSource = MapLibreGL.GeoJSONSource;
15
- Layer = MapLibreGL.Layer;
16
10
  } catch (e) {
17
11
  MapLibreGL = null;
18
- MapLibreMap = null;
19
- GeoJSONSource = null;
20
- Layer = null;
21
12
  }
22
13
 
23
14
  const DEFAULT_STYLE = 'radar-default-v1';
@@ -34,9 +25,8 @@ const createStyleURL = async (style = DEFAULT_STYLE) => {
34
25
  * @param {Object} [props.mapOptions] - Map configuration options
35
26
  * @param {string} [props.mapOptions.mapStyle] - Map style identifier (defaults to 'radar-default-v1')
36
27
  * @param {boolean} [props.mapOptions.showUserLocation] - Whether to show the user's location on the map (default: true)
37
- * @param {React.Ref} [props.mapOptions.mapRef] - Ref to the underlying MapLibre Map component
38
28
  * @param {function} [props.mapOptions.onRegionDidChange] - Callback fired when the map region changes
39
- * @param {Object} props.mapOptions.onRegionDidChange.event - The region event data
29
+ * @param {Object} props.mapOptions.onRegionDidChange.feature - The region feature data
40
30
  * @param {function} [props.mapOptions.onDidFinishLoadingMap] - Callback fired when the map finishes loading
41
31
  * @param {function} [props.mapOptions.onWillStartLoadingMap] - Callback fired when the map starts loading
42
32
  * @param {function} [props.mapOptions.onDidFailLoadingMap] - Callback fired when the map fails to load
@@ -90,61 +80,54 @@ const RadarMap = ({ mapOptions, children }) => {
90
80
  };
91
81
 
92
82
  const userLocationMapIndicator = (
93
- <GeoJSONSource
83
+ <MapLibreGL.ShapeSource
94
84
  id="user-location"
95
- data={JSON.stringify(geoJSONUserLocation)}
85
+ shape={geoJSONUserLocation}
96
86
  >
97
- <Layer
87
+ <MapLibreGL.CircleLayer
98
88
  id="user-location-inner"
99
- type="circle"
100
- paint={{
101
- 'circle-radius': 15,
102
- 'circle-color': '#000257',
103
- 'circle-opacity': 0.2,
104
- 'circle-pitch-alignment': 'map',
89
+ style={{
90
+ circleRadius: 15,
91
+ circleColor: '#000257',
92
+ circleOpacity: 0.2,
93
+ circlePitchAlignment: 'map',
105
94
  }}
106
95
  />
107
- <Layer
96
+ <MapLibreGL.CircleLayer
108
97
  id="user-location-middle"
109
- type="circle"
110
- paint={{
111
- 'circle-radius': 9,
112
- 'circle-color': '#fff',
113
- 'circle-pitch-alignment': 'map',
98
+ style={{
99
+ circleRadius: 9,
100
+ circleColor: '#fff',
101
+ circlePitchAlignment: 'map',
114
102
  }}
115
103
  />
116
- <Layer
104
+ <MapLibreGL.CircleLayer
117
105
  id="user-location-outer"
118
- type="circle"
119
- paint={{
120
- 'circle-radius': 6,
121
- 'circle-color': '#000257',
122
- 'circle-pitch-alignment': 'map',
106
+ style={{
107
+ circleRadius: 6,
108
+ circleColor: '#000257',
109
+ circlePitchAlignment: 'map',
123
110
  }}
124
111
  />
125
- </GeoJSONSource>
112
+ </MapLibreGL.ShapeSource>
126
113
  );
127
114
 
128
115
  return (
129
116
  <View style={styles.mapContainer}>
130
- <MapLibreMap
131
- ref={mapOptions?.mapRef}
117
+ <MapLibreGL.MapView
132
118
  style={styles.map}
133
- touchPitch={false}
134
- compass={false}
135
- logo={false}
136
- attribution
137
- onRegionDidChange={ mapOptions?.onRegionDidChange
138
- ? (event) => mapOptions.onRegionDidChange(event.nativeEvent)
139
- : null
140
- }
119
+ pitchEnabled={false}
120
+ compassEnabled={false}
121
+ logoEnabled={false}
122
+ attributionEnabled
123
+ onRegionDidChange={mapOptions?.onRegionDidChange ? mapOptions.onRegionDidChange : null}
141
124
  onDidFinishLoadingMap={mapOptions?.onDidFinishLoadingMap ? mapOptions.onDidFinishLoadingMap : null}
142
125
  onWillStartLoadingMap={mapOptions?.onWillStartLoadingMap ? mapOptions.onWillStartLoadingMap : null}
143
126
  onDidFailLoadingMap={mapOptions?.onDidFailLoadingMap ? mapOptions.onDidFailLoadingMap : null}
144
127
  mapStyle={styleURL}>
145
128
  {mapOptions?.showUserLocation !== false && userLocationMapIndicator}
146
129
  {children}
147
- </MapLibreMap>
130
+ </MapLibreGL.MapView>
148
131
  <Image
149
132
  source={require('./map-logo.png')}
150
133
  style={styles.mapLogo}
package/src/version.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  // This file contains the version of the react-native-radar package
2
2
  // It should be updated to match the version in package.json
3
- export const VERSION = '3.31.0-beta.1';
3
+ export const VERSION = '3.31.0';
@@ -1,16 +0,0 @@
1
- declare module "@maplibre/maplibre-react-native" {
2
- export interface MapRef {
3
- getCenter(): Promise<{ lng: number; lat: number }>;
4
- getZoom(): Promise<number>;
5
- getBearing(): Promise<number>;
6
- getPitch(): Promise<number>;
7
- getBounds(): Promise<{ ne: [number, number]; sw: [number, number] }>;
8
- project(coordinate: [number, number]): Promise<{ x: number; y: number }>;
9
- unproject(point: { x: number; y: number }): Promise<[number, number]>;
10
- queryRenderedFeatures(
11
- point: [number, number] | [[number, number], [number, number]],
12
- filter?: string[],
13
- layerIDs?: string[],
14
- ): Promise<GeoJSON.FeatureCollection>;
15
- }
16
- }