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
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Commands = void 0;
|
|
7
|
+
const codegenNativeComponent_1 = __importDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));
|
|
8
|
+
const codegenNativeCommands_1 = __importDefault(require("react-native/Libraries/Utilities/codegenNativeCommands"));
|
|
9
|
+
exports.Commands = (0, codegenNativeCommands_1.default)({
|
|
10
|
+
supportedCommands: [
|
|
11
|
+
'animateToRegion',
|
|
12
|
+
'setCamera',
|
|
13
|
+
'animateCamera',
|
|
14
|
+
'fitToElements',
|
|
15
|
+
'fitToSuppliedMarkers',
|
|
16
|
+
'fitToCoordinates',
|
|
17
|
+
],
|
|
18
|
+
});
|
|
19
|
+
exports.default = (0, codegenNativeComponent_1.default)('RNMapsGoogleMapView', {
|
|
20
|
+
excludedPlatforms: ['android'],
|
|
21
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { HostComponent, ViewProps, ColorValue } from 'react-native';
|
|
2
|
+
import { Double, BubblingEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
export type LatLng = Readonly<{
|
|
4
|
+
latitude: Double;
|
|
5
|
+
longitude: Double;
|
|
6
|
+
}>;
|
|
7
|
+
export type PolygonPressEventHandler = BubblingEventHandler<Readonly<{
|
|
8
|
+
action?: string;
|
|
9
|
+
id: string;
|
|
10
|
+
coordinate: {
|
|
11
|
+
latitude: Double;
|
|
12
|
+
longitude: Double;
|
|
13
|
+
};
|
|
14
|
+
position?: {
|
|
15
|
+
x: Double;
|
|
16
|
+
y: Double;
|
|
17
|
+
};
|
|
18
|
+
}>>;
|
|
19
|
+
export interface PolygonFabricNativeProps extends ViewProps {
|
|
20
|
+
/**
|
|
21
|
+
* An array of coordinates to describe the polygon
|
|
22
|
+
*
|
|
23
|
+
* @platform iOS: Supported
|
|
24
|
+
* @platform Android: Supported
|
|
25
|
+
*/
|
|
26
|
+
coordinates: ReadonlyArray<LatLng>;
|
|
27
|
+
/**
|
|
28
|
+
* The fill color to use for the path.
|
|
29
|
+
*
|
|
30
|
+
* @default `#000`, `rgba(r,g,b,0.5)`
|
|
31
|
+
* @platform iOS: Supported
|
|
32
|
+
* @platform Android: Supported
|
|
33
|
+
*/
|
|
34
|
+
fillColor?: ColorValue;
|
|
35
|
+
/**
|
|
36
|
+
* The stroke color to use for the path.
|
|
37
|
+
*
|
|
38
|
+
* @default `#000`, `rgba(r,g,b,0.5)`
|
|
39
|
+
* @platform iOS: Supported
|
|
40
|
+
* @platform Android: Supported
|
|
41
|
+
*/
|
|
42
|
+
strokeColor?: ColorValue;
|
|
43
|
+
/**
|
|
44
|
+
* Boolean to indicate whether to draw each segment of the line as a geodesic as opposed to straight lines on the Mercator projection.
|
|
45
|
+
* A geodesic is the shortest path between two points on the Earth's surface.
|
|
46
|
+
* The geodesic curve is constructed assuming the Earth is a sphere.
|
|
47
|
+
*
|
|
48
|
+
* @platform iOS: Google Maps only
|
|
49
|
+
* @platform Android: Supported
|
|
50
|
+
*/
|
|
51
|
+
geodesic?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* A 2d array of coordinates to describe holes of the polygon where each hole has at least 3 points.
|
|
54
|
+
*
|
|
55
|
+
* @platform iOS: Supported
|
|
56
|
+
* @platform Android: Supported
|
|
57
|
+
*/
|
|
58
|
+
holes?: ReadonlyArray<ReadonlyArray<LatLng>>;
|
|
59
|
+
/**
|
|
60
|
+
* Boolean to allow a polygon to be tappable and use the onPress function.
|
|
61
|
+
*
|
|
62
|
+
* @platform iOS: Google Maps only
|
|
63
|
+
* @platform Android: Supported
|
|
64
|
+
*/
|
|
65
|
+
tappable?: boolean;
|
|
66
|
+
/**
|
|
67
|
+
* Callback that is called when user taps on the map.
|
|
68
|
+
*
|
|
69
|
+
* @platform iOS: Supported
|
|
70
|
+
* @platform Android: Supported
|
|
71
|
+
*/
|
|
72
|
+
onPress?: PolygonPressEventHandler;
|
|
73
|
+
}
|
|
74
|
+
declare const _default: HostComponent<PolygonFabricNativeProps>;
|
|
75
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const codegenNativeComponent_1 = __importDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));
|
|
7
|
+
exports.default = (0, codegenNativeComponent_1.default)('RNMapsGooglePolygon', {
|
|
8
|
+
excludedPlatforms: ['android'],
|
|
9
|
+
});
|
|
@@ -270,7 +270,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
270
270
|
* If `true` map will be cached and displayed as an image instead of being interactable, for performance usage.
|
|
271
271
|
*
|
|
272
272
|
* @default false
|
|
273
|
-
* @platform iOS: Apple
|
|
273
|
+
* @platform iOS: Apple Maps only
|
|
274
274
|
* @platform Android: Supported
|
|
275
275
|
*/
|
|
276
276
|
cacheEnabled?: boolean;
|
|
@@ -343,7 +343,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
343
343
|
*/
|
|
344
344
|
kmlSrc?: string;
|
|
345
345
|
/**
|
|
346
|
-
* If set, changes the position of the "Legal" label link in Apple
|
|
346
|
+
* If set, changes the position of the "Legal" label link in Apple Maps.
|
|
347
347
|
*
|
|
348
348
|
* @platform iOS: Apple Maps only
|
|
349
349
|
* @platform Android: Not supported
|
|
@@ -423,7 +423,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
423
423
|
* @platform Android: Supported
|
|
424
424
|
* @deprecated on Apple Maps, use `cameraZoomRange` instead
|
|
425
425
|
*/
|
|
426
|
-
|
|
426
|
+
maxZoom?: Float;
|
|
427
427
|
/**
|
|
428
428
|
* TODO: Add documentation
|
|
429
429
|
*
|
|
@@ -439,7 +439,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
439
439
|
* @platform Android: Supported
|
|
440
440
|
* @deprecated on Apple Maps, use `cameraZoomRange` instead
|
|
441
441
|
*/
|
|
442
|
-
|
|
442
|
+
minZoom?: Float;
|
|
443
443
|
/**
|
|
444
444
|
* If `false` the map won't move to the marker when pressed.
|
|
445
445
|
*
|
|
@@ -447,7 +447,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
447
447
|
* @platform iOS: Not supported
|
|
448
448
|
* @platform Android: Supported
|
|
449
449
|
*/
|
|
450
|
-
moveOnMarkerPress?: boolean
|
|
450
|
+
moveOnMarkerPress?: WithDefault<boolean, true>;
|
|
451
451
|
/**
|
|
452
452
|
* Callback that is called when a callout is tapped by the user.
|
|
453
453
|
*
|
|
@@ -560,6 +560,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
560
560
|
* @platform Android: Supported
|
|
561
561
|
*/
|
|
562
562
|
onPanDrag?: PanDragEventHandler;
|
|
563
|
+
handlePanDrag?: boolean;
|
|
563
564
|
/**
|
|
564
565
|
* Callback that is called when user click on a POI.
|
|
565
566
|
*
|
|
@@ -624,14 +625,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
624
625
|
* @platform iOS: Google Maps only
|
|
625
626
|
* @platform Android: Supported
|
|
626
627
|
*/
|
|
627
|
-
pitchEnabled?: boolean
|
|
628
|
-
/**
|
|
629
|
-
* The map framework to use.
|
|
630
|
-
* Either `"google"` for GoogleMaps, otherwise `undefined` to use the native map framework (`MapKit` in iOS and `GoogleMaps` in android).
|
|
631
|
-
*
|
|
632
|
-
* @platform iOS: Supported
|
|
633
|
-
* @platform Android: Supported
|
|
634
|
-
*/
|
|
628
|
+
pitchEnabled?: WithDefault<boolean, true>;
|
|
635
629
|
/**
|
|
636
630
|
* The region to be displayed by the map.
|
|
637
631
|
* The region is defined by the center coordinates and the span of coordinates to display.
|
|
@@ -647,7 +641,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
647
641
|
* @platform iOS: Google Maps only
|
|
648
642
|
* @platform Android: Supported
|
|
649
643
|
*/
|
|
650
|
-
rotateEnabled?: boolean
|
|
644
|
+
rotateEnabled?: WithDefault<boolean, true>;
|
|
651
645
|
/**
|
|
652
646
|
* If `false` the map will stay centered while rotating or zooming.
|
|
653
647
|
*
|
|
@@ -655,7 +649,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
655
649
|
* @platform iOS: Google Maps only
|
|
656
650
|
* @platform Android: Supported
|
|
657
651
|
*/
|
|
658
|
-
scrollDuringRotateOrZoomEnabled?: boolean
|
|
652
|
+
scrollDuringRotateOrZoomEnabled?: WithDefault<boolean, true>;
|
|
659
653
|
/**
|
|
660
654
|
* If `false` the user won't be able to change the map region being displayed.
|
|
661
655
|
*
|
|
@@ -663,7 +657,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
663
657
|
* @platform iOS: Supported
|
|
664
658
|
* @platform Android: Supported
|
|
665
659
|
*/
|
|
666
|
-
scrollEnabled?: boolean
|
|
660
|
+
scrollEnabled?: WithDefault<boolean, true>;
|
|
667
661
|
/**
|
|
668
662
|
* A Boolean indicating whether the map displays extruded building information.
|
|
669
663
|
*
|
|
@@ -671,7 +665,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
671
665
|
* @platform iOS: Not supported
|
|
672
666
|
* @platform Android: Supported
|
|
673
667
|
*/
|
|
674
|
-
showsBuildings?: boolean
|
|
668
|
+
showsBuildings?: WithDefault<boolean, true>;
|
|
675
669
|
/**
|
|
676
670
|
* If `false` compass won't be displayed on the map.
|
|
677
671
|
*
|
|
@@ -679,7 +673,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
679
673
|
* @platform iOS: Supported
|
|
680
674
|
* @platform Android: Supported
|
|
681
675
|
*/
|
|
682
|
-
showsCompass?: boolean
|
|
676
|
+
showsCompass?: WithDefault<boolean, true>;
|
|
683
677
|
/**
|
|
684
678
|
* A Boolean indicating whether indoor level picker should be enabled.
|
|
685
679
|
*
|
|
@@ -695,7 +689,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
695
689
|
* @platform iOS: Google Maps only
|
|
696
690
|
* @platform Android: Supported
|
|
697
691
|
*/
|
|
698
|
-
showsIndoors?: boolean
|
|
692
|
+
showsIndoors?: WithDefault<boolean, true>;
|
|
699
693
|
/**
|
|
700
694
|
* If `false` hide the button to move map to the current user's location.
|
|
701
695
|
*
|
|
@@ -703,33 +697,15 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
703
697
|
* @platform iOS: Google Maps only
|
|
704
698
|
* @platform Android: Supported
|
|
705
699
|
*/
|
|
706
|
-
showsMyLocationButton?: boolean
|
|
707
|
-
/**
|
|
708
|
-
* If `false` points of interest won't be displayed on the map.
|
|
709
|
-
* TODO: DEPRECATED? Doesn't seem to do anything
|
|
710
|
-
*
|
|
711
|
-
* @default true
|
|
712
|
-
* @platform iOS: Maybe Apple Maps?
|
|
713
|
-
* @platform Android: Not supported
|
|
714
|
-
*/
|
|
715
|
-
showsPointsOfInterest?: boolean;
|
|
700
|
+
showsMyLocationButton?: WithDefault<boolean, true>;
|
|
716
701
|
/**
|
|
717
702
|
* A Boolean indicating whether the map shows scale information.
|
|
718
703
|
*
|
|
719
|
-
* @default
|
|
704
|
+
* @default false
|
|
720
705
|
* @platform iOS: Apple Maps only
|
|
721
706
|
* @platform Android: Not supported
|
|
722
707
|
*/
|
|
723
708
|
showsScale?: boolean;
|
|
724
|
-
/**
|
|
725
|
-
* A Boolean value indicating whether the map displays traffic information.
|
|
726
|
-
* TODO: Look into android support
|
|
727
|
-
*
|
|
728
|
-
* @default false
|
|
729
|
-
* @platform iOS: Supported
|
|
730
|
-
* @platform Android: Not supported?
|
|
731
|
-
*/
|
|
732
|
-
showsTraffic?: boolean;
|
|
733
709
|
/**
|
|
734
710
|
* If `true` the users location will be displayed on the map.
|
|
735
711
|
*
|
|
@@ -755,7 +731,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
755
731
|
* @platform iOS: Not supported
|
|
756
732
|
* @platform Android: Supported
|
|
757
733
|
*/
|
|
758
|
-
toolbarEnabled?: boolean
|
|
734
|
+
toolbarEnabled?: WithDefault<boolean, true>;
|
|
759
735
|
/**
|
|
760
736
|
* Sets the map to the style selected.
|
|
761
737
|
*
|
|
@@ -791,7 +767,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
791
767
|
* @platform iOS: Not supported
|
|
792
768
|
* @platform Android: Supported
|
|
793
769
|
*/
|
|
794
|
-
userLocationFastestInterval?: Int32
|
|
770
|
+
userLocationFastestInterval?: WithDefault<Int32, 5000>;
|
|
795
771
|
/**
|
|
796
772
|
* Set power priority of user location tracking.
|
|
797
773
|
*
|
|
@@ -811,7 +787,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
811
787
|
* @platform iOS: Not supported
|
|
812
788
|
* @platform Android: Supported
|
|
813
789
|
*/
|
|
814
|
-
userLocationUpdateInterval?: Int32
|
|
790
|
+
userLocationUpdateInterval?: WithDefault<Int32, 5000>;
|
|
815
791
|
/**
|
|
816
792
|
* If `false` the zoom control at the bottom right of the map won't be visible.
|
|
817
793
|
*
|
|
@@ -819,7 +795,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
819
795
|
* @platform iOS: Not supported
|
|
820
796
|
* @platform Android: Supported
|
|
821
797
|
*/
|
|
822
|
-
zoomControlEnabled?: boolean
|
|
798
|
+
zoomControlEnabled?: WithDefault<boolean, true>;
|
|
823
799
|
/**
|
|
824
800
|
* If `false` the user won't be able to pinch/zoom the map.
|
|
825
801
|
*
|
|
@@ -829,7 +805,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
829
805
|
* @platform iOS: Supported
|
|
830
806
|
* @platform Android: Supported
|
|
831
807
|
*/
|
|
832
|
-
zoomEnabled?: boolean
|
|
808
|
+
zoomEnabled?: WithDefault<boolean, true>;
|
|
833
809
|
/**
|
|
834
810
|
* If `false` the user won't be able to double tap to zoom the map.
|
|
835
811
|
* **Note:** But it will greatly decrease delay of tap gesture recognition.
|
|
@@ -838,7 +814,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
838
814
|
* @platform iOS: Google Maps only
|
|
839
815
|
* @platform Android: Not supported
|
|
840
816
|
*/
|
|
841
|
-
zoomTapEnabled?: boolean
|
|
817
|
+
zoomTapEnabled?: WithDefault<boolean, true>;
|
|
842
818
|
/**
|
|
843
819
|
* Map camera distance limits. `minCenterCoordinateDistance` for minimum distance, `maxCenterCoordinateDistance` for maximum.
|
|
844
820
|
* `animated` for animated zoom changes.
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { HostComponent } from 'react-native';
|
|
3
|
+
import type { ViewProps, ColorValue, ImageSourcePropType as ImageSource } from 'react-native';
|
|
4
|
+
import { Int32, Double, BubblingEventHandler, DirectEventHandler, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
5
|
+
export type LatLng = Readonly<{
|
|
6
|
+
latitude: Double;
|
|
7
|
+
longitude: Double;
|
|
8
|
+
}>;
|
|
9
|
+
export type MarkerPressEventHandler = BubblingEventHandler<Readonly<{
|
|
10
|
+
action: string;
|
|
11
|
+
id?: string;
|
|
12
|
+
coordinate?: {
|
|
13
|
+
latitude: Double;
|
|
14
|
+
longitude: Double;
|
|
15
|
+
};
|
|
16
|
+
position?: {
|
|
17
|
+
x: Double;
|
|
18
|
+
y: Double;
|
|
19
|
+
};
|
|
20
|
+
}>>;
|
|
21
|
+
export type MarkerDragEventHandler = DirectEventHandler<Readonly<{
|
|
22
|
+
id?: string;
|
|
23
|
+
coordinate?: {
|
|
24
|
+
latitude: Double;
|
|
25
|
+
longitude: Double;
|
|
26
|
+
};
|
|
27
|
+
}>>;
|
|
28
|
+
export type CalloutPressEventHandler = BubblingEventHandler<Readonly<{
|
|
29
|
+
action: string;
|
|
30
|
+
id?: string;
|
|
31
|
+
frame?: {
|
|
32
|
+
x: Double;
|
|
33
|
+
y: Double;
|
|
34
|
+
width: Double;
|
|
35
|
+
height: Double;
|
|
36
|
+
};
|
|
37
|
+
point?: {
|
|
38
|
+
x: Double;
|
|
39
|
+
y: Double;
|
|
40
|
+
};
|
|
41
|
+
}>>;
|
|
42
|
+
type AppleMarkerVisibility = 'hidden' | 'adaptive' | 'visible';
|
|
43
|
+
export type AppleMarkerPriority = 'required' | 'high' | 'low';
|
|
44
|
+
export type Point = Readonly<{
|
|
45
|
+
x: Double;
|
|
46
|
+
y: Double;
|
|
47
|
+
}>;
|
|
48
|
+
export interface MarkerFabricNativeProps extends ViewProps {
|
|
49
|
+
/**
|
|
50
|
+
* Sets the anchor point for the marker.
|
|
51
|
+
* The anchor specifies the point in the icon image that is anchored to the marker's position on the Earth's surface.
|
|
52
|
+
*
|
|
53
|
+
* The anchor point is specified in the continuous space [0.0, 1.0] x [0.0, 1.0],
|
|
54
|
+
* where (0, 0) is the top-left corner of the image, and (1, 1) is the bottom-right corner.
|
|
55
|
+
*
|
|
56
|
+
* The anchoring point in a W x H image is the nearest discrete grid point in a (W + 1) x (H + 1) grid, obtained by scaling the then rounding.
|
|
57
|
+
* For example, in a 4 x 2 image, the anchor point (0.7, 0.6) resolves to the grid point at (3, 1).
|
|
58
|
+
*
|
|
59
|
+
* @default {x: 0.5, y: 1.0}
|
|
60
|
+
* @platform iOS: Google Maps only. For Apple Maps, see the `centerOffset` prop
|
|
61
|
+
* @platform Android: Supported
|
|
62
|
+
*/
|
|
63
|
+
anchor?: Point;
|
|
64
|
+
/**
|
|
65
|
+
* Specifies the point in the marker image at which to anchor the callout when it is displayed.
|
|
66
|
+
* This is specified in the same coordinate system as the anchor.
|
|
67
|
+
*
|
|
68
|
+
* See the `anchor` prop for more details.
|
|
69
|
+
*
|
|
70
|
+
* @default {x: 0.5, y: 0.0}
|
|
71
|
+
* @platform iOS: Google Maps only. For Apple Maps, see the `calloutOffset` prop
|
|
72
|
+
* @platform Android: Supported
|
|
73
|
+
*/
|
|
74
|
+
calloutAnchor?: Point;
|
|
75
|
+
/**
|
|
76
|
+
* A custom image to be used as the marker's icon. Only local image resources are allowed to be used.
|
|
77
|
+
*
|
|
78
|
+
* @platform iOS: Supported
|
|
79
|
+
* @platform Android: Supported
|
|
80
|
+
*/
|
|
81
|
+
image?: ImageSource | null;
|
|
82
|
+
/**
|
|
83
|
+
* The offset (in points) at which to place the callout bubble.
|
|
84
|
+
* When this property is set to (0, 0),
|
|
85
|
+
* the anchor point of the callout bubble is placed on the top-center point of the marker view’s frame.
|
|
86
|
+
*
|
|
87
|
+
* Specifying positive offset values moves the callout bubble down and to the right,
|
|
88
|
+
* while specifying negative values moves it up and to the left
|
|
89
|
+
*
|
|
90
|
+
* @default {x: 0.0, y: 0.0}
|
|
91
|
+
* @platform iOS: Apple Maps only. For Google Maps, see the `calloutAnchor` prop
|
|
92
|
+
* @platform Android: Not supported. See the `calloutAnchor` prop
|
|
93
|
+
*/
|
|
94
|
+
calloutOffset?: Point;
|
|
95
|
+
/**
|
|
96
|
+
Constants that indicates the display priority for annotations.
|
|
97
|
+
@default required
|
|
98
|
+
@platform iOS: Apple Maps only.
|
|
99
|
+
@platform Android: Not supported
|
|
100
|
+
|
|
101
|
+
Required: A constant indicating that the item is required.
|
|
102
|
+
High: A constant indicating that the item’s display priority is high.
|
|
103
|
+
Low: A constant indicating that the item’s display priority is Low.
|
|
104
|
+
*/
|
|
105
|
+
displayPriority?: WithDefault<AppleMarkerPriority, 'required'>;
|
|
106
|
+
/**
|
|
107
|
+
* The coordinate for the marker.
|
|
108
|
+
*
|
|
109
|
+
* @platform iOS: Supported
|
|
110
|
+
* @platform Android: Supported
|
|
111
|
+
*/
|
|
112
|
+
coordinate: LatLng;
|
|
113
|
+
/**
|
|
114
|
+
* The description of the marker.
|
|
115
|
+
*
|
|
116
|
+
* This is only used if the <Marker /> component has no children that are a `<Callout />`,
|
|
117
|
+
* in which case the default callout behavior will be used,
|
|
118
|
+
* which will show both the `title` and the `description`, if provided.
|
|
119
|
+
*
|
|
120
|
+
* @platform iOS: Supported
|
|
121
|
+
* @platform Android: Supported
|
|
122
|
+
*/
|
|
123
|
+
description?: string;
|
|
124
|
+
/**
|
|
125
|
+
* if `true` allows the marker to be draggable (re-positioned).
|
|
126
|
+
*
|
|
127
|
+
* @default false
|
|
128
|
+
* @platform iOS: Supported
|
|
129
|
+
* @platform Android: Supported
|
|
130
|
+
*/
|
|
131
|
+
draggable?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* The title of the marker.
|
|
134
|
+
* This is only used if the <Marker /> component has no `<Callout />` children.
|
|
135
|
+
*
|
|
136
|
+
* If the marker has <Callout /> children, default callout behavior will be used,
|
|
137
|
+
* which will show both the `title` and the `description`, if provided.
|
|
138
|
+
*
|
|
139
|
+
* @platform iOS: Supported
|
|
140
|
+
* @platform Android: Supported
|
|
141
|
+
*/
|
|
142
|
+
title?: string;
|
|
143
|
+
/**
|
|
144
|
+
* A string that can be used to identify this marker.
|
|
145
|
+
*
|
|
146
|
+
* @platform iOS: Supported
|
|
147
|
+
* @platform Android: Supported
|
|
148
|
+
*/
|
|
149
|
+
identifier?: string;
|
|
150
|
+
/**
|
|
151
|
+
* When true, the marker will be pre-selected.
|
|
152
|
+
* Setting this to true allows the user to drag the marker without needing to tap on it first to focus it.
|
|
153
|
+
*
|
|
154
|
+
* @default false
|
|
155
|
+
* @platform iOS: Apple Maps only
|
|
156
|
+
* @platform Android: Not supported
|
|
157
|
+
*/
|
|
158
|
+
isPreselected?: boolean;
|
|
159
|
+
/**
|
|
160
|
+
* Callback that is called when the user taps the callout view.
|
|
161
|
+
*
|
|
162
|
+
* @platform iOS: Apple Maps only
|
|
163
|
+
* @platform Android: Supported
|
|
164
|
+
*/
|
|
165
|
+
onCalloutPress?: CalloutPressEventHandler;
|
|
166
|
+
/**
|
|
167
|
+
* Callback that is called when the marker is deselected, before the callout is hidden.
|
|
168
|
+
*
|
|
169
|
+
* @platform iOS: Apple Maps only
|
|
170
|
+
* @platform Android: Not supported
|
|
171
|
+
*/
|
|
172
|
+
onDeselect?: MarkerPressEventHandler;
|
|
173
|
+
/**
|
|
174
|
+
* Callback called continuously as the marker is dragged
|
|
175
|
+
*
|
|
176
|
+
* @platform iOS: Apple Maps only
|
|
177
|
+
* @platform Android: Supported
|
|
178
|
+
*/
|
|
179
|
+
onDrag?: MarkerDragEventHandler;
|
|
180
|
+
/**
|
|
181
|
+
* Callback that is called when a drag on the marker finishes.
|
|
182
|
+
* This is usually the point you will want to setState on the marker's coordinate again
|
|
183
|
+
*
|
|
184
|
+
* @platform iOS: Apple Maps only
|
|
185
|
+
* @platform Android: Supported
|
|
186
|
+
*/
|
|
187
|
+
onDragEnd?: MarkerDragEventHandler;
|
|
188
|
+
/**
|
|
189
|
+
* Callback that is called when the user initiates a drag on the marker (if it is draggable)
|
|
190
|
+
*
|
|
191
|
+
* @platform iOS: Apple Maps only
|
|
192
|
+
* @platform Android: Supported
|
|
193
|
+
*/
|
|
194
|
+
onDragStart?: MarkerDragEventHandler;
|
|
195
|
+
/**
|
|
196
|
+
* Callback that is called when the marker is tapped by the user.
|
|
197
|
+
*
|
|
198
|
+
* @platform iOS: Supported
|
|
199
|
+
* @platform Android: Supported
|
|
200
|
+
*/
|
|
201
|
+
onPress?: MarkerPressEventHandler;
|
|
202
|
+
/**
|
|
203
|
+
* Callback that is called when the marker becomes selected.
|
|
204
|
+
* This will be called when the callout for that marker is about to be shown.
|
|
205
|
+
*
|
|
206
|
+
* @platform iOS: Supported.
|
|
207
|
+
* @platform Android: Supported
|
|
208
|
+
*/
|
|
209
|
+
onSelect?: MarkerPressEventHandler;
|
|
210
|
+
/**
|
|
211
|
+
* The marker's opacity between 0.0 and 1.0.
|
|
212
|
+
*
|
|
213
|
+
* @default 1.0
|
|
214
|
+
* @platform iOS: Supported
|
|
215
|
+
* @platform Android: Supported
|
|
216
|
+
*/
|
|
217
|
+
opacity?: WithDefault<Double, 1.0>;
|
|
218
|
+
/**
|
|
219
|
+
* If no custom marker view or custom image is provided, the platform default pin will be used, which can be customized by this color.
|
|
220
|
+
* Ignored if a custom marker is being used.<br/><br/>
|
|
221
|
+
* For Android, the set of available colors is limited. Unsupported colors will fall back to red.
|
|
222
|
+
* See [#887](https://github.com/react-community/react-native-maps/issues/887) for more information.
|
|
223
|
+
*
|
|
224
|
+
* @platform iOS: Supported
|
|
225
|
+
* @platform Android: Supported
|
|
226
|
+
*/
|
|
227
|
+
pinColor?: ColorValue;
|
|
228
|
+
/**
|
|
229
|
+
* Visibility of the title text rendered beneath Marker balloon
|
|
230
|
+
* @platform iOS: Apple Maps only
|
|
231
|
+
* @platform Android: Not supported
|
|
232
|
+
*/
|
|
233
|
+
titleVisibility?: WithDefault<AppleMarkerVisibility, 'visible'>;
|
|
234
|
+
/**
|
|
235
|
+
* Visibility of the subtitle text rendered beneath Marker balloon
|
|
236
|
+
* @platform iOS: Apple Maps only
|
|
237
|
+
* @platform Android: Not supported
|
|
238
|
+
*/
|
|
239
|
+
subtitleVisibility?: WithDefault<AppleMarkerVisibility, 'adaptive'>;
|
|
240
|
+
/**
|
|
241
|
+
* Indicate type of default markers if it's true MKPinAnnotationView will be used and MKMarkerAnnotationView if it's false
|
|
242
|
+
* It doesn't change anything if you are using custom Markers
|
|
243
|
+
* @platform iOS: Apple Maps only
|
|
244
|
+
* @platform Android: Not supported
|
|
245
|
+
*/
|
|
246
|
+
useLegacyPinView?: boolean;
|
|
247
|
+
}
|
|
248
|
+
export interface NativeCommands {
|
|
249
|
+
animateToCoordinates: (viewRef: React.ElementRef<React.ComponentType>, latitude: Double, longitude: Double, duration: Int32) => void;
|
|
250
|
+
setCoordinates: (viewRef: React.ElementRef<React.ComponentType>, latitude: Double, longitude: Double) => void;
|
|
251
|
+
showCallout: (viewRef: React.ElementRef<React.ComponentType>) => void;
|
|
252
|
+
hideCallout: (viewRef: React.ElementRef<React.ComponentType>) => void;
|
|
253
|
+
redrawCallout: (viewRef: React.ElementRef<React.ComponentType>) => void;
|
|
254
|
+
redraw: (viewRef: React.ElementRef<React.ComponentType>) => void;
|
|
255
|
+
}
|
|
256
|
+
export declare const Commands: NativeCommands;
|
|
257
|
+
declare const _default: HostComponent<MarkerFabricNativeProps>;
|
|
258
|
+
export default _default;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Commands = void 0;
|
|
7
|
+
const codegenNativeComponent_1 = __importDefault(require("react-native/Libraries/Utilities/codegenNativeComponent"));
|
|
8
|
+
const codegenNativeCommands_1 = __importDefault(require("react-native/Libraries/Utilities/codegenNativeCommands"));
|
|
9
|
+
exports.Commands = (0, codegenNativeCommands_1.default)({
|
|
10
|
+
supportedCommands: [
|
|
11
|
+
'setCoordinates',
|
|
12
|
+
'animateToCoordinates',
|
|
13
|
+
'showCallout',
|
|
14
|
+
'hideCallout',
|
|
15
|
+
'redrawCallout',
|
|
16
|
+
'redraw',
|
|
17
|
+
],
|
|
18
|
+
});
|
|
19
|
+
exports.default = (0, codegenNativeComponent_1.default)('RNMapsMarker', {
|
|
20
|
+
excludedPlatforms: ['android'],
|
|
21
|
+
});
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"main": "lib/index.js",
|
|
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.41",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"scripts": {
|
|
11
11
|
"lint": "eslint . --max-warnings 0",
|
|
@@ -64,12 +64,12 @@
|
|
|
64
64
|
"@babel/core": "^7.25.2",
|
|
65
65
|
"@babel/preset-env": "^7.25.3",
|
|
66
66
|
"@babel/runtime": "^7.25.0",
|
|
67
|
-
"react-native": "^0.76.
|
|
67
|
+
"react-native": "^0.76.5",
|
|
68
68
|
"react": "^18.3.1",
|
|
69
|
-
"@react-native/babel-preset": "0.76.
|
|
70
|
-
"@react-native/eslint-config": "0.76.
|
|
71
|
-
"@react-native/metro-config": "0.76.
|
|
72
|
-
"@react-native/typescript-config": "0.76.
|
|
69
|
+
"@react-native/babel-preset": "0.76.5",
|
|
70
|
+
"@react-native/eslint-config": "0.76.5",
|
|
71
|
+
"@react-native/metro-config": "0.76.5",
|
|
72
|
+
"@react-native/typescript-config": "0.76.5",
|
|
73
73
|
"@types/react": "^18.2.6",
|
|
74
74
|
"@types/react-test-renderer": "^18.0.0",
|
|
75
75
|
"babel-jest": "^29.6.3",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"codegenConfig": {
|
|
94
94
|
"name": "RNMapsSpecs",
|
|
95
95
|
"type": "all",
|
|
96
|
-
"jsSrcsDir": "./
|
|
96
|
+
"jsSrcsDir": "./lib/specs",
|
|
97
97
|
"android": {
|
|
98
98
|
"javaPackageName": "com.rnmaps.fabric"
|
|
99
99
|
}
|
|
@@ -9,7 +9,7 @@ Pod::Spec.new do |s|
|
|
|
9
9
|
s.authors = package["author"]
|
|
10
10
|
s.homepage = package["homepage"]
|
|
11
11
|
s.license = package["license"]
|
|
12
|
-
s.platform = :ios, "
|
|
12
|
+
s.platform = :ios, "12.0"
|
|
13
13
|
|
|
14
14
|
s.source = { :git => "https://github.com/react-native-maps/react-native-maps.git", :tag=> "v#{s.version}" }
|
|
15
15
|
s.source_files = "ios/AirMaps/**/*.{h,m,mm,swift}"
|