react-native-maps 1.21.0-alpha.9 → 1.21.0-alpha.91
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +45 -14
- package/android/generated/RCTAppDependencyProvider.h +25 -0
- package/android/generated/RCTAppDependencyProvider.mm +55 -0
- package/android/generated/RCTModulesConformingToProtocolsProvider.h +18 -0
- package/android/generated/RCTModulesConformingToProtocolsProvider.mm +33 -0
- package/android/generated/RCTThirdPartyComponentsProvider.h +16 -0
- package/android/generated/RCTThirdPartyComponentsProvider.mm +26 -0
- package/android/generated/ReactAppDependencyProvider.podspec +34 -0
- package/android/generated/java/com/facebook/fbreact/specs/NativeAirMapsModuleSpec.java +63 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsCalloutManagerDelegate.java +35 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsCalloutManagerInterface.java +18 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsCircleManagerDelegate.java +49 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsCircleManagerInterface.java +24 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsGooglePolygonManagerDelegate.java +49 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsGooglePolygonManagerInterface.java +24 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerDelegate.java +206 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsMapViewManagerInterface.java +74 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsMarkerManagerDelegate.java +104 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsMarkerManagerInterface.java +40 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsOverlayManagerDelegate.java +46 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsOverlayManagerInterface.java +24 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsPolylineManagerDelegate.java +58 -0
- package/android/generated/java/com/facebook/react/viewmanagers/RNMapsPolylineManagerInterface.java +27 -0
- package/android/generated/jni/CMakeLists.txt +36 -0
- package/android/generated/jni/RNMapsSpecs-generated.cpp +68 -0
- package/android/generated/jni/RNMapsSpecs.h +31 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.cpp +29 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.h +31 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/EventEmitters.cpp +984 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/EventEmitters.h +853 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/Props.cpp +193 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/Props.h +1223 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/RNMapsSpecsJSI-generated.cpp +74 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/RNMapsSpecsJSI.h +268 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.cpp +24 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.h +109 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/States.cpp +16 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/States.h +113 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +1 -1
- package/android/gradlew +1 -2
- package/android/src/main/java/com/rnmaps/fabric/CalloutManager.java +77 -0
- package/android/src/main/java/com/rnmaps/fabric/CircleManager.java +94 -0
- package/android/src/main/java/com/rnmaps/fabric/JSONUtil.java +86 -0
- package/android/src/main/java/com/rnmaps/fabric/MapViewManager.java +619 -0
- package/android/src/main/java/com/rnmaps/fabric/MarkerManager.java +258 -0
- package/android/src/main/java/com/rnmaps/fabric/NativeAirMapsModule.java +235 -2
- package/android/src/main/java/com/rnmaps/fabric/OverlayManager.java +95 -0
- package/android/src/main/java/com/rnmaps/fabric/PolygonManager.java +89 -0
- package/android/src/main/java/com/rnmaps/fabric/PolylineManager.java +121 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnCalloutPressEvent.java +25 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDeselectEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDoublePressEvent.java +27 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDragEndEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDragEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnDragStartEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnIndoorBuildingFocusedEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnIndoorLevelActivatedEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnKmlReadyEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnLongPressEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMapLoadedEvent.java +29 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMapReadyEvent.java +29 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDeselectEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragEndEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerDragStartEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerPressEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnMarkerSelectEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnPanDragEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnPoiClickEvent.java +27 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnPressEvent.java +27 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeCompleteEvent.java +30 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeEvent.java +48 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnRegionChangeStartEvent.java +33 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnSelectEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/fabric/event/OnUserLocationChangeEvent.java +28 -0
- package/android/src/main/java/com/rnmaps/maps/MapAirModulePackage.java +38 -2
- package/android/src/main/java/com/rnmaps/maps/MapCallout.java +18 -0
- package/android/src/main/java/com/rnmaps/maps/MapCircle.java +24 -0
- package/android/src/main/java/com/rnmaps/maps/MapManager.java +14 -14
- package/android/src/main/java/com/rnmaps/maps/MapMarker.java +79 -3
- package/android/src/main/java/com/rnmaps/maps/MapModule.java +206 -206
- package/android/src/main/java/com/rnmaps/maps/MapOverlay.java +267 -151
- package/android/src/main/java/com/rnmaps/maps/MapPolygon.java +31 -1
- package/android/src/main/java/com/rnmaps/maps/MapPolyline.java +207 -141
- package/android/src/main/java/com/rnmaps/maps/MapPolylineManager.java +1 -16
- package/android/src/main/java/com/rnmaps/maps/MapView.java +1653 -1337
- package/ios/AirGoogleMaps/AIRGoogleMap.h +1 -0
- package/ios/AirGoogleMaps/AIRGoogleMap.m +106 -58
- package/ios/AirGoogleMaps/AIRGoogleMapCircle.m +23 -11
- package/ios/AirGoogleMaps/AIRGoogleMapManager.m +3 -1
- package/ios/AirGoogleMaps/AIRGoogleMapMarker.h +2 -0
- package/ios/AirGoogleMaps/AIRGoogleMapMarker.m +347 -243
- package/ios/AirGoogleMaps/AIRGoogleMapPolygon.h +2 -1
- package/ios/AirGoogleMaps/AIRGoogleMapPolygon.m +30 -0
- package/ios/AirGoogleMaps/AIRGoogleMapPolyline.h +0 -1
- package/ios/AirGoogleMaps/AIRGoogleMapPolyline.m +0 -7
- package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.h +1 -1
- package/ios/AirGoogleMaps/AIRGoogleMapWMSTile.m +2 -2
- package/ios/AirGoogleMaps/RCTConvert+GMSMapViewType.m +2 -0
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +197 -61
- package/ios/AirGoogleMaps/RNMapsGooglePolygonView.h +26 -0
- package/ios/AirGoogleMaps/RNMapsGooglePolygonView.mm +215 -0
- package/ios/AirGoogleMaps/RNMapsGooglePolygonViewManager.mm +25 -0
- package/ios/AirMaps/AIRMap.h +2 -1
- package/ios/AirMaps/AIRMap.m +227 -236
- package/ios/AirMaps/AIRMapManager.m +6 -0
- 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/RNMapsAirModule.h +1 -1
- package/ios/AirMaps/RNMapsAirModule.mm +4 -3
- package/ios/AirMaps/RNMapsAirModuleDelegate.h +24 -0
- package/ios/AirMaps/RNMapsHostVewDelegate.h +17 -0
- package/ios/AirMaps/RNMapsMapView.mm +336 -307
- package/ios/AirMaps/RNMapsMarkerView.h +24 -0
- package/ios/AirMaps/RNMapsMarkerView.mm +427 -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/ios/AirMaps.xcodeproj/project.pbxproj +60 -0
- 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/generated/RNMapsSpecs/ComponentDescriptors.cpp +29 -0
- package/ios/generated/RNMapsSpecs/ComponentDescriptors.h +31 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.cpp +984 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.h +853 -0
- package/ios/generated/RNMapsSpecs/Props.cpp +193 -0
- package/ios/generated/RNMapsSpecs/Props.h +1223 -0
- package/ios/generated/RNMapsSpecs/RCTComponentViewHelpers.h +603 -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 +4 -0
- package/ios/generated/react-native-maps-generated-umbrella.h +14 -0
- package/lib/MapCircle.d.ts +1 -1
- package/lib/MapHeatmap.d.ts +2 -2
- package/lib/MapHeatmap.js +1 -1
- package/lib/MapMarker.d.ts +16 -3
- package/lib/MapMarker.js +58 -9
- package/lib/MapMarkerNativeComponent.js +0 -2
- package/lib/MapOverlay.d.ts +1 -0
- package/lib/MapOverlay.js +21 -9
- package/lib/MapPolygon.d.ts +1 -1
- package/lib/MapPolyline.d.ts +7 -7
- package/lib/MapView.d.ts +15 -27
- package/lib/MapView.js +109 -124
- package/lib/MapView.types.d.ts +1 -1
- package/lib/createFabricMap.d.ts +1 -0
- package/lib/createFabricMap.js +17 -4
- package/lib/decorateMapComponent.js +40 -0
- package/lib/specs/NativeAirMapsModule.d.ts +2 -2
- package/lib/specs/NativeComponentCallout.d.ts +46 -0
- package/lib/specs/NativeComponentCallout.js +9 -0
- package/lib/specs/NativeComponentCircle.d.ts +74 -0
- package/lib/specs/NativeComponentCircle.js +7 -0
- package/lib/specs/NativeComponentGoogleMapView.d.ts +15 -15
- package/lib/specs/NativeComponentGoogleMapView.js +1 -0
- package/lib/specs/NativeComponentGooglePolygon.d.ts +75 -0
- package/lib/specs/NativeComponentGooglePolygon.js +7 -0
- package/lib/specs/NativeComponentMapView.d.ts +28 -36
- package/lib/specs/NativeComponentMapView.js +2 -3
- package/lib/specs/NativeComponentMarker.d.ts +258 -0
- package/lib/specs/NativeComponentMarker.js +19 -0
- package/lib/specs/NativeComponentOverlay.d.ts +67 -0
- package/lib/specs/NativeComponentOverlay.js +7 -0
- package/lib/specs/NativeComponentPolyline.d.ts +101 -0
- package/lib/specs/NativeComponentPolyline.js +7 -0
- package/package.json +27 -21
- package/react-native-maps.podspec +61 -16
package/lib/MapView.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Animated as RNAnimated, Animated, NativeSyntheticEvent, ViewProps } from 'react-native';
|
|
3
3
|
import { CalloutPressEvent, ClickEvent, Frame, LatLng, MarkerDeselectEvent, MarkerDragEvent, MarkerDragStartEndEvent, MarkerPressEvent, MarkerSelectEvent, Point, Provider, Region } from './sharedTypes';
|
|
4
|
-
import { Address, BoundingBox, Camera, CameraZoomRange, ChangeEvent, Details, EdgePadding, FitToOptions,
|
|
4
|
+
import { ActiveIndoorLevel, Address, BoundingBox, Camera, CameraZoomRange, ChangeEvent, Details, EdgePadding, FitToOptions, IndoorBuilding, KmlMapEvent, LongPressEvent, MapPressEvent, MapStyleElement, MapType, MapTypes, PanDragEvent, PoiClickEvent, SnapshotOptions, UserLocationChangeEvent } from './MapView.types';
|
|
5
5
|
import { Modify } from './sharedTypesInternal';
|
|
6
6
|
import { MapViewNativeComponentType } from './MapViewNativeComponent';
|
|
7
7
|
import AnimatedRegion from './AnimatedRegion';
|
|
@@ -217,14 +217,14 @@ export type MapViewProps = ViewProps & {
|
|
|
217
217
|
* @platform iOS: Google Maps only
|
|
218
218
|
* @platform Android: Supported
|
|
219
219
|
*/
|
|
220
|
-
onIndoorBuildingFocused?: (
|
|
220
|
+
onIndoorBuildingFocused?: (indoorBuilding: IndoorBuilding) => void;
|
|
221
221
|
/**
|
|
222
222
|
* Callback that is called when a level on indoor building is activated
|
|
223
223
|
*
|
|
224
224
|
* @platform iOS: Google Maps only
|
|
225
225
|
* @platform Android: Supported
|
|
226
226
|
*/
|
|
227
|
-
onIndoorLevelActivated?: (
|
|
227
|
+
onIndoorLevelActivated?: (indoorLevel: ActiveIndoorLevel) => void;
|
|
228
228
|
/**
|
|
229
229
|
* Callback that is called once the kml is fully loaded.
|
|
230
230
|
*
|
|
@@ -426,7 +426,7 @@ export type MapViewProps = ViewProps & {
|
|
|
426
426
|
* If `false` compass won't be displayed on the map.
|
|
427
427
|
*
|
|
428
428
|
* @default true
|
|
429
|
-
* @platform iOS: Supported
|
|
429
|
+
* @platform iOS: Supported (adaptive on Apple Maps, visible only if map is not pointing north)
|
|
430
430
|
* @platform Android: Supported
|
|
431
431
|
*/
|
|
432
432
|
showsCompass?: boolean;
|
|
@@ -454,32 +454,14 @@ export type MapViewProps = ViewProps & {
|
|
|
454
454
|
* @platform Android: Supported
|
|
455
455
|
*/
|
|
456
456
|
showsMyLocationButton?: boolean;
|
|
457
|
-
/**
|
|
458
|
-
* If `false` points of interest won't be displayed on the map.
|
|
459
|
-
* TODO: DEPRECATED? Doesn't seem to do anything
|
|
460
|
-
*
|
|
461
|
-
* @default true
|
|
462
|
-
* @platform iOS: Maybe Apple Maps?
|
|
463
|
-
* @platform Android: Not supported
|
|
464
|
-
*/
|
|
465
|
-
showsPointsOfInterest?: boolean;
|
|
466
457
|
/**
|
|
467
458
|
* A Boolean indicating whether the map shows scale information.
|
|
468
459
|
*
|
|
469
|
-
* @default
|
|
460
|
+
* @default false
|
|
470
461
|
* @platform iOS: Apple Maps only
|
|
471
462
|
* @platform Android: Not supported
|
|
472
463
|
*/
|
|
473
464
|
showsScale?: boolean;
|
|
474
|
-
/**
|
|
475
|
-
* A Boolean value indicating whether the map displays traffic information.
|
|
476
|
-
* TODO: Look into android support
|
|
477
|
-
*
|
|
478
|
-
* @default false
|
|
479
|
-
* @platform iOS: Supported
|
|
480
|
-
* @platform Android: Not supported?
|
|
481
|
-
*/
|
|
482
|
-
showsTraffic?: boolean;
|
|
483
465
|
/**
|
|
484
466
|
* If `true` the users location will be displayed on the map.
|
|
485
467
|
*
|
|
@@ -510,8 +492,8 @@ export type MapViewProps = ViewProps & {
|
|
|
510
492
|
* Sets the map to the style selected.
|
|
511
493
|
*
|
|
512
494
|
* @default System setting
|
|
513
|
-
* @platform iOS:
|
|
514
|
-
* @platform Android:
|
|
495
|
+
* @platform iOS: Supported
|
|
496
|
+
* @platform Android: Supported
|
|
515
497
|
*/
|
|
516
498
|
userInterfaceStyle?: 'light' | 'dark';
|
|
517
499
|
/**
|
|
@@ -604,7 +586,7 @@ type ModifiedProps = Modify<MapViewProps, {
|
|
|
604
586
|
initialRegion?: MapViewProps['initialRegion'] | null;
|
|
605
587
|
}>;
|
|
606
588
|
export type NativeProps = Omit<ModifiedProps, 'customMapStyle' | 'onRegionChange' | 'onRegionChangeComplete'> & {
|
|
607
|
-
ref: React.RefObject<MapViewNativeComponentType>;
|
|
589
|
+
ref: React.RefObject<MapViewNativeComponentType | null>;
|
|
608
590
|
customMapStyleString?: string;
|
|
609
591
|
handlePanDrag?: boolean;
|
|
610
592
|
onChange?: (e: ChangeEvent) => void;
|
|
@@ -626,6 +608,7 @@ declare class MapView extends React.Component<MapViewProps, State> {
|
|
|
626
608
|
duration?: number;
|
|
627
609
|
}): void;
|
|
628
610
|
animateToRegion(region: Region, duration?: number): void;
|
|
611
|
+
setRegion(region: Region): void;
|
|
629
612
|
fitToElements(options?: FitToOptions): void;
|
|
630
613
|
fitToSuppliedMarkers(markers: string[], options?: FitToOptions): void;
|
|
631
614
|
fitToCoordinates(coordinates?: LatLng[], options?: FitToOptions): void;
|
|
@@ -636,7 +619,7 @@ declare class MapView extends React.Component<MapViewProps, State> {
|
|
|
636
619
|
*/
|
|
637
620
|
getMapBoundaries(): Promise<BoundingBox>;
|
|
638
621
|
setMapBoundaries(northEast: LatLng, southWest: LatLng): void;
|
|
639
|
-
setIndoorActiveLevelIndex(activeLevelIndex: number): void
|
|
622
|
+
setIndoorActiveLevelIndex(activeLevelIndex: number): void | Promise<never>;
|
|
640
623
|
/**
|
|
641
624
|
* Takes a snapshot of the map and saves it to a picture
|
|
642
625
|
* file or returns the image as a base64 encoded string.
|
|
@@ -707,8 +690,13 @@ declare class MapView extends React.Component<MapViewProps, State> {
|
|
|
707
690
|
private handleMapPress;
|
|
708
691
|
private handleMarkerPress;
|
|
709
692
|
private handleMarkerSelect;
|
|
693
|
+
private handleKmlReady;
|
|
710
694
|
private handleMarkerDeselect;
|
|
711
695
|
private handleRegionChange;
|
|
696
|
+
private handleRegionChangeStarted;
|
|
697
|
+
private handleIndoorBuildingFocused;
|
|
698
|
+
private handleIndoorLevelActivated;
|
|
699
|
+
private handleRegionChangeComplete;
|
|
712
700
|
render(): React.JSX.Element;
|
|
713
701
|
}
|
|
714
702
|
export declare const AnimatedMapView: RNAnimated.AnimatedComponent<typeof MapView>;
|
package/lib/MapView.js
CHANGED
|
@@ -35,7 +35,10 @@ const NativeComponentMapView_1 = __importStar(require("./specs/NativeComponentMa
|
|
|
35
35
|
const NativeComponentGoogleMapView_1 = __importStar(require("./specs/NativeComponentGoogleMapView"));
|
|
36
36
|
const createFabricMap_1 = __importDefault(require("./createFabricMap"));
|
|
37
37
|
const FabricMap = (0, createFabricMap_1.default)(NativeComponentMapView_1.default, NativeComponentMapView_1.Commands);
|
|
38
|
-
|
|
38
|
+
var FabricGoogleMap = null;
|
|
39
|
+
if (react_native_1.Platform.OS === 'ios') {
|
|
40
|
+
FabricGoogleMap = (0, createFabricMap_1.default)(NativeComponentGoogleMapView_1.default, NativeComponentGoogleMapView_1.Commands);
|
|
41
|
+
}
|
|
39
42
|
exports.MAP_TYPES = {
|
|
40
43
|
STANDARD: 'standard',
|
|
41
44
|
SATELLITE: 'satellite',
|
|
@@ -55,7 +58,7 @@ class MapView extends React.Component {
|
|
|
55
58
|
this.map = React.createRef();
|
|
56
59
|
this.fabricMap = React.createRef();
|
|
57
60
|
this.state = {
|
|
58
|
-
isReady:
|
|
61
|
+
isReady: false,
|
|
59
62
|
};
|
|
60
63
|
this._onMapReady = this._onMapReady.bind(this);
|
|
61
64
|
this._onChange = this._onChange.bind(this);
|
|
@@ -85,13 +88,8 @@ class MapView extends React.Component {
|
|
|
85
88
|
}
|
|
86
89
|
}
|
|
87
90
|
getCamera() {
|
|
88
|
-
if (
|
|
89
|
-
return
|
|
90
|
-
}
|
|
91
|
-
else if (react_native_1.Platform.OS === 'ios') {
|
|
92
|
-
if (this.fabricMap.current) {
|
|
93
|
-
return this.fabricMap.current.getCamera();
|
|
94
|
-
}
|
|
91
|
+
if (this.fabricMap.current) {
|
|
92
|
+
return this.fabricMap.current.getCamera();
|
|
95
93
|
}
|
|
96
94
|
return Promise.reject('getCamera not supported on this platform');
|
|
97
95
|
}
|
|
@@ -119,6 +117,12 @@ class MapView extends React.Component {
|
|
|
119
117
|
MapViewNativeComponent_1.Commands.animateToRegion(this.map.current, region, duration);
|
|
120
118
|
}
|
|
121
119
|
}
|
|
120
|
+
setRegion(region) {
|
|
121
|
+
if (this.fabricMap.current) {
|
|
122
|
+
this.fabricMap.current.animateToRegion(region, 0);
|
|
123
|
+
}
|
|
124
|
+
//TODO fix for android
|
|
125
|
+
}
|
|
122
126
|
fitToElements(options = {}) {
|
|
123
127
|
const { edgePadding = { top: 0, right: 0, bottom: 0, left: 0 }, animated = true, } = options;
|
|
124
128
|
if (this.fabricMap.current) {
|
|
@@ -152,13 +156,8 @@ class MapView extends React.Component {
|
|
|
152
156
|
* @return Promise Promise with the bounding box ({ northEast: <LatLng>, southWest: <LatLng> })
|
|
153
157
|
*/
|
|
154
158
|
async getMapBoundaries() {
|
|
155
|
-
if (
|
|
156
|
-
return
|
|
157
|
-
}
|
|
158
|
-
else if (react_native_1.Platform.OS === 'ios') {
|
|
159
|
-
if (this.fabricMap.current) {
|
|
160
|
-
return this.fabricMap.current.getMapBoundaries();
|
|
161
|
-
}
|
|
159
|
+
if (this.fabricMap.current) {
|
|
160
|
+
return this.fabricMap.current.getMapBoundaries();
|
|
162
161
|
}
|
|
163
162
|
return Promise.reject('getMapBoundaries not supported on this platform');
|
|
164
163
|
}
|
|
@@ -168,9 +167,10 @@ class MapView extends React.Component {
|
|
|
168
167
|
}
|
|
169
168
|
}
|
|
170
169
|
setIndoorActiveLevelIndex(activeLevelIndex) {
|
|
171
|
-
if (this.
|
|
172
|
-
|
|
170
|
+
if (this.fabricMap.current) {
|
|
171
|
+
return this.fabricMap.current.setIndoorActiveLevelIndex(activeLevelIndex);
|
|
173
172
|
}
|
|
173
|
+
return Promise.reject('getMapBoundaries not supported on this platform');
|
|
174
174
|
}
|
|
175
175
|
/**
|
|
176
176
|
* Takes a snapshot of the map and saves it to a picture
|
|
@@ -202,15 +202,9 @@ class MapView extends React.Component {
|
|
|
202
202
|
if (config.result !== 'file' && config.result !== 'base64') {
|
|
203
203
|
throw new Error('Invalid result specified');
|
|
204
204
|
}
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
return
|
|
208
|
-
}
|
|
209
|
-
else if (react_native_1.Platform.OS === 'ios') {
|
|
210
|
-
if (this.fabricMap.current) {
|
|
211
|
-
// @ts-ignore
|
|
212
|
-
return this.fabricMap.current.takeSnapshot(config);
|
|
213
|
-
}
|
|
205
|
+
if (this.fabricMap.current) {
|
|
206
|
+
// @ts-ignore
|
|
207
|
+
return this.fabricMap.current.takeSnapshot(config);
|
|
214
208
|
}
|
|
215
209
|
return Promise.reject('takeSnapshot not supported on this platform');
|
|
216
210
|
}
|
|
@@ -224,13 +218,8 @@ class MapView extends React.Component {
|
|
|
224
218
|
* @return Promise with return type Address
|
|
225
219
|
*/
|
|
226
220
|
addressForCoordinate(coordinate) {
|
|
227
|
-
if (
|
|
228
|
-
return
|
|
229
|
-
}
|
|
230
|
-
else if (react_native_1.Platform.OS === 'ios') {
|
|
231
|
-
if (this.fabricMap.current) {
|
|
232
|
-
return this.fabricMap.current.getAddressFromCoordinates(coordinate);
|
|
233
|
-
}
|
|
221
|
+
if (this.fabricMap.current) {
|
|
222
|
+
return this.fabricMap.current.getAddressFromCoordinates(coordinate);
|
|
234
223
|
}
|
|
235
224
|
return Promise.reject('getAddress not supported on this platform');
|
|
236
225
|
}
|
|
@@ -244,13 +233,8 @@ class MapView extends React.Component {
|
|
|
244
233
|
* @return Promise Promise with the point ({ x: Number, y: Number })
|
|
245
234
|
*/
|
|
246
235
|
pointForCoordinate(coordinate) {
|
|
247
|
-
if (
|
|
248
|
-
return
|
|
249
|
-
}
|
|
250
|
-
else if (react_native_1.Platform.OS === 'ios') {
|
|
251
|
-
if (this.fabricMap.current) {
|
|
252
|
-
return this.fabricMap.current.getPointForCoordinate(coordinate);
|
|
253
|
-
}
|
|
236
|
+
if (this.fabricMap.current) {
|
|
237
|
+
return this.fabricMap.current.getPointForCoordinate(coordinate);
|
|
254
238
|
}
|
|
255
239
|
return Promise.reject('pointForCoordinate not supported on this platform');
|
|
256
240
|
}
|
|
@@ -264,13 +248,8 @@ class MapView extends React.Component {
|
|
|
264
248
|
* @return Promise Promise with the coordinate ({ latitude: Number, longitude: Number })
|
|
265
249
|
*/
|
|
266
250
|
coordinateForPoint(point) {
|
|
267
|
-
if (
|
|
268
|
-
return
|
|
269
|
-
}
|
|
270
|
-
else if (react_native_1.Platform.OS === 'ios') {
|
|
271
|
-
if (this.fabricMap.current) {
|
|
272
|
-
return this.fabricMap.current.getCoordinateForPoint(point);
|
|
273
|
-
}
|
|
251
|
+
if (this.fabricMap.current) {
|
|
252
|
+
return this.fabricMap.current.getCoordinateForPoint(point);
|
|
274
253
|
}
|
|
275
254
|
return Promise.reject('coordinateForPoint not supported on this platform');
|
|
276
255
|
}
|
|
@@ -282,11 +261,9 @@ class MapView extends React.Component {
|
|
|
282
261
|
* @return Promise Promise with { <identifier>: { point: Point, frame: Frame } }
|
|
283
262
|
*/
|
|
284
263
|
getMarkersFrames(onlyVisible = false) {
|
|
285
|
-
if (
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
return this.fabricMap.current.getMarkersFrames(onlyVisible);
|
|
289
|
-
}
|
|
264
|
+
if (this.fabricMap.current) {
|
|
265
|
+
// @ts-ignore
|
|
266
|
+
return this.fabricMap.current.getMarkersFrames(onlyVisible);
|
|
290
267
|
}
|
|
291
268
|
return Promise.reject('getMarkersFrames not supported on this platform');
|
|
292
269
|
}
|
|
@@ -327,6 +304,11 @@ class MapView extends React.Component {
|
|
|
327
304
|
this.props.onMarkerSelect(event);
|
|
328
305
|
}
|
|
329
306
|
};
|
|
307
|
+
handleKmlReady = (event) => {
|
|
308
|
+
if (this.props.onKmlReady) {
|
|
309
|
+
this.props.onKmlReady(event);
|
|
310
|
+
}
|
|
311
|
+
};
|
|
330
312
|
handleMarkerDeselect = (event) => {
|
|
331
313
|
if (this.props.onMarkerDeselect) {
|
|
332
314
|
this.props.onMarkerDeselect(event);
|
|
@@ -344,82 +326,86 @@ class MapView extends React.Component {
|
|
|
344
326
|
this.props.onRegionChangeComplete(event.nativeEvent.region, details);
|
|
345
327
|
}
|
|
346
328
|
};
|
|
329
|
+
handleRegionChangeStarted = (event) => {
|
|
330
|
+
if (this.props.onRegionChangeStart) {
|
|
331
|
+
this.props.onRegionChangeStart(event);
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
handleIndoorBuildingFocused = (event) => {
|
|
335
|
+
if (this.props.onIndoorBuildingFocused) {
|
|
336
|
+
this.props.onIndoorBuildingFocused(event);
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
handleIndoorLevelActivated = (event) => {
|
|
340
|
+
if (this.props.onIndoorLevelActivated) {
|
|
341
|
+
this.props.onIndoorLevelActivated(event);
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
handleRegionChangeComplete = (event) => {
|
|
345
|
+
const isGesture = event.nativeEvent.isGesture;
|
|
346
|
+
const details = { isGesture };
|
|
347
|
+
if (this.props.onRegionChangeComplete) {
|
|
348
|
+
this.props.onRegionChangeComplete(event.nativeEvent.region, details);
|
|
349
|
+
}
|
|
350
|
+
};
|
|
347
351
|
render() {
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
352
|
+
// Define props specifically for MapFabricNativeProps
|
|
353
|
+
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
354
|
+
const { onCalloutPress, onIndoorBuildingFocused, onKmlReady, onLongPress, onMarkerDeselect, onMarkerPress, onMarkerSelect, onRegionChangeStart, onRegionChange, onRegionChangeComplete, onPress, minZoomLevel, maxZoomLevel, region, provider, children, ...restProps } = this.props;
|
|
355
|
+
/* eslint-enable @typescript-eslint/no-unused-vars */
|
|
356
|
+
const userInterfaceStyle = this.props.userInterfaceStyle || 'system';
|
|
357
|
+
const props = {
|
|
358
|
+
onMapReady: this._onMapReady,
|
|
359
|
+
liteMode: this.props.liteMode,
|
|
360
|
+
googleMapId: this.props.googleMapId,
|
|
361
|
+
googleRenderer: this.props.googleRenderer,
|
|
362
|
+
onPress: this.handleMapPress,
|
|
363
|
+
onMarkerPress: this.handleMarkerPress,
|
|
364
|
+
onMarkerSelect: this.handleMarkerSelect,
|
|
365
|
+
onMarkerDeselect: this.handleMarkerDeselect,
|
|
366
|
+
onKmlReady: this.handleKmlReady,
|
|
367
|
+
userInterfaceStyle: userInterfaceStyle,
|
|
368
|
+
minZoom: minZoomLevel,
|
|
369
|
+
maxZoom: maxZoomLevel,
|
|
370
|
+
onRegionChange: this.handleRegionChange,
|
|
371
|
+
onRegionChangeStart: this.handleRegionChangeStarted,
|
|
372
|
+
onRegionChangeComplete: this.handleRegionChangeComplete,
|
|
373
|
+
onIndoorBuildingFocused: this.handleIndoorBuildingFocused,
|
|
374
|
+
// @ts-ignore
|
|
375
|
+
onIndoorLevelActivated: this.handleIndoorLevelActivated,
|
|
376
|
+
...restProps,
|
|
377
|
+
};
|
|
378
|
+
if (this.props.region) {
|
|
379
|
+
props.region = {
|
|
380
|
+
latitude: this.props.region.latitude,
|
|
381
|
+
longitude: this.props.region.longitude,
|
|
382
|
+
latitudeDelta: this.props.region.latitudeDelta,
|
|
383
|
+
longitudeDelta: this.props.region.longitudeDelta,
|
|
368
384
|
};
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
latitudeDelta: this.props.region.latitudeDelta,
|
|
374
|
-
longitudeDelta: this.props.region.longitudeDelta,
|
|
375
|
-
};
|
|
376
|
-
}
|
|
377
|
-
if (!this.state.isReady) {
|
|
378
|
-
props.style = this.props.style;
|
|
379
|
-
props.initialCamera = this.props.initialCamera;
|
|
380
|
-
props.onLayout = this.props.onLayout;
|
|
381
|
-
}
|
|
382
|
-
if (provider === 'google') {
|
|
383
|
-
return (<decorateMapComponent_1.ProviderContext.Provider value={this.props.provider}>
|
|
384
|
-
<FabricGoogleMap {...props} ref={this.fabricMap}/>
|
|
385
|
-
</decorateMapComponent_1.ProviderContext.Provider>);
|
|
386
|
-
}
|
|
387
|
-
else {
|
|
388
|
-
return (<decorateMapComponent_1.ProviderContext.Provider value={this.props.provider}>
|
|
389
|
-
<FabricMap {...props} ref={this.fabricMap}/>
|
|
390
|
-
</decorateMapComponent_1.ProviderContext.Provider>);
|
|
385
|
+
}
|
|
386
|
+
if (this.state.isReady) {
|
|
387
|
+
if (props.onPanDrag) {
|
|
388
|
+
props.handlePanDrag = !!props.onPanDrag;
|
|
391
389
|
}
|
|
392
390
|
}
|
|
393
391
|
else {
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
: undefined,
|
|
408
|
-
...this.props,
|
|
409
|
-
};
|
|
410
|
-
if (this.state.isReady) {
|
|
411
|
-
if (props.onPanDrag) {
|
|
412
|
-
props.handlePanDrag = !!props.onPanDrag;
|
|
413
|
-
}
|
|
414
|
-
}
|
|
415
|
-
else {
|
|
416
|
-
props.style = this.props.style;
|
|
417
|
-
props.initialCamera = this.props.initialCamera;
|
|
418
|
-
props.onLayout = this.props.onLayout;
|
|
419
|
-
}
|
|
420
|
-
// Render AIRMap with NativeProps
|
|
392
|
+
props.style = this.props.style;
|
|
393
|
+
props.initialCamera = this.props.initialCamera;
|
|
394
|
+
props.onLayout = this.props.onLayout;
|
|
395
|
+
}
|
|
396
|
+
const childrenNodes = this.state.isReady ? children : null;
|
|
397
|
+
if (provider === 'google' && react_native_1.Platform.OS === 'ios') {
|
|
398
|
+
return (<decorateMapComponent_1.ProviderContext.Provider value={this.props.provider}>
|
|
399
|
+
<FabricGoogleMap {...props} ref={this.fabricMap}>
|
|
400
|
+
{childrenNodes}
|
|
401
|
+
</FabricGoogleMap>
|
|
402
|
+
</decorateMapComponent_1.ProviderContext.Provider>);
|
|
403
|
+
}
|
|
404
|
+
else {
|
|
421
405
|
return (<decorateMapComponent_1.ProviderContext.Provider value={this.props.provider}>
|
|
422
|
-
<
|
|
406
|
+
<FabricMap {...props} ref={this.fabricMap}>
|
|
407
|
+
{childrenNodes}
|
|
408
|
+
</FabricMap>
|
|
423
409
|
</decorateMapComponent_1.ProviderContext.Provider>);
|
|
424
410
|
}
|
|
425
411
|
}
|
|
@@ -436,7 +422,6 @@ else {
|
|
|
436
422
|
? (0, react_native_1.requireNativeComponent)('AIRGoogleMap')
|
|
437
423
|
: (0, decorateMapComponent_1.createNotSupportedComponent)('react-native-maps: AirGoogleMaps dir must be added to your xCode project to support GoogleMaps on iOS.');
|
|
438
424
|
}
|
|
439
|
-
const getNativeMapComponent = (provider) => airMaps[provider || 'default'];
|
|
440
425
|
exports.AnimatedMapView = react_native_1.Animated.createAnimatedComponent(MapView);
|
|
441
426
|
MapView.Animated = exports.AnimatedMapView;
|
|
442
427
|
exports.default = MapView;
|
package/lib/MapView.types.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export type ActiveIndoorLevel = {
|
|
|
46
46
|
shortName: string;
|
|
47
47
|
};
|
|
48
48
|
export type IndoorLevelActivatedEvent = NativeSyntheticEvent<{
|
|
49
|
-
|
|
49
|
+
indoorLevel: ActiveIndoorLevel;
|
|
50
50
|
}>;
|
|
51
51
|
export type IndoorBuilding = {
|
|
52
52
|
underground: boolean;
|
package/lib/createFabricMap.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ export interface FabricMapHandle {
|
|
|
18
18
|
getAddressFromCoordinates: (coordinate: LatLng) => Promise<Address>;
|
|
19
19
|
getPointForCoordinate: (coordinate: LatLng) => Promise<Point>;
|
|
20
20
|
getCoordinateForPoint: (point: Point) => Promise<LatLng>;
|
|
21
|
+
setIndoorActiveLevelIndex: (activeLevelIndex: number) => void;
|
|
21
22
|
}
|
|
22
23
|
declare const createFabricMap: (ViewComponent: React.ComponentType, Commands: any) => React.ForwardRefExoticComponent<MapFabricNativeProps & React.RefAttributes<FabricMapHandle>>;
|
|
23
24
|
export default createFabricMap;
|
package/lib/createFabricMap.js
CHANGED
|
@@ -54,7 +54,7 @@ const createFabricMap = (ViewComponent, Commands) => {
|
|
|
54
54
|
return NativeAirMapsModule_1.default.getPointForCoordinate((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, coordinate);
|
|
55
55
|
}
|
|
56
56
|
else {
|
|
57
|
-
throw new Error('getPointForCoordinate is
|
|
57
|
+
throw new Error('getPointForCoordinate is not supported on this platform.');
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
60
|
async getAddressFromCoordinates(coordinate) {
|
|
@@ -62,12 +62,12 @@ const createFabricMap = (ViewComponent, Commands) => {
|
|
|
62
62
|
return NativeAirMapsModule_1.default.getAddressFromCoordinates((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, coordinate);
|
|
63
63
|
}
|
|
64
64
|
else {
|
|
65
|
-
throw new Error('getAddressFromCoordinates is
|
|
65
|
+
throw new Error('getAddressFromCoordinates is not supported on this platform');
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
68
|
async takeSnapshot(config) {
|
|
69
69
|
if (fabricRef.current) {
|
|
70
|
-
return NativeAirMapsModule_1.default.takeSnapshot((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, config);
|
|
70
|
+
return NativeAirMapsModule_1.default.takeSnapshot((0, react_native_1.findNodeHandle)(fabricRef.current) ?? -1, JSON.stringify(config));
|
|
71
71
|
}
|
|
72
72
|
else {
|
|
73
73
|
throw new Error('takeSnapshot is only supported on iOS with Fabric.');
|
|
@@ -154,6 +154,19 @@ const createFabricMap = (ViewComponent, Commands) => {
|
|
|
154
154
|
throw new Error('fitToCoordinates is only supported on iOS with Fabric.');
|
|
155
155
|
}
|
|
156
156
|
},
|
|
157
|
+
setIndoorActiveLevelIndex(activeLevelIndex) {
|
|
158
|
+
if (fabricRef.current) {
|
|
159
|
+
try {
|
|
160
|
+
Commands.setIndoorActiveLevelIndex(fabricRef.current, activeLevelIndex);
|
|
161
|
+
}
|
|
162
|
+
catch (error) {
|
|
163
|
+
console.error('Failed to set camera:', error);
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
else {
|
|
167
|
+
console.warn('setIndoorActiveLevelIndex is not supported.');
|
|
168
|
+
}
|
|
169
|
+
},
|
|
157
170
|
setCamera(camera) {
|
|
158
171
|
if (fabricRef.current) {
|
|
159
172
|
try {
|
|
@@ -164,7 +177,7 @@ const createFabricMap = (ViewComponent, Commands) => {
|
|
|
164
177
|
}
|
|
165
178
|
}
|
|
166
179
|
else {
|
|
167
|
-
console.warn('setCamera is
|
|
180
|
+
console.warn('setCamera is not supported');
|
|
168
181
|
}
|
|
169
182
|
},
|
|
170
183
|
}));
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.googleMapIsInstalled = exports.createNotSupportedComponent = exports.getNativeMapName = exports.ProviderContext = exports.NOT_SUPPORTED = exports.USES_DEFAULT_IMPLEMENTATION = exports.SUPPORTED = void 0;
|
|
4
7
|
const react_1 = require("react");
|
|
5
8
|
const react_native_1 = require("react-native");
|
|
6
9
|
const ProviderConstants_1 = require("./ProviderConstants");
|
|
10
|
+
const NativeComponentGooglePolygon_1 = __importDefault(require("./specs/NativeComponentGooglePolygon"));
|
|
11
|
+
const NativeComponentMarker_1 = __importDefault(require("./specs/NativeComponentMarker"));
|
|
12
|
+
const NativeComponentCallout_1 = __importDefault(require("./specs/NativeComponentCallout"));
|
|
13
|
+
const NativeComponentPolyline_1 = __importDefault(require("./specs/NativeComponentPolyline"));
|
|
14
|
+
const NativeComponentCircle_1 = __importDefault(require("./specs/NativeComponentCircle"));
|
|
15
|
+
const NativeComponentOverlay_1 = __importDefault(require("./specs/NativeComponentOverlay"));
|
|
7
16
|
exports.SUPPORTED = 'SUPPORTED';
|
|
8
17
|
exports.USES_DEFAULT_IMPLEMENTATION = 'USES_DEFAULT_IMPLEMENTATION';
|
|
9
18
|
exports.NOT_SUPPORTED = 'NOT_SUPPORTED';
|
|
@@ -34,6 +43,37 @@ function decorateMapComponent(Component, componentName, providers) {
|
|
|
34
43
|
Component.prototype.getNativeComponent =
|
|
35
44
|
function getNativeComponent() {
|
|
36
45
|
const provider = this.context;
|
|
46
|
+
if (componentName === 'Marker' &&
|
|
47
|
+
(react_native_1.Platform.OS !== 'ios' || provider !== ProviderConstants_1.PROVIDER_GOOGLE)) {
|
|
48
|
+
// @ts-ignore
|
|
49
|
+
return NativeComponentMarker_1.default;
|
|
50
|
+
}
|
|
51
|
+
if (componentName === 'Polygon' &&
|
|
52
|
+
((provider === ProviderConstants_1.PROVIDER_GOOGLE &&
|
|
53
|
+
react_native_1.Platform.OS === 'ios' &&
|
|
54
|
+
exports.googleMapIsInstalled) ||
|
|
55
|
+
react_native_1.Platform.OS === 'android')) {
|
|
56
|
+
// @ts-ignore
|
|
57
|
+
return NativeComponentGooglePolygon_1.default;
|
|
58
|
+
}
|
|
59
|
+
if (react_native_1.Platform.OS === 'android') {
|
|
60
|
+
if (componentName === 'Callout') {
|
|
61
|
+
// @ts-ignore
|
|
62
|
+
return NativeComponentCallout_1.default;
|
|
63
|
+
}
|
|
64
|
+
else if (componentName === 'Polyline') {
|
|
65
|
+
// @ts-ignore
|
|
66
|
+
return NativeComponentPolyline_1.default;
|
|
67
|
+
}
|
|
68
|
+
else if (componentName === 'Circle') {
|
|
69
|
+
// @ts-ignore
|
|
70
|
+
return NativeComponentCircle_1.default;
|
|
71
|
+
}
|
|
72
|
+
else if (componentName === 'Overlay') {
|
|
73
|
+
// @ts-ignore
|
|
74
|
+
return NativeComponentOverlay_1.default;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
37
77
|
const key = provider || 'default';
|
|
38
78
|
if (components[key]) {
|
|
39
79
|
return components[key];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { TurboModule } from 'react-native';
|
|
2
|
-
import type { Double
|
|
2
|
+
import type { Double } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
3
|
import type { Camera } from './NativeComponentMapView';
|
|
4
4
|
import { Address } from 'react-native-maps';
|
|
5
5
|
type LatLng = {
|
|
@@ -22,7 +22,7 @@ export interface Spec extends TurboModule {
|
|
|
22
22
|
getCamera(tag: Double): Promise<Camera>;
|
|
23
23
|
getMarkersFrames(tag: Double, onlyVisible: boolean): Promise<unknown>;
|
|
24
24
|
getMapBoundaries(tag: Double): Promise<MapBoundaries>;
|
|
25
|
-
takeSnapshot(tag: Double, config:
|
|
25
|
+
takeSnapshot(tag: Double, config: string): Promise<string>;
|
|
26
26
|
getAddressFromCoordinates(tag: Double, coordinate: LatLng): Promise<Address>;
|
|
27
27
|
getPointForCoordinate(tag: Double, coordinate: LatLng): Promise<Point>;
|
|
28
28
|
getCoordinateForPoint(tag: Double, point: Point): Promise<LatLng>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { HostComponent, ViewProps } 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 CalloutPressEvent = 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 CalloutFabricNativeProps extends ViewProps {
|
|
20
|
+
/**
|
|
21
|
+
* If `true`, clicks on transparent areas in callout will be passed to map.
|
|
22
|
+
*
|
|
23
|
+
* @default false
|
|
24
|
+
* @platform iOS: Supported
|
|
25
|
+
* @platform Android: Not supported
|
|
26
|
+
*/
|
|
27
|
+
alphaHitTest?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Callback that is called when the user presses on the callout
|
|
30
|
+
*
|
|
31
|
+
* @platform iOS: Apple Maps only
|
|
32
|
+
* @platform Android: Supported
|
|
33
|
+
*/
|
|
34
|
+
onPress?: CalloutPressEvent;
|
|
35
|
+
/**
|
|
36
|
+
* If `false`, a default "tooltip" bubble window will be drawn around this callouts children.
|
|
37
|
+
* If `true`, the child views can fully customize their appearance, including any "bubble" like styles.
|
|
38
|
+
*
|
|
39
|
+
* @default false
|
|
40
|
+
* @platform iOS: Supported
|
|
41
|
+
* @platform Android: Supported
|
|
42
|
+
*/
|
|
43
|
+
tooltip?: boolean;
|
|
44
|
+
}
|
|
45
|
+
declare const _default: HostComponent<CalloutFabricNativeProps>;
|
|
46
|
+
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)('RNMapsCallout', {
|
|
8
|
+
excludedPlatforms: ['iOS'],
|
|
9
|
+
});
|