react-native-maps 1.21.0-alpha.141 → 1.21.0-alpha.143
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.
- package/README.md +4 -4
- package/android/src/main/java/com/rnmaps/fabric/MapViewManager.java +0 -1
- package/android/src/main/java/com/rnmaps/maps/MapView.java +36 -24
- package/ios/AirGoogleMaps/AIRGoogleMap.h +9 -3
- package/ios/AirGoogleMaps/{AIRGoogleMap.m → AIRGoogleMap.mm} +12 -11
- package/ios/AirGoogleMaps/AIRGoogleMapManager.m +7 -1
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.h +4 -1
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +16 -1
- package/ios/AirGoogleMaps/RNMapsGooglePolygonView.mm +9 -0
- package/ios/AirMaps/AIRMap.h +3 -3
- package/ios/AirMaps/{AIRMap.m → AIRMap.mm} +18 -14
- package/ios/AirMaps/AIRMapManager.m +1 -12
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMapView.h +0 -3
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMapView.mm +9 -0
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderPolygonView.mm +8 -0
- package/ios/AirMaps/RNMapsAirModule.h +2 -3
- package/ios/AirMaps/RNMapsAirModule.mm +14 -0
- package/ios/AirMaps/RNMapsDefines.h +1 -1
- package/ios/AirMaps/RNMapsMapView.h +4 -1
- package/ios/AirMaps/RNMapsMapView.mm +12 -2
- package/ios/AirMaps/RNMapsMarkerView.mm +8 -0
- package/ios/AirMaps/module.modulemap +6 -0
- package/ios/generated/RNMapsAirModuleDelegate.h +1 -1
- package/package.json +1 -1
- package/react-native-google-maps.podspec +2 -1
- package/react-native-maps-generated.podspec +1 -2
- package/react-native-maps.podspec +13 -4
- /package/ios/AirMaps/{UIView +AirMap.m → UIView+AirMap.m} +0 -0
package/README.md
CHANGED
|
@@ -18,13 +18,13 @@ See [Setup Instructions for the Included Example Project](docs/examples-setup.md
|
|
|
18
18
|
|
|
19
19
|
### Important Notes:
|
|
20
20
|
|
|
21
|
-
- **Fabric is
|
|
22
|
-
|
|
23
|
-
Follow updates on this issue here: [react-native-maps/issues/5206](https://github.com/react-native-maps/react-native-maps/issues/5206).
|
|
24
|
-
Kindly refrain from opening duplicate tickets regarding this matter.
|
|
21
|
+
- **Fabric is now supported**:
|
|
22
|
+
Fabric is now supported for the latest version of the library, if you don't have Fabric (New Arch) enabled, please use v1.21.0 or earlier
|
|
25
23
|
|
|
26
24
|
### Version Requirements:
|
|
27
25
|
|
|
26
|
+
- **Version `1.22.0` and below**: Requires **React Native `>= 0.76`**.
|
|
27
|
+
- **Version `1.21.0` and below**: Requires **React Native `>= 0.74`**.
|
|
28
28
|
- **Version `1.14.0` and above**: Requires **React Native `>= 0.74`**.
|
|
29
29
|
- **Versions below `1.14.0`**: Require **React Native `>= 0.64.3`**.
|
|
30
30
|
|
|
@@ -9,6 +9,7 @@ import android.graphics.Bitmap;
|
|
|
9
9
|
import android.graphics.Color;
|
|
10
10
|
import android.graphics.Point;
|
|
11
11
|
import android.location.Location;
|
|
12
|
+
|
|
12
13
|
import androidx.lifecycle.DefaultLifecycleObserver;
|
|
13
14
|
import androidx.lifecycle.LifecycleOwner;
|
|
14
15
|
|
|
@@ -194,15 +195,16 @@ public class MapView extends com.google.android.gms.maps.MapView implements Goog
|
|
|
194
195
|
}
|
|
195
196
|
|
|
196
197
|
|
|
197
|
-
@Override
|
|
198
|
-
public void onCreate(LifecycleOwner owner) {
|
|
199
|
-
|
|
200
|
-
}
|
|
198
|
+
@Override
|
|
199
|
+
public void onCreate(LifecycleOwner owner) {
|
|
200
|
+
super.onCreate(null);
|
|
201
|
+
}
|
|
201
202
|
|
|
202
203
|
@Override
|
|
203
204
|
public void onStart(LifecycleOwner owner) {
|
|
204
205
|
super.onStart();
|
|
205
206
|
}
|
|
207
|
+
|
|
206
208
|
@Override
|
|
207
209
|
public void onResume(LifecycleOwner owner) {
|
|
208
210
|
if (hasPermissions() && map != null) {
|
|
@@ -220,7 +222,7 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
220
222
|
|
|
221
223
|
|
|
222
224
|
@Override
|
|
223
|
-
public void onPause(LifecycleOwner owner){
|
|
225
|
+
public void onPause(LifecycleOwner owner) {
|
|
224
226
|
super.onPause();
|
|
225
227
|
if (hasPermissions() && map != null) {
|
|
226
228
|
//noinspection MissingPermission
|
|
@@ -240,7 +242,7 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
240
242
|
}
|
|
241
243
|
|
|
242
244
|
@Override
|
|
243
|
-
public void onDestroy(LifecycleOwner owner){
|
|
245
|
+
public void onDestroy(LifecycleOwner owner) {
|
|
244
246
|
MapView.this.doDestroy();
|
|
245
247
|
}
|
|
246
248
|
|
|
@@ -250,7 +252,7 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
250
252
|
this.context = context;
|
|
251
253
|
Activity activity = context.getCurrentActivity();
|
|
252
254
|
if (activity instanceof LifecycleOwner) {
|
|
253
|
-
|
|
255
|
+
((LifecycleOwner) activity).getLifecycle().addObserver(this);
|
|
254
256
|
}
|
|
255
257
|
super.getMapAsync(this);
|
|
256
258
|
|
|
@@ -324,7 +326,7 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
324
326
|
}
|
|
325
327
|
if (addedPosition) {
|
|
326
328
|
|
|
327
|
-
|
|
329
|
+
LatLngBounds bounds = builder.build();
|
|
328
330
|
LatLng northEast = bounds.northeast;
|
|
329
331
|
LatLng southWest = bounds.southwest;
|
|
330
332
|
|
|
@@ -338,7 +340,7 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
338
340
|
|
|
339
341
|
public void setShowsTraffic(boolean value) {
|
|
340
342
|
showsTraffic = value;
|
|
341
|
-
if (map != null){
|
|
343
|
+
if (map != null) {
|
|
342
344
|
map.setTrafficEnabled(value);
|
|
343
345
|
}
|
|
344
346
|
}
|
|
@@ -554,8 +556,8 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
554
556
|
event.putString("action", "overlay-press");
|
|
555
557
|
|
|
556
558
|
dispatchEvent(event, OnPressEvent::new);
|
|
557
|
-
event =
|
|
558
|
-
dispatchEvent(event, OnPressEvent::new,overlayMap.get(groundOverlay).getId(), context);
|
|
559
|
+
event = makeClickEventData(groundOverlay.getPosition());
|
|
560
|
+
dispatchEvent(event, OnPressEvent::new, overlayMap.get(groundOverlay).getId(), context);
|
|
559
561
|
}
|
|
560
562
|
});
|
|
561
563
|
|
|
@@ -599,7 +601,7 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
599
601
|
|
|
600
602
|
|
|
601
603
|
isMapReady = true;
|
|
602
|
-
if (kmlSrc != null){
|
|
604
|
+
if (kmlSrc != null) {
|
|
603
605
|
setKmlSrc(kmlSrc);
|
|
604
606
|
kmlSrc = null;
|
|
605
607
|
}
|
|
@@ -651,7 +653,8 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
651
653
|
builder.put(OnLongPressEvent.EVENT_NAME, MapBuilder.of("registrationName", OnLongPressEvent.EVENT_NAME));
|
|
652
654
|
return builder.build();
|
|
653
655
|
}
|
|
654
|
-
|
|
656
|
+
|
|
657
|
+
// , ,
|
|
655
658
|
public static Map<String, Object> getExportedCustomDirectEventTypeConstants() {
|
|
656
659
|
MapBuilder.Builder<String, Object> builder = MapBuilder.builder();
|
|
657
660
|
builder.put(OnMarkerPressEvent.EVENT_NAME, MapBuilder.of("registrationName", OnMarkerPressEvent.EVENT_NAME));
|
|
@@ -735,6 +738,13 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
735
738
|
map.setMapStyle(new MapStyleOptions(customMapStyleString));
|
|
736
739
|
}
|
|
737
740
|
this.setPoiClickEnabled(poiClickEnabled);
|
|
741
|
+
if (setPaddingDeferred &&
|
|
742
|
+
(baseLeftMapPadding != 0 ||
|
|
743
|
+
baseTopMapPadding != 0 ||
|
|
744
|
+
baseRightMapPadding != 0 ||
|
|
745
|
+
baseBottomMapPadding != 0)) {
|
|
746
|
+
applyBaseMapPadding(baseLeftMapPadding, baseTopMapPadding, baseRightMapPadding, baseBottomMapPadding);
|
|
747
|
+
}
|
|
738
748
|
}
|
|
739
749
|
|
|
740
750
|
public static LatLngBounds latLngBoundsFromRegion(ReadableMap region) {
|
|
@@ -1219,6 +1229,7 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
1219
1229
|
cameraToSet = null;
|
|
1220
1230
|
}
|
|
1221
1231
|
}
|
|
1232
|
+
|
|
1222
1233
|
public void animateToCamera(CameraPosition position, int duration) {
|
|
1223
1234
|
if (map == null) return;
|
|
1224
1235
|
CameraUpdate update = CameraUpdateFactory.newCameraPosition(position);
|
|
@@ -1263,16 +1274,16 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
1263
1274
|
LatLngBounds.Builder builder = new LatLngBounds.Builder();
|
|
1264
1275
|
|
|
1265
1276
|
boolean addedPosition = false;
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1277
|
+
if (features.size() > 0) {
|
|
1278
|
+
for (MapFeature feature : features) {
|
|
1279
|
+
if (feature instanceof MapMarker) {
|
|
1280
|
+
Marker marker = (Marker) feature.getFeature();
|
|
1281
|
+
builder.include(marker.getPosition());
|
|
1282
|
+
addedPosition = true;
|
|
1283
|
+
}
|
|
1284
|
+
// TODO(lmr): may want to include shapes / etc.
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1276
1287
|
if (addedPosition) {
|
|
1277
1288
|
LatLngBounds bounds = builder.build();
|
|
1278
1289
|
CameraUpdate cu = CameraUpdateFactory.newLatLngBounds(bounds, 0);
|
|
@@ -1379,6 +1390,7 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
1379
1390
|
|
|
1380
1391
|
// Move the google logo to the default base padding value.
|
|
1381
1392
|
map.setPadding(left, top, right, bottom);
|
|
1393
|
+
setPaddingDeferred = false;
|
|
1382
1394
|
}
|
|
1383
1395
|
|
|
1384
1396
|
public void fitToCoordinates(ReadableArray coordinatesArray, ReadableMap edgePadding,
|
|
@@ -1728,7 +1740,7 @@ public void onCreate(LifecycleOwner owner) {
|
|
|
1728
1740
|
e.printStackTrace();
|
|
1729
1741
|
}
|
|
1730
1742
|
} else {
|
|
1731
|
-
|
|
1743
|
+
this.kmlSrc = kmlSrc;
|
|
1732
1744
|
}
|
|
1733
1745
|
}
|
|
1734
1746
|
|
|
@@ -13,10 +13,16 @@
|
|
|
13
13
|
#import <GoogleMaps/GoogleMaps.h>
|
|
14
14
|
#import <MapKit/MapKit.h>
|
|
15
15
|
#import "AIRGMSMarker.h"
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
#import "AIRGoogleMapCoordinate.h"
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
#if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
|
|
20
|
+
#import <ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>
|
|
21
|
+
#else
|
|
22
|
+
#import <react-native-maps-generated/RNMapsAirModuleDelegate.h>
|
|
23
|
+
#endif
|
|
24
|
+
|
|
25
|
+
@interface AIRGoogleMap : GMSMapView<RNMapsAirModuleDelegate>
|
|
20
26
|
|
|
21
27
|
// TODO: don't use MK region?
|
|
22
28
|
@property (nonatomic, weak) RCTBridge *bridge;
|
|
@@ -78,7 +84,7 @@
|
|
|
78
84
|
- (void)didChangeCameraPosition:(GMSCameraPosition *)position isGesture:(BOOL)isGesture;
|
|
79
85
|
- (void)idleAtCameraPosition:(GMSCameraPosition *)position isGesture:(BOOL)isGesture;
|
|
80
86
|
- (void)didTapPOIWithPlaceID:(NSString *)placeID name:(NSString *) name location:(CLLocationCoordinate2D) location;
|
|
81
|
-
- (
|
|
87
|
+
- (NSDictionary *)getMapBoundaries;
|
|
82
88
|
|
|
83
89
|
+ (MKCoordinateRegion)makeGMSCameraPositionFromMap:(GMSMapView *)map andGMSCameraPosition:(GMSCameraPosition *)position;
|
|
84
90
|
+ (GMSCameraPosition*)makeGMSCameraPositionFromMap:(GMSMapView *)map andMKCoordinateRegion:(MKCoordinateRegion)region;
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
#import <React/RCTConvert.h>
|
|
26
26
|
#import <objc/runtime.h>
|
|
27
27
|
|
|
28
|
+
|
|
28
29
|
#ifdef HAVE_GOOGLE_MAPS_UTILS
|
|
29
30
|
#import "GMUKMLParser.h"
|
|
30
31
|
#import "GMUPlacemark.h"
|
|
@@ -342,7 +343,7 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
342
343
|
}
|
|
343
344
|
#pragma clang diagnostic pop
|
|
344
345
|
|
|
345
|
-
- (
|
|
346
|
+
- (NSDictionary *)getMapBoundaries
|
|
346
347
|
{
|
|
347
348
|
GMSVisibleRegion visibleRegion = self.projection.visibleRegion;
|
|
348
349
|
GMSCoordinateBounds *bounds = [[GMSCoordinateBounds alloc] initWithRegion:visibleRegion];
|
|
@@ -350,16 +351,16 @@ id regionAsJSON(MKCoordinateRegion region) {
|
|
|
350
351
|
CLLocationCoordinate2D northEast = bounds.northEast;
|
|
351
352
|
CLLocationCoordinate2D southWest = bounds.southWest;
|
|
352
353
|
|
|
353
|
-
return @
|
|
354
|
-
@
|
|
355
|
-
[NSNumber numberWithDouble:northEast.
|
|
356
|
-
[NSNumber numberWithDouble:northEast.
|
|
357
|
-
|
|
358
|
-
@
|
|
359
|
-
[NSNumber numberWithDouble:southWest.
|
|
360
|
-
[NSNumber numberWithDouble:southWest.
|
|
361
|
-
|
|
362
|
-
|
|
354
|
+
return @{
|
|
355
|
+
@"northEast": @{
|
|
356
|
+
@"latitude": [NSNumber numberWithDouble:northEast.latitude],
|
|
357
|
+
@"longitude": [NSNumber numberWithDouble:northEast.longitude],
|
|
358
|
+
},
|
|
359
|
+
@"southWest": @{
|
|
360
|
+
@"latitude": [NSNumber numberWithDouble:southWest.latitude],
|
|
361
|
+
@"longitude": [NSNumber numberWithDouble:southWest.longitude],
|
|
362
|
+
},
|
|
363
|
+
};
|
|
363
364
|
}
|
|
364
365
|
|
|
365
366
|
- (NSDictionary *) getCameraDic {
|
|
@@ -25,6 +25,12 @@
|
|
|
25
25
|
#import <MapKit/MapKit.h>
|
|
26
26
|
#import <QuartzCore/QuartzCore.h>
|
|
27
27
|
|
|
28
|
+
#if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
|
|
29
|
+
#import <ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>
|
|
30
|
+
#else
|
|
31
|
+
#import <react-native-maps-generated/RNMapsAirModuleDelegate.h>
|
|
32
|
+
#endif
|
|
33
|
+
|
|
28
34
|
static NSString *const RCTMapViewKey = @"MapView";
|
|
29
35
|
|
|
30
36
|
|
|
@@ -344,7 +350,7 @@ RCT_EXPORT_METHOD(coordinateForPoint:(nonnull NSNumber *)reactTag
|
|
|
344
350
|
if (![view isKindOfClass:[AIRGoogleMap class]]) {
|
|
345
351
|
RCTLogError(@"Invalid view returned from registry, expecting AIRMap, got: %@", view);
|
|
346
352
|
} else {
|
|
347
|
-
|
|
353
|
+
id<RNMapsAirModuleDelegate> mapView = (id<RNMapsAirModuleDelegate>) view;
|
|
348
354
|
resolve([view getCoordinatesForPoint:pt]);
|
|
349
355
|
}
|
|
350
356
|
}];
|
|
@@ -10,8 +10,11 @@
|
|
|
10
10
|
|
|
11
11
|
#import <React/RCTViewComponentView.h>
|
|
12
12
|
#import <UIKit/UIKit.h>
|
|
13
|
+
#if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
|
|
14
|
+
#import <ReactNativeMapsGenerated/RNMapsHostVewDelegate.h>
|
|
15
|
+
#else
|
|
13
16
|
#import <react-native-maps-generated/RNMapsHostVewDelegate.h>
|
|
14
|
-
|
|
17
|
+
#endif
|
|
15
18
|
@class AIRGoogleMap;
|
|
16
19
|
|
|
17
20
|
NS_ASSUME_NONNULL_BEGIN
|
|
@@ -10,18 +10,33 @@
|
|
|
10
10
|
#import "RNMapsGoogleMapView.h"
|
|
11
11
|
#import "RNMapsGooglePolygonView.h"
|
|
12
12
|
#import "AIRGoogleMap.h"
|
|
13
|
-
#import "AIRMapMarker.h"
|
|
14
13
|
#import "AIRGoogleMapManager.h"
|
|
14
|
+
#if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
|
|
15
|
+
#import <ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>
|
|
16
|
+
#import <ReactNativeMapsGenerated/RNMapsHostVewDelegate.h>
|
|
17
|
+
#import <ReactNativeMapsGenerated/ComponentDescriptors.h>
|
|
18
|
+
#import <ReactNativeMapsGenerated/EventEmitters.h>
|
|
19
|
+
#import <ReactNativeMapsGenerated/Props.h>
|
|
20
|
+
#import <ReactNativeMapsGenerated/RCTComponentViewHelpers.h>
|
|
21
|
+
#else
|
|
22
|
+
#import <react-native-maps-generated/RNMapsAirModuleDelegate.h>
|
|
15
23
|
#import <react-native-maps-generated/ComponentDescriptors.h>
|
|
16
24
|
#import <react-native-maps-generated/EventEmitters.h>
|
|
17
25
|
#import <react-native-maps-generated/Props.h>
|
|
18
26
|
#import <react-native-maps-generated/RCTComponentViewHelpers.h>
|
|
27
|
+
#endif
|
|
19
28
|
#import "RCTFabricComponentsPlugins.h"
|
|
20
29
|
#import <React/RCTConversions.h>
|
|
21
30
|
#import <React/RCTUtils.h>
|
|
22
31
|
#import "RCTConvert+GMSMapViewType.h"
|
|
32
|
+
#if __has_include(<ReactNativeMaps/RCTConvert+AirMap.h>)
|
|
33
|
+
#import <ReactNativeMaps/RCTConvert+AirMap.h>
|
|
34
|
+
#import <ReactNativeMaps/UIView+AirMap.h>
|
|
35
|
+
#else
|
|
23
36
|
#import "RCTConvert+AirMap.h"
|
|
24
37
|
#import "UIView+AirMap.h"
|
|
38
|
+
#endif
|
|
39
|
+
|
|
25
40
|
|
|
26
41
|
using namespace facebook::react;
|
|
27
42
|
|
|
@@ -10,11 +10,20 @@
|
|
|
10
10
|
#import "RNMapsGooglePolygonView.h"
|
|
11
11
|
#import "AIRGMSPolygon.h"
|
|
12
12
|
#import "AIRGoogleMap.h"
|
|
13
|
+
#if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
|
|
14
|
+
#import <ReactNativeMapsGenerated/RNMapsSpecs.h>
|
|
15
|
+
#import <ReactNativeMapsGenerated/RNMapsHostVewDelegate.h>
|
|
16
|
+
#import <ReactNativeMapsGenerated/ComponentDescriptors.h>
|
|
17
|
+
#import <ReactNativeMapsGenerated/EventEmitters.h>
|
|
18
|
+
#import <ReactNativeMapsGenerated/Props.h>
|
|
19
|
+
#import <ReactNativeMapsGenerated/RCTComponentViewHelpers.h>
|
|
20
|
+
#else
|
|
13
21
|
#import <react-native-maps-generated/RNMapsSpecs.h>
|
|
14
22
|
#import <react-native-maps-generated/ComponentDescriptors.h>
|
|
15
23
|
#import <react-native-maps-generated/EventEmitters.h>
|
|
16
24
|
#import <react-native-maps-generated/Props.h>
|
|
17
25
|
#import <react-native-maps-generated/RCTComponentViewHelpers.h>
|
|
26
|
+
#endif
|
|
18
27
|
|
|
19
28
|
#import "RCTFabricComponentsPlugins.h"
|
|
20
29
|
#import <React/RCTConversions.h>
|
package/ios/AirMaps/AIRMap.h
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
#import "SMCalloutView.h"
|
|
15
15
|
#import "RCTConvert+AirMap.h"
|
|
16
16
|
#import "AIRMapCalloutSubview.h"
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
|
|
19
19
|
@class AIRMapCoordinate;
|
|
20
20
|
@class AIRMapMarker;
|
|
@@ -23,7 +23,7 @@ extern const NSTimeInterval AIRMapRegionChangeObserveInterval;
|
|
|
23
23
|
extern const CGFloat AIRMapZoomBoundBuffer;
|
|
24
24
|
extern const NSInteger AIRMapMaxZoomLevel;
|
|
25
25
|
|
|
26
|
-
@interface AIRMap: MKMapView<SMCalloutViewDelegate
|
|
26
|
+
@interface AIRMap: MKMapView<SMCalloutViewDelegate>
|
|
27
27
|
|
|
28
28
|
@property (nonatomic, strong) SMCalloutView *calloutView;
|
|
29
29
|
@property (nonatomic, strong) UIImageView *cacheImageView;
|
|
@@ -77,7 +77,7 @@ extern const NSInteger AIRMapMaxZoomLevel;
|
|
|
77
77
|
- (void)beginLoading;
|
|
78
78
|
- (void)finishLoading;
|
|
79
79
|
- (double)getZoomLevel;
|
|
80
|
-
- (
|
|
80
|
+
- (NSDictionary *)getMapBoundaries;
|
|
81
81
|
|
|
82
82
|
- (AIRMapMarker*) markerAtPoint:(CGPoint)point;
|
|
83
83
|
- (NSDictionary*) getMarkersFramesWithOnlyVisible:(BOOL)onlyVisible;
|
|
@@ -26,8 +26,12 @@ const NSTimeInterval AIRMapRegionChangeObserveInterval = 0.1;
|
|
|
26
26
|
const CGFloat AIRMapZoomBoundBuffer = 0.01;
|
|
27
27
|
const NSInteger AIRMapMaxZoomLevel = 20;
|
|
28
28
|
|
|
29
|
-
|
|
30
|
-
|
|
29
|
+
#if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
|
|
30
|
+
#import <ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>
|
|
31
|
+
#else
|
|
32
|
+
#import <react-native-maps-generated/RNMapsAirModuleDelegate.h>
|
|
33
|
+
#endif
|
|
34
|
+
@interface MKMapView (UIGestureRecognizer)<RNMapsAirModuleDelegate>
|
|
31
35
|
|
|
32
36
|
// this tells the compiler that MKMapView actually implements this method
|
|
33
37
|
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch;
|
|
@@ -320,23 +324,23 @@ const NSInteger AIRMapMaxZoomLevel = 20;
|
|
|
320
324
|
|
|
321
325
|
#pragma mark RNMapsAirModuleDelegate.h
|
|
322
326
|
|
|
323
|
-
- (
|
|
327
|
+
- (NSDictionary *)getMapBoundaries
|
|
324
328
|
{
|
|
325
329
|
MKMapRect mapRect = self.visibleMapRect;
|
|
326
330
|
|
|
327
331
|
CLLocationCoordinate2D northEast = MKCoordinateForMapPoint(MKMapPointMake(MKMapRectGetMaxX(mapRect), mapRect.origin.y));
|
|
328
332
|
CLLocationCoordinate2D southWest = MKCoordinateForMapPoint(MKMapPointMake(mapRect.origin.x, MKMapRectGetMaxY(mapRect)));
|
|
329
333
|
|
|
330
|
-
return @
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
334
|
+
return @{
|
|
335
|
+
@"northEast": @{
|
|
336
|
+
@"latitude": [NSNumber numberWithDouble:northEast.latitude],
|
|
337
|
+
@"longitude": [NSNumber numberWithDouble:northEast.longitude],
|
|
338
|
+
},
|
|
339
|
+
@"southWest": @{
|
|
340
|
+
@"latitude": [NSNumber numberWithDouble:southWest.latitude],
|
|
341
|
+
@"longitude": [NSNumber numberWithDouble:southWest.longitude],
|
|
342
|
+
},
|
|
343
|
+
};
|
|
340
344
|
}
|
|
341
345
|
- (NSDictionary *) getPointForCoordinates:(CLLocationCoordinate2D) location
|
|
342
346
|
{
|
|
@@ -749,7 +753,7 @@ const NSInteger AIRMapMaxZoomLevel = 20;
|
|
|
749
753
|
|
|
750
754
|
- (void) listenToMemoryWarnings
|
|
751
755
|
{
|
|
752
|
-
__weak
|
|
756
|
+
__weak __typeof(self) weakSelf = self;
|
|
753
757
|
static dispatch_once_t onceToken;
|
|
754
758
|
static dispatch_source_t source;
|
|
755
759
|
dispatch_once(&onceToken, ^{
|
|
@@ -186,18 +186,7 @@ RCT_EXPORT_METHOD(getMapBoundaries:(nonnull NSNumber *)reactTag
|
|
|
186
186
|
if (![view isKindOfClass:[AIRMap class]]) {
|
|
187
187
|
RCTLogError(@"Invalid view returned from registry, expecting AIRMap, got: %@", view);
|
|
188
188
|
} else {
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
resolve(@{
|
|
192
|
-
@"northEast" : @{
|
|
193
|
-
@"longitude" : boundingBox[0][0],
|
|
194
|
-
@"latitude" : boundingBox[0][1]
|
|
195
|
-
},
|
|
196
|
-
@"southWest" : @{
|
|
197
|
-
@"longitude" : boundingBox[1][0],
|
|
198
|
-
@"latitude" : boundingBox[1][1]
|
|
199
|
-
}
|
|
200
|
-
});
|
|
189
|
+
resolve([view getMapBoundaries]);
|
|
201
190
|
}
|
|
202
191
|
}];
|
|
203
192
|
}
|
|
@@ -9,10 +9,19 @@
|
|
|
9
9
|
|
|
10
10
|
#if HAVE_GOOGLE_MAPS == 0
|
|
11
11
|
|
|
12
|
+
#if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
|
|
13
|
+
#import <ReactNativeMapsGenerated/RNMapsHostVewDelegate.h>
|
|
14
|
+
#import <ReactNativeMapsGenerated/ComponentDescriptors.h>
|
|
15
|
+
#import <ReactNativeMapsGenerated/EventEmitters.h>
|
|
16
|
+
#import <ReactNativeMapsGenerated/Props.h>
|
|
17
|
+
#import <ReactNativeMapsGenerated/RCTComponentViewHelpers.h>
|
|
18
|
+
#else
|
|
12
19
|
#import <react-native-maps-generated/ComponentDescriptors.h>
|
|
13
20
|
#import <react-native-maps-generated/EventEmitters.h>
|
|
14
21
|
#import <react-native-maps-generated/Props.h>
|
|
15
22
|
#import <react-native-maps-generated/RCTComponentViewHelpers.h>
|
|
23
|
+
#import <react-native-maps-generated/RNMapsHostVewDelegate.h>
|
|
24
|
+
#endif
|
|
16
25
|
#import "RCTFabricComponentsPlugins.h"
|
|
17
26
|
#import <React/RCTConversions.h>
|
|
18
27
|
#import "PlaceHolderGoogleMapView.h"
|
|
@@ -9,10 +9,18 @@
|
|
|
9
9
|
|
|
10
10
|
#if HAVE_GOOGLE_MAPS == 0
|
|
11
11
|
|
|
12
|
+
#if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
|
|
13
|
+
#import <ReactNativeMapsGenerated/RNMapsHostVewDelegate.h>
|
|
14
|
+
#import <ReactNativeMapsGenerated/ComponentDescriptors.h>
|
|
15
|
+
#import <ReactNativeMapsGenerated/EventEmitters.h>
|
|
16
|
+
#import <ReactNativeMapsGenerated/Props.h>
|
|
17
|
+
#import <ReactNativeMapsGenerated/RCTComponentViewHelpers.h>
|
|
18
|
+
#else
|
|
12
19
|
#import <react-native-maps-generated/ComponentDescriptors.h>
|
|
13
20
|
#import <react-native-maps-generated/EventEmitters.h>
|
|
14
21
|
#import <react-native-maps-generated/Props.h>
|
|
15
22
|
#import <react-native-maps-generated/RCTComponentViewHelpers.h>
|
|
23
|
+
#endif
|
|
16
24
|
|
|
17
25
|
#import "RCTFabricComponentsPlugins.h"
|
|
18
26
|
#import <React/RCTConversions.h>
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
// RCTNativeLocalStorage.h
|
|
2
1
|
// TurboModuleExample
|
|
3
2
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
4
3
|
|
|
5
4
|
#import <Foundation/Foundation.h>
|
|
6
|
-
|
|
5
|
+
|
|
7
6
|
|
|
8
7
|
NS_ASSUME_NONNULL_BEGIN
|
|
9
8
|
|
|
10
|
-
@interface RNMapsAirModule : NSObject
|
|
9
|
+
@interface RNMapsAirModule : NSObject
|
|
11
10
|
|
|
12
11
|
@end
|
|
13
12
|
|
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
// Created by Salah Ghanim on 23.11.24.
|
|
6
6
|
// Copyright © 2024 react-native-maps. All rights reserved.
|
|
7
7
|
//
|
|
8
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
9
|
+
|
|
8
10
|
|
|
9
11
|
#import "RNMapsAirModule.h"
|
|
10
12
|
#import <React/RCTUIManager.h>
|
|
@@ -15,6 +17,16 @@
|
|
|
15
17
|
#import <MapKit/MapKit.h>
|
|
16
18
|
#import "RCTConvert+AirMap.h"
|
|
17
19
|
|
|
20
|
+
#if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
|
|
21
|
+
#import <ReactNativeMapsGenerated/RNMapsSpecs.h>
|
|
22
|
+
#import <ReactNativeMapsGenerated/RNMapsHostVewDelegate.h>
|
|
23
|
+
#else
|
|
24
|
+
#import <react-native-maps-generated/RNMapsSpecs.h>
|
|
25
|
+
#import <react-native-maps-generated/RNMapsHostVewDelegate.h>
|
|
26
|
+
#endif
|
|
27
|
+
@interface RNMapsAirModule()<NativeAirMapsModuleSpec>
|
|
28
|
+
@end
|
|
29
|
+
|
|
18
30
|
@implementation RNMapsAirModule
|
|
19
31
|
|
|
20
32
|
@synthesize viewRegistry_DEPRECATED = _viewRegistry_DEPRECATED;
|
|
@@ -148,3 +160,5 @@
|
|
|
148
160
|
|
|
149
161
|
@end
|
|
150
162
|
|
|
163
|
+
|
|
164
|
+
#endif
|
|
@@ -1 +1 @@
|
|
|
1
|
-
#define HAVE_GOOGLE_MAPS
|
|
1
|
+
#define HAVE_GOOGLE_MAPS 0
|
|
@@ -9,8 +9,11 @@
|
|
|
9
9
|
|
|
10
10
|
#import <React/RCTViewComponentView.h>
|
|
11
11
|
#import <UIKit/UIKit.h>
|
|
12
|
+
#if __has_include(<ReactNativeMapsGenerated/RNMapsHostVewDelegate.h>)
|
|
13
|
+
#import <ReactNativeMapsGenerated/RNMapsHostVewDelegate.h>
|
|
14
|
+
#else
|
|
12
15
|
#import <react-native-maps-generated/RNMapsHostVewDelegate.h>
|
|
13
|
-
|
|
16
|
+
#endif
|
|
14
17
|
@class AIRMap;
|
|
15
18
|
|
|
16
19
|
NS_ASSUME_NONNULL_BEGIN
|
|
@@ -11,10 +11,20 @@
|
|
|
11
11
|
#import "AIRMapMarker.h"
|
|
12
12
|
#import "AIRMapManager.h"
|
|
13
13
|
#import "RNMapsMarkerView.h"
|
|
14
|
-
#
|
|
14
|
+
#if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
|
|
15
|
+
#import <ReactNativeMapsGenerated/RNMapsSpecs.h>
|
|
16
|
+
#import <ReactNativeMapsGenerated/RNMapsHostVewDelegate.h>
|
|
17
|
+
#import <ReactNativeMapsGenerated/ComponentDescriptors.h>
|
|
18
|
+
#import <ReactNativeMapsGenerated/EventEmitters.h>
|
|
19
|
+
#import <ReactNativeMapsGenerated/Props.h>
|
|
20
|
+
#import <ReactNativeMapsGenerated/RCTComponentViewHelpers.h>
|
|
21
|
+
#else
|
|
22
|
+
#import <react-native-maps-generated/RNMapsSpecs.h>
|
|
15
23
|
#import <react-native-maps-generated/ComponentDescriptors.h>
|
|
24
|
+
#import <react-native-maps-generated/EventEmitters.h>
|
|
16
25
|
#import <react-native-maps-generated/Props.h>
|
|
17
26
|
#import <react-native-maps-generated/RCTComponentViewHelpers.h>
|
|
27
|
+
#endif
|
|
18
28
|
#import "RCTFabricComponentsPlugins.h"
|
|
19
29
|
#import <React/RCTConversions.h>
|
|
20
30
|
#import "UIView+AirMap.h"
|
|
@@ -31,7 +41,7 @@ using namespace facebook::react;
|
|
|
31
41
|
|
|
32
42
|
|
|
33
43
|
- (id<RNMapsAirModuleDelegate>) mapView {
|
|
34
|
-
return
|
|
44
|
+
return nil;
|
|
35
45
|
}
|
|
36
46
|
|
|
37
47
|
- (void) prepareForRecycle
|
|
@@ -10,10 +10,18 @@
|
|
|
10
10
|
#import "AIRMap.h"
|
|
11
11
|
#import "AIRMapMarker.h"
|
|
12
12
|
#import "AIRMapMarkerManager.h"
|
|
13
|
+
#if __has_include(<ReactNativeMapsGenerated/RNMapsAirModuleDelegate.h>)
|
|
14
|
+
#import <ReactNativeMapsGenerated/RNMapsHostVewDelegate.h>
|
|
15
|
+
#import <ReactNativeMapsGenerated/ComponentDescriptors.h>
|
|
16
|
+
#import <ReactNativeMapsGenerated/EventEmitters.h>
|
|
17
|
+
#import <ReactNativeMapsGenerated/Props.h>
|
|
18
|
+
#import <ReactNativeMapsGenerated/RCTComponentViewHelpers.h>
|
|
19
|
+
#else
|
|
13
20
|
#import <react-native-maps-generated/ComponentDescriptors.h>
|
|
14
21
|
#import <react-native-maps-generated/EventEmitters.h>
|
|
15
22
|
#import <react-native-maps-generated/Props.h>
|
|
16
23
|
#import <react-native-maps-generated/RCTComponentViewHelpers.h>
|
|
24
|
+
#endif
|
|
17
25
|
#import "RCTFabricComponentsPlugins.h"
|
|
18
26
|
#import <React/RCTConversions.h>
|
|
19
27
|
#import "UIView+AirMap.h"
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
- (NSDictionary *) getCameraDic;
|
|
20
20
|
- (NSDictionary*) getMarkersFramesWithOnlyVisible:(BOOL)onlyVisible;
|
|
21
|
-
- (
|
|
21
|
+
- (NSDictionary *) getMapBoundaries;
|
|
22
22
|
- (NSDictionary *) getPointForCoordinates:(CLLocationCoordinate2D) location;
|
|
23
23
|
- (NSDictionary *) getCoordinatesForPoint:(CGPoint) point;
|
|
24
24
|
@end
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"main": "src/index.ts",
|
|
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.21.0-alpha.
|
|
8
|
+
"version": "1.21.0-alpha.143",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"lint": "eslint . --max-warnings 0",
|
|
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.authors = package["author"]
|
|
12
12
|
s.homepage = package["homepage"]
|
|
13
13
|
s.license = package["license"]
|
|
14
|
-
s.platform = :ios, "15.
|
|
14
|
+
s.platform = :ios, "15.1"
|
|
15
15
|
s.source = { :git => "https://github.com/react-native-maps/react-native-maps.git", :tag=> "v#{s.version}" }
|
|
16
16
|
s.source_files = "ios/AirGoogleMaps/**/*.{h,m,mm,swift}"
|
|
17
17
|
s.resource_bundles = {
|
|
@@ -21,6 +21,7 @@ Pod::Spec.new do |s|
|
|
|
21
21
|
s.dependency 'GoogleMaps', '9.3.0'
|
|
22
22
|
s.dependency 'Google-Maps-iOS-Utils', '6.1.0'
|
|
23
23
|
s.dependency 'react-native-maps-generated'
|
|
24
|
+
s.dependency 'react-native-maps'
|
|
24
25
|
install_modules_dependencies(s)
|
|
25
26
|
|
|
26
27
|
end
|
|
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.authors = package["author"]
|
|
12
12
|
s.homepage = package["homepage"]
|
|
13
13
|
s.license = package["license"]
|
|
14
|
-
s.platform = :ios, "
|
|
14
|
+
s.platform = :ios, "15.1"
|
|
15
15
|
s.source = { :git => "https://github.com/react-native-maps/react-native-maps.git", :tag=> "v#{s.version}" }
|
|
16
16
|
s.source_files = "ios/generated/**/*.{h,m,mm,cpp,swift}"
|
|
17
17
|
s.exclude_files = [
|
|
@@ -24,7 +24,6 @@ Pod::Spec.new do |s|
|
|
|
24
24
|
]
|
|
25
25
|
s.public_header_files = "ios/generated/**/*.h"
|
|
26
26
|
s.module_name = 'ReactNativeMapsGenerated'
|
|
27
|
-
s.dependency "React-Core"
|
|
28
27
|
s.compiler_flags = folly_compiler_flags
|
|
29
28
|
install_modules_dependencies(s)
|
|
30
29
|
|
|
@@ -11,13 +11,19 @@ Pod::Spec.new do |s|
|
|
|
11
11
|
s.authors = package["author"]
|
|
12
12
|
s.homepage = package["homepage"]
|
|
13
13
|
s.license = package["license"]
|
|
14
|
-
s.platform = :ios, "
|
|
14
|
+
s.platform = :ios, "15.1"
|
|
15
15
|
s.source = { :git => "https://github.com/react-native-maps/react-native-maps.git", :tag=> "v#{s.version}" }
|
|
16
16
|
|
|
17
17
|
s.source_files = "ios/AirMaps/**/*.{h,m,mm,swift}"
|
|
18
|
-
s.
|
|
18
|
+
s.module_map = 'ios/AirMaps/module.modulemap'
|
|
19
|
+
s.public_header_files = [
|
|
20
|
+
'ios/AirMaps/UIView+AirMap.h',
|
|
21
|
+
'ios/AirMaps/RCTConvert+AirMap.h',
|
|
22
|
+
]
|
|
23
|
+
s.module_name = 'ReactNativeMaps'
|
|
19
24
|
s.compiler_flags = folly_compiler_flags
|
|
20
25
|
s.dependency 'react-native-maps-generated'
|
|
26
|
+
s.dependency "React-Core"
|
|
21
27
|
install_modules_dependencies(s)
|
|
22
28
|
|
|
23
29
|
# Add script phase to detect Google Maps
|
|
@@ -55,8 +61,11 @@ Pod::Spec.new do |s|
|
|
|
55
61
|
}
|
|
56
62
|
]
|
|
57
63
|
|
|
58
|
-
# Add the generated defines header to the header search path
|
|
59
64
|
s.pod_target_xcconfig = {
|
|
60
|
-
'HEADER_SEARCH_PATHS' =>
|
|
65
|
+
'HEADER_SEARCH_PATHS' => [
|
|
66
|
+
'$(PODS_ROOT)/Headers/Public/React-Core',
|
|
67
|
+
'$(PODS_TARGET_SRCROOT)/../../../node_modules/react-native/React'
|
|
68
|
+
]
|
|
61
69
|
}
|
|
70
|
+
|
|
62
71
|
end
|
|
File without changes
|