react-native-maps 1.21.0-alpha.8 → 1.21.0-alpha.81
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/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/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 +27 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ComponentDescriptors.h +29 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/EventEmitters.cpp +940 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/EventEmitters.h +809 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/Props.cpp +170 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/Props.h +1142 -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 +22 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/ShadowNodes.h +87 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/States.cpp +16 -0
- package/android/generated/jni/react/renderer/components/RNMapsSpecs/States.h +89 -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/JSONUtil.java +86 -0
- package/android/src/main/java/com/rnmaps/fabric/MapViewManager.java +618 -0
- package/android/src/main/java/com/rnmaps/fabric/MarkerManager.java +259 -0
- package/android/src/main/java/com/rnmaps/fabric/NativeAirMapsModule.java +156 -4
- 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/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 +30 -2
- package/android/src/main/java/com/rnmaps/maps/MapCallout.java +18 -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/MapPolygon.java +29 -0
- 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 +1649 -1336
- package/ios/AirGoogleMaps/AIRGoogleMap.h +3 -2
- package/ios/AirGoogleMaps/AIRGoogleMap.m +155 -50
- package/ios/AirGoogleMaps/AIRGoogleMapCircle.m +23 -11
- package/ios/AirGoogleMaps/AIRGoogleMapManager.m +17 -28
- 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.h +3 -3
- package/ios/AirGoogleMaps/RNMapsGoogleMapView.mm +201 -60
- package/ios/AirGoogleMaps/RNMapsGooglePolygonView.h +26 -0
- package/ios/AirGoogleMaps/RNMapsGooglePolygonView.mm +217 -0
- package/ios/AirGoogleMaps/RNMapsGooglePolygonViewManager.mm +25 -0
- package/ios/AirMaps/AIRMap.h +5 -2
- package/ios/AirMaps/AIRMap.m +285 -153
- 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 +42 -172
- package/ios/AirMaps/RNMapsAirModuleDelegate.h +24 -0
- package/ios/AirMaps/RNMapsHostVewDelegate.h +17 -0
- package/ios/AirMaps/RNMapsMapView.h +3 -3
- package/ios/AirMaps/RNMapsMapView.mm +340 -308
- package/ios/AirMaps/RNMapsMarkerView.h +24 -0
- package/ios/AirMaps/RNMapsMarkerView.mm +430 -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 +27 -0
- package/ios/generated/RNMapsSpecs/ComponentDescriptors.h +29 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.cpp +940 -0
- package/ios/generated/RNMapsSpecs/EventEmitters.h +809 -0
- package/ios/generated/RNMapsSpecs/Props.cpp +170 -0
- package/ios/generated/RNMapsSpecs/Props.h +1142 -0
- package/ios/generated/RNMapsSpecs/RCTComponentViewHelpers.h +595 -0
- package/ios/generated/RNMapsSpecs/RNMapsSpecs-generated.mm +92 -0
- package/ios/generated/RNMapsSpecs/RNMapsSpecs.h +137 -0
- package/ios/generated/RNMapsSpecs/ShadowNodes.cpp +22 -0
- package/ios/generated/RNMapsSpecs/ShadowNodes.h +87 -0
- package/ios/generated/RNMapsSpecs/States.cpp +16 -0
- package/ios/generated/RNMapsSpecs/States.h +89 -0
- package/ios/generated/RNMapsSpecsJSI-generated.cpp +74 -0
- package/ios/generated/RNMapsSpecsJSI.h +268 -0
- package/ios/generated/ReactAppDependencyProvider.podspec +34 -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 +53 -9
- package/lib/MapMarkerNativeComponent.js +0 -2
- package/lib/MapOverlay.js +2 -8
- package/lib/MapPolygon.d.ts +1 -1
- package/lib/MapPolyline.d.ts +7 -7
- package/lib/MapView.d.ts +14 -27
- package/lib/MapView.js +97 -103
- package/lib/MapView.types.d.ts +1 -1
- package/lib/createFabricMap.d.ts +1 -0
- package/lib/createFabricMap.js +15 -2
- package/lib/decorateMapComponent.js +30 -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/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/NativeComponentPolyline.d.ts +101 -0
- package/lib/specs/NativeComponentPolyline.js +7 -0
- package/package.json +25 -20
- package/react-native-maps.podspec +2 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
#
|
|
3
|
+
# This source code is licensed under the MIT license found in the
|
|
4
|
+
# LICENSE file in the root directory of this source tree.
|
|
5
|
+
|
|
6
|
+
version = "0.78.0"
|
|
7
|
+
source = { :git => 'https://github.com/facebook/react-native.git' }
|
|
8
|
+
if version == '1000.0.0'
|
|
9
|
+
# This is an unpublished version, use the latest commit hash of the react-native repo, which we’re presumably in.
|
|
10
|
+
source[:commit] = `git rev-parse HEAD`.strip if system("git rev-parse --git-dir > /dev/null 2>&1")
|
|
11
|
+
else
|
|
12
|
+
source[:tag] = "v#{version}"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
Pod::Spec.new do |s|
|
|
16
|
+
s.name = "ReactAppDependencyProvider"
|
|
17
|
+
s.version = version
|
|
18
|
+
s.summary = "The third party dependency provider for the app"
|
|
19
|
+
s.homepage = "https://reactnative.dev/"
|
|
20
|
+
s.documentation_url = "https://reactnative.dev/"
|
|
21
|
+
s.license = "MIT"
|
|
22
|
+
s.author = "Meta Platforms, Inc. and its affiliates"
|
|
23
|
+
s.platforms = min_supported_versions
|
|
24
|
+
s.source = source
|
|
25
|
+
s.source_files = "**/RCTAppDependencyProvider.{h,mm}"
|
|
26
|
+
|
|
27
|
+
# This guard prevent to install the dependencies when we run `pod install` in the old architecture.
|
|
28
|
+
s.pod_target_xcconfig = {
|
|
29
|
+
"CLANG_CXX_LANGUAGE_STANDARD" => rct_cxx_language_standard(),
|
|
30
|
+
"DEFINES_MODULE" => "YES"
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
s.dependency "ReactCodegen"
|
|
34
|
+
end
|
package/lib/MapCircle.d.ts
CHANGED
|
@@ -101,7 +101,7 @@ export type MapCircleProps = ViewProps & {
|
|
|
101
101
|
zIndex?: number;
|
|
102
102
|
};
|
|
103
103
|
type NativeProps = MapCircleProps & {
|
|
104
|
-
ref: React.RefObject<View>;
|
|
104
|
+
ref: React.RefObject<View | null>;
|
|
105
105
|
};
|
|
106
106
|
export declare class MapCircle extends React.Component<MapCircleProps> {
|
|
107
107
|
context: React.ContextType<typeof ProviderContext>;
|
package/lib/MapHeatmap.d.ts
CHANGED
|
@@ -59,9 +59,9 @@ type NativeProps = Modify<MapHeatmapProps, {
|
|
|
59
59
|
colors: (ProcessedColorValue | null | undefined)[];
|
|
60
60
|
}>;
|
|
61
61
|
}> & {
|
|
62
|
-
ref: React.RefObject<View>;
|
|
62
|
+
ref: React.RefObject<View | null>;
|
|
63
63
|
};
|
|
64
|
-
export declare class MapHeatmap extends React.Component<MapHeatmapProps> {
|
|
64
|
+
export declare class MapHeatmap extends React.Component<MapHeatmapProps | null> {
|
|
65
65
|
context: React.ContextType<typeof ProviderContext>;
|
|
66
66
|
getNativeComponent: () => NativeComponent<NativeProps>;
|
|
67
67
|
getMapManagerCommand: (name: string) => MapManagerCommand;
|
package/lib/MapHeatmap.js
CHANGED
|
@@ -41,7 +41,7 @@ class MapHeatmap extends React.Component {
|
|
|
41
41
|
}
|
|
42
42
|
render() {
|
|
43
43
|
const AIRMapHeatmap = this.getNativeComponent();
|
|
44
|
-
const propGradient = this.props
|
|
44
|
+
const propGradient = this.props?.gradient;
|
|
45
45
|
let gradient;
|
|
46
46
|
if (propGradient) {
|
|
47
47
|
const colors = propGradient.colors.map(c => (0, react_native_1.processColor)(c));
|
package/lib/MapMarker.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import * as React from 'react';
|
|
|
2
2
|
import { Animated, ViewProps, ImageURISource, ImageRequireSource } from 'react-native';
|
|
3
3
|
import { MapManagerCommand, NativeComponent, ProviderContext, UIManagerCommand } from './decorateMapComponent';
|
|
4
4
|
import { MapMarkerNativeComponentType } from './MapMarkerNativeComponent';
|
|
5
|
+
import type { AppleMarkerPriority } from './specs/NativeComponentMarker';
|
|
5
6
|
import { CalloutPressEvent, LatLng, MarkerDeselectEvent, MarkerDragEvent, MarkerDragStartEndEvent, MarkerPressEvent, MarkerSelectEvent, Point } from './sharedTypes';
|
|
6
7
|
import { Modify } from './sharedTypesInternal';
|
|
7
8
|
type AppleMarkerVisibility = 'hidden' | 'adaptive' | 'visible';
|
|
@@ -42,7 +43,7 @@ export type MapMarkerProps = ViewProps & {
|
|
|
42
43
|
*
|
|
43
44
|
* @default {x: 0.0, y: 0.0}
|
|
44
45
|
* @platform iOS: Apple Maps only. For Google Maps, see the `calloutAnchor` prop
|
|
45
|
-
* @platform Android: Not supported.
|
|
46
|
+
* @platform Android: Not supported. see the `calloutAnchor` prop
|
|
46
47
|
*/
|
|
47
48
|
calloutOffset?: Point;
|
|
48
49
|
/**
|
|
@@ -54,7 +55,7 @@ export type MapMarkerProps = ViewProps & {
|
|
|
54
55
|
*
|
|
55
56
|
* @default {x: 0.0, y: 0.0}
|
|
56
57
|
* @platform iOS: Apple Maps only. For Google Maps, see the `anchor` prop
|
|
57
|
-
* @platform Android: Not supported.
|
|
58
|
+
* @platform Android: Not supported. see the `anchor` prop
|
|
58
59
|
*/
|
|
59
60
|
centerOffset?: Point;
|
|
60
61
|
/**
|
|
@@ -261,6 +262,17 @@ export type MapMarkerProps = ViewProps & {
|
|
|
261
262
|
* @platform Android: Supported
|
|
262
263
|
*/
|
|
263
264
|
zIndex?: number;
|
|
265
|
+
/**
|
|
266
|
+
Constants that indicates the display priority for annotations.
|
|
267
|
+
@default required
|
|
268
|
+
@platform iOS: Apple Maps only.
|
|
269
|
+
@platform Android: Not supported
|
|
270
|
+
|
|
271
|
+
Required: A constant indicating that the item is required.
|
|
272
|
+
High: A constant indicating that the item’s display priority is high.
|
|
273
|
+
Low: A constant indicating that the item’s display priority is Low.
|
|
274
|
+
*/
|
|
275
|
+
displayPriority?: AppleMarkerPriority;
|
|
264
276
|
/**
|
|
265
277
|
* Visibility of the title text rendered beneath Marker balloon
|
|
266
278
|
* @platform iOS: Apple Maps only
|
|
@@ -286,7 +298,7 @@ export type NativeProps = Modify<OmittedProps, {
|
|
|
286
298
|
icon?: string;
|
|
287
299
|
image?: MapMarkerProps['image'] | string;
|
|
288
300
|
}> & {
|
|
289
|
-
ref: React.RefObject<MapMarkerNativeComponentType>;
|
|
301
|
+
ref: React.RefObject<MapMarkerNativeComponentType | null>;
|
|
290
302
|
};
|
|
291
303
|
export declare class MapMarker extends React.Component<MapMarkerProps> {
|
|
292
304
|
context: React.ContextType<typeof ProviderContext>;
|
|
@@ -295,6 +307,7 @@ export declare class MapMarker extends React.Component<MapMarkerProps> {
|
|
|
295
307
|
getUIManagerCommand: (name: string) => UIManagerCommand;
|
|
296
308
|
static Animated: Animated.AnimatedComponent<typeof MapMarker>;
|
|
297
309
|
private marker;
|
|
310
|
+
private fabricMarker?;
|
|
298
311
|
constructor(props: MapMarkerProps);
|
|
299
312
|
setNativeProps(props: Partial<NativeProps>): void;
|
|
300
313
|
showCallout(): void;
|
package/lib/MapMarker.js
CHANGED
|
@@ -28,12 +28,15 @@ const React = __importStar(require("react"));
|
|
|
28
28
|
const react_native_1 = require("react-native");
|
|
29
29
|
const decorateMapComponent_1 = __importStar(require("./decorateMapComponent"));
|
|
30
30
|
const MapMarkerNativeComponent_1 = require("./MapMarkerNativeComponent");
|
|
31
|
+
const NativeComponentMarker_1 = require("./specs/NativeComponentMarker");
|
|
32
|
+
const ProviderConstants_1 = require("./ProviderConstants");
|
|
31
33
|
class MapMarker extends React.Component {
|
|
32
34
|
getNativeComponent;
|
|
33
35
|
getMapManagerCommand;
|
|
34
36
|
getUIManagerCommand;
|
|
35
37
|
static Animated;
|
|
36
38
|
marker;
|
|
39
|
+
fabricMarker = undefined;
|
|
37
40
|
constructor(props) {
|
|
38
41
|
super(props);
|
|
39
42
|
this.marker = React.createRef();
|
|
@@ -49,27 +52,59 @@ class MapMarker extends React.Component {
|
|
|
49
52
|
}
|
|
50
53
|
showCallout() {
|
|
51
54
|
if (this.marker.current) {
|
|
52
|
-
|
|
55
|
+
if (this.fabricMarker) {
|
|
56
|
+
// @ts-ignore
|
|
57
|
+
NativeComponentMarker_1.Commands.showCallout(this.marker.current);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
MapMarkerNativeComponent_1.Commands.showCallout(this.marker.current);
|
|
61
|
+
}
|
|
53
62
|
}
|
|
54
63
|
}
|
|
55
64
|
hideCallout() {
|
|
56
65
|
if (this.marker.current) {
|
|
57
|
-
|
|
66
|
+
if (this.fabricMarker) {
|
|
67
|
+
// @ts-ignore
|
|
68
|
+
NativeComponentMarker_1.Commands.hideCallout(this.marker.current);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
MapMarkerNativeComponent_1.Commands.hideCallout(this.marker.current);
|
|
72
|
+
}
|
|
58
73
|
}
|
|
59
74
|
}
|
|
60
75
|
setCoordinates(coordinate) {
|
|
61
76
|
if (this.marker.current) {
|
|
62
|
-
|
|
77
|
+
if (this.fabricMarker) {
|
|
78
|
+
NativeComponentMarker_1.Commands.setCoordinates(
|
|
79
|
+
// @ts-ignore
|
|
80
|
+
this.marker.current, coordinate.latitude, coordinate.longitude);
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
MapMarkerNativeComponent_1.Commands.setCoordinates(this.marker.current, coordinate);
|
|
84
|
+
}
|
|
63
85
|
}
|
|
64
86
|
}
|
|
65
87
|
redrawCallout() {
|
|
66
88
|
if (this.marker.current) {
|
|
67
|
-
|
|
89
|
+
if (this.fabricMarker) {
|
|
90
|
+
// @ts-ignore
|
|
91
|
+
NativeComponentMarker_1.Commands.redrawCallout(this.marker.current);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
MapMarkerNativeComponent_1.Commands.redrawCallout(this.marker.current);
|
|
95
|
+
}
|
|
68
96
|
}
|
|
69
97
|
}
|
|
70
98
|
animateMarkerToCoordinate(coordinate, duration = 500) {
|
|
71
99
|
if (this.marker.current) {
|
|
72
|
-
|
|
100
|
+
if (this.fabricMarker) {
|
|
101
|
+
NativeComponentMarker_1.Commands.animateToCoordinates(
|
|
102
|
+
// @ts-ignore
|
|
103
|
+
this.marker.current, coordinate.latitude, coordinate.longitude, duration);
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
MapMarkerNativeComponent_1.Commands.animateMarkerToCoordinate(this.marker.current, coordinate, duration);
|
|
107
|
+
}
|
|
73
108
|
}
|
|
74
109
|
}
|
|
75
110
|
redraw() {
|
|
@@ -79,10 +114,9 @@ class MapMarker extends React.Component {
|
|
|
79
114
|
}
|
|
80
115
|
render() {
|
|
81
116
|
const { stopPropagation = false } = this.props;
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
image = image.uri || this.props.image;
|
|
117
|
+
if (this.fabricMarker === undefined) {
|
|
118
|
+
const provider = this.context;
|
|
119
|
+
this.fabricMarker = !(react_native_1.Platform.OS === 'ios' && provider !== ProviderConstants_1.PROVIDER_GOOGLE);
|
|
86
120
|
}
|
|
87
121
|
let icon;
|
|
88
122
|
if (this.props.icon) {
|
|
@@ -90,6 +124,16 @@ class MapMarker extends React.Component {
|
|
|
90
124
|
icon = icon.uri;
|
|
91
125
|
}
|
|
92
126
|
const AIRMapMarker = this.getNativeComponent();
|
|
127
|
+
let image;
|
|
128
|
+
if (this.props.image) {
|
|
129
|
+
if (this.fabricMarker) {
|
|
130
|
+
image = this.props.image;
|
|
131
|
+
}
|
|
132
|
+
else {
|
|
133
|
+
const resolvedImage = react_native_1.Image.resolveAssetSource(this.props.image) || {};
|
|
134
|
+
image = resolvedImage.uri || this.props.image;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
93
137
|
return (<AIRMapMarker {...this.props} ref={this.marker} image={image} icon={icon} style={[styles.marker, this.props.style]} onPress={event => {
|
|
94
138
|
if (stopPropagation) {
|
|
95
139
|
event.stopPropagation();
|
package/lib/MapOverlay.js
CHANGED
|
@@ -35,14 +35,8 @@ class MapOverlay extends React.Component {
|
|
|
35
35
|
render() {
|
|
36
36
|
const { opacity = 1.0 } = this.props;
|
|
37
37
|
let image;
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
image = this.props.image.uri;
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
const sourceAsset = react_native_1.Image.resolveAssetSource(this.props.image) || {};
|
|
44
|
-
image = sourceAsset.uri;
|
|
45
|
-
}
|
|
38
|
+
const resolvedImage = react_native_1.Image.resolveAssetSource(this.props.image) || {};
|
|
39
|
+
image = resolvedImage.uri || this.props.image;
|
|
46
40
|
const AIRMapOverlay = this.getNativeComponent();
|
|
47
41
|
return (<AIRMapOverlay {...this.props} opacity={opacity} image={image} style={[styles.overlay, this.props.style]}/>);
|
|
48
42
|
}
|
package/lib/MapPolygon.d.ts
CHANGED
|
@@ -124,7 +124,7 @@ export type MapPolygonProps = ViewProps & {
|
|
|
124
124
|
zIndex?: number;
|
|
125
125
|
};
|
|
126
126
|
type NativeProps = MapPolygonProps & {
|
|
127
|
-
ref: React.RefObject<View>;
|
|
127
|
+
ref: React.RefObject<View | null>;
|
|
128
128
|
};
|
|
129
129
|
export declare class MapPolygon extends React.Component<MapPolygonProps> {
|
|
130
130
|
context: React.ContextType<typeof ProviderContext>;
|
package/lib/MapPolyline.d.ts
CHANGED
|
@@ -14,7 +14,7 @@ export type MapPolylineProps = ViewProps & {
|
|
|
14
14
|
* The fill color to use for the path.
|
|
15
15
|
*
|
|
16
16
|
* @default `#000`, `rgba(r,g,b,0.5)`
|
|
17
|
-
* @platform iOS:
|
|
17
|
+
* @platform iOS: Apple Maps only
|
|
18
18
|
* @platform Android: Not supported
|
|
19
19
|
*/
|
|
20
20
|
fillColor?: string;
|
|
@@ -32,8 +32,8 @@ export type MapPolylineProps = ViewProps & {
|
|
|
32
32
|
*
|
|
33
33
|
* @default `round`
|
|
34
34
|
* @platform iOS: Apple Maps only
|
|
35
|
-
* @platform Android:
|
|
36
|
-
*/
|
|
35
|
+
* @platform Android: supported
|
|
36
|
+
* */
|
|
37
37
|
lineCap?: LineCapType;
|
|
38
38
|
/**
|
|
39
39
|
* An array of numbers specifying the dash pattern to use for the path.
|
|
@@ -42,8 +42,8 @@ export type MapPolylineProps = ViewProps & {
|
|
|
42
42
|
* The values in the array alternate, starting with the first line segment length,
|
|
43
43
|
* followed by the first gap length, followed by the second line segment length, and so on.
|
|
44
44
|
*
|
|
45
|
-
* @platform iOS:
|
|
46
|
-
* @platform Android:
|
|
45
|
+
* @platform iOS: Apple Maps only
|
|
46
|
+
* @platform Android: supported
|
|
47
47
|
*/
|
|
48
48
|
lineDashPattern?: number[];
|
|
49
49
|
/**
|
|
@@ -60,7 +60,7 @@ export type MapPolylineProps = ViewProps & {
|
|
|
60
60
|
* The line join style to apply to corners of the path.
|
|
61
61
|
*
|
|
62
62
|
* @platform iOS: Apple Maps only
|
|
63
|
-
* @platform Android:
|
|
63
|
+
* @platform Android: supported
|
|
64
64
|
*/
|
|
65
65
|
lineJoin?: LineJoinType;
|
|
66
66
|
/**
|
|
@@ -125,7 +125,7 @@ export type MapPolylineProps = ViewProps & {
|
|
|
125
125
|
zIndex?: number;
|
|
126
126
|
};
|
|
127
127
|
type NativeProps = MapPolylineProps & {
|
|
128
|
-
ref: React.RefObject<View>;
|
|
128
|
+
ref: React.RefObject<View | null>;
|
|
129
129
|
};
|
|
130
130
|
export declare class MapPolyline extends React.Component<MapPolylineProps> {
|
|
131
131
|
context: React.ContextType<typeof ProviderContext>;
|
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.
|
|
@@ -709,6 +692,10 @@ declare class MapView extends React.Component<MapViewProps, State> {
|
|
|
709
692
|
private handleMarkerSelect;
|
|
710
693
|
private handleMarkerDeselect;
|
|
711
694
|
private handleRegionChange;
|
|
695
|
+
private handleRegionChangeStarted;
|
|
696
|
+
private handleIndoorBuildingFocused;
|
|
697
|
+
private handleIndoorLevelActivated;
|
|
698
|
+
private handleRegionChangeComplete;
|
|
712
699
|
render(): React.JSX.Element;
|
|
713
700
|
}
|
|
714
701
|
export declare const AnimatedMapView: RNAnimated.AnimatedComponent<typeof MapView>;
|