react-native-maps 1.21.0-alpha.11 → 1.21.0-alpha.111
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/build.gradle +77 -57
- package/android/gradlew +1 -2
- package/android/src/main/java/com/rnmaps/fabric/CalloutManager.java +77 -0
- package/android/src/main/java/com/rnmaps/fabric/CircleManager.java +94 -0
- package/android/src/main/java/com/rnmaps/fabric/JSONUtil.java +86 -0
- package/android/src/main/java/com/rnmaps/fabric/MapViewManager.java +619 -0
- package/android/src/main/java/com/rnmaps/fabric/MarkerManager.java +258 -0
- package/android/src/main/java/com/rnmaps/fabric/NativeAirMapsModule.java +235 -2
- package/android/src/main/java/com/rnmaps/fabric/OverlayManager.java +95 -0
- package/android/src/main/java/com/rnmaps/fabric/PolygonManager.java +89 -0
- package/android/src/main/java/com/rnmaps/fabric/PolylineManager.java +121 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnCalloutPressEvent.java +25 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDeselectEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDoublePressEvent.java +27 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDragEndEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDragEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDragStartEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnIndoorBuildingFocusedEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnIndoorLevelActivatedEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnKmlReadyEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnLongPressEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMapLoadedEvent.java +29 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMapReadyEvent.java +29 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDeselectEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragEndEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragStartEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerPressEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerSelectEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnPanDragEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnPoiClickEvent.java +27 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnPressEvent.java +27 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeCompleteEvent.java +30 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeEvent.java +48 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeStartEvent.java +33 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnSelectEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnUserLocationChangeEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/maps/MapAirModulePackage.java +39 -3
- package/android/src/main/java/com/rnmaps/maps/MapCallout.java +18 -0
- package/android/src/main/java/com/rnmaps/maps/MapCircle.java +24 -0
- package/android/src/main/java/com/rnmaps/maps/MapManager.java +14 -14
- package/android/src/main/java/com/rnmaps/maps/MapMarker.java +637 -556
- package/android/src/main/java/com/rnmaps/maps/MapMarkerManager.java +3 -3
- package/android/src/main/java/com/rnmaps/maps/MapModule.java +206 -206
- package/android/src/main/java/com/rnmaps/maps/MapOverlay.java +267 -151
- package/android/src/main/java/com/rnmaps/maps/MapPolygon.java +31 -1
- package/android/src/main/java/com/rnmaps/maps/MapPolyline.java +207 -141
- package/android/src/main/java/com/rnmaps/maps/MapPolylineManager.java +1 -16
- package/android/src/main/java/com/rnmaps/maps/MapView.java +1650 -1337
- package/ios/AirGoogleMaps/AIRGMSMarker.h +1 -1
- package/ios/AirGoogleMaps/AIRGoogleMap.h +9 -10
- package/ios/AirGoogleMaps/AIRGoogleMap.m +112 -74
- package/ios/AirGoogleMaps/AIRGoogleMapCircle.m +23 -11
- package/ios/AirGoogleMaps/AIRGoogleMapManager.m +10 -9
- package/ios/AirGoogleMaps/AIRGoogleMapMarker.h +2 -0
- package/ios/AirGoogleMaps/AIRGoogleMapMarker.m +347 -243
- package/ios/AirGoogleMaps/AIRGoogleMapMarkerManager.m +1 -1
- package/ios/AirGoogleMaps/AIRGoogleMapPolygon.h +2 -1
- package/ios/AirGoogleMaps/AIRGoogleMapPolygon.m +30 -0
- package/ios/AirGoogleMaps/AIRGoogleMapPolyline.h +0 -1
- package/ios/AirGoogleMaps/AIRGoogleMapPolyline.m +0 -7
- package/ios/AirGoogleMaps/AIRGoogleMapUrlTile.m +2 -2
- package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.h +1 -1
- package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.m +4 -4
- package/ios/AirGoogleMaps/RCTConvert+GMSMapViewType.m +2 -0
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +137 -57
- package/ios/AirGoogleMaps/RNMapsGoogleMapViewManager.mm +16 -1
- package/ios/AirGoogleMaps/RNMapsGooglePolygonView.h +26 -0
- package/ios/AirGoogleMaps/RNMapsGooglePolygonView.mm +217 -0
- package/ios/AirGoogleMaps/RNMapsGooglePolygonViewManager.mm +26 -0
- package/ios/AirMaps/AIRMap.h +7 -7
- package/ios/AirMaps/AIRMap.m +227 -236
- package/ios/AirMaps/AIRMapManager.m +13 -7
- 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/NSObject+DynamicLoad.h +16 -0
- package/ios/AirMaps/NSObject+DynamicLoad.m +28 -0
- package/ios/AirMaps/RNMapsAirModule.h +1 -1
- package/ios/AirMaps/RNMapsAirModule.mm +4 -3
- package/ios/AirMaps/RNMapsAirModuleDelegate.h +2 -2
- package/ios/AirMaps/RNMapsMapView.mm +332 -295
- package/ios/AirMaps/RNMapsMapViewManager.mm +19 -1
- package/ios/AirMaps/RNMapsMarkerView.h +24 -0
- package/ios/AirMaps/RNMapsMarkerView.mm +430 -0
- package/ios/AirMaps/RNMapsMarkerViewManager.mm +28 -0
- package/ios/AirMaps.xcodeproj/project.pbxproj +20 -0
- package/lib/MapCircle.d.ts +1 -1
- package/lib/MapHeatmap.d.ts +2 -2
- package/lib/MapHeatmap.js +1 -1
- package/lib/MapMarker.d.ts +16 -3
- package/lib/MapMarker.js +55 -13
- package/lib/MapMarkerNativeComponent.js +0 -2
- package/lib/MapOverlay.d.ts +1 -0
- package/lib/MapOverlay.js +11 -9
- package/lib/MapPolygon.d.ts +1 -1
- package/lib/MapPolyline.d.ts +7 -7
- package/lib/MapView.d.ts +17 -29
- package/lib/MapView.js +114 -128
- package/lib/MapView.types.d.ts +1 -1
- package/lib/createFabricMap.d.ts +1 -0
- package/lib/createFabricMap.js +17 -4
- package/lib/decorateMapComponent.js +40 -0
- package/lib/fixImageProp.d.ts +4 -0
- package/lib/fixImageProp.js +16 -0
- package/lib/specs/NativeAirMapsModule.d.ts +2 -2
- package/lib/specs/NativeComponentCallout.d.ts +46 -0
- package/lib/specs/NativeComponentCallout.js +9 -0
- package/lib/specs/NativeComponentCircle.d.ts +74 -0
- package/lib/specs/NativeComponentCircle.js +7 -0
- package/lib/specs/NativeComponentGoogleMapView.d.ts +19 -22
- package/lib/specs/NativeComponentGoogleMapView.js +1 -0
- package/lib/specs/NativeComponentGooglePolygon.d.ts +75 -0
- package/lib/specs/NativeComponentGooglePolygon.js +7 -0
- package/lib/specs/NativeComponentMapView.d.ts +43 -56
- package/lib/specs/NativeComponentMapView.js +2 -3
- package/lib/specs/NativeComponentMarker.d.ts +258 -0
- package/lib/specs/NativeComponentMarker.js +19 -0
- package/lib/specs/NativeComponentOverlay.d.ts +67 -0
- package/lib/specs/NativeComponentOverlay.js +7 -0
- package/lib/specs/NativeComponentPolyline.d.ts +101 -0
- package/lib/specs/NativeComponentPolyline.js +7 -0
- package/package.json +21 -19
- package/react-native-maps.podspec +15 -15
- package/specs/NativeAirMapsModule.ts +36 -0
- package/specs/NativeComponentCallout.ts +63 -0
- package/specs/NativeComponentCircle.ts +94 -0
- package/specs/NativeComponentGoogleMapView.ts +913 -0
- package/specs/NativeComponentGooglePolygon.ts +94 -0
- package/specs/NativeComponentMapView.ts +1059 -0
- package/specs/NativeComponentMarker.ts +326 -0
- package/specs/NativeComponentOverlay.ts +89 -0
- package/specs/NativeComponentPolyline.ts +124 -0
|
@@ -17,7 +17,25 @@
|
|
|
17
17
|
|
|
18
18
|
RCT_EXPORT_MODULE(RNMapsMapViewManager)
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
RCT_EXPORT_VIEW_PROPERTY(onMapReady, RCTDirectEventBlock)
|
|
21
|
+
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
|
|
22
|
+
RCT_EXPORT_VIEW_PROPERTY(onLongPress, RCTBubblingEventBlock)
|
|
23
|
+
RCT_EXPORT_VIEW_PROPERTY(onCalloutPress, RCTDirectEventBlock)
|
|
24
|
+
RCT_EXPORT_VIEW_PROPERTY(onDoublePress, RCTDirectEventBlock)
|
|
25
|
+
|
|
26
|
+
RCT_EXPORT_VIEW_PROPERTY(onPanDrag, RCTDirectEventBlock)
|
|
27
|
+
|
|
28
|
+
RCT_EXPORT_VIEW_PROPERTY(onMarkerPress, RCTDirectEventBlock)
|
|
29
|
+
RCT_EXPORT_VIEW_PROPERTY(onMarkerSelect, RCTDirectEventBlock)
|
|
30
|
+
RCT_EXPORT_VIEW_PROPERTY(onMarkerDeselect, RCTDirectEventBlock)
|
|
31
|
+
RCT_EXPORT_VIEW_PROPERTY(onMarkerDragStart, RCTDirectEventBlock)
|
|
32
|
+
RCT_EXPORT_VIEW_PROPERTY(onMarkerDrag, RCTDirectEventBlock)
|
|
33
|
+
RCT_EXPORT_VIEW_PROPERTY(onMarkerDragEnd, RCTDirectEventBlock)
|
|
34
|
+
|
|
35
|
+
RCT_EXPORT_VIEW_PROPERTY(onRegionChangeStart, RCTDirectEventBlock)
|
|
36
|
+
RCT_EXPORT_VIEW_PROPERTY(onRegionChangeComplete, RCTDirectEventBlock)
|
|
37
|
+
RCT_EXPORT_VIEW_PROPERTY(onRegionChange, RCTDirectEventBlock)
|
|
38
|
+
RCT_EXPORT_VIEW_PROPERTY(onUserLocationChange, RCTDirectEventBlock)
|
|
21
39
|
|
|
22
40
|
|
|
23
41
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RNMapsMarker.h
|
|
3
|
+
// AirMaps
|
|
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
|
+
|
|
10
|
+
#import <React/RCTViewComponentView.h>
|
|
11
|
+
#import <UIKit/UIKit.h>
|
|
12
|
+
|
|
13
|
+
NS_ASSUME_NONNULL_BEGIN
|
|
14
|
+
|
|
15
|
+
typedef void (^LoadCompletionHandler)(UIView *view);
|
|
16
|
+
|
|
17
|
+
@class AIRMapMarker;
|
|
18
|
+
@interface RNMapsMarkerView : RCTViewComponentView
|
|
19
|
+
- (AIRMapMarker*) marker;
|
|
20
|
+
@end
|
|
21
|
+
|
|
22
|
+
NS_ASSUME_NONNULL_END
|
|
23
|
+
|
|
24
|
+
#endif
|
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RNMapsMarker.m
|
|
3
|
+
// AirMaps
|
|
4
|
+
//
|
|
5
|
+
// Created by Salah Ghanim on 23.11.24.
|
|
6
|
+
// Copyright © 2024 react-native-maps. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import "RNMapsMarkerView.h"
|
|
10
|
+
#import "AIRMap.h"
|
|
11
|
+
#import "AIRMapMarker.h"
|
|
12
|
+
#import "AIRMapMarkerManager.h"
|
|
13
|
+
#import <react/renderer/components/RNMapsSpecs/ComponentDescriptors.h>
|
|
14
|
+
#import <react/renderer/components/RNMapsSpecs/EventEmitters.h>
|
|
15
|
+
#import <react/renderer/components/RNMapsSpecs/Props.h>
|
|
16
|
+
#import <react/renderer/components/RNMapsSpecs/RCTComponentViewHelpers.h>
|
|
17
|
+
#import "RCTFabricComponentsPlugins.h"
|
|
18
|
+
#import <React/RCTConversions.h>
|
|
19
|
+
#import "UIView+AirMap.h"
|
|
20
|
+
|
|
21
|
+
using namespace facebook::react;
|
|
22
|
+
|
|
23
|
+
@interface RNMapsMarkerView () <RCTRNMapsMarkerViewProtocol>
|
|
24
|
+
@end
|
|
25
|
+
|
|
26
|
+
@implementation RNMapsMarkerView {
|
|
27
|
+
AIRMapMarker *_view;
|
|
28
|
+
AIRMapMarkerManager* _legacyMapManager;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
- (AIRMapMarker *) marker {
|
|
32
|
+
return _view;
|
|
33
|
+
}
|
|
34
|
+
- (void) prepareForRecycle
|
|
35
|
+
{
|
|
36
|
+
[super prepareForRecycle];
|
|
37
|
+
[_view removeFromSuperview];
|
|
38
|
+
_view = nil;
|
|
39
|
+
_legacyMapManager = nil;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#pragma mark - JS Commands
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
#pragma mark - Native commands
|
|
46
|
+
|
|
47
|
+
- (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args
|
|
48
|
+
{
|
|
49
|
+
RCTRNMapsMarkerHandleCommand(self, commandName, args);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
+ (ComponentDescriptorProvider)componentDescriptorProvider
|
|
54
|
+
{
|
|
55
|
+
return concreteComponentDescriptorProvider<RNMapsMarkerComponentDescriptor>();
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
- (void) animateToCoordinates:(double)latitude longitude:(double)longitude duration:(NSInteger)duration
|
|
59
|
+
{
|
|
60
|
+
[_view animateToCoordinate:CLLocationCoordinate2DMake(latitude, longitude) duration:duration/1000];
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
- (void) showCallout
|
|
64
|
+
{
|
|
65
|
+
[_view.map selectAnnotation:_view animated:YES];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
- (void) hideCallout
|
|
69
|
+
{
|
|
70
|
+
[_view.map deselectAnnotation:_view animated:YES];
|
|
71
|
+
|
|
72
|
+
}
|
|
73
|
+
- (void) redraw
|
|
74
|
+
{
|
|
75
|
+
// do nothing
|
|
76
|
+
}
|
|
77
|
+
- (void) redrawCallout
|
|
78
|
+
{
|
|
79
|
+
// do nothing
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
- (void) setCoordinates:(double)latitude longitude:(double)longitude
|
|
83
|
+
{
|
|
84
|
+
[_view setCoordinate:CLLocationCoordinate2DMake(latitude, longitude)];
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
- (void) prepareMarkerView
|
|
90
|
+
{
|
|
91
|
+
if (_legacyMapManager && _view) return;
|
|
92
|
+
static const auto defaultProps = std::make_shared<const RNMapsMarkerProps>();
|
|
93
|
+
_props = defaultProps;
|
|
94
|
+
_legacyMapManager = [[AIRMapMarkerManager alloc] init];
|
|
95
|
+
_view = (AIRMapMarker *)[_legacyMapManager view];
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
_view.onPress = [self](NSDictionary* dictionary) {
|
|
99
|
+
if (_eventEmitter) {
|
|
100
|
+
// Extract values from the NSDictionary
|
|
101
|
+
NSDictionary* coordinateDict = dictionary[@"coordinate"];
|
|
102
|
+
NSDictionary* positionDict = dictionary[@"position"];
|
|
103
|
+
|
|
104
|
+
// Populate the OnCalloutPressPoint struct
|
|
105
|
+
facebook::react::RNMapsMarkerEventEmitter::OnPressPosition point = {
|
|
106
|
+
.x = [coordinateDict[@"x"] doubleValue],
|
|
107
|
+
.y = [coordinateDict[@"y"] doubleValue],
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
facebook::react::RNMapsMarkerEventEmitter::OnPressCoordinate coordinate = {
|
|
112
|
+
.latitude = [coordinateDict[@"latitude"] doubleValue],
|
|
113
|
+
.longitude = [coordinateDict[@"longitude"] doubleValue],
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
auto eventEmitter = std::static_pointer_cast<RNMapsMarkerEventEmitter const>(_eventEmitter);
|
|
117
|
+
facebook::react::RNMapsMarkerEventEmitter::OnPress data = {
|
|
118
|
+
.action = std::string([dictionary[@"action"] UTF8String]),
|
|
119
|
+
.id = std::string([dictionary[@"id"] UTF8String]),
|
|
120
|
+
.position = point,
|
|
121
|
+
.coordinate = coordinate,
|
|
122
|
+
};
|
|
123
|
+
eventEmitter->onPress(data);
|
|
124
|
+
}
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
_view.onDeselect = [self](NSDictionary* dictionary) {
|
|
128
|
+
if (_eventEmitter) {
|
|
129
|
+
// Extract values from the NSDictionary
|
|
130
|
+
NSDictionary* coordinateDict = dictionary[@"coordinate"];
|
|
131
|
+
NSDictionary* positionDict = dictionary[@"position"];
|
|
132
|
+
|
|
133
|
+
// Populate the OnCalloutPressPoint struct
|
|
134
|
+
facebook::react::RNMapsMarkerEventEmitter::OnDeselectPosition point = {
|
|
135
|
+
.x = [coordinateDict[@"x"] doubleValue],
|
|
136
|
+
.y = [coordinateDict[@"y"] doubleValue],
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
facebook::react::RNMapsMarkerEventEmitter::OnDeselectCoordinate coordinate = {
|
|
141
|
+
.latitude = [coordinateDict[@"latitude"] doubleValue],
|
|
142
|
+
.longitude = [coordinateDict[@"longitude"] doubleValue],
|
|
143
|
+
};
|
|
144
|
+
|
|
145
|
+
auto eventEmitter = std::static_pointer_cast<RNMapsMarkerEventEmitter const>(_eventEmitter);
|
|
146
|
+
facebook::react::RNMapsMarkerEventEmitter::OnDeselect data = {
|
|
147
|
+
.action = std::string([dictionary[@"action"] UTF8String]),
|
|
148
|
+
.id = std::string([dictionary[@"id"] UTF8String]),
|
|
149
|
+
.position = point,
|
|
150
|
+
.coordinate = coordinate,
|
|
151
|
+
};
|
|
152
|
+
eventEmitter->onDeselect(data);
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
_view.onDrag = [self](NSDictionary* dictionary) {
|
|
157
|
+
if (_eventEmitter) {
|
|
158
|
+
// Extract values from the NSDictionary
|
|
159
|
+
NSDictionary* coordinateDict = dictionary[@"coordinate"];
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
facebook::react::RNMapsMarkerEventEmitter::OnDragCoordinate coordinate = {
|
|
163
|
+
.latitude = [coordinateDict[@"latitude"] doubleValue],
|
|
164
|
+
.longitude = [coordinateDict[@"longitude"] doubleValue],
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
auto eventEmitter = std::static_pointer_cast<RNMapsMarkerEventEmitter const>(_eventEmitter);
|
|
168
|
+
facebook::react::RNMapsMarkerEventEmitter::OnDrag data = {
|
|
169
|
+
.id = std::string([dictionary[@"id"] UTF8String]),
|
|
170
|
+
.coordinate = coordinate,
|
|
171
|
+
};
|
|
172
|
+
eventEmitter->onDrag(data);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
_view.onDragStart = [self](NSDictionary* dictionary) {
|
|
176
|
+
if (_eventEmitter) {
|
|
177
|
+
// Extract values from the NSDictionary
|
|
178
|
+
NSDictionary* coordinateDict = dictionary[@"coordinate"];
|
|
179
|
+
|
|
180
|
+
facebook::react::RNMapsMarkerEventEmitter::OnDragStartCoordinate coordinate = {
|
|
181
|
+
.latitude = [coordinateDict[@"latitude"] doubleValue],
|
|
182
|
+
.longitude = [coordinateDict[@"longitude"] doubleValue],
|
|
183
|
+
};
|
|
184
|
+
|
|
185
|
+
auto eventEmitter = std::static_pointer_cast<RNMapsMarkerEventEmitter const>(_eventEmitter);
|
|
186
|
+
facebook::react::RNMapsMarkerEventEmitter::OnDragStart data = {
|
|
187
|
+
.id = std::string([dictionary[@"id"] UTF8String]),
|
|
188
|
+
.coordinate = coordinate,
|
|
189
|
+
};
|
|
190
|
+
eventEmitter->onDragStart(data);
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
_view.onDragEnd = [self](NSDictionary* dictionary) {
|
|
195
|
+
if (_eventEmitter) {
|
|
196
|
+
// Extract values from the NSDictionary
|
|
197
|
+
NSDictionary* coordinateDict = dictionary[@"coordinate"];
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
facebook::react::RNMapsMarkerEventEmitter::OnDragEndCoordinate coordinate = {
|
|
201
|
+
.latitude = [coordinateDict[@"latitude"] doubleValue],
|
|
202
|
+
.longitude = [coordinateDict[@"longitude"] doubleValue],
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
auto eventEmitter = std::static_pointer_cast<RNMapsMarkerEventEmitter const>(_eventEmitter);
|
|
206
|
+
facebook::react::RNMapsMarkerEventEmitter::OnDragEnd data = {
|
|
207
|
+
.id = std::string([dictionary[@"id"] UTF8String]),
|
|
208
|
+
.coordinate = coordinate,
|
|
209
|
+
};
|
|
210
|
+
eventEmitter->onDragEnd(data);
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
_view.onSelect = [self](NSDictionary* dictionary) {
|
|
215
|
+
if (_eventEmitter) {
|
|
216
|
+
// Extract values from the NSDictionary
|
|
217
|
+
NSDictionary* coordinateDict = dictionary[@"coordinate"];
|
|
218
|
+
NSDictionary* positionDict = dictionary[@"position"];
|
|
219
|
+
|
|
220
|
+
// Populate the OnCalloutPressPoint struct
|
|
221
|
+
facebook::react::RNMapsMarkerEventEmitter::OnSelectPosition point = {
|
|
222
|
+
.x = [coordinateDict[@"x"] doubleValue],
|
|
223
|
+
.y = [coordinateDict[@"y"] doubleValue],
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
facebook::react::RNMapsMarkerEventEmitter::OnSelectCoordinate coordinate = {
|
|
228
|
+
.latitude = [coordinateDict[@"latitude"] doubleValue],
|
|
229
|
+
.longitude = [coordinateDict[@"longitude"] doubleValue],
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
auto eventEmitter = std::static_pointer_cast<RNMapsMarkerEventEmitter const>(_eventEmitter);
|
|
233
|
+
facebook::react::RNMapsMarkerEventEmitter::OnSelect data = {
|
|
234
|
+
.action = std::string([dictionary[@"action"] UTF8String]),
|
|
235
|
+
.id = std::string([dictionary[@"id"] UTF8String]),
|
|
236
|
+
.position = point,
|
|
237
|
+
.coordinate = coordinate,
|
|
238
|
+
};
|
|
239
|
+
eventEmitter->onSelect(data);
|
|
240
|
+
}
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
_view.onCalloutPress = [self](NSDictionary* dictionary) {
|
|
245
|
+
if (_eventEmitter) {
|
|
246
|
+
// Extract values from the NSDictionary
|
|
247
|
+
NSDictionary* pointDict = dictionary[@"point"];
|
|
248
|
+
NSDictionary* frameDict = dictionary[@"frame"];
|
|
249
|
+
|
|
250
|
+
// Populate the OnCalloutPressPoint struct
|
|
251
|
+
facebook::react::RNMapsMarkerEventEmitter::OnCalloutPressPoint point = {
|
|
252
|
+
.x = [pointDict[@"x"] doubleValue],
|
|
253
|
+
.y = [pointDict[@"y"] doubleValue],
|
|
254
|
+
};
|
|
255
|
+
|
|
256
|
+
|
|
257
|
+
facebook::react::RNMapsMarkerEventEmitter::OnCalloutPressFrame frame = {
|
|
258
|
+
.x = [frameDict[@"x"] doubleValue],
|
|
259
|
+
.y = [frameDict[@"x"] doubleValue],
|
|
260
|
+
.width = [frameDict[@"width"] doubleValue],
|
|
261
|
+
.height = [frameDict[@"height"] doubleValue],
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
auto eventEmitter = std::static_pointer_cast<RNMapsMarkerEventEmitter const>(_eventEmitter);
|
|
265
|
+
facebook::react::RNMapsMarkerEventEmitter::OnCalloutPress data = {
|
|
266
|
+
.action = std::string([dictionary[@"action"] UTF8String]),
|
|
267
|
+
.id = std::string([dictionary[@"id"] UTF8String]),
|
|
268
|
+
.frame = frame,
|
|
269
|
+
.point = point,
|
|
270
|
+
};
|
|
271
|
+
eventEmitter->onCalloutPress(data);
|
|
272
|
+
}
|
|
273
|
+
};
|
|
274
|
+
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
- (void)mountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index{
|
|
278
|
+
if (!_view){
|
|
279
|
+
[self prepareMarkerView];
|
|
280
|
+
}
|
|
281
|
+
id<RCTComponent> paperView = [childComponentView getPaperViewFromChildComponentView];
|
|
282
|
+
if (paperView){
|
|
283
|
+
[_view insertReactSubview:paperView atIndex:index];
|
|
284
|
+
} else {
|
|
285
|
+
[_view insertReactSubview:childComponentView atIndex:index];
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
- (void) unmountChildComponentView:(UIView<RCTComponentViewProtocol> *)childComponentView index:(NSInteger)index
|
|
290
|
+
{
|
|
291
|
+
id<RCTComponent> paperView = [childComponentView getPaperViewFromChildComponentView];
|
|
292
|
+
if (paperView){
|
|
293
|
+
[_view removeReactSubview:paperView];
|
|
294
|
+
} else {
|
|
295
|
+
[_view removeReactSubview:childComponentView];
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
- (instancetype)initWithFrame:(CGRect)frame
|
|
299
|
+
{
|
|
300
|
+
if (self = [super initWithFrame:frame]) {
|
|
301
|
+
[self prepareMarkerView];
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
return self;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
- (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
|
|
308
|
+
{
|
|
309
|
+
[self prepareMarkerView];
|
|
310
|
+
const auto &oldViewProps = *std::static_pointer_cast<RNMapsMarkerProps const>(_props);
|
|
311
|
+
const auto &newViewProps = *std::static_pointer_cast<RNMapsMarkerProps const>(props);
|
|
312
|
+
BOOL completionHandlerCalled = false;
|
|
313
|
+
|
|
314
|
+
#define REMAP_MAPVIEW_PROP(name) \
|
|
315
|
+
if (oldViewProps.name != newViewProps.name) { \
|
|
316
|
+
_view.name = newViewProps.name; \
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
#define REMAP_MAPVIEW_STRING_PROP(name) \
|
|
320
|
+
if (oldViewProps.name != newViewProps.name) { \
|
|
321
|
+
_view.name = RCTNSStringFromString(newViewProps.name); \
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
#define REMAP_MAPVIEW_COLOR_PROP(name) \
|
|
325
|
+
if (oldViewProps.name != newViewProps.name) { \
|
|
326
|
+
_view.name = RCTUIColorFromSharedColor(newViewProps.name); \
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
#define REMAP_MAPVIEW_POINT_PROP(name) \
|
|
330
|
+
if (newViewProps.name.x != oldViewProps.name.x || \
|
|
331
|
+
newViewProps.name.y != oldViewProps.name.y) { \
|
|
332
|
+
_view.name = CGPointMake(newViewProps.name.x, newViewProps.name.y); \
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
if (newViewProps.zIndex != oldViewProps.zIndex){
|
|
336
|
+
if (newViewProps.zIndex.has_value()){
|
|
337
|
+
_view.zIndex = newViewProps.zIndex.value();
|
|
338
|
+
} else {
|
|
339
|
+
// default
|
|
340
|
+
_view.zIndex = 0;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
if (newViewProps.image != oldViewProps.image){
|
|
344
|
+
if (newViewProps.image.uri.size()){
|
|
345
|
+
[_view setImageSrc:RCTNSStringFromString(newViewProps.image.uri)];
|
|
346
|
+
completionHandlerCalled = true;
|
|
347
|
+
} else {
|
|
348
|
+
[_view setImageSrc:nil];
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
REMAP_MAPVIEW_PROP(useLegacyPinView)
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
REMAP_MAPVIEW_PROP(opacity)
|
|
356
|
+
REMAP_MAPVIEW_PROP(draggable)
|
|
357
|
+
REMAP_MAPVIEW_PROP(isPreselected)
|
|
358
|
+
|
|
359
|
+
REMAP_MAPVIEW_COLOR_PROP(pinColor)
|
|
360
|
+
|
|
361
|
+
|
|
362
|
+
REMAP_MAPVIEW_POINT_PROP(calloutOffset)
|
|
363
|
+
if (newViewProps.coordinate.latitude != oldViewProps.coordinate.latitude ||
|
|
364
|
+
newViewProps.coordinate.longitude != oldViewProps.coordinate.longitude) {
|
|
365
|
+
CLLocationCoordinate2D coordinates = CLLocationCoordinate2DMake(
|
|
366
|
+
newViewProps.coordinate.latitude,
|
|
367
|
+
newViewProps.coordinate.longitude);
|
|
368
|
+
_view.coordinate = coordinates;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
|
|
372
|
+
if (newViewProps.description != oldViewProps.description){
|
|
373
|
+
_view.subtitle = RCTNSStringFromString(newViewProps.description);
|
|
374
|
+
}
|
|
375
|
+
REMAP_MAPVIEW_STRING_PROP(title)
|
|
376
|
+
REMAP_MAPVIEW_STRING_PROP(identifier)
|
|
377
|
+
if (newViewProps.titleVisibility != oldViewProps.titleVisibility){
|
|
378
|
+
switch (newViewProps.titleVisibility) {
|
|
379
|
+
case RNMapsMarkerTitleVisibility::Visible:
|
|
380
|
+
[_view setTitleVisibility:MKFeatureVisibilityVisible];
|
|
381
|
+
break;
|
|
382
|
+
case RNMapsMarkerTitleVisibility::Adaptive:
|
|
383
|
+
[_view setTitleVisibility:MKFeatureVisibilityAdaptive];
|
|
384
|
+
break;
|
|
385
|
+
case RNMapsMarkerTitleVisibility::Hidden:
|
|
386
|
+
[_view setTitleVisibility:MKFeatureVisibilityHidden];
|
|
387
|
+
break;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
if (newViewProps.subtitleVisibility != oldViewProps.subtitleVisibility){
|
|
391
|
+
switch (newViewProps.subtitleVisibility) {
|
|
392
|
+
case RNMapsMarkerSubtitleVisibility::Visible:
|
|
393
|
+
[_view setSubtitleVisibility:MKFeatureVisibilityVisible];
|
|
394
|
+
break;
|
|
395
|
+
case RNMapsMarkerSubtitleVisibility::Adaptive:
|
|
396
|
+
[_view setSubtitleVisibility:MKFeatureVisibilityAdaptive];
|
|
397
|
+
break;
|
|
398
|
+
case RNMapsMarkerSubtitleVisibility::Hidden:
|
|
399
|
+
[_view setSubtitleVisibility:MKFeatureVisibilityHidden];
|
|
400
|
+
break;
|
|
401
|
+
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
if (newViewProps.displayPriority != oldViewProps.displayPriority){
|
|
406
|
+
switch (newViewProps.displayPriority) {
|
|
407
|
+
case RNMapsMarkerDisplayPriority::Required:
|
|
408
|
+
[_view setDisplayPriority:MKFeatureDisplayPriorityRequired];
|
|
409
|
+
break;
|
|
410
|
+
case RNMapsMarkerDisplayPriority::High:
|
|
411
|
+
[_view setDisplayPriority:MKFeatureDisplayPriorityDefaultHigh];
|
|
412
|
+
break;
|
|
413
|
+
case RNMapsMarkerDisplayPriority::Low:
|
|
414
|
+
[_view setDisplayPriority:MKFeatureDisplayPriorityDefaultLow];
|
|
415
|
+
break;
|
|
416
|
+
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
[super updateProps:props oldProps:oldProps];
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
|
|
425
|
+
@end
|
|
426
|
+
|
|
427
|
+
Class<RCTComponentViewProtocol> RNMapsMarkerCls(void)
|
|
428
|
+
{
|
|
429
|
+
return RNMapsMarkerView.class;
|
|
430
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// RNMapsMarkerManager.m
|
|
3
|
+
// AirMaps
|
|
4
|
+
//
|
|
5
|
+
// Created by Salah Ghanim on 23.11.24.
|
|
6
|
+
// Copyright © 2024 react-native-maps. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import <React/RCTLog.h>
|
|
10
|
+
#import <React/RCTUIManager.h>
|
|
11
|
+
#import <React/RCTViewManager.h>
|
|
12
|
+
|
|
13
|
+
@interface RNMapsMarkerViewManager : RCTViewManager
|
|
14
|
+
@end
|
|
15
|
+
|
|
16
|
+
@implementation RNMapsMarkerViewManager
|
|
17
|
+
|
|
18
|
+
RCT_EXPORT_MODULE(RNMapsMarkerViewManager)
|
|
19
|
+
|
|
20
|
+
RCT_EXPORT_VIEW_PROPERTY(onPress, RCTBubblingEventBlock)
|
|
21
|
+
RCT_EXPORT_VIEW_PROPERTY(onSelect, RCTDirectEventBlock)
|
|
22
|
+
RCT_EXPORT_VIEW_PROPERTY(onDeselect, RCTDirectEventBlock)
|
|
23
|
+
RCT_EXPORT_VIEW_PROPERTY(onCalloutPress, RCTDirectEventBlock)
|
|
24
|
+
RCT_EXPORT_VIEW_PROPERTY(onDragStart, RCTDirectEventBlock)
|
|
25
|
+
RCT_EXPORT_VIEW_PROPERTY(onDrag, RCTDirectEventBlock)
|
|
26
|
+
RCT_EXPORT_VIEW_PROPERTY(onDragEnd, RCTDirectEventBlock)
|
|
27
|
+
|
|
28
|
+
@end
|
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
4C99C9DE2226CF2800A8693E /* AIRWeakTimerReference.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C99C9DD2226CF2800A8693E /* AIRWeakTimerReference.m */; };
|
|
27
27
|
4C99C9E12226D8C400A8693E /* AIRWeakMapReference.m in Sources */ = {isa = PBXBuildFile; fileRef = 4C99C9E02226D8C400A8693E /* AIRWeakMapReference.m */; };
|
|
28
28
|
4E0CFBDE2B388F2B0017E126 /* RCTComponentData+Maps.m in Sources */ = {isa = PBXBuildFile; fileRef = 4E0CFBDD2B388F2B0017E126 /* RCTComponentData+Maps.m */; };
|
|
29
|
+
4E34FA002D84E24A009CC683 /* PlaceHolderGoogleMapView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4E34F9FC2D84E24A009CC683 /* PlaceHolderGoogleMapView.mm */; };
|
|
30
|
+
4E34FA012D84E24A009CC683 /* PlaceHolderPolygonView.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4E34F9FE2D84E24A009CC683 /* PlaceHolderPolygonView.mm */; };
|
|
29
31
|
4E430F272CF20153006E4F41 /* RNMapsMarkerManager.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4E430F262CF20153006E4F41 /* RNMapsMarkerManager.mm */; };
|
|
30
32
|
4E430F2A2CF20305006E4F41 /* RNMapsMarker.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4E430F292CF20305006E4F41 /* RNMapsMarker.mm */; };
|
|
31
33
|
53D31636202E723B00B55447 /* AIRMapOverlayManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 53D31635202E723B00B55447 /* AIRMapOverlayManager.m */; };
|
|
@@ -119,6 +121,10 @@
|
|
|
119
121
|
4E0A36152BFB4E76009FCCE4 /* PrivacyInfo.xcprivacy */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = PrivacyInfo.xcprivacy; sourceTree = "<group>"; };
|
|
120
122
|
4E0CFBDC2B388F2B0017E126 /* RCTComponentData+Maps.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "RCTComponentData+Maps.h"; sourceTree = "<group>"; };
|
|
121
123
|
4E0CFBDD2B388F2B0017E126 /* RCTComponentData+Maps.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "RCTComponentData+Maps.m"; sourceTree = "<group>"; };
|
|
124
|
+
4E34F9FB2D84E24A009CC683 /* PlaceHolderGoogleMapView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlaceHolderGoogleMapView.h; sourceTree = "<group>"; };
|
|
125
|
+
4E34F9FC2D84E24A009CC683 /* PlaceHolderGoogleMapView.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PlaceHolderGoogleMapView.mm; sourceTree = "<group>"; };
|
|
126
|
+
4E34F9FD2D84E24A009CC683 /* PlaceHolderPolygonView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PlaceHolderPolygonView.h; sourceTree = "<group>"; };
|
|
127
|
+
4E34F9FE2D84E24A009CC683 /* PlaceHolderPolygonView.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = PlaceHolderPolygonView.mm; sourceTree = "<group>"; };
|
|
122
128
|
4E430F262CF20153006E4F41 /* RNMapsMarkerManager.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RNMapsMarkerManager.mm; sourceTree = "<group>"; };
|
|
123
129
|
4E430F282CF20305006E4F41 /* RNMapsMarker.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = RNMapsMarker.h; sourceTree = "<group>"; };
|
|
124
130
|
4E430F292CF20305006E4F41 /* RNMapsMarker.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = RNMapsMarker.mm; sourceTree = "<group>"; };
|
|
@@ -228,6 +234,7 @@
|
|
|
228
234
|
11FA5C531C4A1296003AC2EE /* AirMaps */ = {
|
|
229
235
|
isa = PBXGroup;
|
|
230
236
|
children = (
|
|
237
|
+
4E34F9FF2D84E24A009CC683 /* FabricPlaceholders */,
|
|
231
238
|
4E0CFBDC2B388F2B0017E126 /* RCTComponentData+Maps.h */,
|
|
232
239
|
4E0CFBDD2B388F2B0017E126 /* RCTComponentData+Maps.m */,
|
|
233
240
|
BE2E4EC72621F63C00CC7F2E /* AIRMapUrlTileCachedOverlay.h */,
|
|
@@ -297,6 +304,17 @@
|
|
|
297
304
|
path = AirMaps;
|
|
298
305
|
sourceTree = "<group>";
|
|
299
306
|
};
|
|
307
|
+
4E34F9FF2D84E24A009CC683 /* FabricPlaceholders */ = {
|
|
308
|
+
isa = PBXGroup;
|
|
309
|
+
children = (
|
|
310
|
+
4E34F9FB2D84E24A009CC683 /* PlaceHolderGoogleMapView.h */,
|
|
311
|
+
4E34F9FC2D84E24A009CC683 /* PlaceHolderGoogleMapView.mm */,
|
|
312
|
+
4E34F9FD2D84E24A009CC683 /* PlaceHolderPolygonView.h */,
|
|
313
|
+
4E34F9FE2D84E24A009CC683 /* PlaceHolderPolygonView.mm */,
|
|
314
|
+
);
|
|
315
|
+
path = FabricPlaceholders;
|
|
316
|
+
sourceTree = "<group>";
|
|
317
|
+
};
|
|
300
318
|
9B9498A32017EF9D00158761 /* AirGoogleMaps */ = {
|
|
301
319
|
isa = PBXGroup;
|
|
302
320
|
children = (
|
|
@@ -437,6 +455,8 @@
|
|
|
437
455
|
BE2E4EC92621F63C00CC7F2E /* AIRMapUrlTileCachedOverlay.m in Sources */,
|
|
438
456
|
DA6C263E1C9E324A0035349F /* AIRMapUrlTileManager.m in Sources */,
|
|
439
457
|
9B9498DB2017EFB800158761 /* AIRGoogleMapMarker.m in Sources */,
|
|
458
|
+
4E34FA002D84E24A009CC683 /* PlaceHolderGoogleMapView.mm in Sources */,
|
|
459
|
+
4E34FA012D84E24A009CC683 /* PlaceHolderPolygonView.mm in Sources */,
|
|
440
460
|
628F81201FD16DF80058313A /* AIRMapLocalTile.m in Sources */,
|
|
441
461
|
9B9498D92017EFB800158761 /* AIRGoogleMapCalloutManager.m in Sources */,
|
|
442
462
|
53D3163A202E72FC00B55447 /* AIRMapOverlay.m in Sources */,
|
package/lib/MapCircle.d.ts
CHANGED
|
@@ -101,7 +101,7 @@ export type MapCircleProps = ViewProps & {
|
|
|
101
101
|
zIndex?: number;
|
|
102
102
|
};
|
|
103
103
|
type NativeProps = MapCircleProps & {
|
|
104
|
-
ref: React.RefObject<View>;
|
|
104
|
+
ref: React.RefObject<View | null>;
|
|
105
105
|
};
|
|
106
106
|
export declare class MapCircle extends React.Component<MapCircleProps> {
|
|
107
107
|
context: React.ContextType<typeof ProviderContext>;
|
package/lib/MapHeatmap.d.ts
CHANGED
|
@@ -59,9 +59,9 @@ type NativeProps = Modify<MapHeatmapProps, {
|
|
|
59
59
|
colors: (ProcessedColorValue | null | undefined)[];
|
|
60
60
|
}>;
|
|
61
61
|
}> & {
|
|
62
|
-
ref: React.RefObject<View>;
|
|
62
|
+
ref: React.RefObject<View | null>;
|
|
63
63
|
};
|
|
64
|
-
export declare class MapHeatmap extends React.Component<MapHeatmapProps> {
|
|
64
|
+
export declare class MapHeatmap extends React.Component<MapHeatmapProps | null> {
|
|
65
65
|
context: React.ContextType<typeof ProviderContext>;
|
|
66
66
|
getNativeComponent: () => NativeComponent<NativeProps>;
|
|
67
67
|
getMapManagerCommand: (name: string) => MapManagerCommand;
|
package/lib/MapHeatmap.js
CHANGED
|
@@ -41,7 +41,7 @@ class MapHeatmap extends React.Component {
|
|
|
41
41
|
}
|
|
42
42
|
render() {
|
|
43
43
|
const AIRMapHeatmap = this.getNativeComponent();
|
|
44
|
-
const propGradient = this.props
|
|
44
|
+
const propGradient = this.props?.gradient;
|
|
45
45
|
let gradient;
|
|
46
46
|
if (propGradient) {
|
|
47
47
|
const colors = propGradient.colors.map(c => (0, react_native_1.processColor)(c));
|
package/lib/MapMarker.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { Animated, ViewProps, ImageURISource, ImageRequireSource } from 'react-native';
|
|
3
3
|
import { MapManagerCommand, NativeComponent, ProviderContext, UIManagerCommand } from './decorateMapComponent';
|
|
4
4
|
import { MapMarkerNativeComponentType } from './MapMarkerNativeComponent';
|
|
5
|
+
import type { AppleMarkerPriority } from './specs/NativeComponentMarker';
|
|
5
6
|
import { CalloutPressEvent, LatLng, MarkerDeselectEvent, MarkerDragEvent, MarkerDragStartEndEvent, MarkerPressEvent, MarkerSelectEvent, Point } from './sharedTypes';
|
|
6
7
|
import { Modify } from './sharedTypesInternal';
|
|
7
8
|
type AppleMarkerVisibility = 'hidden' | 'adaptive' | 'visible';
|
|
@@ -42,7 +43,7 @@ export type MapMarkerProps = ViewProps & {
|
|
|
42
43
|
*
|
|
43
44
|
* @default {x: 0.0, y: 0.0}
|
|
44
45
|
* @platform iOS: Apple Maps only. For Google Maps, see the `calloutAnchor` prop
|
|
45
|
-
* @platform Android: Not supported.
|
|
46
|
+
* @platform Android: Not supported. see the `calloutAnchor` prop
|
|
46
47
|
*/
|
|
47
48
|
calloutOffset?: Point;
|
|
48
49
|
/**
|
|
@@ -54,7 +55,7 @@ export type MapMarkerProps = ViewProps & {
|
|
|
54
55
|
*
|
|
55
56
|
* @default {x: 0.0, y: 0.0}
|
|
56
57
|
* @platform iOS: Apple Maps only. For Google Maps, see the `anchor` prop
|
|
57
|
-
* @platform Android: Not supported.
|
|
58
|
+
* @platform Android: Not supported. see the `anchor` prop
|
|
58
59
|
*/
|
|
59
60
|
centerOffset?: Point;
|
|
60
61
|
/**
|
|
@@ -261,6 +262,17 @@ export type MapMarkerProps = ViewProps & {
|
|
|
261
262
|
* @platform Android: Supported
|
|
262
263
|
*/
|
|
263
264
|
zIndex?: number;
|
|
265
|
+
/**
|
|
266
|
+
Constants that indicates the display priority for annotations.
|
|
267
|
+
@default required
|
|
268
|
+
@platform iOS: Apple Maps only.
|
|
269
|
+
@platform Android: Not supported
|
|
270
|
+
|
|
271
|
+
Required: A constant indicating that the item is required.
|
|
272
|
+
High: A constant indicating that the item’s display priority is high.
|
|
273
|
+
Low: A constant indicating that the item’s display priority is Low.
|
|
274
|
+
*/
|
|
275
|
+
displayPriority?: AppleMarkerPriority;
|
|
264
276
|
/**
|
|
265
277
|
* Visibility of the title text rendered beneath Marker balloon
|
|
266
278
|
* @platform iOS: Apple Maps only
|
|
@@ -286,7 +298,7 @@ export type NativeProps = Modify<OmittedProps, {
|
|
|
286
298
|
icon?: string;
|
|
287
299
|
image?: MapMarkerProps['image'] | string;
|
|
288
300
|
}> & {
|
|
289
|
-
ref: React.RefObject<MapMarkerNativeComponentType>;
|
|
301
|
+
ref: React.RefObject<MapMarkerNativeComponentType | null>;
|
|
290
302
|
};
|
|
291
303
|
export declare class MapMarker extends React.Component<MapMarkerProps> {
|
|
292
304
|
context: React.ContextType<typeof ProviderContext>;
|
|
@@ -295,6 +307,7 @@ export declare class MapMarker extends React.Component<MapMarkerProps> {
|
|
|
295
307
|
getUIManagerCommand: (name: string) => UIManagerCommand;
|
|
296
308
|
static Animated: Animated.AnimatedComponent<typeof MapMarker>;
|
|
297
309
|
private marker;
|
|
310
|
+
private fabricMarker?;
|
|
298
311
|
constructor(props: MapMarkerProps);
|
|
299
312
|
setNativeProps(props: Partial<NativeProps>): void;
|
|
300
313
|
showCallout(): void;
|