@lugg/maps 0.2.0-alpha.3 → 0.2.0-alpha.30
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 +21 -3
- package/android/src/main/java/com/luggmaps/LuggMapView.kt +265 -0
- package/android/src/main/java/com/luggmaps/{LuggGoogleMapViewManager.kt → LuggMapViewManager.kt} +75 -36
- package/android/src/main/java/com/luggmaps/LuggMapWrapperView.kt +6 -5
- package/android/src/main/java/com/luggmaps/LuggMarkerView.kt +136 -14
- package/android/src/main/java/com/luggmaps/LuggMarkerViewManager.kt +21 -0
- package/android/src/main/java/com/luggmaps/LuggPackage.kt +1 -4
- package/android/src/main/java/com/luggmaps/LuggPolylineView.kt +16 -0
- package/android/src/main/java/com/luggmaps/LuggPolylineViewManager.kt +22 -0
- package/android/src/main/java/com/luggmaps/{LuggGoogleMapView.kt → core/GoogleMapProvider.kt} +251 -241
- package/android/src/main/java/com/luggmaps/core/MapProviderDelegate.kt +55 -0
- package/android/src/main/java/com/luggmaps/core/PolylineAnimator.kt +163 -52
- package/ios/LuggMapView.h +9 -0
- package/ios/LuggMapView.mm +312 -0
- package/ios/LuggMarkerView.h +9 -0
- package/ios/LuggMarkerView.mm +79 -0
- package/ios/LuggPolylineView.h +4 -0
- package/ios/LuggPolylineView.mm +23 -0
- package/ios/core/AppleMapProvider.h +15 -0
- package/ios/core/AppleMapProvider.mm +664 -0
- package/ios/core/GMSPolylineAnimator.h +3 -0
- package/ios/core/GMSPolylineAnimator.m +175 -40
- package/ios/core/GoogleMapProvider.h +13 -0
- package/ios/core/GoogleMapProvider.mm +513 -0
- package/ios/core/MKPolylineAnimator.h +4 -0
- package/ios/core/MKPolylineAnimator.m +224 -68
- package/ios/core/MapProviderDelegate.h +72 -0
- package/ios/core/PolylineAnimatorBase.h +24 -1
- package/ios/core/PolylineAnimatorBase.m +82 -19
- package/ios/extensions/MKMapView+Zoom.h +2 -0
- package/ios/extensions/MKMapView+Zoom.m +14 -4
- package/lib/module/MapProvider.js +13 -0
- package/lib/module/MapProvider.js.map +1 -0
- package/lib/module/MapProvider.types.js +4 -0
- package/lib/module/MapProvider.types.js.map +1 -0
- package/lib/module/MapProvider.web.js +20 -0
- package/lib/module/MapProvider.web.js.map +1 -0
- package/lib/module/MapView.js +29 -16
- package/lib/module/MapView.js.map +1 -1
- package/lib/module/MapView.web.js +290 -0
- package/lib/module/MapView.web.js.map +1 -0
- package/lib/module/components/Marker.js +19 -2
- package/lib/module/components/Marker.js.map +1 -1
- package/lib/module/components/Marker.web.js +33 -0
- package/lib/module/components/Marker.web.js.map +1 -0
- package/lib/module/components/Polyline.js +17 -4
- package/lib/module/components/Polyline.js.map +1 -1
- package/lib/module/components/Polyline.web.js +229 -0
- package/lib/module/components/Polyline.web.js.map +1 -0
- package/lib/module/components/index.js +2 -2
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/index.web.js +5 -0
- package/lib/module/components/index.web.js.map +1 -0
- package/lib/module/fabric/{LuggGoogleMapViewNativeComponent.ts → LuggMapViewNativeComponent.ts} +19 -7
- package/lib/module/fabric/LuggMarkerViewNativeComponent.ts +7 -1
- package/lib/module/fabric/LuggPolylineViewNativeComponent.ts +8 -0
- package/lib/module/index.js +4 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +7 -0
- package/lib/module/index.web.js.map +1 -0
- package/lib/typescript/src/MapProvider.d.ts +8 -0
- package/lib/typescript/src/MapProvider.d.ts.map +1 -0
- package/lib/typescript/src/MapProvider.types.d.ts +16 -0
- package/lib/typescript/src/MapProvider.types.d.ts.map +1 -0
- package/lib/typescript/src/MapProvider.web.d.ts +11 -0
- package/lib/typescript/src/MapProvider.web.d.ts.map +1 -0
- package/lib/typescript/src/MapView.d.ts +4 -4
- package/lib/typescript/src/MapView.d.ts.map +1 -1
- package/lib/typescript/src/MapView.types.d.ts +23 -7
- package/lib/typescript/src/MapView.types.d.ts.map +1 -1
- package/lib/typescript/src/MapView.web.d.ts +3 -0
- package/lib/typescript/src/MapView.web.d.ts.map +1 -0
- package/lib/typescript/src/components/Marker.d.ts +25 -1
- package/lib/typescript/src/components/Marker.d.ts.map +1 -1
- package/lib/typescript/src/components/Marker.web.d.ts +3 -0
- package/lib/typescript/src/components/Marker.web.d.ts.map +1 -0
- package/lib/typescript/src/components/Polyline.d.ts +36 -1
- package/lib/typescript/src/components/Polyline.d.ts.map +1 -1
- package/lib/typescript/src/components/Polyline.web.d.ts +3 -0
- package/lib/typescript/src/components/Polyline.web.d.ts.map +1 -0
- package/lib/typescript/src/components/index.d.ts +4 -2
- package/lib/typescript/src/components/index.d.ts.map +1 -1
- package/lib/typescript/src/components/index.web.d.ts +5 -0
- package/lib/typescript/src/components/index.web.d.ts.map +1 -0
- package/lib/typescript/src/fabric/{LuggGoogleMapViewNativeComponent.d.ts → LuggMapViewNativeComponent.d.ts} +8 -4
- package/lib/typescript/src/fabric/LuggMapViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/LuggMarkerViewNativeComponent.d.ts +4 -1
- package/lib/typescript/src/fabric/LuggMarkerViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/fabric/LuggPolylineViewNativeComponent.d.ts +7 -0
- package/lib/typescript/src/fabric/LuggPolylineViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +8 -3
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/index.web.d.ts +10 -0
- package/lib/typescript/src/index.web.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +4 -0
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/package.json +17 -3
- package/src/MapProvider.tsx +10 -0
- package/src/MapProvider.types.ts +16 -0
- package/src/MapProvider.web.tsx +14 -0
- package/src/MapView.tsx +28 -26
- package/src/MapView.types.ts +24 -7
- package/src/MapView.web.tsx +364 -0
- package/src/components/Marker.tsx +50 -4
- package/src/components/Marker.web.tsx +33 -0
- package/src/components/Polyline.tsx +51 -2
- package/src/components/Polyline.web.tsx +287 -0
- package/src/components/index.ts +8 -2
- package/src/components/index.web.ts +4 -0
- package/src/fabric/{LuggGoogleMapViewNativeComponent.ts → LuggMapViewNativeComponent.ts} +19 -7
- package/src/fabric/LuggMarkerViewNativeComponent.ts +7 -1
- package/src/fabric/LuggPolylineViewNativeComponent.ts +8 -0
- package/src/index.ts +18 -2
- package/src/index.web.ts +20 -0
- package/src/types.ts +5 -0
- package/ios/LuggAppleMapView.h +0 -16
- package/ios/LuggAppleMapView.mm +0 -580
- package/ios/LuggGoogleMapView.h +0 -13
- package/ios/LuggGoogleMapView.mm +0 -454
- package/lib/module/fabric/LuggAppleMapViewNativeComponent.ts +0 -83
- package/lib/typescript/src/fabric/LuggAppleMapViewNativeComponent.d.ts +0 -54
- 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 -83
|
@@ -1,6 +1,30 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ColorValue } from 'react-native';
|
|
3
3
|
import type { Coordinate } from '../types';
|
|
4
|
+
export type PolylineEasing = 'linear' | 'easeIn' | 'easeOut' | 'easeInOut';
|
|
5
|
+
export interface PolylineAnimatedOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Animation duration in milliseconds
|
|
8
|
+
* @default 2150
|
|
9
|
+
*/
|
|
10
|
+
duration?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Easing function for the animation
|
|
13
|
+
* @default 'linear'
|
|
14
|
+
*/
|
|
15
|
+
easing?: PolylineEasing;
|
|
16
|
+
/**
|
|
17
|
+
* Portion of the line visible as trail (0-1)
|
|
18
|
+
* 1.0 = full snake effect, 0.2 = short worm
|
|
19
|
+
* @default 1.0
|
|
20
|
+
*/
|
|
21
|
+
trailLength?: number;
|
|
22
|
+
/**
|
|
23
|
+
* Delay before animation starts in milliseconds
|
|
24
|
+
* @default 0
|
|
25
|
+
*/
|
|
26
|
+
delay?: number;
|
|
27
|
+
}
|
|
4
28
|
export interface PolylineProps {
|
|
5
29
|
/**
|
|
6
30
|
* Array of coordinates forming the polyline
|
|
@@ -18,8 +42,19 @@ export interface PolylineProps {
|
|
|
18
42
|
* Animate the polyline with a snake effect
|
|
19
43
|
*/
|
|
20
44
|
animated?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Animation configuration options
|
|
47
|
+
*/
|
|
48
|
+
animatedOptions?: PolylineAnimatedOptions;
|
|
49
|
+
/**
|
|
50
|
+
* Z-index for layering polylines
|
|
51
|
+
*/
|
|
52
|
+
zIndex?: number;
|
|
21
53
|
}
|
|
22
|
-
export declare class Polyline extends React.
|
|
54
|
+
export declare class Polyline extends React.PureComponent<PolylineProps> {
|
|
55
|
+
private getStyle;
|
|
56
|
+
private _cachedZIndex;
|
|
57
|
+
private _cachedStyle;
|
|
23
58
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
24
59
|
}
|
|
25
60
|
//# sourceMappingURL=Polyline.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Polyline.d.ts","sourceRoot":"","sources":["../../../../src/components/Polyline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B;;OAEG;IACH,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"Polyline.d.ts","sourceRoot":"","sources":["../../../../src/components/Polyline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,WAAW,CAAC;AAE3E,MAAM,WAAW,uBAAuB;IACtC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,WAAW,EAAE,UAAU,EAAE,CAAC;IAC1B;;OAEG;IACH,YAAY,CAAC,EAAE,UAAU,EAAE,CAAC;IAC5B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,eAAe,CAAC,EAAE,uBAAuB,CAAC;IAC1C;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qBAAa,QAAS,SAAQ,KAAK,CAAC,aAAa,CAAC,aAAa,CAAC;IAC9D,OAAO,CAAC,QAAQ;IAShB,OAAO,CAAC,aAAa,CAAqB;IAC1C,OAAO,CAAC,YAAY,CAAM;IAE1B,MAAM;CAqBP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Polyline.web.d.ts","sourceRoot":"","sources":["../../../../src/components/Polyline.web.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,YAAY,CAAC;AA+ChE,wBAAgB,QAAQ,CAAC,EACvB,WAAW,EACX,YAAY,EACZ,WAAe,EACf,QAAQ,EACR,eAAe,EACf,MAAM,GACP,EAAE,aAAa,QAsOf"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export { Marker } from './Marker';
|
|
2
|
+
export type { MarkerProps } from './Marker';
|
|
3
|
+
export { Polyline } from './Polyline';
|
|
4
|
+
export type { PolylineProps, PolylineEasing, PolylineAnimatedOptions, } from './Polyline';
|
|
3
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EACV,aAAa,EACb,cAAc,EACd,uBAAuB,GACxB,MAAM,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../../src/components/index.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ViewProps, HostComponent } from 'react-native';
|
|
2
|
-
import type { Double, DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
|
|
2
|
+
import type { Double, WithDefault, DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
3
|
export interface Coordinate {
|
|
4
4
|
latitude: Double;
|
|
5
5
|
longitude: Double;
|
|
@@ -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;
|
|
@@ -38,8 +39,10 @@ export interface NativeProps extends ViewProps {
|
|
|
38
39
|
scrollEnabled?: boolean;
|
|
39
40
|
rotateEnabled?: boolean;
|
|
40
41
|
pitchEnabled?: boolean;
|
|
41
|
-
|
|
42
|
+
edgeInsets?: EdgeInsets;
|
|
42
43
|
userLocationEnabled?: boolean;
|
|
44
|
+
userLocationButtonEnabled?: boolean;
|
|
45
|
+
theme?: WithDefault<'light' | 'dark' | 'system', 'system'>;
|
|
43
46
|
onCameraMove?: DirectEventHandler<CameraMoveEvent>;
|
|
44
47
|
onCameraIdle?: DirectEventHandler<CameraIdleEvent>;
|
|
45
48
|
onReady?: DirectEventHandler<ReadyEvent>;
|
|
@@ -47,9 +50,10 @@ export interface NativeProps extends ViewProps {
|
|
|
47
50
|
type ComponentType = HostComponent<NativeProps>;
|
|
48
51
|
interface NativeCommands {
|
|
49
52
|
moveCamera: (viewRef: React.ElementRef<ComponentType>, latitude: Double, longitude: Double, zoom: Double, duration: Double) => void;
|
|
50
|
-
fitCoordinates: (viewRef: React.ElementRef<ComponentType>, coordinates: Coordinate[],
|
|
53
|
+
fitCoordinates: (viewRef: React.ElementRef<ComponentType>, coordinates: Coordinate[], edgeInsetsTop: Double, edgeInsetsLeft: Double, edgeInsetsBottom: Double, edgeInsetsRight: Double, duration: Double) => void;
|
|
54
|
+
setEdgeInsets: (viewRef: React.ElementRef<ComponentType>, top: Double, left: Double, bottom: Double, right: Double, duration: Double) => void;
|
|
51
55
|
}
|
|
52
56
|
export declare const Commands: NativeCommands;
|
|
53
57
|
declare const _default: ComponentType;
|
|
54
58
|
export default _default;
|
|
55
|
-
//# sourceMappingURL=
|
|
59
|
+
//# sourceMappingURL=LuggMapViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LuggMapViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/LuggMapViewNativeComponent.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ViewProps, HostComponent } from 'react-native';
|
|
2
|
-
import type { Double } from 'react-native/Libraries/Types/CodegenTypes';
|
|
2
|
+
import type { Double, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
3
|
export interface Coordinate {
|
|
4
4
|
latitude: Double;
|
|
5
5
|
longitude: Double;
|
|
@@ -14,6 +14,9 @@ export interface NativeProps extends ViewProps {
|
|
|
14
14
|
title?: string;
|
|
15
15
|
description?: string;
|
|
16
16
|
anchor?: Point;
|
|
17
|
+
rotate?: WithDefault<Double, 0>;
|
|
18
|
+
scale?: WithDefault<Double, 1>;
|
|
19
|
+
rasterize?: WithDefault<boolean, true>;
|
|
17
20
|
}
|
|
18
21
|
declare const _default: HostComponent<NativeProps>;
|
|
19
22
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LuggMarkerViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/LuggMarkerViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"LuggMarkerViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/LuggMarkerViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EACV,MAAM,EACN,WAAW,EACZ,MAAM,2CAA2C,CAAC;AAEnD,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAChC,KAAK,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IAC/B,SAAS,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;CACxC;wBAII,aAAa,CAAC,WAAW,CAAC;AAF/B,wBAEgC"}
|
|
@@ -4,11 +4,18 @@ export interface Coordinate {
|
|
|
4
4
|
latitude: Double;
|
|
5
5
|
longitude: Double;
|
|
6
6
|
}
|
|
7
|
+
export interface AnimatedOptions {
|
|
8
|
+
duration?: Double;
|
|
9
|
+
easing?: string;
|
|
10
|
+
trailLength?: Double;
|
|
11
|
+
delay?: Double;
|
|
12
|
+
}
|
|
7
13
|
export interface NativeProps extends ViewProps {
|
|
8
14
|
coordinates: ReadonlyArray<Coordinate>;
|
|
9
15
|
strokeColors?: ReadonlyArray<ColorValue>;
|
|
10
16
|
strokeWidth?: Double;
|
|
11
17
|
animated?: boolean;
|
|
18
|
+
animatedOptions?: AnimatedOptions;
|
|
12
19
|
}
|
|
13
20
|
declare const _default: HostComponent<NativeProps>;
|
|
14
21
|
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LuggPolylineViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/LuggPolylineViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAExE,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,WAAW,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IACvC,YAAY,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"LuggPolylineViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/LuggPolylineViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AAExE,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,WAAW,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IACvC,YAAY,CAAC,EAAE,aAAa,CAAC,UAAU,CAAC,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;wBAII,aAAa,CAAC,WAAW,CAAC;AAF/B,wBAEgC"}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
export { MapView } from './MapView';
|
|
2
|
-
export
|
|
3
|
-
export type {
|
|
4
|
-
export
|
|
2
|
+
export { MapProvider } from './MapProvider';
|
|
3
|
+
export type { MapProviderProps } from './MapProvider.types';
|
|
4
|
+
export { Marker } from './components';
|
|
5
|
+
export type { MarkerProps } from './components';
|
|
6
|
+
export { Polyline } from './components';
|
|
7
|
+
export type { PolylineProps, PolylineEasing, PolylineAnimatedOptions, } from './components';
|
|
8
|
+
export type { MapViewProps, MapViewRef, MoveCameraOptions, FitCoordinatesOptions, SetEdgeInsetsOptions, CameraEventPayload, } from './MapView.types';
|
|
9
|
+
export type { MapProvider as MapProviderType, MapTheme, Coordinate, Point, EdgeInsets, } from './types';
|
|
5
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,cAAc,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,YAAY,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,YAAY,EACV,aAAa,EACb,cAAc,EACd,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,YAAY,EACV,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,WAAW,IAAI,eAAe,EAC9B,QAAQ,EACR,UAAU,EACV,KAAK,EACL,UAAU,GACX,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { MapView } from './MapView.web';
|
|
2
|
+
export { MapProvider } from './MapProvider.web';
|
|
3
|
+
export type { MapProviderProps } from './MapProvider.types';
|
|
4
|
+
export { Marker } from './components/index.web';
|
|
5
|
+
export type { MarkerProps } from './components/index.web';
|
|
6
|
+
export { Polyline } from './components/index.web';
|
|
7
|
+
export type { PolylineProps } from './components/index.web';
|
|
8
|
+
export type { MapViewProps, MapViewRef, MoveCameraOptions, FitCoordinatesOptions, CameraEventPayload, } from './MapView.types';
|
|
9
|
+
export type { MapProvider as MapProviderType, Coordinate, Point, EdgeInsets, } from './types';
|
|
10
|
+
//# sourceMappingURL=index.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.web.d.ts","sourceRoot":"","sources":["../../../src/index.web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,YAAY,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,YAAY,EACV,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,WAAW,IAAI,eAAe,EAC9B,UAAU,EACV,KAAK,EACL,UAAU,GACX,MAAM,SAAS,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED;;GAEG;AACH,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;;GAEG;AACH,MAAM,MAAM,QAAQ,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lugg/maps",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.30",
|
|
4
4
|
"description": "Universal maps for React Native.",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
9
|
"source": "./src/index.ts",
|
|
10
|
+
"react-native": "./lib/module/index.js",
|
|
11
|
+
"web": {
|
|
12
|
+
"types": "./lib/typescript/src/index.web.d.ts",
|
|
13
|
+
"default": "./lib/module/index.web.js"
|
|
14
|
+
},
|
|
10
15
|
"types": "./lib/typescript/src/index.d.ts",
|
|
11
16
|
"default": "./lib/module/index.js"
|
|
12
17
|
},
|
|
@@ -75,6 +80,7 @@
|
|
|
75
80
|
"@release-it/conventional-changelog": "^10.0.1",
|
|
76
81
|
"@types/jest": "^29.5.14",
|
|
77
82
|
"@types/react": "^19.2.0",
|
|
83
|
+
"@vis.gl/react-google-maps": "^1.7.1",
|
|
78
84
|
"commitlint": "^19.8.1",
|
|
79
85
|
"del-cli": "^6.0.0",
|
|
80
86
|
"eslint": "^9.35.0",
|
|
@@ -90,10 +96,19 @@
|
|
|
90
96
|
"turbo": "^2.5.6",
|
|
91
97
|
"typescript": "^5.9.2"
|
|
92
98
|
},
|
|
99
|
+
"resolutions": {
|
|
100
|
+
"@lodev09/react-native-true-sheet": "3.9.0-beta.1"
|
|
101
|
+
},
|
|
93
102
|
"peerDependencies": {
|
|
103
|
+
"@vis.gl/react-google-maps": ">=1.0.0",
|
|
94
104
|
"react": "*",
|
|
95
105
|
"react-native": "*"
|
|
96
106
|
},
|
|
107
|
+
"peerDependenciesMeta": {
|
|
108
|
+
"@vis.gl/react-google-maps": {
|
|
109
|
+
"optional": true
|
|
110
|
+
}
|
|
111
|
+
},
|
|
97
112
|
"dependencies": {
|
|
98
113
|
"@expo/config-plugins": "^9.0.0"
|
|
99
114
|
},
|
|
@@ -130,8 +145,7 @@
|
|
|
130
145
|
},
|
|
131
146
|
"ios": {
|
|
132
147
|
"componentProvider": {
|
|
133
|
-
"
|
|
134
|
-
"LuggAppleMapView": "LuggAppleMapView",
|
|
148
|
+
"LuggMapView": "LuggMapView",
|
|
135
149
|
"LuggMarkerView": "LuggMarkerView",
|
|
136
150
|
"LuggMapWrapperView": "LuggMapWrapperView",
|
|
137
151
|
"LuggPolylineView": "LuggPolylineView"
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MapProviderProps } from './MapProvider.types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Provider component for map configuration.
|
|
5
|
+
* On web, wraps children with Google Maps APIProvider.
|
|
6
|
+
* On native, passes children through.
|
|
7
|
+
*/
|
|
8
|
+
export function MapProvider({ children }: MapProviderProps) {
|
|
9
|
+
return children;
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
2
|
+
import { APIProvider } from '@vis.gl/react-google-maps';
|
|
3
|
+
import type { MapProviderProps } from './MapProvider.types';
|
|
4
|
+
|
|
5
|
+
export const MapContext = createContext<{
|
|
6
|
+
map: google.maps.Map | null;
|
|
7
|
+
isDragging: boolean;
|
|
8
|
+
}>({ map: null, isDragging: false });
|
|
9
|
+
|
|
10
|
+
export const useMapContext = () => useContext(MapContext);
|
|
11
|
+
|
|
12
|
+
export function MapProvider({ apiKey = '', children }: MapProviderProps) {
|
|
13
|
+
return <APIProvider apiKey={apiKey}>{children}</APIProvider>;
|
|
14
|
+
}
|
package/src/MapView.tsx
CHANGED
|
@@ -1,19 +1,17 @@
|
|
|
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,
|
|
12
9
|
MapViewRef,
|
|
13
10
|
MoveCameraOptions,
|
|
14
11
|
FitCoordinatesOptions,
|
|
12
|
+
SetEdgeInsetsOptions,
|
|
15
13
|
} from './MapView.types';
|
|
16
|
-
import type { Coordinate } from './types';
|
|
14
|
+
import type { Coordinate, EdgeInsets } from './types';
|
|
17
15
|
|
|
18
16
|
export class MapView
|
|
19
17
|
extends React.Component<MapViewProps>
|
|
@@ -26,22 +24,17 @@ export class MapView
|
|
|
26
24
|
scrollEnabled: true,
|
|
27
25
|
rotateEnabled: true,
|
|
28
26
|
pitchEnabled: true,
|
|
27
|
+
theme: 'system',
|
|
29
28
|
};
|
|
30
29
|
|
|
31
30
|
private nativeRef = React.createRef<any>();
|
|
32
31
|
|
|
33
|
-
|
|
34
|
-
const provider = this.props.provider ?? MapView.defaultProps.provider;
|
|
35
|
-
const isApple = Platform.OS === 'ios' && provider === 'apple';
|
|
36
|
-
return isApple ? AppleMapCommands : GoogleMapCommands;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
moveCamera(coordinate: Coordinate, options: MoveCameraOptions) {
|
|
32
|
+
moveCamera(coordinate: Coordinate, options?: MoveCameraOptions) {
|
|
40
33
|
const ref = this.nativeRef.current;
|
|
41
34
|
if (!ref) return;
|
|
42
35
|
|
|
43
|
-
const { zoom, duration = -1 } = options;
|
|
44
|
-
|
|
36
|
+
const { zoom = 0, duration = -1 } = options ?? {};
|
|
37
|
+
Commands.moveCamera(
|
|
45
38
|
ref,
|
|
46
39
|
coordinate.latitude,
|
|
47
40
|
coordinate.longitude,
|
|
@@ -64,7 +57,7 @@ export class MapView
|
|
|
64
57
|
return;
|
|
65
58
|
}
|
|
66
59
|
|
|
67
|
-
|
|
60
|
+
Commands.fitCoordinates(
|
|
68
61
|
ref,
|
|
69
62
|
coordinates,
|
|
70
63
|
top,
|
|
@@ -75,6 +68,15 @@ export class MapView
|
|
|
75
68
|
);
|
|
76
69
|
}
|
|
77
70
|
|
|
71
|
+
setEdgeInsets(edgeInsets: EdgeInsets, options?: SetEdgeInsetsOptions) {
|
|
72
|
+
const ref = this.nativeRef.current;
|
|
73
|
+
if (!ref) return;
|
|
74
|
+
|
|
75
|
+
const { top = 0, left = 0, bottom = 0, right = 0 } = edgeInsets;
|
|
76
|
+
const { duration = -1 } = options ?? {};
|
|
77
|
+
Commands.setEdgeInsets(ref, top, left, bottom, right, duration);
|
|
78
|
+
}
|
|
79
|
+
|
|
78
80
|
render() {
|
|
79
81
|
const {
|
|
80
82
|
provider,
|
|
@@ -87,8 +89,10 @@ export class MapView
|
|
|
87
89
|
scrollEnabled,
|
|
88
90
|
rotateEnabled,
|
|
89
91
|
pitchEnabled,
|
|
90
|
-
|
|
92
|
+
edgeInsets,
|
|
91
93
|
userLocationEnabled,
|
|
94
|
+
userLocationButtonEnabled,
|
|
95
|
+
theme,
|
|
92
96
|
onCameraMove,
|
|
93
97
|
onCameraIdle,
|
|
94
98
|
onReady,
|
|
@@ -96,15 +100,11 @@ export class MapView
|
|
|
96
100
|
...rest
|
|
97
101
|
} = this.props;
|
|
98
102
|
|
|
99
|
-
const NativeMapView =
|
|
100
|
-
Platform.OS === 'ios' && provider === 'apple'
|
|
101
|
-
? LuggAppleMapViewNativeComponent
|
|
102
|
-
: LuggGoogleMapViewNativeComponent;
|
|
103
|
-
|
|
104
103
|
return (
|
|
105
|
-
<
|
|
104
|
+
<LuggMapViewNativeComponent
|
|
106
105
|
ref={this.nativeRef}
|
|
107
106
|
{...rest}
|
|
107
|
+
provider={provider}
|
|
108
108
|
mapId={mapId}
|
|
109
109
|
initialCoordinate={initialCoordinate}
|
|
110
110
|
initialZoom={initialZoom}
|
|
@@ -114,15 +114,17 @@ export class MapView
|
|
|
114
114
|
scrollEnabled={scrollEnabled}
|
|
115
115
|
rotateEnabled={rotateEnabled}
|
|
116
116
|
pitchEnabled={pitchEnabled}
|
|
117
|
-
|
|
117
|
+
edgeInsets={edgeInsets}
|
|
118
118
|
userLocationEnabled={userLocationEnabled}
|
|
119
|
+
userLocationButtonEnabled={userLocationButtonEnabled}
|
|
120
|
+
theme={theme}
|
|
119
121
|
onCameraMove={onCameraMove}
|
|
120
122
|
onCameraIdle={onCameraIdle}
|
|
121
123
|
onReady={onReady}
|
|
122
124
|
>
|
|
123
125
|
<LuggMapWrapperViewNativeComponent style={StyleSheet.absoluteFill} />
|
|
124
126
|
{children}
|
|
125
|
-
</
|
|
127
|
+
</LuggMapViewNativeComponent>
|
|
126
128
|
);
|
|
127
129
|
}
|
|
128
130
|
}
|
package/src/MapView.types.ts
CHANGED
|
@@ -1,34 +1,40 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { NativeSyntheticEvent, ViewProps } from 'react-native';
|
|
3
|
-
import type { MapProvider, Coordinate, EdgeInsets } from './types';
|
|
3
|
+
import type { MapProvider, Coordinate, EdgeInsets, MapTheme } from './types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Options for moving the camera
|
|
7
|
-
* @default duration -1
|
|
8
7
|
*/
|
|
9
8
|
export interface MoveCameraOptions {
|
|
10
|
-
zoom
|
|
9
|
+
zoom?: number;
|
|
11
10
|
duration?: number;
|
|
12
11
|
}
|
|
13
12
|
|
|
14
13
|
/**
|
|
15
14
|
* Options for fitting coordinates in view
|
|
16
|
-
* @default duration -1
|
|
17
15
|
*/
|
|
18
16
|
export interface FitCoordinatesOptions {
|
|
19
17
|
padding?: EdgeInsets;
|
|
20
18
|
duration?: number;
|
|
21
19
|
}
|
|
22
20
|
|
|
21
|
+
/**
|
|
22
|
+
* Options for setting edge insets
|
|
23
|
+
*/
|
|
24
|
+
export interface SetEdgeInsetsOptions {
|
|
25
|
+
duration?: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
23
28
|
/**
|
|
24
29
|
* MapView ref methods
|
|
25
30
|
*/
|
|
26
31
|
export interface MapViewRef {
|
|
27
|
-
moveCamera(coordinate: Coordinate, options
|
|
32
|
+
moveCamera(coordinate: Coordinate, options?: MoveCameraOptions): void;
|
|
28
33
|
fitCoordinates(
|
|
29
34
|
coordinates: Coordinate[],
|
|
30
35
|
options?: FitCoordinatesOptions
|
|
31
36
|
): void;
|
|
37
|
+
setEdgeInsets(edgeInsets: EdgeInsets, options?: SetEdgeInsetsOptions): void;
|
|
32
38
|
}
|
|
33
39
|
|
|
34
40
|
/**
|
|
@@ -91,15 +97,26 @@ export interface MapViewProps extends ViewProps {
|
|
|
91
97
|
*/
|
|
92
98
|
pitchEnabled?: boolean;
|
|
93
99
|
/**
|
|
94
|
-
* Map content
|
|
100
|
+
* Map content edge insets
|
|
95
101
|
*/
|
|
96
|
-
|
|
102
|
+
edgeInsets?: EdgeInsets;
|
|
97
103
|
/**
|
|
98
104
|
* Show current user location on the map.
|
|
99
105
|
* Requires location permission to be granted, otherwise silently ignored.
|
|
100
106
|
* @default false
|
|
101
107
|
*/
|
|
102
108
|
userLocationEnabled?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* Show native my-location button when userLocationEnabled is true (Android only).
|
|
111
|
+
* @default false
|
|
112
|
+
* @platform android
|
|
113
|
+
*/
|
|
114
|
+
userLocationButtonEnabled?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Map color theme
|
|
117
|
+
* @default 'system'
|
|
118
|
+
*/
|
|
119
|
+
theme?: MapTheme;
|
|
103
120
|
/**
|
|
104
121
|
* Called when camera moves
|
|
105
122
|
*/
|