react-native-maps 1.21.0-alpha.99 → 1.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -4
- package/android/build.gradle +65 -72
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/src/main/RCTAppDependencyProvider.h +25 -0
- package/android/src/main/RCTAppDependencyProvider.mm +55 -0
- package/android/src/main/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/android/src/main/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/android/src/main/RCTThirdPartyComponentsProvider.h +16 -0
- package/android/src/main/RCTThirdPartyComponentsProvider.mm +28 -0
- package/android/src/main/ReactAppDependencyProvider.podspec +34 -0
- package/android/src/main/java/com/facebook/fbreact/specs/NativeAirMapsModuleSpec.java +63 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsCalloutManagerDelegate.java +35 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsCalloutManagerInterface.java +17 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsCircleManagerDelegate.java +49 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsCircleManagerInterface.java +23 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsGooglePolygonManagerDelegate.java +49 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsGooglePolygonManagerInterface.java +23 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerDelegate.java +209 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerInterface.java +74 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsMarkerManagerDelegate.java +104 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsMarkerManagerInterface.java +39 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsOverlayManagerDelegate.java +45 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsOverlayManagerInterface.java +22 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsPolylineManagerDelegate.java +58 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsPolylineManagerInterface.java +26 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsUrlTileManagerDelegate.java +62 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsUrlTileManagerInterface.java +27 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsWMSTileManagerDelegate.java +56 -0
- package/android/src/main/java/com/facebook/react/viewmanagers/RNMapsWMSTileManagerInterface.java +25 -0
- package/android/src/main/java/com/rnmaps/fabric/MapViewManager.java +5 -1
- package/android/src/main/java/com/rnmaps/fabric/NativeAirMapsModule.java +1 -1
- package/android/src/main/java/com/rnmaps/fabric/OverlayManager.java +9 -3
- package/android/src/main/java/com/rnmaps/fabric/UrlTileManager.java +124 -0
- package/android/src/main/java/com/rnmaps/fabric/WMSTileManager.java +114 -0
- package/android/src/main/java/com/rnmaps/maps/MapAirModulePackage.java +19 -3
- package/android/src/main/java/com/rnmaps/maps/MapMarker.java +608 -603
- package/android/src/main/java/com/rnmaps/maps/MapMarkerManager.java +3 -3
- package/android/src/main/java/com/rnmaps/maps/MapOverlay.java +2 -22
- package/android/src/main/java/com/rnmaps/maps/MapOverlayManager.java +23 -1
- package/android/src/main/java/com/rnmaps/maps/MapUrlTile.java +18 -18
- package/android/src/main/java/com/rnmaps/maps/MapUrlTileManager.java +10 -14
- package/android/src/main/java/com/rnmaps/maps/MapView.java +58 -49
- package/android/src/main/java/com/rnmaps/maps/MapWMSTile.java +3 -3
- package/android/src/main/java/com/rnmaps/maps/MapWMSTileManager.java +10 -10
- package/android/src/main/jni/CMakeLists.txt +36 -0
- package/android/src/main/jni/RNMapsSpecs-generated.cpp +68 -0
- package/android/src/main/jni/RNMapsSpecs.h +31 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.cpp +31 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.h +33 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/EventEmitters.cpp +979 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/EventEmitters.h +860 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/Props.cpp +227 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/Props.h +1297 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/RNMapsSpecsJSI-generated.cpp +74 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/RNMapsSpecsJSI.h +268 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.cpp +26 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.h +131 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/States.cpp +16 -0
- package/android/src/main/jni/react/renderer/components/RNMapsSpecs/States.h +137 -0
- package/app.plugin.js +1 -0
- package/ios/AirGoogleMaps/AIRGoogleMap.h +13 -13
- package/ios/AirGoogleMaps/{AIRGoogleMap.m → AIRGoogleMap.mm} +32 -34
- package/ios/AirGoogleMaps/AIRGoogleMapManager.h +1 -0
- package/ios/AirGoogleMaps/AIRGoogleMapManager.mm +543 -0
- package/ios/AirGoogleMaps/AIRGoogleMapMarker.m +3 -3
- package/ios/AirGoogleMaps/AIRGoogleMapMarkerManager.m +1 -1
- package/ios/AirGoogleMaps/AIRGoogleMapUrlTile.m +2 -2
- package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.m +2 -2
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.h +5 -2
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +41 -33
- package/ios/AirGoogleMaps/RNMapsGoogleMapViewManager.mm +16 -1
- package/ios/AirGoogleMaps/RNMapsGooglePolygonView.mm +23 -14
- package/ios/AirGoogleMaps/RNMapsGooglePolygonViewManager.mm +1 -0
- package/ios/AirMaps/AIRMap.h +8 -9
- package/ios/AirMaps/{AIRMap.m → AIRMap.mm} +18 -14
- package/ios/AirMaps/AIRMapManager.m +8 -19
- package/ios/AirMaps/AIRMapMarker.m +57 -44
- package/ios/AirMaps/AIRMapOverlay.m +2 -2
- package/ios/AirMaps/AIRMapWMSTile.m +8 -8
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMapView.h +25 -0
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderGoogleMapView.mm +77 -0
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderPolygonView.h +25 -0
- package/ios/AirMaps/FabricPlaceholders/PlaceHolderPolygonView.mm +51 -0
- package/ios/AirMaps/RNMapsAirModule.h +2 -3
- package/ios/AirMaps/RNMapsAirModule.mm +14 -0
- package/ios/AirMaps/RNMapsDefines.h +1 -0
- package/ios/AirMaps/RNMapsMapView.h +5 -2
- package/ios/AirMaps/RNMapsMapView.mm +16 -6
- package/ios/AirMaps/RNMapsMapViewManager.mm +19 -1
- package/ios/AirMaps/RNMapsMarkerView.mm +12 -4
- package/ios/AirMaps/RNMapsMarkerViewManager.mm +7 -0
- package/ios/AirMaps/module.modulemap +6 -0
- package/ios/AirMaps.xcodeproj/project.pbxproj +15 -55
- package/ios/generated/RCTAppDependencyProvider.h +25 -0
- package/ios/generated/RCTAppDependencyProvider.mm +55 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/ios/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/ios/generated/RCTThirdPartyComponentsProvider.mm +26 -0
- package/ios/{AirMaps → generated}/RNMapsAirModuleDelegate.h +1 -1
- package/ios/generated/RNMapsSpecs/ComponentDescriptors.cpp +29 -0
- package/ios/generated/RNMapsSpecs/ComponentDescriptors.h +31 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.cpp +977 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.h +846 -0
- package/ios/generated/RNMapsSpecs/Props.cpp +194 -0
- package/ios/generated/RNMapsSpecs/Props.h +1224 -0
- package/ios/generated/RNMapsSpecs/RCTComponentViewHelpers.h +591 -0
- package/ios/generated/RNMapsSpecs/RNMapsSpecs-generated.mm +92 -0
- package/ios/generated/RNMapsSpecs/RNMapsSpecs.h +137 -0
- package/ios/generated/RNMapsSpecs/ShadowNodes.cpp +24 -0
- package/ios/generated/RNMapsSpecs/ShadowNodes.h +109 -0
- package/ios/generated/RNMapsSpecs/States.cpp +16 -0
- package/ios/generated/RNMapsSpecs/States.h +113 -0
- package/ios/generated/RNMapsSpecsJSI-generated.cpp +74 -0
- package/ios/generated/RNMapsSpecsJSI.h +268 -0
- package/ios/generated/ReactAppDependencyProvider.podspec +34 -0
- package/ios/generated/module.modulemap +15 -0
- package/package.json +34 -27
- package/plugin/build/android.js +58 -0
- package/plugin/build/index.js +10 -0
- package/plugin/build/ios.js +172 -0
- package/react-native-google-maps.podspec +27 -0
- package/react-native-maps-generated.podspec +31 -0
- package/react-native-maps.podspec +52 -46
- package/react-native.config.js +16 -0
- package/src/AnimatedRegion.ts +169 -0
- package/src/Geojson.tsx +541 -0
- package/src/MapCallout.tsx +77 -0
- package/src/MapCalloutSubview.tsx +64 -0
- package/src/MapCircle.tsx +162 -0
- package/src/MapHeatmap.tsx +125 -0
- package/src/MapLocalTile.tsx +60 -0
- package/src/MapMarker.tsx +531 -0
- package/src/MapMarkerNativeComponent.ts +51 -0
- package/src/MapOverlay.tsx +178 -0
- package/src/MapPolygon.tsx +188 -0
- package/src/MapPolygon.types.ts +25 -0
- package/src/MapPolyline.tsx +215 -0
- package/src/MapUrlTile.tsx +169 -0
- package/src/MapView.tsx +1230 -0
- package/src/MapView.types.ts +212 -0
- package/src/MapView.web.ts +2 -0
- package/src/MapViewNativeComponent.ts +86 -0
- package/src/MapWMSTile.tsx +148 -0
- package/src/ProviderConstants.ts +2 -0
- package/src/createFabricMap.tsx +253 -0
- package/src/decorateMapComponent.ts +229 -0
- package/src/fixImageProp.ts +17 -0
- package/src/index.ts +52 -0
- package/src/sharedTypes.ts +101 -0
- package/{specs → src/specs}/NativeComponentCircle.ts +3 -4
- package/{specs → src/specs}/NativeComponentGoogleMapView.ts +15 -9
- package/{specs → src/specs}/NativeComponentMapView.ts +61 -32
- package/{specs → src/specs}/NativeComponentOverlay.ts +11 -2
- package/{specs → src/specs}/NativeComponentPolyline.ts +1 -1
- package/src/specs/NativeComponentUrlTile.ts +128 -0
- package/src/specs/NativeComponentWMSTile.ts +107 -0
- package/ios/AirGoogleMaps/AIRGoogleMapManager.m +0 -533
- package/lib/AnimatedRegion.d.ts +0 -19
- package/lib/AnimatedRegion.js +0 -134
- package/lib/Geojson.d.ts +0 -204
- package/lib/Geojson.js +0 -166
- package/lib/MapCallout.d.ts +0 -40
- package/lib/MapCallout.js +0 -51
- package/lib/MapCalloutSubview.d.ts +0 -34
- package/lib/MapCalloutSubview.js +0 -48
- package/lib/MapCircle.d.ts +0 -117
- package/lib/MapCircle.js +0 -53
- package/lib/MapHeatmap.d.ts +0 -78
- package/lib/MapHeatmap.js +0 -59
- package/lib/MapLocalTile.d.ts +0 -35
- package/lib/MapLocalTile.js +0 -44
- package/lib/MapMarker.d.ts +0 -322
- package/lib/MapMarker.js +0 -158
- package/lib/MapMarkerNativeComponent.d.ts +0 -15
- package/lib/MapMarkerNativeComponent.js +0 -15
- package/lib/MapOverlay.d.ts +0 -88
- package/lib/MapOverlay.js +0 -65
- package/lib/MapPolygon.d.ts +0 -140
- package/lib/MapPolygon.js +0 -53
- package/lib/MapPolygon.types.d.ts +0 -18
- package/lib/MapPolyline.d.ts +0 -156
- package/lib/MapPolyline.js +0 -53
- package/lib/MapUrlTile.d.ts +0 -134
- package/lib/MapUrlTile.js +0 -44
- package/lib/MapView.d.ts +0 -703
- package/lib/MapView.js +0 -427
- package/lib/MapView.types.d.ts +0 -161
- package/lib/MapView.types.js +0 -2
- package/lib/MapView.web.d.ts +0 -1
- package/lib/MapView.web.js +0 -9
- package/lib/MapViewNativeComponent.d.ts +0 -18
- package/lib/MapViewNativeComponent.js +0 -19
- package/lib/MapWMSTile.d.ts +0 -116
- package/lib/MapWMSTile.js +0 -44
- package/lib/ProviderConstants.d.ts +0 -2
- package/lib/ProviderConstants.js +0 -5
- package/lib/createFabricMap.d.ts +0 -24
- package/lib/createFabricMap.js +0 -188
- package/lib/decorateMapComponent.d.ts +0 -36
- package/lib/decorateMapComponent.js +0 -120
- package/lib/fixImageProp.d.ts +0 -4
- package/lib/fixImageProp.js +0 -16
- package/lib/index.d.ts +0 -38
- package/lib/index.js +0 -81
- package/lib/sharedTypes.d.ts +0 -81
- package/lib/sharedTypes.js +0 -2
- package/lib/sharedTypesInternal.js +0 -2
- package/lib/specs/NativeAirMapsModule.d.ts +0 -31
- package/lib/specs/NativeAirMapsModule.js +0 -4
- package/lib/specs/NativeComponentCallout.d.ts +0 -46
- package/lib/specs/NativeComponentCallout.js +0 -9
- package/lib/specs/NativeComponentCircle.d.ts +0 -74
- package/lib/specs/NativeComponentCircle.js +0 -7
- package/lib/specs/NativeComponentGoogleMapView.d.ts +0 -713
- package/lib/specs/NativeComponentGoogleMapView.js +0 -22
- package/lib/specs/NativeComponentGooglePolygon.d.ts +0 -75
- package/lib/specs/NativeComponentGooglePolygon.js +0 -7
- package/lib/specs/NativeComponentMapView.d.ts +0 -847
- package/lib/specs/NativeComponentMapView.js +0 -20
- package/lib/specs/NativeComponentMarker.d.ts +0 -258
- package/lib/specs/NativeComponentMarker.js +0 -19
- package/lib/specs/NativeComponentOverlay.d.ts +0 -67
- package/lib/specs/NativeComponentOverlay.js +0 -7
- package/lib/specs/NativeComponentPolyline.d.ts +0 -101
- package/lib/specs/NativeComponentPolyline.js +0 -7
- /package/ios/AirMaps/{UIView +AirMap.m → UIView+AirMap.m} +0 -0
- /package/ios/{AirMaps → generated}/RNMapsHostVewDelegate.h +0 -0
- /package/{lib/MapPolygon.types.js → plugin/build/types.js} +0 -0
- /package/{lib/sharedTypesInternal.d.ts → src/sharedTypesInternal.ts} +0 -0
- /package/{specs → src/specs}/NativeAirMapsModule.ts +0 -0
- /package/{specs → src/specs}/NativeComponentCallout.ts +0 -0
- /package/{specs → src/specs}/NativeComponentGooglePolygon.ts +0 -0
- /package/{specs → src/specs}/NativeComponentMarker.ts +0 -0
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import {createContext} from 'react';
|
|
2
|
+
import {
|
|
3
|
+
requireNativeComponent,
|
|
4
|
+
NativeModules,
|
|
5
|
+
Platform,
|
|
6
|
+
UIManager,
|
|
7
|
+
HostComponent,
|
|
8
|
+
} from 'react-native';
|
|
9
|
+
import {PROVIDER_DEFAULT, PROVIDER_GOOGLE} from './ProviderConstants';
|
|
10
|
+
import {Provider} from './sharedTypes';
|
|
11
|
+
import {MapCallout} from './MapCallout';
|
|
12
|
+
import {MapOverlay} from './MapOverlay';
|
|
13
|
+
import {MapCalloutSubview} from './MapCalloutSubview';
|
|
14
|
+
import {MapCircle} from './MapCircle';
|
|
15
|
+
import {MapHeatmap} from './MapHeatmap';
|
|
16
|
+
import {MapLocalTile} from './MapLocalTile';
|
|
17
|
+
import {MapMarker} from './MapMarker';
|
|
18
|
+
import {MapPolygon} from './MapPolygon';
|
|
19
|
+
import {MapPolyline} from './MapPolyline';
|
|
20
|
+
import {MapUrlTile} from './MapUrlTile';
|
|
21
|
+
import {MapWMSTile} from './MapWMSTile';
|
|
22
|
+
import {Commands} from './MapViewNativeComponent';
|
|
23
|
+
import GooglePolygon from './specs/NativeComponentGooglePolygon';
|
|
24
|
+
import FabricMarker from './specs/NativeComponentMarker';
|
|
25
|
+
import FabricUrlTile from './specs/NativeComponentUrlTile';
|
|
26
|
+
import FabricWMSTile from './specs/NativeComponentWMSTile.ts';
|
|
27
|
+
import FabricCallout from './specs/NativeComponentCallout';
|
|
28
|
+
import FabricPolyline from './specs/NativeComponentPolyline';
|
|
29
|
+
import FabricCircle from './specs/NativeComponentCircle';
|
|
30
|
+
import FabricOverlay from './specs/NativeComponentOverlay';
|
|
31
|
+
|
|
32
|
+
export const SUPPORTED: ImplementationStatus = 'SUPPORTED';
|
|
33
|
+
export const USES_DEFAULT_IMPLEMENTATION: ImplementationStatus =
|
|
34
|
+
'USES_DEFAULT_IMPLEMENTATION';
|
|
35
|
+
export const NOT_SUPPORTED: ImplementationStatus = 'NOT_SUPPORTED';
|
|
36
|
+
|
|
37
|
+
export const ProviderContext = createContext<Provider>(undefined);
|
|
38
|
+
|
|
39
|
+
export function getNativeMapName(provider: Provider) {
|
|
40
|
+
if (Platform.OS === 'android') {
|
|
41
|
+
return 'AIRMap';
|
|
42
|
+
}
|
|
43
|
+
if (provider === PROVIDER_GOOGLE) {
|
|
44
|
+
return 'AIRGoogleMap';
|
|
45
|
+
}
|
|
46
|
+
return 'AIRMap';
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function getNativeComponentName(provider: Provider, component: ComponentName) {
|
|
50
|
+
return `${getNativeMapName(provider)}${component}`;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const createNotSupportedComponent = (message: string): (() => null) => {
|
|
54
|
+
return () => {
|
|
55
|
+
console.error(message);
|
|
56
|
+
return null;
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
export const googleMapIsInstalled = !!UIManager.hasViewManagerConfig(
|
|
61
|
+
getNativeMapName(PROVIDER_GOOGLE),
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
export default function decorateMapComponent<Type extends Component>(
|
|
65
|
+
Component: Type,
|
|
66
|
+
componentName: ComponentName,
|
|
67
|
+
providers: Providers,
|
|
68
|
+
): Type {
|
|
69
|
+
const components: {
|
|
70
|
+
[key: string]: NativeComponent;
|
|
71
|
+
} = {};
|
|
72
|
+
|
|
73
|
+
const getDefaultComponent = () =>
|
|
74
|
+
requireNativeComponent(getNativeComponentName(undefined, componentName));
|
|
75
|
+
|
|
76
|
+
Component.contextType = ProviderContext;
|
|
77
|
+
|
|
78
|
+
Component.prototype.getNativeComponent =
|
|
79
|
+
function getNativeComponent(): NativeComponent {
|
|
80
|
+
const provider = this.context;
|
|
81
|
+
if (
|
|
82
|
+
componentName === 'Marker' &&
|
|
83
|
+
(Platform.OS !== 'ios' || provider !== PROVIDER_GOOGLE)
|
|
84
|
+
) {
|
|
85
|
+
// @ts-ignore
|
|
86
|
+
return FabricMarker;
|
|
87
|
+
}
|
|
88
|
+
if (
|
|
89
|
+
componentName === 'Polygon' &&
|
|
90
|
+
((provider === PROVIDER_GOOGLE &&
|
|
91
|
+
Platform.OS === 'ios' &&
|
|
92
|
+
googleMapIsInstalled) ||
|
|
93
|
+
Platform.OS === 'android')
|
|
94
|
+
) {
|
|
95
|
+
// @ts-ignore
|
|
96
|
+
return GooglePolygon;
|
|
97
|
+
}
|
|
98
|
+
if (Platform.OS === 'android') {
|
|
99
|
+
if (componentName === 'Callout') {
|
|
100
|
+
// @ts-ignore
|
|
101
|
+
return FabricCallout;
|
|
102
|
+
} else if (componentName === 'Polyline') {
|
|
103
|
+
// @ts-ignore
|
|
104
|
+
return FabricPolyline;
|
|
105
|
+
} else if (componentName === 'Circle') {
|
|
106
|
+
// @ts-ignore
|
|
107
|
+
return FabricCircle;
|
|
108
|
+
} else if (componentName === 'Overlay') {
|
|
109
|
+
// @ts-ignore
|
|
110
|
+
return FabricOverlay;
|
|
111
|
+
} else if (componentName === 'UrlTile') {
|
|
112
|
+
// @ts-ignore
|
|
113
|
+
return FabricUrlTile;
|
|
114
|
+
} else if (componentName === 'WMSTile') {
|
|
115
|
+
// @ts-ignore
|
|
116
|
+
return FabricWMSTile;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const key = provider || 'default';
|
|
120
|
+
if (components[key]) {
|
|
121
|
+
return components[key];
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
if (provider === PROVIDER_DEFAULT) {
|
|
125
|
+
components[key] = getDefaultComponent();
|
|
126
|
+
return components[key];
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const providerInfo = providers[provider];
|
|
130
|
+
// quick fix. Previous code assumed android | ios
|
|
131
|
+
if (Platform.OS !== 'android' && Platform.OS !== 'ios') {
|
|
132
|
+
throw new Error(`react-native-maps doesn't support ${Platform.OS}`);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const platformSupport = providerInfo[Platform.OS];
|
|
136
|
+
const nativeComponentName = getNativeComponentName(
|
|
137
|
+
provider,
|
|
138
|
+
componentName,
|
|
139
|
+
);
|
|
140
|
+
if (platformSupport === NOT_SUPPORTED) {
|
|
141
|
+
components[key] = createNotSupportedComponent(
|
|
142
|
+
`react-native-maps: ${nativeComponentName} is not supported on ${Platform.OS}`,
|
|
143
|
+
);
|
|
144
|
+
} else if (platformSupport === SUPPORTED) {
|
|
145
|
+
if (
|
|
146
|
+
provider !== PROVIDER_GOOGLE ||
|
|
147
|
+
(Platform.OS === 'ios' && googleMapIsInstalled)
|
|
148
|
+
) {
|
|
149
|
+
components[key] = requireNativeComponent(nativeComponentName);
|
|
150
|
+
}
|
|
151
|
+
} else {
|
|
152
|
+
// (platformSupport === USES_DEFAULT_IMPLEMENTATION)
|
|
153
|
+
if (!components.default) {
|
|
154
|
+
components.default = getDefaultComponent();
|
|
155
|
+
}
|
|
156
|
+
components[key] = components.default;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
return components[key];
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
Component.prototype.getUIManagerCommand = function getUIManagerCommand(
|
|
163
|
+
name: string,
|
|
164
|
+
): UIManagerCommand {
|
|
165
|
+
const nativeComponentName = getNativeComponentName(
|
|
166
|
+
this.context,
|
|
167
|
+
componentName,
|
|
168
|
+
);
|
|
169
|
+
return UIManager.getViewManagerConfig(nativeComponentName).Commands[name];
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
Component.prototype.getMapManagerCommand = function getMapManagerCommand(
|
|
173
|
+
name: string,
|
|
174
|
+
): MapManagerCommand {
|
|
175
|
+
const nativeComponentName = `${getNativeComponentName(
|
|
176
|
+
this.context,
|
|
177
|
+
componentName,
|
|
178
|
+
)}Manager`;
|
|
179
|
+
return NativeModules[nativeComponentName][name];
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
return Component;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
type ImplementationStatus =
|
|
186
|
+
| 'SUPPORTED'
|
|
187
|
+
| 'USES_DEFAULT_IMPLEMENTATION'
|
|
188
|
+
| 'NOT_SUPPORTED';
|
|
189
|
+
|
|
190
|
+
type Providers = {
|
|
191
|
+
google: {
|
|
192
|
+
ios: ImplementationStatus;
|
|
193
|
+
android: ImplementationStatus;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
export type UIManagerCommand = number;
|
|
198
|
+
|
|
199
|
+
export type MapManagerCommand = keyof typeof Commands;
|
|
200
|
+
|
|
201
|
+
export type NativeComponent<H = unknown> =
|
|
202
|
+
| HostComponent<H>
|
|
203
|
+
| ReturnType<typeof createNotSupportedComponent>;
|
|
204
|
+
|
|
205
|
+
type Component =
|
|
206
|
+
| typeof MapCallout
|
|
207
|
+
| typeof MapCalloutSubview
|
|
208
|
+
| typeof MapCircle
|
|
209
|
+
| typeof MapHeatmap
|
|
210
|
+
| typeof MapLocalTile
|
|
211
|
+
| typeof MapMarker
|
|
212
|
+
| typeof MapOverlay
|
|
213
|
+
| typeof MapPolygon
|
|
214
|
+
| typeof MapPolyline
|
|
215
|
+
| typeof MapUrlTile
|
|
216
|
+
| typeof MapWMSTile;
|
|
217
|
+
|
|
218
|
+
type ComponentName =
|
|
219
|
+
| 'Callout'
|
|
220
|
+
| 'CalloutSubview'
|
|
221
|
+
| 'Circle'
|
|
222
|
+
| 'Heatmap'
|
|
223
|
+
| 'LocalTile'
|
|
224
|
+
| 'Marker'
|
|
225
|
+
| 'Overlay'
|
|
226
|
+
| 'Polygon'
|
|
227
|
+
| 'Polyline'
|
|
228
|
+
| 'UrlTile'
|
|
229
|
+
| 'WMSTile';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {Image, ImageSourcePropType} from 'react-native';
|
|
2
|
+
|
|
3
|
+
export function fixImageProp(
|
|
4
|
+
image: ImageSourcePropType,
|
|
5
|
+
): {uri: string} | ImageSourcePropType {
|
|
6
|
+
if (typeof image === 'string') {
|
|
7
|
+
return {uri: image};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
if (typeof image === 'number') {
|
|
11
|
+
// Handle local image asset (require('./image.png'))
|
|
12
|
+
const resolvedImage = Image.resolveAssetSource(image);
|
|
13
|
+
return resolvedImage?.uri ? {uri: resolvedImage.uri} : image;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return image;
|
|
17
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import MapView, {
|
|
2
|
+
AnimatedMapView as Animated,
|
|
3
|
+
MAP_TYPES,
|
|
4
|
+
MapViewProps,
|
|
5
|
+
} from './MapView';
|
|
6
|
+
|
|
7
|
+
import Marker from './MapMarker';
|
|
8
|
+
export {MapMarker} from './MapMarker';
|
|
9
|
+
export type {MapMarkerProps} from './MapMarker';
|
|
10
|
+
|
|
11
|
+
import Overlay from './MapOverlay';
|
|
12
|
+
export {MapOverlay} from './MapOverlay';
|
|
13
|
+
export type {MapOverlayProps} from './MapOverlay';
|
|
14
|
+
|
|
15
|
+
export {default as Polyline, MapPolyline} from './MapPolyline';
|
|
16
|
+
export type {MapPolylineProps} from './MapPolyline';
|
|
17
|
+
export {default as Heatmap, MapHeatmap} from './MapHeatmap';
|
|
18
|
+
export type {MapHeatmapProps} from './MapHeatmap';
|
|
19
|
+
export {default as Polygon, MapPolygon} from './MapPolygon';
|
|
20
|
+
export type {MapPolygonProps} from './MapPolygon';
|
|
21
|
+
export {default as Circle, MapCircle} from './MapCircle';
|
|
22
|
+
export type {MapCircleProps} from './MapCircle';
|
|
23
|
+
export {default as UrlTile, MapUrlTile} from './MapUrlTile';
|
|
24
|
+
export type {MapUrlTileProps} from './MapUrlTile';
|
|
25
|
+
export {default as WMSTile, MapWMSTile} from './MapWMSTile';
|
|
26
|
+
export type {MapWMSTileProps} from './MapWMSTile';
|
|
27
|
+
export {default as LocalTile, MapLocalTile} from './MapLocalTile';
|
|
28
|
+
export type {MapLocalTileProps} from './MapLocalTile';
|
|
29
|
+
export {default as Callout, MapCallout} from './MapCallout';
|
|
30
|
+
export type {MapCalloutProps} from './MapCallout';
|
|
31
|
+
export {
|
|
32
|
+
default as CalloutSubview,
|
|
33
|
+
MapCalloutSubview,
|
|
34
|
+
} from './MapCalloutSubview';
|
|
35
|
+
export type {MapCalloutSubviewProps} from './MapCalloutSubview';
|
|
36
|
+
export {default as AnimatedRegion} from './AnimatedRegion';
|
|
37
|
+
export {default as Geojson} from './Geojson';
|
|
38
|
+
export type {GeojsonProps} from './Geojson';
|
|
39
|
+
|
|
40
|
+
export {Marker, Overlay};
|
|
41
|
+
export type {MapViewProps};
|
|
42
|
+
export {Animated, MAP_TYPES};
|
|
43
|
+
|
|
44
|
+
export * from './ProviderConstants';
|
|
45
|
+
export * from './MapView.types';
|
|
46
|
+
export * from './MapPolygon.types';
|
|
47
|
+
export * from './sharedTypes';
|
|
48
|
+
|
|
49
|
+
export const MarkerAnimated = Marker.Animated;
|
|
50
|
+
export const OverlayAnimated = Overlay.Animated;
|
|
51
|
+
|
|
52
|
+
export default MapView;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import {NativeSyntheticEvent} from 'react-native';
|
|
2
|
+
|
|
3
|
+
export type Provider = 'google' | undefined;
|
|
4
|
+
|
|
5
|
+
export type LatLng = {
|
|
6
|
+
latitude: number;
|
|
7
|
+
longitude: number;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type Point = {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type Region = LatLng & {
|
|
16
|
+
latitudeDelta: number;
|
|
17
|
+
longitudeDelta: number;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type Frame = Point & {height: number; width: number};
|
|
21
|
+
|
|
22
|
+
export type CalloutPressEvent = NativeSyntheticEvent<{
|
|
23
|
+
action: 'callout-press';
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* @platform iOS
|
|
27
|
+
*/
|
|
28
|
+
frame?: Frame;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* @platform iOS
|
|
32
|
+
*/
|
|
33
|
+
id?: string;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* @platform iOS
|
|
37
|
+
*/
|
|
38
|
+
point?: Point;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* @platform Android
|
|
42
|
+
*/
|
|
43
|
+
coordinate?: LatLng;
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @platform Android
|
|
47
|
+
*/
|
|
48
|
+
position?: Point;
|
|
49
|
+
}>;
|
|
50
|
+
|
|
51
|
+
export type LineCapType = 'butt' | 'round' | 'square';
|
|
52
|
+
export type LineJoinType = 'miter' | 'round' | 'bevel';
|
|
53
|
+
|
|
54
|
+
export type ClickEvent<T = {}> = NativeSyntheticEvent<
|
|
55
|
+
{coordinate: LatLng; position: Point} & T
|
|
56
|
+
>;
|
|
57
|
+
|
|
58
|
+
export type MarkerDeselectEvent = Omit<
|
|
59
|
+
ClickEvent<{
|
|
60
|
+
action: 'marker-deselect';
|
|
61
|
+
id: string;
|
|
62
|
+
}>,
|
|
63
|
+
'position'
|
|
64
|
+
>;
|
|
65
|
+
|
|
66
|
+
export type MarkerSelectEvent = Omit<
|
|
67
|
+
ClickEvent<{id: string; action: 'marker-select'}>,
|
|
68
|
+
'position'
|
|
69
|
+
>;
|
|
70
|
+
|
|
71
|
+
export type MarkerDragEvent = ClickEvent<{
|
|
72
|
+
/**
|
|
73
|
+
* @platform iOS
|
|
74
|
+
*/
|
|
75
|
+
id?: string;
|
|
76
|
+
}>;
|
|
77
|
+
|
|
78
|
+
export type MarkerDragStartEndEvent = NativeSyntheticEvent<{
|
|
79
|
+
coordinate: LatLng;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @platform iOS
|
|
83
|
+
*/
|
|
84
|
+
id?: string;
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* @platform Android
|
|
88
|
+
*/
|
|
89
|
+
position?: Point;
|
|
90
|
+
}>;
|
|
91
|
+
|
|
92
|
+
export type MarkerPressEvent = NativeSyntheticEvent<{
|
|
93
|
+
id: string;
|
|
94
|
+
action: 'marker-press';
|
|
95
|
+
coordinate: LatLng;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* @platform Android
|
|
99
|
+
*/
|
|
100
|
+
position?: Point;
|
|
101
|
+
}>;
|
|
@@ -88,7 +88,6 @@ export interface CircleFabricNativeProps extends ViewProps {
|
|
|
88
88
|
tappable?: boolean;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
export default codegenNativeComponent<CircleFabricNativeProps>(
|
|
92
|
-
'
|
|
93
|
-
|
|
94
|
-
) as HostComponent<CircleFabricNativeProps>;
|
|
91
|
+
export default codegenNativeComponent<CircleFabricNativeProps>('RNMapsCircle', {
|
|
92
|
+
excludedPlatforms: ['iOS'],
|
|
93
|
+
}) as HostComponent<CircleFabricNativeProps>;
|
|
@@ -181,11 +181,9 @@ export type IndoorLevel = Readonly<{
|
|
|
181
181
|
|
|
182
182
|
export type IndoorLevelActivatedEventHandler = DirectEventHandler<
|
|
183
183
|
Readonly<{
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
shortName: string; // Non-nullable string
|
|
188
|
-
}; // Nested ActiveIndoorLevel type
|
|
184
|
+
activeLevelIndex: Int32; // Int32 for integers
|
|
185
|
+
name: string; // Non-nullable string
|
|
186
|
+
shortName: string; // Non-nullable string
|
|
189
187
|
}>
|
|
190
188
|
>;
|
|
191
189
|
|
|
@@ -197,10 +195,9 @@ export type IndoorBuilding = Readonly<{
|
|
|
197
195
|
|
|
198
196
|
export type IndoorBuildingEventHandler = DirectEventHandler<
|
|
199
197
|
Readonly<{
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
};
|
|
198
|
+
underground: boolean; // Non-nullable boolean
|
|
199
|
+
activeLevelIndex: Int32; // Int32 for integers
|
|
200
|
+
levels: string; // Immutable array of IndoorLevel
|
|
204
201
|
}>
|
|
205
202
|
>;
|
|
206
203
|
|
|
@@ -777,6 +774,15 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
777
774
|
*/
|
|
778
775
|
userInterfaceStyle?: WithDefault<'system' | 'light' | 'dark', 'system'>;
|
|
779
776
|
|
|
777
|
+
/**
|
|
778
|
+
* Adds custom styling to the map component.
|
|
779
|
+
* See [README](https://github.com/react-native-maps/react-native-maps#customizing-the-map-style) for more information.
|
|
780
|
+
*
|
|
781
|
+
* @platform iOS: Google Maps only
|
|
782
|
+
* @platform Android: Supported
|
|
783
|
+
*/
|
|
784
|
+
customMapStyleString?: string;
|
|
785
|
+
|
|
780
786
|
/**
|
|
781
787
|
* If `true` clicking user location will show the default callout for userLocation annotation.
|
|
782
788
|
*
|
|
@@ -33,7 +33,7 @@ export type Frame = Readonly<{
|
|
|
33
33
|
height: Double;
|
|
34
34
|
}>;
|
|
35
35
|
|
|
36
|
-
export type ClickEvent =
|
|
36
|
+
export type ClickEvent = DirectEventHandler<
|
|
37
37
|
Readonly<{
|
|
38
38
|
coordinate: {
|
|
39
39
|
latitude: Double; // Inlined LatLng
|
|
@@ -74,7 +74,7 @@ export type LongPressEventHandler = BubblingEventHandler<
|
|
|
74
74
|
}>
|
|
75
75
|
>;
|
|
76
76
|
|
|
77
|
-
export type MarkerDeselectEventHandler =
|
|
77
|
+
export type MarkerDeselectEventHandler = DirectEventHandler<
|
|
78
78
|
Readonly<{
|
|
79
79
|
action?: string;
|
|
80
80
|
id: string;
|
|
@@ -85,7 +85,7 @@ export type MarkerDeselectEventHandler = BubblingEventHandler<
|
|
|
85
85
|
}>
|
|
86
86
|
>;
|
|
87
87
|
|
|
88
|
-
export type MarkerSelectEventHandler =
|
|
88
|
+
export type MarkerSelectEventHandler = DirectEventHandler<
|
|
89
89
|
Readonly<{
|
|
90
90
|
action?: string;
|
|
91
91
|
id: string;
|
|
@@ -96,7 +96,7 @@ export type MarkerSelectEventHandler = BubblingEventHandler<
|
|
|
96
96
|
}>
|
|
97
97
|
>;
|
|
98
98
|
|
|
99
|
-
export type CalloutPressEvent =
|
|
99
|
+
export type CalloutPressEvent = DirectEventHandler<{
|
|
100
100
|
action?: string;
|
|
101
101
|
|
|
102
102
|
/**
|
|
@@ -204,17 +204,11 @@ export type IndoorBuildingEventHandler = DirectEventHandler<
|
|
|
204
204
|
}>
|
|
205
205
|
>;
|
|
206
206
|
|
|
207
|
-
export type KmlMapEventHandler = DirectEventHandler<Readonly<{}>>;
|
|
208
|
-
|
|
209
|
-
export type MapLoadedEventHandler = DirectEventHandler<Readonly<{}>>;
|
|
210
|
-
|
|
211
|
-
export type MapReadyEventHandler = DirectEventHandler<Readonly<{}>>;
|
|
212
|
-
|
|
213
207
|
export type Details = Readonly<{
|
|
214
208
|
isGesture?: boolean; // Optional boolean for gesture detail
|
|
215
209
|
}>;
|
|
216
210
|
|
|
217
|
-
export type MarkerDragEventHandler =
|
|
211
|
+
export type MarkerDragEventHandler = DirectEventHandler<
|
|
218
212
|
Readonly<{
|
|
219
213
|
coordinate: {
|
|
220
214
|
latitude: Double; // Inlined LatLng
|
|
@@ -228,7 +222,7 @@ export type MarkerDragEventHandler = BubblingEventHandler<
|
|
|
228
222
|
}>
|
|
229
223
|
>;
|
|
230
224
|
|
|
231
|
-
export type MarkerDragStartEndEventHandler =
|
|
225
|
+
export type MarkerDragStartEndEventHandler = DirectEventHandler<
|
|
232
226
|
Readonly<{
|
|
233
227
|
coordinate: {
|
|
234
228
|
latitude: Double; // Inlined LatLng
|
|
@@ -242,7 +236,7 @@ export type MarkerDragStartEndEventHandler = BubblingEventHandler<
|
|
|
242
236
|
}>
|
|
243
237
|
>;
|
|
244
238
|
|
|
245
|
-
export type MarkerPressEventHandler =
|
|
239
|
+
export type MarkerPressEventHandler = DirectEventHandler<
|
|
246
240
|
Readonly<{
|
|
247
241
|
action?: string;
|
|
248
242
|
id: string;
|
|
@@ -257,7 +251,7 @@ export type MarkerPressEventHandler = BubblingEventHandler<
|
|
|
257
251
|
}>
|
|
258
252
|
>;
|
|
259
253
|
|
|
260
|
-
export type PanDragEventHandler =
|
|
254
|
+
export type PanDragEventHandler = DirectEventHandler<
|
|
261
255
|
Readonly<{
|
|
262
256
|
coordinate: {
|
|
263
257
|
latitude: Double; // Inlined LatLng
|
|
@@ -270,7 +264,7 @@ export type PanDragEventHandler = BubblingEventHandler<
|
|
|
270
264
|
}>
|
|
271
265
|
>;
|
|
272
266
|
|
|
273
|
-
export type PoiClickEventHandler =
|
|
267
|
+
export type PoiClickEventHandler = DirectEventHandler<
|
|
274
268
|
Readonly<{
|
|
275
269
|
placeId: string;
|
|
276
270
|
name: string;
|
|
@@ -298,9 +292,6 @@ export type MapPressEventHandler = BubblingEventHandler<
|
|
|
298
292
|
action?: string;
|
|
299
293
|
}>
|
|
300
294
|
>;
|
|
301
|
-
|
|
302
|
-
export type RegionChangeStartEventHandler = DirectEventHandler<Details>;
|
|
303
|
-
|
|
304
295
|
export type RegionChangeEvent = Readonly<{
|
|
305
296
|
region: {
|
|
306
297
|
latitude: Double; // Non-nullable Double for latitude
|
|
@@ -310,9 +301,6 @@ export type RegionChangeEvent = Readonly<{
|
|
|
310
301
|
}; // The region object
|
|
311
302
|
continuous?: boolean;
|
|
312
303
|
}>;
|
|
313
|
-
|
|
314
|
-
export type RegionChangeEventHandler = BubblingEventHandler<RegionChangeEvent>;
|
|
315
|
-
|
|
316
304
|
export type UserLocationChangeEvent = Readonly<{
|
|
317
305
|
coordinate?: {
|
|
318
306
|
latitude: Double; // Non-nullable Double for latitude
|
|
@@ -369,7 +357,23 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
369
357
|
* @platform iOS: Supported
|
|
370
358
|
* @platform Android: Supported
|
|
371
359
|
*/
|
|
372
|
-
camera?:
|
|
360
|
+
camera?: Readonly<{
|
|
361
|
+
/**
|
|
362
|
+
* Apple Maps
|
|
363
|
+
*/
|
|
364
|
+
altitude?: Double; // Nullable Double for altitude
|
|
365
|
+
center: {
|
|
366
|
+
latitude: Double; // Inlined LatLng
|
|
367
|
+
longitude: Double;
|
|
368
|
+
}; // Non-nullable center
|
|
369
|
+
heading: Double; // Non-nullable Double for heading
|
|
370
|
+
pitch: Double; // Non-nullable Double for pitch
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* Google Maps
|
|
374
|
+
*/
|
|
375
|
+
zoom?: Float; // Nullable Double for zoom
|
|
376
|
+
}>;
|
|
373
377
|
|
|
374
378
|
/**
|
|
375
379
|
* If set, changes the position of the compass.
|
|
@@ -413,7 +417,23 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
413
417
|
* @platform iOS: Supported
|
|
414
418
|
* @platform Android: Supported
|
|
415
419
|
*/
|
|
416
|
-
initialCamera?:
|
|
420
|
+
initialCamera?: Readonly<{
|
|
421
|
+
/**
|
|
422
|
+
* Apple Maps
|
|
423
|
+
*/
|
|
424
|
+
altitude?: Double; // Nullable Double for altitude
|
|
425
|
+
center: {
|
|
426
|
+
latitude: Double; // Inlined LatLng
|
|
427
|
+
longitude: Double;
|
|
428
|
+
}; // Non-nullable center
|
|
429
|
+
heading: Double; // Non-nullable Double for heading
|
|
430
|
+
pitch: Double; // Non-nullable Double for pitch
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* Google Maps
|
|
434
|
+
*/
|
|
435
|
+
zoom?: Float; // Nullable Double for zoom
|
|
436
|
+
}>;
|
|
417
437
|
|
|
418
438
|
/**
|
|
419
439
|
* The initial region to be displayed by the map. Use this prop instead of `region`
|
|
@@ -604,7 +624,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
604
624
|
* @platform iOS: Google Maps only
|
|
605
625
|
* @platform Android: Supported
|
|
606
626
|
*/
|
|
607
|
-
onKmlReady?:
|
|
627
|
+
onKmlReady?: DirectEventHandler<null>;
|
|
608
628
|
|
|
609
629
|
/**
|
|
610
630
|
* Callback that is called when user makes a "long press" somewhere on the map.
|
|
@@ -620,7 +640,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
620
640
|
* @platform iOS: Google Maps only
|
|
621
641
|
* @platform Android: Supported
|
|
622
642
|
*/
|
|
623
|
-
onMapLoaded?:
|
|
643
|
+
onMapLoaded?: DirectEventHandler<null>;
|
|
624
644
|
|
|
625
645
|
/**
|
|
626
646
|
* Callback that is called once the map is ready.
|
|
@@ -631,7 +651,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
631
651
|
* @platform iOS: Supported
|
|
632
652
|
* @platform Android: Supported
|
|
633
653
|
*/
|
|
634
|
-
onMapReady?:
|
|
654
|
+
onMapReady?: DirectEventHandler<null>;
|
|
635
655
|
|
|
636
656
|
/**
|
|
637
657
|
* Callback that is called when a marker on the map becomes deselected.
|
|
@@ -694,9 +714,9 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
694
714
|
onPanDrag?: PanDragEventHandler;
|
|
695
715
|
|
|
696
716
|
/*
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
717
|
+
internal flag to enable pan gesture handling on iOS manually
|
|
718
|
+
* see MapView.ts line 1228
|
|
719
|
+
*/
|
|
700
720
|
handlePanDrag?: boolean;
|
|
701
721
|
|
|
702
722
|
/**
|
|
@@ -723,7 +743,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
723
743
|
* @platform iOS: Supported
|
|
724
744
|
* @platform Android: Supported
|
|
725
745
|
*/
|
|
726
|
-
onRegionChangeStart?:
|
|
746
|
+
onRegionChangeStart?: DirectEventHandler<RegionChangeEvent>;
|
|
727
747
|
|
|
728
748
|
/**
|
|
729
749
|
* Callback that is called continuously when the region changes, such as when a user is dragging the map.
|
|
@@ -733,7 +753,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
733
753
|
* @platform iOS: Supported
|
|
734
754
|
* @platform Android: Supported
|
|
735
755
|
*/
|
|
736
|
-
onRegionChange?:
|
|
756
|
+
onRegionChange?: DirectEventHandler<RegionChangeEvent>;
|
|
737
757
|
|
|
738
758
|
/**
|
|
739
759
|
* Callback that is called once when the region changes, such as when the user is done moving the map.
|
|
@@ -743,7 +763,7 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
743
763
|
* @platform iOS: Supported
|
|
744
764
|
* @platform Android: Supported
|
|
745
765
|
*/
|
|
746
|
-
onRegionChangeComplete?:
|
|
766
|
+
onRegionChangeComplete?: DirectEventHandler<RegionChangeEvent>;
|
|
747
767
|
|
|
748
768
|
/**
|
|
749
769
|
* Callback that is called when the underlying map figures our users current location
|
|
@@ -903,6 +923,15 @@ export interface MapFabricNativeProps extends ViewProps {
|
|
|
903
923
|
*/
|
|
904
924
|
userInterfaceStyle?: WithDefault<'system' | 'light' | 'dark', 'system'>;
|
|
905
925
|
|
|
926
|
+
/**
|
|
927
|
+
* Adds custom styling to the map component.
|
|
928
|
+
* See [README](https://github.com/react-native-maps/react-native-maps#customizing-the-map-style) for more information.
|
|
929
|
+
*
|
|
930
|
+
* @platform iOS: Google Maps only
|
|
931
|
+
* @platform Android: Supported
|
|
932
|
+
*/
|
|
933
|
+
customMapStyleString?: string;
|
|
934
|
+
|
|
906
935
|
/**
|
|
907
936
|
* The title of the annotation for current user location.
|
|
908
937
|
*
|