@lugg/maps 0.2.0-alpha.22 → 0.2.0-alpha.24
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 +5 -0
- package/android/src/main/java/com/luggmaps/LuggMapView.kt +241 -0
- package/android/src/main/java/com/luggmaps/{LuggGoogleMapViewManager.kt → LuggMapViewManager.kt} +36 -31
- package/android/src/main/java/com/luggmaps/LuggPackage.kt +1 -4
- package/android/src/main/java/com/luggmaps/{LuggGoogleMapView.kt → core/GoogleMapProvider.kt} +172 -212
- package/android/src/main/java/com/luggmaps/core/MapProviderDelegate.kt +53 -0
- package/android/src/main/java/com/luggmaps/core/PolylineAnimator.kt +32 -26
- package/ios/LuggMapView.h +9 -0
- package/ios/LuggMapView.mm +285 -0
- package/ios/core/AppleMapProvider.h +15 -0
- package/ios/{LuggAppleMapView.mm → core/AppleMapProvider.mm} +310 -421
- package/ios/core/GMSPolylineAnimator.m +16 -4
- package/ios/core/GoogleMapProvider.h +13 -0
- package/ios/{LuggGoogleMapView.mm → core/GoogleMapProvider.mm} +178 -238
- package/ios/core/MapProviderDelegate.h +68 -0
- package/lib/module/MapView.js +5 -11
- package/lib/module/MapView.js.map +1 -1
- package/lib/module/fabric/{LuggGoogleMapViewNativeComponent.ts → LuggMapViewNativeComponent.ts} +2 -1
- package/lib/typescript/src/MapView.d.ts +0 -1
- package/lib/typescript/src/MapView.d.ts.map +1 -1
- package/lib/typescript/src/fabric/{LuggGoogleMapViewNativeComponent.d.ts → LuggMapViewNativeComponent.d.ts} +2 -1
- package/lib/typescript/src/fabric/LuggMapViewNativeComponent.d.ts.map +1 -0
- package/package.json +3 -4
- package/src/MapView.tsx +8 -21
- package/src/fabric/{LuggGoogleMapViewNativeComponent.ts → LuggMapViewNativeComponent.ts} +2 -1
- package/ios/LuggAppleMapView.h +0 -16
- package/ios/LuggGoogleMapView.h +0 -13
- package/lib/module/fabric/LuggAppleMapViewNativeComponent.ts +0 -85
- package/lib/typescript/src/fabric/LuggAppleMapViewNativeComponent.d.ts +0 -55
- package/lib/typescript/src/fabric/LuggAppleMapViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/src/fabric/LuggGoogleMapViewNativeComponent.d.ts.map +0 -1
- package/src/fabric/LuggAppleMapViewNativeComponent.ts +0 -85
package/lib/module/MapView.js
CHANGED
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Platform, StyleSheet } from 'react-native';
|
|
5
|
-
import
|
|
6
|
-
import LuggAppleMapViewNativeComponent, { Commands as AppleMapCommands } from './fabric/LuggAppleMapViewNativeComponent';
|
|
5
|
+
import LuggMapViewNativeComponent, { Commands } from './fabric/LuggMapViewNativeComponent';
|
|
7
6
|
import LuggMapWrapperViewNativeComponent from './fabric/LuggMapWrapperViewNativeComponent';
|
|
8
7
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
9
8
|
export class MapView extends React.Component {
|
|
@@ -17,11 +16,6 @@ export class MapView extends React.Component {
|
|
|
17
16
|
theme: 'system'
|
|
18
17
|
};
|
|
19
18
|
nativeRef = /*#__PURE__*/React.createRef();
|
|
20
|
-
get nativeCommands() {
|
|
21
|
-
const provider = this.props.provider ?? MapView.defaultProps.provider;
|
|
22
|
-
const isApple = Platform.OS === 'ios' && provider === 'apple';
|
|
23
|
-
return isApple ? AppleMapCommands : GoogleMapCommands;
|
|
24
|
-
}
|
|
25
19
|
moveCamera(coordinate, options) {
|
|
26
20
|
const ref = this.nativeRef.current;
|
|
27
21
|
if (!ref) return;
|
|
@@ -29,7 +23,7 @@ export class MapView extends React.Component {
|
|
|
29
23
|
zoom = 0,
|
|
30
24
|
duration = -1
|
|
31
25
|
} = options ?? {};
|
|
32
|
-
|
|
26
|
+
Commands.moveCamera(ref, coordinate.latitude, coordinate.longitude, zoom, duration);
|
|
33
27
|
}
|
|
34
28
|
fitCoordinates(coordinates, options) {
|
|
35
29
|
const ref = this.nativeRef.current;
|
|
@@ -53,7 +47,7 @@ export class MapView extends React.Component {
|
|
|
53
47
|
});
|
|
54
48
|
return;
|
|
55
49
|
}
|
|
56
|
-
|
|
50
|
+
Commands.fitCoordinates(ref, coordinates, top, left, bottom, right, duration);
|
|
57
51
|
}
|
|
58
52
|
render() {
|
|
59
53
|
const {
|
|
@@ -76,10 +70,10 @@ export class MapView extends React.Component {
|
|
|
76
70
|
children,
|
|
77
71
|
...rest
|
|
78
72
|
} = this.props;
|
|
79
|
-
|
|
80
|
-
return /*#__PURE__*/_jsxs(NativeMapView, {
|
|
73
|
+
return /*#__PURE__*/_jsxs(LuggMapViewNativeComponent, {
|
|
81
74
|
ref: this.nativeRef,
|
|
82
75
|
...rest,
|
|
76
|
+
provider: provider,
|
|
83
77
|
mapId: mapId,
|
|
84
78
|
initialCoordinate: initialCoordinate,
|
|
85
79
|
initialZoom: initialZoom,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","Platform","StyleSheet","
|
|
1
|
+
{"version":3,"names":["React","Platform","StyleSheet","LuggMapViewNativeComponent","Commands","LuggMapWrapperViewNativeComponent","jsx","_jsx","jsxs","_jsxs","MapView","Component","defaultProps","provider","OS","initialZoom","zoomEnabled","scrollEnabled","rotateEnabled","pitchEnabled","theme","nativeRef","createRef","moveCamera","coordinate","options","ref","current","zoom","duration","latitude","longitude","fitCoordinates","coordinates","first","padding","top","left","bottom","right","length","props","render","mapId","initialCoordinate","minZoom","maxZoom","userLocationEnabled","onCameraMove","onCameraIdle","onReady","children","rest","style","absoluteFill"],"sourceRoot":"../../src","sources":["MapView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,EAAEC,UAAU,QAAQ,cAAc;AACnD,OAAOC,0BAA0B,IAC/BC,QAAQ,QACH,qCAAqC;AAC5C,OAAOC,iCAAiC,MAAM,4CAA4C;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,K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AAU,CAACoD;MAAa,CAAE,CAAC,EACpEH,QAAQ;IAAA,CACiB,CAAC;EAEjC;AACF","ignoreList":[]}
|
package/lib/module/fabric/{LuggGoogleMapViewNativeComponent.ts → LuggMapViewNativeComponent.ts}
RENAMED
|
@@ -39,6 +39,7 @@ export interface CameraIdleEvent {
|
|
|
39
39
|
export interface ReadyEvent {}
|
|
40
40
|
|
|
41
41
|
export interface NativeProps extends ViewProps {
|
|
42
|
+
provider?: WithDefault<'google' | 'apple', 'google'>;
|
|
42
43
|
mapId?: string;
|
|
43
44
|
initialCoordinate?: Coordinate;
|
|
44
45
|
initialZoom?: Double;
|
|
@@ -82,5 +83,5 @@ export const Commands = codegenNativeCommands<NativeCommands>({
|
|
|
82
83
|
});
|
|
83
84
|
|
|
84
85
|
export default codegenNativeComponent<NativeProps>(
|
|
85
|
-
'
|
|
86
|
+
'LuggMapView'
|
|
86
87
|
) as ComponentType;
|
|
@@ -4,7 +4,6 @@ import type { Coordinate } from './types';
|
|
|
4
4
|
export declare class MapView extends React.Component<MapViewProps> implements MapViewRef {
|
|
5
5
|
static defaultProps: Partial<MapViewProps>;
|
|
6
6
|
private nativeRef;
|
|
7
|
-
private get nativeCommands();
|
|
8
7
|
moveCamera(coordinate: Coordinate, options?: MoveCameraOptions): void;
|
|
9
8
|
fitCoordinates(coordinates: Coordinate[], options?: FitCoordinatesOptions): void;
|
|
10
9
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../src/MapView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../src/MapView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACtB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C,qBAAa,OACX,SAAQ,KAAK,CAAC,SAAS,CAAC,YAAY,CACpC,YAAW,UAAU;IAErB,MAAM,CAAC,YAAY,EAAE,OAAO,CAAC,YAAY,CAAC,CAQxC;IAEF,OAAO,CAAC,SAAS,CAA0B;IAE3C,UAAU,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,iBAAiB;IAc9D,cAAc,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,OAAO,CAAC,EAAE,qBAAqB;IAyBzE,MAAM;CAgDP"}
|
|
@@ -29,6 +29,7 @@ export interface CameraIdleEvent {
|
|
|
29
29
|
export interface ReadyEvent {
|
|
30
30
|
}
|
|
31
31
|
export interface NativeProps extends ViewProps {
|
|
32
|
+
provider?: WithDefault<'google' | 'apple', 'google'>;
|
|
32
33
|
mapId?: string;
|
|
33
34
|
initialCoordinate?: Coordinate;
|
|
34
35
|
initialZoom?: Double;
|
|
@@ -53,4 +54,4 @@ interface NativeCommands {
|
|
|
53
54
|
export declare const Commands: NativeCommands;
|
|
54
55
|
declare const _default: ComponentType;
|
|
55
56
|
export default _default;
|
|
56
|
-
//# sourceMappingURL=
|
|
57
|
+
//# sourceMappingURL=LuggMapViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LuggMapViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/LuggMapViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EACV,MAAM,EACN,WAAW,EACX,kBAAkB,EACnB,MAAM,2CAA2C,CAAC;AAEnD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU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C,CAAC;IACnD,OAAO,CAAC,EAAE,kBAAkB,CAAC,UAAU,CAAC,CAAC;CAC1C;AAED,KAAK,aAAa,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;AAEhD,UAAU,cAAc;IACtB,UAAU,EAAE,CACV,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,EACxC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;IACV,cAAc,EAAE,CACd,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,EACxC,WAAW,EAAE,UAAU,EAAE,EACzB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;CACX;AAED,eAAO,MAAM,QAAQ,gBAEnB,CAAC;wBAIE,aAAa;AAFlB,wBAEmB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lugg/maps",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.24",
|
|
4
4
|
"description": "Universal maps for React Native.",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
"typescript": "^5.9.2"
|
|
98
98
|
},
|
|
99
99
|
"resolutions": {
|
|
100
|
-
"@lodev09/react-native-true-sheet": "3.9.0-beta.
|
|
100
|
+
"@lodev09/react-native-true-sheet": "3.9.0-beta.1"
|
|
101
101
|
},
|
|
102
102
|
"peerDependencies": {
|
|
103
103
|
"@vis.gl/react-google-maps": ">=1.0.0",
|
|
@@ -145,8 +145,7 @@
|
|
|
145
145
|
},
|
|
146
146
|
"ios": {
|
|
147
147
|
"componentProvider": {
|
|
148
|
-
"
|
|
149
|
-
"LuggAppleMapView": "LuggAppleMapView",
|
|
148
|
+
"LuggMapView": "LuggMapView",
|
|
150
149
|
"LuggMarkerView": "LuggMarkerView",
|
|
151
150
|
"LuggMapWrapperView": "LuggMapWrapperView",
|
|
152
151
|
"LuggPolylineView": "LuggPolylineView"
|
package/src/MapView.tsx
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { Platform, StyleSheet } from 'react-native';
|
|
3
|
-
import
|
|
4
|
-
Commands
|
|
5
|
-
} from './fabric/
|
|
6
|
-
import LuggAppleMapViewNativeComponent, {
|
|
7
|
-
Commands as AppleMapCommands,
|
|
8
|
-
} from './fabric/LuggAppleMapViewNativeComponent';
|
|
3
|
+
import LuggMapViewNativeComponent, {
|
|
4
|
+
Commands,
|
|
5
|
+
} from './fabric/LuggMapViewNativeComponent';
|
|
9
6
|
import LuggMapWrapperViewNativeComponent from './fabric/LuggMapWrapperViewNativeComponent';
|
|
10
7
|
import type {
|
|
11
8
|
MapViewProps,
|
|
@@ -31,18 +28,12 @@ export class MapView
|
|
|
31
28
|
|
|
32
29
|
private nativeRef = React.createRef<any>();
|
|
33
30
|
|
|
34
|
-
private get nativeCommands() {
|
|
35
|
-
const provider = this.props.provider ?? MapView.defaultProps.provider;
|
|
36
|
-
const isApple = Platform.OS === 'ios' && provider === 'apple';
|
|
37
|
-
return isApple ? AppleMapCommands : GoogleMapCommands;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
31
|
moveCamera(coordinate: Coordinate, options?: MoveCameraOptions) {
|
|
41
32
|
const ref = this.nativeRef.current;
|
|
42
33
|
if (!ref) return;
|
|
43
34
|
|
|
44
35
|
const { zoom = 0, duration = -1 } = options ?? {};
|
|
45
|
-
|
|
36
|
+
Commands.moveCamera(
|
|
46
37
|
ref,
|
|
47
38
|
coordinate.latitude,
|
|
48
39
|
coordinate.longitude,
|
|
@@ -65,7 +56,7 @@ export class MapView
|
|
|
65
56
|
return;
|
|
66
57
|
}
|
|
67
58
|
|
|
68
|
-
|
|
59
|
+
Commands.fitCoordinates(
|
|
69
60
|
ref,
|
|
70
61
|
coordinates,
|
|
71
62
|
top,
|
|
@@ -98,15 +89,11 @@ export class MapView
|
|
|
98
89
|
...rest
|
|
99
90
|
} = this.props;
|
|
100
91
|
|
|
101
|
-
const NativeMapView =
|
|
102
|
-
Platform.OS === 'ios' && provider === 'apple'
|
|
103
|
-
? LuggAppleMapViewNativeComponent
|
|
104
|
-
: LuggGoogleMapViewNativeComponent;
|
|
105
|
-
|
|
106
92
|
return (
|
|
107
|
-
<
|
|
93
|
+
<LuggMapViewNativeComponent
|
|
108
94
|
ref={this.nativeRef}
|
|
109
95
|
{...rest}
|
|
96
|
+
provider={provider}
|
|
110
97
|
mapId={mapId}
|
|
111
98
|
initialCoordinate={initialCoordinate}
|
|
112
99
|
initialZoom={initialZoom}
|
|
@@ -125,7 +112,7 @@ export class MapView
|
|
|
125
112
|
>
|
|
126
113
|
<LuggMapWrapperViewNativeComponent style={StyleSheet.absoluteFill} />
|
|
127
114
|
{children}
|
|
128
|
-
</
|
|
115
|
+
</LuggMapViewNativeComponent>
|
|
129
116
|
);
|
|
130
117
|
}
|
|
131
118
|
}
|
|
@@ -39,6 +39,7 @@ export interface CameraIdleEvent {
|
|
|
39
39
|
export interface ReadyEvent {}
|
|
40
40
|
|
|
41
41
|
export interface NativeProps extends ViewProps {
|
|
42
|
+
provider?: WithDefault<'google' | 'apple', 'google'>;
|
|
42
43
|
mapId?: string;
|
|
43
44
|
initialCoordinate?: Coordinate;
|
|
44
45
|
initialZoom?: Double;
|
|
@@ -82,5 +83,5 @@ export const Commands = codegenNativeCommands<NativeCommands>({
|
|
|
82
83
|
});
|
|
83
84
|
|
|
84
85
|
export default codegenNativeComponent<NativeProps>(
|
|
85
|
-
'
|
|
86
|
+
'LuggMapView'
|
|
86
87
|
) as ComponentType;
|
package/ios/LuggAppleMapView.h
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
#import <MapKit/MapKit.h>
|
|
2
|
-
#import <React/RCTViewComponentView.h>
|
|
3
|
-
#import <UIKit/UIKit.h>
|
|
4
|
-
|
|
5
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
6
|
-
|
|
7
|
-
@interface LuggAppleMapViewContent : MKMapView
|
|
8
|
-
@end
|
|
9
|
-
|
|
10
|
-
@interface LuggAppleMapView : RCTViewComponentView
|
|
11
|
-
|
|
12
|
-
- (MKMapView *)mapView;
|
|
13
|
-
|
|
14
|
-
@end
|
|
15
|
-
|
|
16
|
-
NS_ASSUME_NONNULL_END
|
package/ios/LuggGoogleMapView.h
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#import <GoogleMaps/GoogleMaps.h>
|
|
2
|
-
#import <React/RCTViewComponentView.h>
|
|
3
|
-
#import <UIKit/UIKit.h>
|
|
4
|
-
|
|
5
|
-
NS_ASSUME_NONNULL_BEGIN
|
|
6
|
-
|
|
7
|
-
@interface LuggGoogleMapView : RCTViewComponentView
|
|
8
|
-
|
|
9
|
-
@property(nonatomic, readonly, nullable) GMSMapView *mapView;
|
|
10
|
-
|
|
11
|
-
@end
|
|
12
|
-
|
|
13
|
-
NS_ASSUME_NONNULL_END
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { codegenNativeComponent, codegenNativeCommands } from 'react-native';
|
|
2
|
-
import type { ViewProps, HostComponent } from 'react-native';
|
|
3
|
-
import type {
|
|
4
|
-
Double,
|
|
5
|
-
WithDefault,
|
|
6
|
-
DirectEventHandler,
|
|
7
|
-
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
8
|
-
|
|
9
|
-
export interface Coordinate {
|
|
10
|
-
latitude: Double;
|
|
11
|
-
longitude: Double;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface EdgeInsets {
|
|
15
|
-
top: Double;
|
|
16
|
-
left: Double;
|
|
17
|
-
bottom: Double;
|
|
18
|
-
right: Double;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface CameraMoveEvent {
|
|
22
|
-
coordinate: {
|
|
23
|
-
latitude: Double;
|
|
24
|
-
longitude: Double;
|
|
25
|
-
};
|
|
26
|
-
zoom: Double;
|
|
27
|
-
gesture: boolean;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface CameraIdleEvent {
|
|
31
|
-
coordinate: {
|
|
32
|
-
latitude: Double;
|
|
33
|
-
longitude: Double;
|
|
34
|
-
};
|
|
35
|
-
zoom: Double;
|
|
36
|
-
gesture: boolean;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface ReadyEvent {}
|
|
40
|
-
|
|
41
|
-
export interface NativeProps extends ViewProps {
|
|
42
|
-
initialCoordinate?: Coordinate;
|
|
43
|
-
initialZoom?: Double;
|
|
44
|
-
minZoom?: Double;
|
|
45
|
-
maxZoom?: Double;
|
|
46
|
-
zoomEnabled?: boolean;
|
|
47
|
-
scrollEnabled?: boolean;
|
|
48
|
-
rotateEnabled?: boolean;
|
|
49
|
-
pitchEnabled?: boolean;
|
|
50
|
-
padding?: EdgeInsets;
|
|
51
|
-
userLocationEnabled?: boolean;
|
|
52
|
-
theme?: WithDefault<'light' | 'dark' | 'system', 'system'>;
|
|
53
|
-
onCameraMove?: DirectEventHandler<CameraMoveEvent>;
|
|
54
|
-
onCameraIdle?: DirectEventHandler<CameraIdleEvent>;
|
|
55
|
-
onReady?: DirectEventHandler<ReadyEvent>;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
type ComponentType = HostComponent<NativeProps>;
|
|
59
|
-
|
|
60
|
-
interface NativeCommands {
|
|
61
|
-
moveCamera: (
|
|
62
|
-
viewRef: React.ElementRef<ComponentType>,
|
|
63
|
-
latitude: Double,
|
|
64
|
-
longitude: Double,
|
|
65
|
-
zoom: Double,
|
|
66
|
-
duration: Double
|
|
67
|
-
) => void;
|
|
68
|
-
fitCoordinates: (
|
|
69
|
-
viewRef: React.ElementRef<ComponentType>,
|
|
70
|
-
coordinates: Coordinate[],
|
|
71
|
-
paddingTop: Double,
|
|
72
|
-
paddingLeft: Double,
|
|
73
|
-
paddingBottom: Double,
|
|
74
|
-
paddingRight: Double,
|
|
75
|
-
duration: Double
|
|
76
|
-
) => void;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export const Commands = codegenNativeCommands<NativeCommands>({
|
|
80
|
-
supportedCommands: ['moveCamera', 'fitCoordinates'],
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
export default codegenNativeComponent<NativeProps>(
|
|
84
|
-
'LuggAppleMapView'
|
|
85
|
-
) as ComponentType;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import type { ViewProps, HostComponent } from 'react-native';
|
|
2
|
-
import type { Double, WithDefault, DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
-
export interface Coordinate {
|
|
4
|
-
latitude: Double;
|
|
5
|
-
longitude: Double;
|
|
6
|
-
}
|
|
7
|
-
export interface EdgeInsets {
|
|
8
|
-
top: Double;
|
|
9
|
-
left: Double;
|
|
10
|
-
bottom: Double;
|
|
11
|
-
right: Double;
|
|
12
|
-
}
|
|
13
|
-
export interface CameraMoveEvent {
|
|
14
|
-
coordinate: {
|
|
15
|
-
latitude: Double;
|
|
16
|
-
longitude: Double;
|
|
17
|
-
};
|
|
18
|
-
zoom: Double;
|
|
19
|
-
gesture: boolean;
|
|
20
|
-
}
|
|
21
|
-
export interface CameraIdleEvent {
|
|
22
|
-
coordinate: {
|
|
23
|
-
latitude: Double;
|
|
24
|
-
longitude: Double;
|
|
25
|
-
};
|
|
26
|
-
zoom: Double;
|
|
27
|
-
gesture: boolean;
|
|
28
|
-
}
|
|
29
|
-
export interface ReadyEvent {
|
|
30
|
-
}
|
|
31
|
-
export interface NativeProps extends ViewProps {
|
|
32
|
-
initialCoordinate?: Coordinate;
|
|
33
|
-
initialZoom?: Double;
|
|
34
|
-
minZoom?: Double;
|
|
35
|
-
maxZoom?: Double;
|
|
36
|
-
zoomEnabled?: boolean;
|
|
37
|
-
scrollEnabled?: boolean;
|
|
38
|
-
rotateEnabled?: boolean;
|
|
39
|
-
pitchEnabled?: boolean;
|
|
40
|
-
padding?: EdgeInsets;
|
|
41
|
-
userLocationEnabled?: boolean;
|
|
42
|
-
theme?: WithDefault<'light' | 'dark' | 'system', 'system'>;
|
|
43
|
-
onCameraMove?: DirectEventHandler<CameraMoveEvent>;
|
|
44
|
-
onCameraIdle?: DirectEventHandler<CameraIdleEvent>;
|
|
45
|
-
onReady?: DirectEventHandler<ReadyEvent>;
|
|
46
|
-
}
|
|
47
|
-
type ComponentType = HostComponent<NativeProps>;
|
|
48
|
-
interface NativeCommands {
|
|
49
|
-
moveCamera: (viewRef: React.ElementRef<ComponentType>, latitude: Double, longitude: Double, zoom: Double, duration: Double) => void;
|
|
50
|
-
fitCoordinates: (viewRef: React.ElementRef<ComponentType>, coordinates: Coordinate[], paddingTop: Double, paddingLeft: Double, paddingBottom: Double, paddingRight: Double, duration: Double) => void;
|
|
51
|
-
}
|
|
52
|
-
export declare const Commands: NativeCommands;
|
|
53
|
-
declare const _default: ComponentType;
|
|
54
|
-
export default _default;
|
|
55
|
-
//# sourceMappingURL=LuggAppleMapViewNativeComponent.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LuggAppleMapViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/LuggAppleMapViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EACV,MAAM,EACN,WAAW,EACX,kBAAkB,EACnB,MAAM,2CAA2C,CAAC;AAEnD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,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U,EAAE,CACV,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,EACxC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;IACV,cAAc,EAAE,CACd,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,EACxC,WAAW,EAAE,UAAU,EAAE,EACzB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;CACX;AAED,eAAO,MAAM,QAAQ,gBAEnB,CAAC;wBAIE,aAAa;AAFlB,wBAEmB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LuggGoogleMapViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/LuggGoogleMapViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EACV,MAAM,EACN,WAAW,EACX,kBAAkB,EACnB,MAAM,2CAA2C,CAAC;AAEnD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,E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AU,EAAE,EACzB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,aAAa,EAAE,MAAM,EACrB,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;CACX;AAED,eAAO,MAAM,QAAQ,gBAEnB,CAAC;wBAIE,aAAa;AAFlB,wBAEmB"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { codegenNativeComponent, codegenNativeCommands } from 'react-native';
|
|
2
|
-
import type { ViewProps, HostComponent } from 'react-native';
|
|
3
|
-
import type {
|
|
4
|
-
Double,
|
|
5
|
-
WithDefault,
|
|
6
|
-
DirectEventHandler,
|
|
7
|
-
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
8
|
-
|
|
9
|
-
export interface Coordinate {
|
|
10
|
-
latitude: Double;
|
|
11
|
-
longitude: Double;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export interface EdgeInsets {
|
|
15
|
-
top: Double;
|
|
16
|
-
left: Double;
|
|
17
|
-
bottom: Double;
|
|
18
|
-
right: Double;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface CameraMoveEvent {
|
|
22
|
-
coordinate: {
|
|
23
|
-
latitude: Double;
|
|
24
|
-
longitude: Double;
|
|
25
|
-
};
|
|
26
|
-
zoom: Double;
|
|
27
|
-
gesture: boolean;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export interface CameraIdleEvent {
|
|
31
|
-
coordinate: {
|
|
32
|
-
latitude: Double;
|
|
33
|
-
longitude: Double;
|
|
34
|
-
};
|
|
35
|
-
zoom: Double;
|
|
36
|
-
gesture: boolean;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export interface ReadyEvent {}
|
|
40
|
-
|
|
41
|
-
export interface NativeProps extends ViewProps {
|
|
42
|
-
initialCoordinate?: Coordinate;
|
|
43
|
-
initialZoom?: Double;
|
|
44
|
-
minZoom?: Double;
|
|
45
|
-
maxZoom?: Double;
|
|
46
|
-
zoomEnabled?: boolean;
|
|
47
|
-
scrollEnabled?: boolean;
|
|
48
|
-
rotateEnabled?: boolean;
|
|
49
|
-
pitchEnabled?: boolean;
|
|
50
|
-
padding?: EdgeInsets;
|
|
51
|
-
userLocationEnabled?: boolean;
|
|
52
|
-
theme?: WithDefault<'light' | 'dark' | 'system', 'system'>;
|
|
53
|
-
onCameraMove?: DirectEventHandler<CameraMoveEvent>;
|
|
54
|
-
onCameraIdle?: DirectEventHandler<CameraIdleEvent>;
|
|
55
|
-
onReady?: DirectEventHandler<ReadyEvent>;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
type ComponentType = HostComponent<NativeProps>;
|
|
59
|
-
|
|
60
|
-
interface NativeCommands {
|
|
61
|
-
moveCamera: (
|
|
62
|
-
viewRef: React.ElementRef<ComponentType>,
|
|
63
|
-
latitude: Double,
|
|
64
|
-
longitude: Double,
|
|
65
|
-
zoom: Double,
|
|
66
|
-
duration: Double
|
|
67
|
-
) => void;
|
|
68
|
-
fitCoordinates: (
|
|
69
|
-
viewRef: React.ElementRef<ComponentType>,
|
|
70
|
-
coordinates: Coordinate[],
|
|
71
|
-
paddingTop: Double,
|
|
72
|
-
paddingLeft: Double,
|
|
73
|
-
paddingBottom: Double,
|
|
74
|
-
paddingRight: Double,
|
|
75
|
-
duration: Double
|
|
76
|
-
) => void;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export const Commands = codegenNativeCommands<NativeCommands>({
|
|
80
|
-
supportedCommands: ['moveCamera', 'fitCoordinates'],
|
|
81
|
-
});
|
|
82
|
-
|
|
83
|
-
export default codegenNativeComponent<NativeProps>(
|
|
84
|
-
'LuggAppleMapView'
|
|
85
|
-
) as ComponentType;
|