@lugg/maps 0.2.0-alpha.2 → 0.2.0-alpha.21
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 +17 -4
- package/android/src/main/java/com/luggmaps/LuggGoogleMapView.kt +31 -37
- 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/LuggPolylineView.kt +16 -0
- package/android/src/main/java/com/luggmaps/LuggPolylineViewManager.kt +22 -0
- package/android/src/main/java/com/luggmaps/core/PolylineAnimator.kt +157 -52
- package/ios/LuggAppleMapView.mm +161 -46
- package/ios/LuggGoogleMapView.mm +52 -22
- 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/GMSPolylineAnimator.h +3 -0
- package/ios/core/GMSPolylineAnimator.m +164 -41
- package/ios/core/MKPolylineAnimator.h +4 -0
- package/ios/core/MKPolylineAnimator.m +162 -43
- package/ios/core/PolylineAnimatorBase.h +14 -0
- package/ios/core/PolylineAnimatorBase.m +33 -0
- 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 +2 -2
- package/lib/module/MapView.js.map +1 -1
- package/lib/module/MapView.web.js +272 -0
- package/lib/module/MapView.web.js.map +1 -0
- package/lib/module/components/Marker.js +10 -1
- 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 +8 -3
- 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/LuggMarkerViewNativeComponent.ts +7 -1
- package/lib/module/fabric/LuggPolylineViewNativeComponent.ts +8 -0
- package/lib/module/index.js +3 -2
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +6 -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 +1 -1
- package/lib/typescript/src/MapView.d.ts.map +1 -1
- package/lib/typescript/src/MapView.types.d.ts +2 -2
- 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 +21 -0
- 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 +32 -0
- 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.web.d.ts +5 -0
- package/lib/typescript/src/components/index.web.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 +3 -1
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/index.web.d.ts +7 -0
- package/lib/typescript/src/index.web.d.ts.map +1 -0
- package/package.json +15 -2
- package/src/MapProvider.tsx +10 -0
- package/src/MapProvider.types.ts +16 -0
- package/src/MapProvider.web.tsx +14 -0
- package/src/MapView.tsx +2 -2
- package/src/MapView.types.ts +2 -2
- package/src/MapView.web.tsx +337 -0
- package/src/components/Marker.tsx +37 -3
- package/src/components/Marker.web.tsx +33 -0
- package/src/components/Polyline.tsx +38 -1
- package/src/components/Polyline.web.tsx +287 -0
- package/src/components/index.web.ts +4 -0
- package/src/fabric/LuggMarkerViewNativeComponent.ts +7 -1
- package/src/fabric/LuggPolylineViewNativeComponent.ts +8 -0
- package/src/index.ts +8 -1
- package/src/index.web.ts +17 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["Marker","Polyline"],"sourceRoot":"../../../src","sources":["components/index.web.ts"],"mappings":";;AAAA,SAASA,MAAM,QAAQ,iBAAc;AACrC,SAASC,QAAQ,QAAQ,mBAAgB","ignoreList":[]}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { codegenNativeComponent } from 'react-native';
|
|
2
2
|
import type { ViewProps, HostComponent } from 'react-native';
|
|
3
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
Double,
|
|
5
|
+
WithDefault,
|
|
6
|
+
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
4
7
|
|
|
5
8
|
export interface Coordinate {
|
|
6
9
|
latitude: Double;
|
|
@@ -18,6 +21,9 @@ export interface NativeProps extends ViewProps {
|
|
|
18
21
|
title?: string;
|
|
19
22
|
description?: string;
|
|
20
23
|
anchor?: Point;
|
|
24
|
+
rotate?: WithDefault<Double, 0>;
|
|
25
|
+
scale?: WithDefault<Double, 1>;
|
|
26
|
+
rasterize?: WithDefault<boolean, true>;
|
|
21
27
|
}
|
|
22
28
|
|
|
23
29
|
export default codegenNativeComponent<NativeProps>(
|
|
@@ -7,11 +7,19 @@ export interface Coordinate {
|
|
|
7
7
|
longitude: Double;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
export interface AnimatedOptions {
|
|
11
|
+
duration?: Double;
|
|
12
|
+
easing?: string;
|
|
13
|
+
trailLength?: Double;
|
|
14
|
+
delay?: Double;
|
|
15
|
+
}
|
|
16
|
+
|
|
10
17
|
export interface NativeProps extends ViewProps {
|
|
11
18
|
coordinates: ReadonlyArray<Coordinate>;
|
|
12
19
|
strokeColors?: ReadonlyArray<ColorValue>;
|
|
13
20
|
strokeWidth?: Double;
|
|
14
21
|
animated?: boolean;
|
|
22
|
+
animatedOptions?: AnimatedOptions;
|
|
15
23
|
}
|
|
16
24
|
|
|
17
25
|
export default codegenNativeComponent<NativeProps>(
|
package/lib/module/index.js
CHANGED
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["MapView"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,
|
|
1
|
+
{"version":3,"names":["MapView","MapProvider"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,WAAW;AACnC,SAASC,WAAW,QAAQ,eAAe;AAE3C,cAAc,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["MapView","MapProvider"],"sourceRoot":"../../src","sources":["index.web.ts"],"mappings":";;AAAA,SAASA,OAAO,QAAQ,kBAAe;AACvC,SAASC,WAAW,QAAQ,sBAAmB;AAE/C,cAAc,2BAAwB","ignoreList":[]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { MapProviderProps } from './MapProvider.types';
|
|
2
|
+
/**
|
|
3
|
+
* Provider component for map configuration.
|
|
4
|
+
* On web, wraps children with Google Maps APIProvider.
|
|
5
|
+
* On native, passes children through.
|
|
6
|
+
*/
|
|
7
|
+
export declare function MapProvider({ children }: MapProviderProps): import("react").ReactNode;
|
|
8
|
+
//# sourceMappingURL=MapProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapProvider.d.ts","sourceRoot":"","sources":["../../../src/MapProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,EAAE,gBAAgB,6BAEzD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* MapProvider props
|
|
4
|
+
*/
|
|
5
|
+
export interface MapProviderProps {
|
|
6
|
+
/**
|
|
7
|
+
* Google Maps API key
|
|
8
|
+
* @platform web
|
|
9
|
+
*/
|
|
10
|
+
apiKey?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Map children
|
|
13
|
+
*/
|
|
14
|
+
children: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=MapProvider.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapProvider.types.d.ts","sourceRoot":"","sources":["../../../src/MapProvider.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { MapProviderProps } from './MapProvider.types';
|
|
2
|
+
export declare const MapContext: import("react").Context<{
|
|
3
|
+
map: google.maps.Map | null;
|
|
4
|
+
isDragging: boolean;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const useMapContext: () => {
|
|
7
|
+
map: google.maps.Map | null;
|
|
8
|
+
isDragging: boolean;
|
|
9
|
+
};
|
|
10
|
+
export declare function MapProvider({ apiKey, children }: MapProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
//# sourceMappingURL=MapProvider.web.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapProvider.web.d.ts","sourceRoot":"","sources":["../../../src/MapProvider.web.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAE5D,eAAO,MAAM,UAAU;SAChB,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI;gBACf,OAAO;EACe,CAAC;AAErC,eAAO,MAAM,aAAa;SAJnB,MAAM,CAAC,IAAI,CAAC,GAAG,GAAG,IAAI;gBACf,OAAO;CAGoC,CAAC;AAE1D,wBAAgB,WAAW,CAAC,EAAE,MAAW,EAAE,QAAQ,EAAE,EAAE,gBAAgB,2CAEtE"}
|
|
@@ -5,7 +5,7 @@ export declare class MapView extends React.Component<MapViewProps> implements Ma
|
|
|
5
5
|
static defaultProps: Partial<MapViewProps>;
|
|
6
6
|
private nativeRef;
|
|
7
7
|
private get nativeCommands();
|
|
8
|
-
moveCamera(coordinate: Coordinate, options
|
|
8
|
+
moveCamera(coordinate: Coordinate, options?: MoveCameraOptions): void;
|
|
9
9
|
fitCoordinates(coordinates: Coordinate[], options?: FitCoordinatesOptions): void;
|
|
10
10
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
11
11
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../src/MapView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,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,CAOxC;IAEF,OAAO,CAAC,SAAS,CAA0B;IAE3C,OAAO,KAAK,cAAc,GAIzB;IAED,UAAU,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,iBAAiB;
|
|
1
|
+
{"version":3,"file":"MapView.d.ts","sourceRoot":"","sources":["../../../src/MapView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAS1B,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,CAOxC;IAEF,OAAO,CAAC,SAAS,CAA0B;IAE3C,OAAO,KAAK,cAAc,GAIzB;IAED,UAAU,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,iBAAiB;IAc9D,cAAc,CAAC,WAAW,EAAE,UAAU,EAAE,EAAE,OAAO,CAAC,EAAE,qBAAqB;IAyBzE,MAAM;CAkDP"}
|
|
@@ -6,7 +6,7 @@ import type { MapProvider, Coordinate, EdgeInsets } from './types';
|
|
|
6
6
|
* @default duration -1
|
|
7
7
|
*/
|
|
8
8
|
export interface MoveCameraOptions {
|
|
9
|
-
zoom
|
|
9
|
+
zoom?: number;
|
|
10
10
|
duration?: number;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
@@ -21,7 +21,7 @@ export interface FitCoordinatesOptions {
|
|
|
21
21
|
* MapView ref methods
|
|
22
22
|
*/
|
|
23
23
|
export interface MapViewRef {
|
|
24
|
-
moveCamera(coordinate: Coordinate, options
|
|
24
|
+
moveCamera(coordinate: Coordinate, options?: MoveCameraOptions): void;
|
|
25
25
|
fitCoordinates(coordinates: Coordinate[], options?: FitCoordinatesOptions): void;
|
|
26
26
|
}
|
|
27
27
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MapView.types.d.ts","sourceRoot":"","sources":["../../../src/MapView.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEnE;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"MapView.types.d.ts","sourceRoot":"","sources":["../../../src/MapView.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAEnE;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,UAAU,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IACtE,cAAc,CACZ,WAAW,EAAE,UAAU,EAAE,EACzB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,IAAI,CAAC;CACT;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,UAAU,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,YAAa,SAAQ,SAAS;IAC7C;;;OAGG;IACH,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;OAEG;IACH,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IACzE;;OAEG;IACH,YAAY,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,kBAAkB,CAAC,KAAK,IAAI,CAAC;IACzE;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MapView.web.d.ts","sourceRoot":"","sources":["../../../src/MapView.web.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EAIX,MAAM,iBAAiB,CAAC;AAoEzB,eAAO,MAAM,OAAO,qGAiPlB,CAAC"}
|
|
@@ -22,6 +22,27 @@ export interface MarkerProps {
|
|
|
22
22
|
* Anchor point for custom marker views
|
|
23
23
|
*/
|
|
24
24
|
anchor?: Point;
|
|
25
|
+
/**
|
|
26
|
+
* Z-index for marker ordering. Higher values render on top.
|
|
27
|
+
*/
|
|
28
|
+
zIndex?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Rotation angle in degrees clockwise from north.
|
|
31
|
+
* @default 0
|
|
32
|
+
*/
|
|
33
|
+
rotate?: number;
|
|
34
|
+
/**
|
|
35
|
+
* Scale factor for the marker.
|
|
36
|
+
* @default 1
|
|
37
|
+
*/
|
|
38
|
+
scale?: number;
|
|
39
|
+
/**
|
|
40
|
+
* Rasterize custom marker view to bitmap for better performance.
|
|
41
|
+
* Set to false if you need live view updates (e.g., animations).
|
|
42
|
+
* @platform ios, android
|
|
43
|
+
* @default true
|
|
44
|
+
*/
|
|
45
|
+
rasterize?: boolean;
|
|
25
46
|
/**
|
|
26
47
|
* Custom marker view
|
|
27
48
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Marker.d.ts","sourceRoot":"","sources":["../../../../src/components/Marker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,UAAU,EAAE,UAAU,CAAC;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,qBAAa,MAAO,SAAQ,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC;IACtD,MAAM;
|
|
1
|
+
{"version":3,"file":"Marker.d.ts","sourceRoot":"","sources":["../../../../src/components/Marker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAElD,MAAM,WAAW,WAAW;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,UAAU,EAAE,UAAU,CAAC;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC;IACf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;CACtB;AAED,qBAAa,MAAO,SAAQ,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC;IACtD,MAAM;CA8BP"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Marker.web.d.ts","sourceRoot":"","sources":["../../../../src/components/Marker.web.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAI5C,wBAAgB,MAAM,CAAC,EACrB,UAAU,EACV,KAAK,EACL,MAAM,EACN,MAAM,EACN,MAAM,EACN,KAAK,EACL,QAAQ,GACT,EAAE,WAAW,2CAmBb"}
|
|
@@ -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,6 +42,14 @@ 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
54
|
export declare class Polyline extends React.Component<PolylineProps> {
|
|
23
55
|
render(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -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,SAAS,CAAC,aAAa,CAAC;IAC1D,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"}
|
|
@@ -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 } 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,7 @@
|
|
|
1
1
|
export { MapView } from './MapView';
|
|
2
|
+
export { MapProvider } from './MapProvider';
|
|
3
|
+
export type { MapProviderProps } from './MapProvider.types';
|
|
2
4
|
export * from './components';
|
|
3
5
|
export type { MapViewProps, MapViewRef, MoveCameraOptions, FitCoordinatesOptions, CameraEventPayload, } from './MapView.types';
|
|
4
|
-
export type { MapProvider, Coordinate, Point, EdgeInsets } from './types';
|
|
6
|
+
export type { MapProvider as MapProviderType, Coordinate, Point, EdgeInsets, } from './types';
|
|
5
7
|
//# 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;AAC7B,YAAY,EACV,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,iBAAiB,CAAC;AACzB,YAAY,
|
|
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,cAAc,cAAc,CAAC;AAC7B,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"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { MapView } from './MapView.web';
|
|
2
|
+
export { MapProvider } from './MapProvider.web';
|
|
3
|
+
export type { MapProviderProps } from './MapProvider.types';
|
|
4
|
+
export * from './components/index.web';
|
|
5
|
+
export type { MapViewProps, MapViewRef, MoveCameraOptions, FitCoordinatesOptions, CameraEventPayload, } from './MapView.types';
|
|
6
|
+
export type { MapProvider as MapProviderType, Coordinate, Point, EdgeInsets, } from './types';
|
|
7
|
+
//# 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,cAAc,wBAAwB,CAAC;AACvC,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"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lugg/maps",
|
|
3
|
-
"version": "0.2.0-alpha.
|
|
3
|
+
"version": "0.2.0-alpha.21",
|
|
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
|
},
|
|
13
|
-
"./package.json": "./package.json"
|
|
18
|
+
"./package.json": "./package.json",
|
|
19
|
+
"./app.plugin.js": "./app.plugin.js"
|
|
14
20
|
},
|
|
15
21
|
"files": [
|
|
16
22
|
"src",
|
|
@@ -74,6 +80,7 @@
|
|
|
74
80
|
"@release-it/conventional-changelog": "^10.0.1",
|
|
75
81
|
"@types/jest": "^29.5.14",
|
|
76
82
|
"@types/react": "^19.2.0",
|
|
83
|
+
"@vis.gl/react-google-maps": "^1.7.1",
|
|
77
84
|
"commitlint": "^19.8.1",
|
|
78
85
|
"del-cli": "^6.0.0",
|
|
79
86
|
"eslint": "^9.35.0",
|
|
@@ -90,9 +97,15 @@
|
|
|
90
97
|
"typescript": "^5.9.2"
|
|
91
98
|
},
|
|
92
99
|
"peerDependencies": {
|
|
100
|
+
"@vis.gl/react-google-maps": ">=1.0.0",
|
|
93
101
|
"react": "*",
|
|
94
102
|
"react-native": "*"
|
|
95
103
|
},
|
|
104
|
+
"peerDependenciesMeta": {
|
|
105
|
+
"@vis.gl/react-google-maps": {
|
|
106
|
+
"optional": true
|
|
107
|
+
}
|
|
108
|
+
},
|
|
96
109
|
"dependencies": {
|
|
97
110
|
"@expo/config-plugins": "^9.0.0"
|
|
98
111
|
},
|
|
@@ -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
|
@@ -36,11 +36,11 @@ export class MapView
|
|
|
36
36
|
return isApple ? AppleMapCommands : GoogleMapCommands;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
moveCamera(coordinate: Coordinate, options
|
|
39
|
+
moveCamera(coordinate: Coordinate, options?: MoveCameraOptions) {
|
|
40
40
|
const ref = this.nativeRef.current;
|
|
41
41
|
if (!ref) return;
|
|
42
42
|
|
|
43
|
-
const { zoom, duration = -1 } = options;
|
|
43
|
+
const { zoom = 0, duration = -1 } = options ?? {};
|
|
44
44
|
this.nativeCommands.moveCamera(
|
|
45
45
|
ref,
|
|
46
46
|
coordinate.latitude,
|
package/src/MapView.types.ts
CHANGED
|
@@ -7,7 +7,7 @@ import type { MapProvider, Coordinate, EdgeInsets } from './types';
|
|
|
7
7
|
* @default duration -1
|
|
8
8
|
*/
|
|
9
9
|
export interface MoveCameraOptions {
|
|
10
|
-
zoom
|
|
10
|
+
zoom?: number;
|
|
11
11
|
duration?: number;
|
|
12
12
|
}
|
|
13
13
|
|
|
@@ -24,7 +24,7 @@ export interface FitCoordinatesOptions {
|
|
|
24
24
|
* MapView ref methods
|
|
25
25
|
*/
|
|
26
26
|
export interface MapViewRef {
|
|
27
|
-
moveCamera(coordinate: Coordinate, options
|
|
27
|
+
moveCamera(coordinate: Coordinate, options?: MoveCameraOptions): void;
|
|
28
28
|
fitCoordinates(
|
|
29
29
|
coordinates: Coordinate[],
|
|
30
30
|
options?: FitCoordinatesOptions
|