react-native-maps 1.21.0-alpha.98 → 1.21.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/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 +30 -25
- 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 +227 -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/MapPolygon.types.js +0 -2
- 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/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,77 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {StyleSheet, ViewProps} from 'react-native';
|
|
3
|
+
import decorateMapComponent, {
|
|
4
|
+
MapManagerCommand,
|
|
5
|
+
NativeComponent,
|
|
6
|
+
ProviderContext,
|
|
7
|
+
SUPPORTED,
|
|
8
|
+
UIManagerCommand,
|
|
9
|
+
USES_DEFAULT_IMPLEMENTATION,
|
|
10
|
+
} from './decorateMapComponent';
|
|
11
|
+
import {CalloutPressEvent} from './sharedTypes';
|
|
12
|
+
|
|
13
|
+
export type MapCalloutProps = ViewProps & {
|
|
14
|
+
/**
|
|
15
|
+
* If `true`, clicks on transparent areas in callout will be passed to map.
|
|
16
|
+
*
|
|
17
|
+
* @default false
|
|
18
|
+
* @platform iOS: Supported
|
|
19
|
+
* @platform Android: Not supported
|
|
20
|
+
*/
|
|
21
|
+
alphaHitTest?: boolean;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Callback that is called when the user presses on the callout
|
|
25
|
+
*
|
|
26
|
+
* @platform iOS: Apple Maps only
|
|
27
|
+
* @platform Android: Supported
|
|
28
|
+
*/
|
|
29
|
+
onPress?: (event: CalloutPressEvent) => void;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* If `false`, a default "tooltip" bubble window will be drawn around this callouts children.
|
|
33
|
+
* If `true`, the child views can fully customize their appearance, including any "bubble" like styles.
|
|
34
|
+
*
|
|
35
|
+
* @default false
|
|
36
|
+
* @platform iOS: Supported
|
|
37
|
+
* @platform Android: Supported
|
|
38
|
+
*/
|
|
39
|
+
tooltip?: boolean;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
type NativeProps = MapCalloutProps;
|
|
43
|
+
|
|
44
|
+
export class MapCallout extends React.Component<MapCalloutProps> {
|
|
45
|
+
// declaration only, as they are set through decorateMap
|
|
46
|
+
/// @ts-ignore
|
|
47
|
+
context!: React.ContextType<typeof ProviderContext>;
|
|
48
|
+
getNativeComponent!: () => NativeComponent<NativeProps>;
|
|
49
|
+
getMapManagerCommand!: (name: string) => MapManagerCommand;
|
|
50
|
+
getUIManagerCommand!: (name: string) => UIManagerCommand;
|
|
51
|
+
|
|
52
|
+
render() {
|
|
53
|
+
const {tooltip = false, alphaHitTest = false} = this.props;
|
|
54
|
+
const AIRMapCallout = this.getNativeComponent();
|
|
55
|
+
return (
|
|
56
|
+
<AIRMapCallout
|
|
57
|
+
{...this.props}
|
|
58
|
+
tooltip={tooltip}
|
|
59
|
+
alphaHitTest={alphaHitTest}
|
|
60
|
+
style={[styles.callout, this.props.style]}
|
|
61
|
+
/>
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
const styles = StyleSheet.create({
|
|
67
|
+
callout: {
|
|
68
|
+
position: 'absolute',
|
|
69
|
+
},
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
export default decorateMapComponent(MapCallout, 'Callout', {
|
|
73
|
+
google: {
|
|
74
|
+
ios: SUPPORTED,
|
|
75
|
+
android: USES_DEFAULT_IMPLEMENTATION,
|
|
76
|
+
},
|
|
77
|
+
});
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {NativeSyntheticEvent, StyleSheet, ViewProps} from 'react-native';
|
|
3
|
+
import decorateMapComponent, {
|
|
4
|
+
SUPPORTED,
|
|
5
|
+
NOT_SUPPORTED,
|
|
6
|
+
ProviderContext,
|
|
7
|
+
NativeComponent,
|
|
8
|
+
MapManagerCommand,
|
|
9
|
+
UIManagerCommand,
|
|
10
|
+
} from './decorateMapComponent';
|
|
11
|
+
import {Frame, Point} from './sharedTypes';
|
|
12
|
+
|
|
13
|
+
export type MapCalloutSubviewProps = ViewProps & {
|
|
14
|
+
/**
|
|
15
|
+
* Callback that is called when the user presses on this subview inside callout
|
|
16
|
+
*
|
|
17
|
+
* @platform iOS: Supported
|
|
18
|
+
* @platform Android: Not supported
|
|
19
|
+
*/
|
|
20
|
+
onPress?: (event: CalloutSubviewPressEvent) => void;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
type NativeProps = MapCalloutSubviewProps;
|
|
24
|
+
|
|
25
|
+
export class MapCalloutSubview extends React.Component<MapCalloutSubviewProps> {
|
|
26
|
+
// declaration only, as they are set through decorateMap
|
|
27
|
+
/// @ts-ignore
|
|
28
|
+
context!: React.ContextType<typeof ProviderContext>;
|
|
29
|
+
getNativeComponent!: () => NativeComponent<NativeProps>;
|
|
30
|
+
getMapManagerCommand!: (name: string) => MapManagerCommand;
|
|
31
|
+
getUIManagerCommand!: (name: string) => UIManagerCommand;
|
|
32
|
+
render() {
|
|
33
|
+
const AIRMapCalloutSubview = this.getNativeComponent();
|
|
34
|
+
return (
|
|
35
|
+
<AIRMapCalloutSubview
|
|
36
|
+
{...this.props}
|
|
37
|
+
style={[styles.calloutSubview, this.props.style]}
|
|
38
|
+
/>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
const styles = StyleSheet.create({
|
|
44
|
+
calloutSubview: {},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
export default decorateMapComponent(MapCalloutSubview, 'CalloutSubview', {
|
|
48
|
+
google: {
|
|
49
|
+
ios: SUPPORTED,
|
|
50
|
+
android: NOT_SUPPORTED,
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
type CalloutSubviewPressEvent = NativeSyntheticEvent<{
|
|
55
|
+
/**
|
|
56
|
+
* Apple Maps: `callout-inside-press`
|
|
57
|
+
*
|
|
58
|
+
* Google Maps: `marker-inside-overlay-press`
|
|
59
|
+
*/
|
|
60
|
+
action: 'callout-inside-press' | 'marker-inside-overlay-press';
|
|
61
|
+
frame: Frame;
|
|
62
|
+
id: string;
|
|
63
|
+
point: Point;
|
|
64
|
+
}>;
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {View, ViewProps} from 'react-native';
|
|
3
|
+
import decorateMapComponent, {
|
|
4
|
+
USES_DEFAULT_IMPLEMENTATION,
|
|
5
|
+
SUPPORTED,
|
|
6
|
+
ProviderContext,
|
|
7
|
+
NativeComponent,
|
|
8
|
+
MapManagerCommand,
|
|
9
|
+
UIManagerCommand,
|
|
10
|
+
} from './decorateMapComponent';
|
|
11
|
+
import {LatLng, LineCapType, LineJoinType} from './sharedTypes';
|
|
12
|
+
|
|
13
|
+
export type MapCircleProps = ViewProps & {
|
|
14
|
+
/**
|
|
15
|
+
* The coordinates of the center of the circle.
|
|
16
|
+
*
|
|
17
|
+
* @platform iOS: Supported
|
|
18
|
+
* @platform Android: Supported
|
|
19
|
+
*/
|
|
20
|
+
center: LatLng;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The fill color to use for the path.
|
|
24
|
+
*
|
|
25
|
+
* @default `#000`, `rgba(r,g,b,0.5)`
|
|
26
|
+
* @platform iOS: Supported
|
|
27
|
+
* @platform Android: Supported
|
|
28
|
+
*/
|
|
29
|
+
fillColor?: string;
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* The line cap style to apply to the open ends of the path
|
|
33
|
+
*
|
|
34
|
+
* @default `round`
|
|
35
|
+
* @platform iOS: Apple Maps only
|
|
36
|
+
* @platform Android: Not supported
|
|
37
|
+
*/
|
|
38
|
+
lineCap?: LineCapType;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* An array of numbers specifying the dash pattern to use for the path.
|
|
42
|
+
* The array contains one or more numbers that indicate the lengths (measured in points)
|
|
43
|
+
* of the line segments and gaps in the pattern.
|
|
44
|
+
* The values in the array alternate, starting with the first line segment length,
|
|
45
|
+
* followed by the first gap length, followed by the second line segment length, and so on.
|
|
46
|
+
*
|
|
47
|
+
* @platform iOS: Apple Maps only
|
|
48
|
+
* @platform Android: Not supported
|
|
49
|
+
*/
|
|
50
|
+
lineDashPattern?: number[];
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The offset (in points) at which to start drawing the dash pattern.
|
|
54
|
+
* Use this property to start drawing a dashed line partway through a segment or gap.
|
|
55
|
+
* For example, a phase value of 6 for the patter 5-2-3-2 would cause drawing to begin in the middle of the first gap.
|
|
56
|
+
*
|
|
57
|
+
* @default 0
|
|
58
|
+
* @platform iOS: Apple Maps only
|
|
59
|
+
* @platform Android: Not supported
|
|
60
|
+
*/
|
|
61
|
+
lineDashPhase?: number;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The line join style to apply to corners of the path.
|
|
65
|
+
*
|
|
66
|
+
* @platform iOS: Apple Maps only
|
|
67
|
+
* @platform Android: Not supported
|
|
68
|
+
*/
|
|
69
|
+
lineJoin?: LineJoinType;
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The limiting value that helps avoid spikes at junctions between connected line segments.
|
|
73
|
+
* The miter limit helps you avoid spikes in paths that use the `miter` `lineJoin` style.
|
|
74
|
+
* If the ratio of the miter length—that is, the diagonal length of the miter join—to the line thickness exceeds the miter limit,
|
|
75
|
+
* the joint is converted to a bevel join.
|
|
76
|
+
* The default miter limit is 10, which results in the conversion of miters whose angle at the joint is less than 11 degrees.
|
|
77
|
+
*
|
|
78
|
+
* @default 10
|
|
79
|
+
* @platform iOS: Apple Maps only
|
|
80
|
+
* @platform Android: Not supported
|
|
81
|
+
*/
|
|
82
|
+
miterLimit?: number;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* The radius of the circle to be drawn (in meters)
|
|
86
|
+
*
|
|
87
|
+
* @platform iOS: Supported
|
|
88
|
+
* @platform Android: Supported
|
|
89
|
+
*/
|
|
90
|
+
radius: number;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* The stroke color to use for the path.
|
|
94
|
+
*
|
|
95
|
+
* @default `#000`, `rgba(r,g,b,0.5)`
|
|
96
|
+
* @platform iOS: Supported
|
|
97
|
+
* @platform Android: Supported
|
|
98
|
+
*/
|
|
99
|
+
strokeColor?: string;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The stroke width to use for the path.
|
|
103
|
+
*
|
|
104
|
+
* @default 1
|
|
105
|
+
* @platform iOS: Supported
|
|
106
|
+
* @platform Android: Supported
|
|
107
|
+
*/
|
|
108
|
+
strokeWidth?: number;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The order in which this tile overlay is drawn with respect to other overlays.
|
|
112
|
+
* An overlay with a larger z-index is drawn over overlays with smaller z-indices.
|
|
113
|
+
* The order of overlays with the same z-index is arbitrary.
|
|
114
|
+
*
|
|
115
|
+
* @default 0
|
|
116
|
+
* @platform iOS: Google Maps only
|
|
117
|
+
* @platform Android: Supported
|
|
118
|
+
*/
|
|
119
|
+
zIndex?: number;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
type NativeProps = MapCircleProps & {ref: React.RefObject<View | null>};
|
|
123
|
+
|
|
124
|
+
export class MapCircle extends React.Component<MapCircleProps> {
|
|
125
|
+
// declaration only, as they are set through decorateMap
|
|
126
|
+
/// @ts-ignore
|
|
127
|
+
context!: React.ContextType<typeof ProviderContext>;
|
|
128
|
+
getNativeComponent!: () => NativeComponent<NativeProps>;
|
|
129
|
+
getMapManagerCommand!: (name: string) => MapManagerCommand;
|
|
130
|
+
getUIManagerCommand!: (name: string) => UIManagerCommand;
|
|
131
|
+
|
|
132
|
+
private circle: NativeProps['ref'];
|
|
133
|
+
|
|
134
|
+
constructor(props: MapCircleProps) {
|
|
135
|
+
super(props);
|
|
136
|
+
this.circle = React.createRef<View>();
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
setNativeProps(props: Partial<NativeProps>) {
|
|
140
|
+
this.circle.current?.setNativeProps(props);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
render() {
|
|
144
|
+
const {strokeColor = '#000', strokeWidth = 1} = this.props;
|
|
145
|
+
const AIRMapCircle = this.getNativeComponent();
|
|
146
|
+
return (
|
|
147
|
+
<AIRMapCircle
|
|
148
|
+
{...this.props}
|
|
149
|
+
strokeColor={strokeColor}
|
|
150
|
+
strokeWidth={strokeWidth}
|
|
151
|
+
ref={this.circle}
|
|
152
|
+
/>
|
|
153
|
+
);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export default decorateMapComponent(MapCircle, 'Circle', {
|
|
158
|
+
google: {
|
|
159
|
+
ios: SUPPORTED,
|
|
160
|
+
android: USES_DEFAULT_IMPLEMENTATION,
|
|
161
|
+
},
|
|
162
|
+
});
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {processColor, ProcessedColorValue, View, ViewProps} from 'react-native';
|
|
3
|
+
import decorateMapComponent, {
|
|
4
|
+
MapManagerCommand,
|
|
5
|
+
NativeComponent,
|
|
6
|
+
ProviderContext,
|
|
7
|
+
SUPPORTED,
|
|
8
|
+
UIManagerCommand,
|
|
9
|
+
USES_DEFAULT_IMPLEMENTATION,
|
|
10
|
+
} from './decorateMapComponent';
|
|
11
|
+
import {LatLng} from './sharedTypes';
|
|
12
|
+
import {Modify} from './sharedTypesInternal';
|
|
13
|
+
|
|
14
|
+
export type MapHeatmapProps = ViewProps & {
|
|
15
|
+
gradient?: {
|
|
16
|
+
/**
|
|
17
|
+
* Resolution of color map -- number corresponding to the number of steps colors are interpolated into.
|
|
18
|
+
*
|
|
19
|
+
* @default 256
|
|
20
|
+
* @platform iOS: Google Maps only
|
|
21
|
+
* @platform Android: Supported
|
|
22
|
+
*/
|
|
23
|
+
colorMapSize: number;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Colors (one or more) to used for gradient.
|
|
27
|
+
*
|
|
28
|
+
* @platform iOS: Google Maps only
|
|
29
|
+
* @platform Android: Supported
|
|
30
|
+
*/
|
|
31
|
+
colors: string[];
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Array of floating point values from 0 to 1 representing where each color starts.
|
|
35
|
+
*
|
|
36
|
+
* Array length must be equal to `colors` array length.
|
|
37
|
+
*
|
|
38
|
+
* @platform iOS: Google Maps only
|
|
39
|
+
* @platform Android: Supported
|
|
40
|
+
*/
|
|
41
|
+
startPoints: number[];
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* The opacity of the heatmap.
|
|
46
|
+
*
|
|
47
|
+
* @default 0.7
|
|
48
|
+
* @platform iOS: Google Maps only
|
|
49
|
+
* @platform Android: Supported
|
|
50
|
+
*/
|
|
51
|
+
opacity?: number;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Array of heatmap entries to apply towards density.
|
|
55
|
+
*
|
|
56
|
+
* @platform iOS: Google Maps only
|
|
57
|
+
* @platform Android: Supported
|
|
58
|
+
*/
|
|
59
|
+
points?: WeightedLatLng[];
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* The radius of the heatmap points in pixels, between 10 and 50.
|
|
63
|
+
*
|
|
64
|
+
* @default 20
|
|
65
|
+
* @platform iOS: Google Maps only
|
|
66
|
+
* @platform Android: Supported
|
|
67
|
+
*/
|
|
68
|
+
radius?: number;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
type NativeProps = Modify<
|
|
72
|
+
MapHeatmapProps,
|
|
73
|
+
{
|
|
74
|
+
gradient?: Modify<
|
|
75
|
+
MapHeatmapProps['gradient'],
|
|
76
|
+
{colors: (ProcessedColorValue | null | undefined)[]}
|
|
77
|
+
>;
|
|
78
|
+
}
|
|
79
|
+
> & {
|
|
80
|
+
ref: React.RefObject<View | null>;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
export class MapHeatmap extends React.Component<MapHeatmapProps | null> {
|
|
84
|
+
// declaration only, as they are set through decorateMap
|
|
85
|
+
/// @ts-ignore
|
|
86
|
+
context!: React.ContextType<typeof ProviderContext>;
|
|
87
|
+
getNativeComponent!: () => NativeComponent<NativeProps>;
|
|
88
|
+
getMapManagerCommand!: (name: string) => MapManagerCommand;
|
|
89
|
+
getUIManagerCommand!: (name: string) => UIManagerCommand;
|
|
90
|
+
|
|
91
|
+
private heatmap: NativeProps['ref'];
|
|
92
|
+
|
|
93
|
+
constructor(props: MapHeatmapProps) {
|
|
94
|
+
super(props);
|
|
95
|
+
this.heatmap = React.createRef<View>();
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
setNativeProps(props: Partial<NativeProps>) {
|
|
99
|
+
this.heatmap.current?.setNativeProps(props);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
render() {
|
|
103
|
+
const AIRMapHeatmap = this.getNativeComponent();
|
|
104
|
+
const propGradient = this.props?.gradient;
|
|
105
|
+
let gradient: NativeProps['gradient'];
|
|
106
|
+
if (propGradient) {
|
|
107
|
+
const colors = propGradient.colors.map(c => processColor(c));
|
|
108
|
+
gradient = {...propGradient, colors};
|
|
109
|
+
}
|
|
110
|
+
return (
|
|
111
|
+
<AIRMapHeatmap {...this.props} gradient={gradient} ref={this.heatmap} />
|
|
112
|
+
);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export default decorateMapComponent(MapHeatmap, 'Heatmap', {
|
|
117
|
+
google: {
|
|
118
|
+
ios: SUPPORTED,
|
|
119
|
+
android: USES_DEFAULT_IMPLEMENTATION,
|
|
120
|
+
},
|
|
121
|
+
});
|
|
122
|
+
|
|
123
|
+
type WeightedLatLng = LatLng & {
|
|
124
|
+
weight?: number;
|
|
125
|
+
};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {ViewProps} from 'react-native';
|
|
3
|
+
|
|
4
|
+
import decorateMapComponent, {
|
|
5
|
+
USES_DEFAULT_IMPLEMENTATION,
|
|
6
|
+
SUPPORTED,
|
|
7
|
+
ProviderContext,
|
|
8
|
+
NativeComponent,
|
|
9
|
+
MapManagerCommand,
|
|
10
|
+
UIManagerCommand,
|
|
11
|
+
} from './decorateMapComponent';
|
|
12
|
+
|
|
13
|
+
export type MapLocalTileProps = ViewProps & {
|
|
14
|
+
/**
|
|
15
|
+
* @platform iOS: Apple Maps only
|
|
16
|
+
* @platform Android: Supported
|
|
17
|
+
*/
|
|
18
|
+
pathTemplate: string;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @platform iOS: Apple Maps only
|
|
22
|
+
* @platform Android: Supported
|
|
23
|
+
*/
|
|
24
|
+
tileSize?: number;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Set to true to use pathTemplate to open files from Android's AssetManager. The default is false.
|
|
28
|
+
* @platform android
|
|
29
|
+
*/
|
|
30
|
+
useAssets?: boolean;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* @platform iOS: Not supported
|
|
34
|
+
* @platform Android: Supported
|
|
35
|
+
*/
|
|
36
|
+
zIndex?: number;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
type NativeProps = MapLocalTileProps;
|
|
40
|
+
|
|
41
|
+
export class MapLocalTile extends React.Component<MapLocalTileProps> {
|
|
42
|
+
// declaration only, as they are set through decorateMap
|
|
43
|
+
/// @ts-ignore
|
|
44
|
+
context!: React.ContextType<typeof ProviderContext>;
|
|
45
|
+
getNativeComponent!: () => NativeComponent<NativeProps>;
|
|
46
|
+
getMapManagerCommand!: (name: string) => MapManagerCommand;
|
|
47
|
+
getUIManagerCommand!: (name: string) => UIManagerCommand;
|
|
48
|
+
|
|
49
|
+
render() {
|
|
50
|
+
const AIRMapLocalTile = this.getNativeComponent();
|
|
51
|
+
return <AIRMapLocalTile {...this.props} />;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export default decorateMapComponent(MapLocalTile, 'LocalTile', {
|
|
56
|
+
google: {
|
|
57
|
+
ios: SUPPORTED,
|
|
58
|
+
android: USES_DEFAULT_IMPLEMENTATION,
|
|
59
|
+
},
|
|
60
|
+
});
|