react-native-maps 1.21.0-alpha.4 → 1.21.0-alpha.41
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/android/src/main/java/com/rnmaps/fabric/NativeAirMapsModule.java +51 -0
- package/android/src/main/java/com/rnmaps/maps/MapAirModulePackage.java +46 -0
- package/ios/AirGoogleMaps/AIRGoogleMap.h +8 -2
- package/ios/AirGoogleMaps/AIRGoogleMap.m +179 -11
- package/ios/AirGoogleMaps/AIRGoogleMapCircle.h +0 -1
- package/ios/AirGoogleMaps/AIRGoogleMapCircle.m +23 -11
- package/ios/AirGoogleMaps/AIRGoogleMapCoordinate.h +13 -0
- package/ios/AirGoogleMaps/AIRGoogleMapCoordinate.m +10 -0
- package/ios/AirGoogleMaps/AIRGoogleMapManager.h +7 -0
- package/ios/AirGoogleMaps/AIRGoogleMapManager.m +30 -119
- package/ios/AirGoogleMaps/AIRGoogleMapMarker.h +2 -0
- package/ios/AirGoogleMaps/AIRGoogleMapMarker.m +347 -243
- package/ios/AirGoogleMaps/AIRGoogleMapMarkerManager.m +0 -1
- package/ios/AirGoogleMaps/AIRGoogleMapOverlay.h +0 -1
- package/ios/AirGoogleMaps/AIRGoogleMapPolygon.h +5 -4
- package/ios/AirGoogleMaps/AIRGoogleMapPolygon.m +32 -2
- package/ios/AirGoogleMaps/AIRGoogleMapPolygonManager.m +3 -3
- package/ios/AirGoogleMaps/AIRGoogleMapPolyline.h +3 -2
- package/ios/AirGoogleMaps/AIRGoogleMapPolyline.m +2 -3
- package/ios/AirGoogleMaps/AIRGoogleMapPolylineManager.m +2 -2
- package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.h +1 -1
- package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.m +2 -2
- package/ios/AirGoogleMaps/RCTConvert+GMSMapViewType.h +3 -0
- package/ios/AirGoogleMaps/RCTConvert+GMSMapViewType.m +18 -0
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.h +26 -0
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +599 -0
- package/ios/AirGoogleMaps/RNMapsGoogleMapViewManager.mm +25 -0
- package/ios/AirGoogleMaps/RNMapsGooglePolygonView.h +26 -0
- package/ios/AirGoogleMaps/RNMapsGooglePolygonView.mm +217 -0
- package/ios/AirGoogleMaps/RNMapsGooglePolygonViewManager.mm +25 -0
- package/ios/AirMaps/AIRMap.h +8 -5
- package/ios/AirMaps/AIRMap.m +284 -141
- package/ios/AirMaps/AIRMapManager.m +12 -21
- package/ios/AirMaps/AIRMapMarker.h +1 -0
- package/ios/AirMaps/AIRMapMarker.m +165 -103
- package/ios/AirMaps/Callout/SMCalloutView.m +1 -1
- package/ios/AirMaps/RCTConvert+AirMap.h +4 -0
- package/ios/AirMaps/RCTConvert+AirMap.m +2 -0
- package/ios/AirMaps/RNMapsAirModule.h +3 -0
- package/ios/AirMaps/RNMapsAirModule.mm +42 -172
- package/ios/AirMaps/RNMapsAirModuleDelegate.h +24 -0
- package/ios/AirMaps/RNMapsHostVewDelegate.h +17 -0
- package/ios/AirMaps/RNMapsMapView.h +6 -3
- package/ios/AirMaps/RNMapsMapView.mm +341 -334
- package/ios/AirMaps/RNMapsMarkerView.h +24 -0
- package/ios/AirMaps/RNMapsMarkerView.mm +422 -0
- package/ios/AirMaps/RNMapsMarkerViewManager.mm +21 -0
- package/ios/AirMaps/UIView +AirMap.m +20 -0
- package/ios/AirMaps/UIView+AirMap.h +11 -0
- package/lib/MapMarker.d.ts +15 -2
- package/lib/MapMarker.js +53 -9
- package/lib/MapMarkerNativeComponent.js +0 -2
- package/lib/MapOverlay.d.ts +1 -1
- package/lib/MapView.d.ts +5 -22
- package/lib/MapView.js +34 -21
- package/lib/{FabricMapView.d.ts → createFabricMap.d.ts} +7 -6
- package/lib/createFabricMap.js +175 -0
- package/lib/decorateMapComponent.js +18 -0
- package/lib/specs/NativeAirMapsModule.d.ts +2 -2
- package/lib/specs/NativeComponentGoogleMapView.d.ts +713 -0
- package/lib/specs/NativeComponentGoogleMapView.js +21 -0
- package/lib/specs/NativeComponentGooglePolygon.d.ts +75 -0
- package/lib/specs/NativeComponentGooglePolygon.js +9 -0
- package/lib/specs/NativeComponentMapView.d.ts +21 -45
- package/lib/specs/NativeComponentMarker.d.ts +258 -0
- package/lib/specs/NativeComponentMarker.js +21 -0
- package/package.json +7 -7
- package/react-native-maps.podspec +1 -1
- package/lib/FabricMapView.js +0 -175
|
@@ -9,15 +9,16 @@
|
|
|
9
9
|
#import <GoogleMaps/GoogleMaps.h>
|
|
10
10
|
#import <React/RCTBridge.h>
|
|
11
11
|
#import "AIRGMSPolygon.h"
|
|
12
|
-
#import "
|
|
12
|
+
#import "AIRGoogleMapCoordinate.h"
|
|
13
|
+
#import "AIRGoogleMap.h"
|
|
13
14
|
|
|
14
15
|
@interface AIRGoogleMapPolygon : UIView
|
|
15
16
|
|
|
16
17
|
@property (nonatomic, weak) RCTBridge *bridge;
|
|
17
18
|
@property (nonatomic, strong) NSString *identifier;
|
|
18
19
|
@property (nonatomic, strong) AIRGMSPolygon *polygon;
|
|
19
|
-
@property (nonatomic, strong) NSArray<
|
|
20
|
-
@property (nonatomic, strong) NSArray<NSArray<
|
|
20
|
+
@property (nonatomic, strong) NSArray<AIRGoogleMapCoordinate *> *coordinates;
|
|
21
|
+
@property (nonatomic, strong) NSArray<NSArray<AIRGoogleMapCoordinate *> *> *holes;
|
|
21
22
|
@property (nonatomic, copy) RCTBubblingEventBlock onPress;
|
|
22
23
|
|
|
23
24
|
@property (nonatomic, strong) UIColor *fillColor;
|
|
@@ -26,7 +27,7 @@
|
|
|
26
27
|
@property (nonatomic, assign) BOOL geodesic;
|
|
27
28
|
@property (nonatomic, assign) int zIndex;
|
|
28
29
|
@property (nonatomic, assign) BOOL tappable;
|
|
29
|
-
|
|
30
|
+
- (void) didInsertInMap:(AIRGoogleMap *) map;
|
|
30
31
|
@end
|
|
31
32
|
|
|
32
33
|
#endif
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
#import "AIRGoogleMapPolygon.h"
|
|
10
10
|
#import "AIRGMSPolygon.h"
|
|
11
11
|
#import <GoogleMaps/GoogleMaps.h>
|
|
12
|
+
#import "AIRGoogleMap.h"
|
|
12
13
|
|
|
13
14
|
@implementation AIRGoogleMapPolygon
|
|
14
15
|
{
|
|
@@ -41,8 +42,37 @@
|
|
|
41
42
|
_polygon.strokeWidth = _strokeWidth;
|
|
42
43
|
}
|
|
43
44
|
}
|
|
45
|
+
- (void) didInsertInMap:(AIRGoogleMap *) map
|
|
46
|
+
{
|
|
47
|
+
_polygon = [AIRGMSPolygon new];
|
|
48
|
+
|
|
49
|
+
if (_identifier){
|
|
50
|
+
[_polygon setIdentifier:_identifier];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
[_polygon setTappable:_tappable];
|
|
54
|
+
if (_strokeColor){
|
|
55
|
+
_polygon.strokeColor = _strokeColor;
|
|
56
|
+
}
|
|
57
|
+
if (_fillColor){
|
|
58
|
+
_polygon.fillColor = _fillColor;
|
|
59
|
+
}
|
|
60
|
+
if (_strokeWidth){
|
|
61
|
+
_polygon.strokeWidth = _strokeWidth;
|
|
62
|
+
}
|
|
63
|
+
if (_coordinates){
|
|
64
|
+
[self setCoordinates:_coordinates];
|
|
65
|
+
}
|
|
66
|
+
if (_holes){
|
|
67
|
+
[self setHoles:_holes];
|
|
68
|
+
}
|
|
69
|
+
if (_zIndex){
|
|
70
|
+
_polygon.zIndex = _zIndex;
|
|
71
|
+
}
|
|
72
|
+
[_polygon setMap:map];
|
|
73
|
+
}
|
|
44
74
|
|
|
45
|
-
- (void)setCoordinates:(NSArray<
|
|
75
|
+
- (void)setCoordinates:(NSArray<AIRGoogleMapCoordinate *> *)coordinates
|
|
46
76
|
{
|
|
47
77
|
_coordinates = coordinates;
|
|
48
78
|
|
|
@@ -55,7 +85,7 @@
|
|
|
55
85
|
_polygon.path = path;
|
|
56
86
|
}
|
|
57
87
|
|
|
58
|
-
- (void)setHoles:(NSArray<NSArray<
|
|
88
|
+
- (void)setHoles:(NSArray<NSArray<AIRGoogleMapCoordinate *> *> *)holes
|
|
59
89
|
{
|
|
60
90
|
_holes = holes;
|
|
61
91
|
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
#import <React/RCTEventDispatcher.h>
|
|
14
14
|
#import <React/RCTViewManager.h>
|
|
15
15
|
#import <React/UIView+React.h>
|
|
16
|
-
#import "RCTConvert+AirMap.h"
|
|
17
16
|
#import "AIRGoogleMapPolygon.h"
|
|
17
|
+
#import "RCTConvert+GMSMapViewType.h"
|
|
18
18
|
|
|
19
19
|
@interface AIRGoogleMapPolygonManager()
|
|
20
20
|
|
|
@@ -31,8 +31,8 @@ RCT_EXPORT_MODULE()
|
|
|
31
31
|
return polygon;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
RCT_EXPORT_VIEW_PROPERTY(coordinates,
|
|
35
|
-
RCT_EXPORT_VIEW_PROPERTY(holes,
|
|
34
|
+
RCT_EXPORT_VIEW_PROPERTY(coordinates, AIRGoogleMapCoordinateArray)
|
|
35
|
+
RCT_EXPORT_VIEW_PROPERTY(holes, AIRGoogleMapCoordinateArrayArray)
|
|
36
36
|
RCT_EXPORT_VIEW_PROPERTY(fillColor, UIColor)
|
|
37
37
|
RCT_EXPORT_VIEW_PROPERTY(strokeWidth, double)
|
|
38
38
|
RCT_EXPORT_VIEW_PROPERTY(strokeColor, UIColor)
|
|
@@ -9,15 +9,16 @@
|
|
|
9
9
|
#import <GoogleMaps/GoogleMaps.h>
|
|
10
10
|
#import <React/RCTBridge.h>
|
|
11
11
|
#import "AIRGMSPolyline.h"
|
|
12
|
-
#import "AIRMapCoordinate.h"
|
|
13
12
|
#import "AIRGoogleMapMarker.h"
|
|
14
13
|
|
|
14
|
+
#import "AIRGoogleMapCoordinate.h"
|
|
15
|
+
|
|
15
16
|
@interface AIRGoogleMapPolyline : UIView
|
|
16
17
|
|
|
17
18
|
@property (nonatomic, weak) RCTBridge *bridge;
|
|
18
19
|
@property (nonatomic, strong) NSString *identifier;
|
|
19
20
|
@property (nonatomic, strong) AIRGMSPolyline *polyline;
|
|
20
|
-
@property (nonatomic, strong) NSArray<
|
|
21
|
+
@property (nonatomic, strong) NSArray<AIRGoogleMapCoordinate *> *coordinates;
|
|
21
22
|
@property (nonatomic, copy) RCTBubblingEventBlock onPress;
|
|
22
23
|
@property (nonatomic, strong) GMSMapView *originalMap;
|
|
23
24
|
|
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
#import <UIKit/UIKit.h>
|
|
9
9
|
#import "AIRGoogleMapPolyline.h"
|
|
10
10
|
#import "AIRGMSPolyline.h"
|
|
11
|
-
#import "AIRMapCoordinate.h"
|
|
12
11
|
#import "AIRGoogleMapMarker.h"
|
|
13
12
|
#import "AIRGoogleMapMarkerManager.h"
|
|
14
13
|
#import <GoogleMaps/GoogleMaps.h>
|
|
@@ -26,13 +25,13 @@
|
|
|
26
25
|
return self;
|
|
27
26
|
}
|
|
28
27
|
|
|
29
|
-
-(void)setCoordinates:(NSArray<
|
|
28
|
+
-(void)setCoordinates:(NSArray<AIRGoogleMapCoordinate *> *)coordinates
|
|
30
29
|
{
|
|
31
30
|
_coordinates = coordinates;
|
|
32
31
|
|
|
33
32
|
GMSMutablePath *path = [GMSMutablePath path];
|
|
34
33
|
|
|
35
|
-
if (!coordinates || coordinates.count == 0)
|
|
34
|
+
if (!coordinates || coordinates.count == 0)
|
|
36
35
|
{
|
|
37
36
|
[path removeAllCoordinates];
|
|
38
37
|
return;
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
#import <React/RCTEventDispatcher.h>
|
|
15
15
|
#import <React/RCTViewManager.h>
|
|
16
16
|
#import <React/UIView+React.h>
|
|
17
|
-
#import "RCTConvert+AirMap.h"
|
|
18
17
|
#import "AIRGoogleMapPolyline.h"
|
|
18
|
+
#import "RCTConvert+GMSMapViewType.h"
|
|
19
19
|
|
|
20
20
|
@interface AIRGoogleMapPolylineManager()
|
|
21
21
|
|
|
@@ -32,7 +32,7 @@ RCT_EXPORT_MODULE()
|
|
|
32
32
|
return polyline;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
RCT_EXPORT_VIEW_PROPERTY(coordinates,
|
|
35
|
+
RCT_EXPORT_VIEW_PROPERTY(coordinates, AIRGoogleMapCoordinateArray)
|
|
36
36
|
RCT_EXPORT_VIEW_PROPERTY(fillColor, UIColor)
|
|
37
37
|
RCT_EXPORT_VIEW_PROPERTY(strokeColor, UIColor)
|
|
38
38
|
RCT_EXPORT_VIEW_PROPERTY(strokeColors, UIColorArray)
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|
|
14
14
|
@interface WMSTileOverlay : GMSSyncTileLayer
|
|
15
15
|
@property (nonatomic) double MapX,MapY,FULL;
|
|
16
|
-
@property (nonatomic,
|
|
16
|
+
@property (nonatomic, assign) NSString *urlTemplate;
|
|
17
17
|
@property (nonatomic, assign) NSInteger maximumZ;
|
|
18
18
|
@property (nonatomic, assign) NSInteger minimumZ;
|
|
19
19
|
@end
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
{
|
|
63
63
|
_urlTemplate = urlTemplate;
|
|
64
64
|
WMSTileOverlay *tile = [[WMSTileOverlay alloc] init];
|
|
65
|
-
[tile
|
|
65
|
+
[tile setUrlTemplate:urlTemplate];
|
|
66
66
|
[tile setMaximumZ: _maximumZ];
|
|
67
67
|
[tile setMinimumZ: _minimumZ];
|
|
68
68
|
[tile setOpacity: _opacity];
|
|
@@ -107,7 +107,7 @@
|
|
|
107
107
|
return nil;
|
|
108
108
|
}
|
|
109
109
|
NSArray *bb = [self getBoundBox:x yAxis:y zoom:zoom];
|
|
110
|
-
NSMutableString *url = [self.
|
|
110
|
+
NSMutableString *url = [self.urlTemplate mutableCopy];
|
|
111
111
|
[url replaceOccurrencesOfString: @"{minX}" withString:[NSString stringWithFormat:@"%@", bb[0]] options:0 range:NSMakeRange(0, url.length)];
|
|
112
112
|
[url replaceOccurrencesOfString: @"{minY}" withString:[NSString stringWithFormat:@"%@", bb[1]] options:0 range:NSMakeRange(0, url.length)];
|
|
113
113
|
[url replaceOccurrencesOfString: @"{maxX}" withString:[NSString stringWithFormat:@"%@", bb[2]] options:0 range:NSMakeRange(0, url.length)];
|
|
@@ -9,9 +9,12 @@
|
|
|
9
9
|
#import <Foundation/Foundation.h>
|
|
10
10
|
#import <GoogleMaps/GoogleMaps.h>
|
|
11
11
|
#import <React/RCTConvert.h>
|
|
12
|
+
#import "AIRGoogleMapCoordinate.h"
|
|
12
13
|
|
|
13
14
|
@interface RCTConvert (GMSMapViewType)
|
|
14
15
|
+ (GMSCameraPosition*)GMSCameraPositionWithDefaults:(id)json existingCamera:(GMSCameraPosition*)existingCamera;
|
|
16
|
+
+ (NSArray<NSArray<AIRGoogleMapCoordinate *> *> *)AIRGoogleMapCoordinateArrayArray:(id)json;
|
|
17
|
+
+ (AIRGoogleMapCoordinate *)AIRGoogleMapCoordinate:(id)json;
|
|
15
18
|
@end
|
|
16
19
|
|
|
17
20
|
#endif
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
#import <GoogleMaps/GoogleMaps.h>
|
|
11
11
|
#import <React/RCTConvert.h>
|
|
12
12
|
#import <React/RCTConvert+CoreLocation.h>
|
|
13
|
+
#import "AIRGoogleMapCoordinate.h"
|
|
13
14
|
|
|
14
15
|
@implementation RCTConvert (GMSMapViewType)
|
|
15
16
|
RCT_ENUM_CONVERTER(GMSMapViewType,
|
|
@@ -30,6 +31,23 @@
|
|
|
30
31
|
return [RCTConvert GMSCameraPositionWithDefaults:json existingCamera:nil];
|
|
31
32
|
}
|
|
32
33
|
|
|
34
|
+
+ (AIRGoogleMapCoordinate *)AIRGoogleMapCoordinate:(id)json
|
|
35
|
+
{
|
|
36
|
+
// empty coordinates
|
|
37
|
+
if ([json isKindOfClass:[NSArray class]] && [json count] == 0) return nil;
|
|
38
|
+
AIRGoogleMapCoordinate *coord = [AIRGoogleMapCoordinate new];
|
|
39
|
+
coord.coordinate = [self CLLocationCoordinate2D:json];
|
|
40
|
+
return coord;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
RCT_ARRAY_CONVERTER(AIRGoogleMapCoordinate)
|
|
44
|
+
|
|
45
|
+
+ (NSArray<NSArray<AIRGoogleMapCoordinate *> *> *)AIRGoogleMapCoordinateArrayArray:(id)json
|
|
46
|
+
{
|
|
47
|
+
return RCTConvertArrayValue(@selector(AIRGoogleMapCoordinate:), json);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
|
|
33
51
|
+ (GMSCameraPosition*)GMSCameraPositionWithDefaults:(id)json existingCamera:(GMSCameraPosition*)existingCamera
|
|
34
52
|
{
|
|
35
53
|
CLLocationDegrees latitude = 0;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RNMapsGoogleMapView.h
|
|
3
|
+
//
|
|
4
|
+
//
|
|
5
|
+
// Created by Salah Ghanim on 23.11.24.
|
|
6
|
+
// Copyright © 2024 react-native-maps. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
#ifdef RCT_NEW_ARCH_ENABLED
|
|
9
|
+
#ifdef HAVE_GOOGLE_MAPS
|
|
10
|
+
|
|
11
|
+
#import <React/RCTViewComponentView.h>
|
|
12
|
+
#import <UIKit/UIKit.h>
|
|
13
|
+
#import "RNMapsHostVewDelegate.h"
|
|
14
|
+
|
|
15
|
+
@class AIRGoogleMap;
|
|
16
|
+
|
|
17
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
18
|
+
|
|
19
|
+
@interface RNMapsGoogleMapView : RCTViewComponentView<RNMapsHostVewDelegate>
|
|
20
|
+
|
|
21
|
+
@end
|
|
22
|
+
|
|
23
|
+
NS_ASSUME_NONNULL_END
|
|
24
|
+
|
|
25
|
+
#endif
|
|
26
|
+
#endif
|