@lugg/maps 0.2.0-alpha.9 → 1.0.0-beta.1
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 -20
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/luggmaps/LuggCalloutView.kt +74 -0
- package/android/src/main/java/com/luggmaps/LuggCalloutViewManager.kt +38 -0
- package/android/src/main/java/com/luggmaps/LuggMapView.kt +290 -0
- package/android/src/main/java/com/luggmaps/{LuggGoogleMapViewManager.kt → LuggMapViewManager.kt} +99 -36
- package/android/src/main/java/com/luggmaps/LuggMapWrapperView.kt +11 -14
- package/android/src/main/java/com/luggmaps/LuggMarkerView.kt +187 -21
- package/android/src/main/java/com/luggmaps/LuggMarkerViewManager.kt +28 -0
- package/android/src/main/java/com/luggmaps/LuggPackage.kt +8 -4
- package/android/src/main/java/com/luggmaps/LuggPolygonView.kt +85 -0
- package/android/src/main/java/com/luggmaps/LuggPolygonViewManager.kt +100 -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/GoogleMapProvider.kt +874 -0
- package/android/src/main/java/com/luggmaps/core/MapProviderDelegate.kt +60 -0
- package/android/src/main/java/com/luggmaps/core/PolylineAnimator.kt +89 -24
- package/android/src/main/java/com/luggmaps/events/LongPressEvent.kt +29 -0
- package/android/src/main/java/com/luggmaps/events/MarkerDragEvent.kt +41 -0
- package/android/src/main/java/com/luggmaps/events/MarkerPressEvent.kt +34 -0
- package/android/src/main/java/com/luggmaps/events/PolygonPressEvent.kt +12 -0
- package/android/src/main/java/com/luggmaps/events/PressEvent.kt +29 -0
- package/ios/LuggCalloutView.h +23 -0
- package/ios/LuggCalloutView.mm +145 -0
- package/ios/LuggMapView.h +9 -0
- package/ios/LuggMapView.mm +343 -0
- package/ios/LuggMarkerView.h +15 -0
- package/ios/LuggMarkerView.mm +136 -2
- package/ios/LuggPolygonView.h +31 -0
- package/ios/LuggPolygonView.mm +151 -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 +1173 -0
- package/ios/core/GMSPolylineAnimator.h +3 -0
- package/ios/core/GMSPolylineAnimator.m +101 -15
- package/ios/core/GoogleMapProvider.h +13 -0
- package/ios/core/GoogleMapProvider.mm +798 -0
- package/ios/core/LuggAnnotationView.h +12 -0
- package/ios/core/LuggAnnotationView.mm +55 -0
- package/ios/core/MKPolylineAnimator.h +4 -0
- package/ios/core/MKPolylineAnimator.m +167 -42
- package/ios/core/MapProviderDelegate.h +84 -0
- package/ios/core/PolylineAnimatorBase.h +24 -1
- package/ios/core/PolylineAnimatorBase.m +82 -19
- package/ios/events/LongPressEvent.h +29 -0
- package/ios/events/MarkerDragEvent.h +69 -0
- package/ios/events/MarkerPressEvent.h +29 -0
- package/ios/events/PolygonPressEvent.h +20 -0
- package/ios/events/PressEvent.h +29 -0
- package/ios/extensions/MKMapView+Zoom.h +2 -0
- package/ios/extensions/MKMapView+Zoom.m +14 -4
- package/lib/module/MapProvider.js +2 -4
- package/lib/module/MapProvider.js.map +1 -1
- package/lib/module/MapProvider.web.js +14 -7
- package/lib/module/MapProvider.web.js.map +1 -1
- package/lib/module/MapView.js +33 -16
- package/lib/module/MapView.js.map +1 -1
- package/lib/module/MapView.web.js +296 -181
- package/lib/module/MapView.web.js.map +1 -1
- package/lib/module/components/GeoJson.js +159 -0
- package/lib/module/components/GeoJson.js.map +1 -0
- package/lib/module/components/GeoJson.types.js +4 -0
- package/lib/module/components/GeoJson.types.js.map +1 -0
- package/lib/module/components/Marker.js +49 -8
- package/lib/module/components/Marker.js.map +1 -1
- package/lib/module/components/Marker.types.js +4 -0
- package/lib/module/components/Marker.types.js.map +1 -0
- package/lib/module/components/Marker.web.js +159 -24
- package/lib/module/components/Marker.web.js.map +1 -1
- package/lib/module/components/Polygon.js +46 -0
- package/lib/module/components/Polygon.js.map +1 -0
- package/lib/module/components/Polygon.types.js +4 -0
- package/lib/module/components/Polygon.types.js.map +1 -0
- package/lib/module/components/Polygon.web.js +87 -0
- package/lib/module/components/Polygon.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.types.js +4 -0
- package/lib/module/components/Polyline.types.js.map +1 -0
- package/lib/module/components/Polyline.web.js +108 -31
- package/lib/module/components/Polyline.web.js.map +1 -1
- package/lib/module/components/index.js +4 -2
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/index.web.js +2 -0
- package/lib/module/components/index.web.js.map +1 -1
- package/lib/module/fabric/LuggCalloutViewNativeComponent.ts +20 -0
- package/lib/module/fabric/{LuggGoogleMapViewNativeComponent.ts → LuggMapViewNativeComponent.ts} +43 -7
- package/lib/module/fabric/LuggMarkerViewNativeComponent.ts +49 -1
- package/lib/module/fabric/LuggPolygonViewNativeComponent.ts +25 -0
- package/lib/module/fabric/LuggPolylineViewNativeComponent.ts +8 -0
- package/lib/module/index.js +4 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +4 -1
- package/lib/module/index.web.js.map +1 -1
- package/lib/typescript/src/MapProvider.d.ts +1 -1
- package/lib/typescript/src/MapProvider.d.ts.map +1 -1
- package/lib/typescript/src/MapProvider.web.d.ts +23 -1
- package/lib/typescript/src/MapProvider.web.d.ts.map +1 -1
- 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 +35 -9
- package/lib/typescript/src/MapView.types.d.ts.map +1 -1
- package/lib/typescript/src/MapView.web.d.ts +2 -11
- package/lib/typescript/src/MapView.web.d.ts.map +1 -1
- package/lib/typescript/src/components/GeoJson.d.ts +4 -0
- package/lib/typescript/src/components/GeoJson.d.ts.map +1 -0
- package/lib/typescript/src/components/GeoJson.types.d.ts +89 -0
- package/lib/typescript/src/components/GeoJson.types.d.ts.map +1 -0
- package/lib/typescript/src/components/Marker.d.ts +6 -33
- package/lib/typescript/src/components/Marker.d.ts.map +1 -1
- package/lib/typescript/src/components/Marker.types.d.ts +100 -0
- package/lib/typescript/src/components/Marker.types.d.ts.map +1 -0
- package/lib/typescript/src/components/Marker.web.d.ts +2 -5
- package/lib/typescript/src/components/Marker.web.d.ts.map +1 -1
- package/lib/typescript/src/components/Polygon.d.ts +10 -0
- package/lib/typescript/src/components/Polygon.d.ts.map +1 -0
- package/lib/typescript/src/components/Polygon.types.d.ts +33 -0
- package/lib/typescript/src/components/Polygon.types.d.ts.map +1 -0
- package/lib/typescript/src/components/Polygon.web.d.ts +3 -0
- package/lib/typescript/src/components/Polygon.web.d.ts.map +1 -0
- package/lib/typescript/src/components/Polyline.d.ts +6 -21
- package/lib/typescript/src/components/Polyline.d.ts.map +1 -1
- package/lib/typescript/src/components/Polyline.types.d.ts +53 -0
- package/lib/typescript/src/components/Polyline.types.d.ts.map +1 -0
- package/lib/typescript/src/components/Polyline.web.d.ts +2 -5
- package/lib/typescript/src/components/Polyline.web.d.ts.map +1 -1
- package/lib/typescript/src/components/index.d.ts +8 -2
- package/lib/typescript/src/components/index.d.ts.map +1 -1
- package/lib/typescript/src/components/index.web.d.ts +6 -2
- package/lib/typescript/src/components/index.web.d.ts.map +1 -1
- package/lib/typescript/src/fabric/LuggCalloutViewNativeComponent.d.ts +13 -0
- package/lib/typescript/src/fabric/LuggCalloutViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/{LuggGoogleMapViewNativeComponent.d.ts → LuggMapViewNativeComponent.d.ts} +30 -4
- package/lib/typescript/src/fabric/LuggMapViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/LuggMarkerViewNativeComponent.d.ts +45 -1
- package/lib/typescript/src/fabric/LuggMarkerViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/fabric/LuggPolygonViewNativeComponent.d.ts +18 -0
- package/lib/typescript/src/fabric/LuggPolygonViewNativeComponent.d.ts.map +1 -0
- 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 +11 -3
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/index.web.d.ts +9 -1
- package/lib/typescript/src/index.web.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +11 -0
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/package.json +11 -9
- package/src/MapProvider.tsx +1 -3
- package/src/MapProvider.web.tsx +22 -3
- package/src/MapView.tsx +32 -26
- package/src/MapView.types.ts +43 -9
- package/src/MapView.web.tsx +368 -210
- package/src/components/GeoJson.tsx +221 -0
- package/src/components/GeoJson.types.ts +118 -0
- package/src/components/Marker.tsx +75 -38
- package/src/components/Marker.types.ts +102 -0
- package/src/components/Marker.web.tsx +197 -19
- package/src/components/Polygon.tsx +52 -0
- package/src/components/Polygon.types.ts +33 -0
- package/src/components/Polygon.web.tsx +104 -0
- package/src/components/Polyline.tsx +23 -22
- package/src/components/Polyline.types.ts +55 -0
- package/src/components/Polyline.web.tsx +151 -37
- package/src/components/index.ts +17 -2
- package/src/components/index.web.ts +6 -2
- package/src/fabric/LuggCalloutViewNativeComponent.ts +20 -0
- package/src/fabric/{LuggGoogleMapViewNativeComponent.ts → LuggMapViewNativeComponent.ts} +43 -7
- package/src/fabric/LuggMarkerViewNativeComponent.ts +49 -1
- package/src/fabric/LuggPolygonViewNativeComponent.ts +25 -0
- package/src/fabric/LuggPolylineViewNativeComponent.ts +8 -0
- package/src/index.ts +30 -1
- package/src/index.web.ts +16 -1
- package/src/types.ts +13 -0
- package/android/src/main/java/com/luggmaps/LuggGoogleMapView.kt +0 -511
- package/ios/LuggAppleMapView.h +0 -16
- package/ios/LuggAppleMapView.mm +0 -592
- package/ios/LuggGoogleMapView.h +0 -13
- package/ios/LuggGoogleMapView.mm +0 -455
- 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,5 +1,9 @@
|
|
|
1
1
|
export { Marker } from './Marker.web';
|
|
2
|
+
export { Polygon } from './Polygon.web';
|
|
2
3
|
export { Polyline } from './Polyline.web';
|
|
3
|
-
export type { MarkerProps } from './Marker';
|
|
4
|
-
export type {
|
|
4
|
+
export type { CalloutOptions, MarkerProps } from './Marker.types';
|
|
5
|
+
export type { PolygonProps } from './Polygon.types';
|
|
6
|
+
export type { PolylineProps } from './Polyline.types';
|
|
7
|
+
export { GeoJson } from './GeoJson';
|
|
8
|
+
export type { GeoJsonProps } from './GeoJson.types';
|
|
5
9
|
//# sourceMappingURL=index.web.d.ts.map
|
|
@@ -1 +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,
|
|
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,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ViewProps, HostComponent } from 'react-native';
|
|
2
|
+
import type { Double, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
export interface Point {
|
|
4
|
+
x: Double;
|
|
5
|
+
y: Double;
|
|
6
|
+
}
|
|
7
|
+
export interface NativeProps extends ViewProps {
|
|
8
|
+
bubbled?: WithDefault<boolean, true>;
|
|
9
|
+
anchor?: Point;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: HostComponent<NativeProps>;
|
|
12
|
+
export default _default;
|
|
13
|
+
//# sourceMappingURL=LuggCalloutViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LuggCalloutViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/LuggCalloutViewNativeComponent.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,KAAK;IACpB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,OAAO,CAAC,EAAE,WAAW,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACrC,MAAM,CAAC,EAAE,KAAK,CAAC;CAChB;wBAII,aAAa,CAAC,WAAW,CAAC;AAF/B,wBAEgC"}
|
|
@@ -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;
|
|
@@ -26,9 +26,30 @@ export interface CameraIdleEvent {
|
|
|
26
26
|
zoom: Double;
|
|
27
27
|
gesture: boolean;
|
|
28
28
|
}
|
|
29
|
+
export interface PressEvent {
|
|
30
|
+
coordinate: {
|
|
31
|
+
latitude: Double;
|
|
32
|
+
longitude: Double;
|
|
33
|
+
};
|
|
34
|
+
point: {
|
|
35
|
+
x: Double;
|
|
36
|
+
y: Double;
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export interface LongPressEvent {
|
|
40
|
+
coordinate: {
|
|
41
|
+
latitude: Double;
|
|
42
|
+
longitude: Double;
|
|
43
|
+
};
|
|
44
|
+
point: {
|
|
45
|
+
x: Double;
|
|
46
|
+
y: Double;
|
|
47
|
+
};
|
|
48
|
+
}
|
|
29
49
|
export interface ReadyEvent {
|
|
30
50
|
}
|
|
31
51
|
export interface NativeProps extends ViewProps {
|
|
52
|
+
provider?: WithDefault<'google' | 'apple', 'google'>;
|
|
32
53
|
mapId?: string;
|
|
33
54
|
initialCoordinate?: Coordinate;
|
|
34
55
|
initialZoom?: Double;
|
|
@@ -38,8 +59,12 @@ export interface NativeProps extends ViewProps {
|
|
|
38
59
|
scrollEnabled?: boolean;
|
|
39
60
|
rotateEnabled?: boolean;
|
|
40
61
|
pitchEnabled?: boolean;
|
|
41
|
-
|
|
62
|
+
edgeInsets?: EdgeInsets;
|
|
42
63
|
userLocationEnabled?: boolean;
|
|
64
|
+
userLocationButtonEnabled?: boolean;
|
|
65
|
+
theme?: WithDefault<'light' | 'dark' | 'system', 'system'>;
|
|
66
|
+
onMapPress?: DirectEventHandler<PressEvent>;
|
|
67
|
+
onMapLongPress?: DirectEventHandler<LongPressEvent>;
|
|
43
68
|
onCameraMove?: DirectEventHandler<CameraMoveEvent>;
|
|
44
69
|
onCameraIdle?: DirectEventHandler<CameraIdleEvent>;
|
|
45
70
|
onReady?: DirectEventHandler<ReadyEvent>;
|
|
@@ -47,9 +72,10 @@ export interface NativeProps extends ViewProps {
|
|
|
47
72
|
type ComponentType = HostComponent<NativeProps>;
|
|
48
73
|
interface NativeCommands {
|
|
49
74
|
moveCamera: (viewRef: React.ElementRef<ComponentType>, latitude: Double, longitude: Double, zoom: Double, duration: Double) => void;
|
|
50
|
-
fitCoordinates: (viewRef: React.ElementRef<ComponentType>, coordinates: Coordinate[],
|
|
75
|
+
fitCoordinates: (viewRef: React.ElementRef<ComponentType>, coordinates: Coordinate[], edgeInsetsTop: Double, edgeInsetsLeft: Double, edgeInsetsBottom: Double, edgeInsetsRight: Double, duration: Double) => void;
|
|
76
|
+
setEdgeInsets: (viewRef: React.ElementRef<ComponentType>, top: Double, left: Double, bottom: Double, right: Double, duration: Double) => void;
|
|
51
77
|
}
|
|
52
78
|
export declare const Commands: NativeCommands;
|
|
53
79
|
declare const _default: ComponentType;
|
|
54
80
|
export default _default;
|
|
55
|
-
//# sourceMappingURL=
|
|
81
|
+
//# 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;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,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b,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;CACX;AAED,eAAO,MAAM,QAAQ,gBAEnB,CAAC;wBAIE,aAAa;AAFlB,wBAEmB"}
|
|
@@ -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, DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
3
|
export interface Coordinate {
|
|
4
4
|
latitude: Double;
|
|
5
5
|
longitude: Double;
|
|
@@ -14,6 +14,50 @@ 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>;
|
|
20
|
+
draggable?: WithDefault<boolean, false>;
|
|
21
|
+
onMarkerPress?: DirectEventHandler<{
|
|
22
|
+
coordinate: {
|
|
23
|
+
latitude: Double;
|
|
24
|
+
longitude: Double;
|
|
25
|
+
};
|
|
26
|
+
point: {
|
|
27
|
+
x: Double;
|
|
28
|
+
y: Double;
|
|
29
|
+
};
|
|
30
|
+
}>;
|
|
31
|
+
onMarkerDragStart?: DirectEventHandler<{
|
|
32
|
+
coordinate: {
|
|
33
|
+
latitude: Double;
|
|
34
|
+
longitude: Double;
|
|
35
|
+
};
|
|
36
|
+
point: {
|
|
37
|
+
x: Double;
|
|
38
|
+
y: Double;
|
|
39
|
+
};
|
|
40
|
+
}>;
|
|
41
|
+
onMarkerDragChange?: DirectEventHandler<{
|
|
42
|
+
coordinate: {
|
|
43
|
+
latitude: Double;
|
|
44
|
+
longitude: Double;
|
|
45
|
+
};
|
|
46
|
+
point: {
|
|
47
|
+
x: Double;
|
|
48
|
+
y: Double;
|
|
49
|
+
};
|
|
50
|
+
}>;
|
|
51
|
+
onMarkerDragEnd?: DirectEventHandler<{
|
|
52
|
+
coordinate: {
|
|
53
|
+
latitude: Double;
|
|
54
|
+
longitude: Double;
|
|
55
|
+
};
|
|
56
|
+
point: {
|
|
57
|
+
x: Double;
|
|
58
|
+
y: Double;
|
|
59
|
+
};
|
|
60
|
+
}>;
|
|
17
61
|
}
|
|
18
62
|
declare const _default: HostComponent<NativeProps>;
|
|
19
63
|
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,EACX,kBAAkB,EACnB,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,MA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, DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
export interface Coordinate {
|
|
4
|
+
latitude: Double;
|
|
5
|
+
longitude: Double;
|
|
6
|
+
}
|
|
7
|
+
export interface NativeProps extends ViewProps {
|
|
8
|
+
coordinates: ReadonlyArray<Coordinate>;
|
|
9
|
+
holes?: ReadonlyArray<ReadonlyArray<Coordinate>>;
|
|
10
|
+
strokeColor?: ColorValue;
|
|
11
|
+
strokeWidth?: Double;
|
|
12
|
+
fillColor?: ColorValue;
|
|
13
|
+
tappable?: boolean;
|
|
14
|
+
onPolygonPress?: DirectEventHandler<null>;
|
|
15
|
+
}
|
|
16
|
+
declare const _default: HostComponent<NativeProps>;
|
|
17
|
+
export default _default;
|
|
18
|
+
//# sourceMappingURL=LuggPolygonViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LuggPolygonViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/LuggPolygonViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACzE,OAAO,KAAK,EACV,MAAM,EACN,kBAAkB,EACnB,MAAM,2CAA2C,CAAC;AAEnD,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,KAAK,CAAC,EAAE,aAAa,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC;IACjD,WAAW,CAAC,EAAE,UAAU,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,UAAU,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,kBAAkB,CAAC,IAAI,CAAC,CAAC;CAC3C;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,7 +1,15 @@
|
|
|
1
1
|
export { MapView } from './MapView';
|
|
2
2
|
export { MapProvider } from './MapProvider';
|
|
3
3
|
export type { MapProviderProps } from './MapProvider.types';
|
|
4
|
-
export
|
|
5
|
-
export type {
|
|
6
|
-
export
|
|
4
|
+
export { Marker } from './components';
|
|
5
|
+
export type { CalloutOptions, MarkerProps, MarkerPressEvent, MarkerDragEvent, } from './components';
|
|
6
|
+
export { Polygon } from './components';
|
|
7
|
+
export type { PolygonProps } from './components';
|
|
8
|
+
export { Polyline } from './components';
|
|
9
|
+
export type { PolylineProps, PolylineEasing, PolylineAnimatedOptions, } from './components';
|
|
10
|
+
export { GeoJson } from './components';
|
|
11
|
+
export type { GeoJsonProps } from './components';
|
|
12
|
+
export type { MapViewProps, MapViewRef, MoveCameraOptions, FitCoordinatesOptions, SetEdgeInsetsOptions, CameraEventPayload, MapCameraEvent, MapPressEvent, } from './MapView.types';
|
|
13
|
+
export type { MapProvider as MapProviderType, MapTheme, Coordinate, Point, EdgeInsets, PressEventPayload, } from './types';
|
|
14
|
+
export type { GeoJSON, Feature, FeatureCollection, FeatureProperties, Geometry, Position, } from './components/GeoJson.types';
|
|
7
15
|
//# 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,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,YAAY,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAC5D,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,EACV,cAAc,EACd,WAAW,EACX,gBAAgB,EAChB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,YAAY,EACV,aAAa,EACb,cAAc,EACd,uBAAuB,GACxB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,YAAY,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACjD,YAAY,EACV,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,YAAY,EACV,WAAW,IAAI,eAAe,EAC9B,QAAQ,EACR,UAAU,EACV,KAAK,EACL,UAAU,EACV,iBAAiB,GAClB,MAAM,SAAS,CAAC;AACjB,YAAY,EACV,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,iBAAiB,EACjB,QAAQ,EACR,QAAQ,GACT,MAAM,4BAA4B,CAAC"}
|
|
@@ -1,7 +1,15 @@
|
|
|
1
1
|
export { MapView } from './MapView.web';
|
|
2
2
|
export { MapProvider } from './MapProvider.web';
|
|
3
3
|
export type { MapProviderProps } from './MapProvider.types';
|
|
4
|
-
export
|
|
4
|
+
export { Marker } from './components/index.web';
|
|
5
|
+
export type { CalloutOptions, MarkerProps } from './components/index.web';
|
|
6
|
+
export { Polygon } from './components/index.web';
|
|
7
|
+
export type { PolygonProps } from './components/index.web';
|
|
8
|
+
export { Polyline } from './components/index.web';
|
|
9
|
+
export type { PolylineProps } from './components/index.web';
|
|
10
|
+
export { GeoJson } from './components/index.web';
|
|
11
|
+
export type { GeoJsonProps } from './components/index.web';
|
|
5
12
|
export type { MapViewProps, MapViewRef, MoveCameraOptions, FitCoordinatesOptions, CameraEventPayload, } from './MapView.types';
|
|
6
13
|
export type { MapProvider as MapProviderType, Coordinate, Point, EdgeInsets, } from './types';
|
|
14
|
+
export type { GeoJSON, Feature, FeatureCollection, FeatureProperties, Geometry, Position, } from './components/GeoJson.types';
|
|
7
15
|
//# sourceMappingURL=index.web.d.ts.map
|
|
@@ -1 +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;
|
|
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,cAAc,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1E,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,YAAY,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,YAAY,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAC3D,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;AACjB,YAAY,EACV,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,iBAAiB,EACjB,QAAQ,EACR,QAAQ,GACT,MAAM,4BAA4B,CAAC"}
|
|
@@ -25,4 +25,15 @@ export interface EdgeInsets {
|
|
|
25
25
|
bottom: number;
|
|
26
26
|
right: number;
|
|
27
27
|
}
|
|
28
|
+
/**
|
|
29
|
+
* Map theme
|
|
30
|
+
*/
|
|
31
|
+
export type MapTheme = 'light' | 'dark' | 'system';
|
|
32
|
+
/**
|
|
33
|
+
* Press event payload
|
|
34
|
+
*/
|
|
35
|
+
export interface PressEventPayload {
|
|
36
|
+
coordinate: Coordinate;
|
|
37
|
+
point: Point;
|
|
38
|
+
}
|
|
28
39
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -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;AAEnD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,UAAU,EAAE,UAAU,CAAC;IACvB,KAAK,EAAE,KAAK,CAAC;CACd"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lugg/maps",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-beta.1",
|
|
4
4
|
"description": "Universal maps for React Native.",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"clean": "scripts/clean.sh",
|
|
51
51
|
"prepare": "bob build && yarn build:plugin",
|
|
52
52
|
"build:plugin": "tsc --project plugin",
|
|
53
|
-
"release": "release-it --preRelease=
|
|
53
|
+
"release": "release-it --preRelease=beta"
|
|
54
54
|
},
|
|
55
55
|
"keywords": [
|
|
56
56
|
"react-native",
|
|
@@ -96,6 +96,9 @@
|
|
|
96
96
|
"turbo": "^2.5.6",
|
|
97
97
|
"typescript": "^5.9.2"
|
|
98
98
|
},
|
|
99
|
+
"resolutions": {
|
|
100
|
+
"@lodev09/react-native-true-sheet": "3.9.0-beta.1"
|
|
101
|
+
},
|
|
99
102
|
"peerDependencies": {
|
|
100
103
|
"@vis.gl/react-google-maps": ">=1.0.0",
|
|
101
104
|
"react": "*",
|
|
@@ -142,11 +145,12 @@
|
|
|
142
145
|
},
|
|
143
146
|
"ios": {
|
|
144
147
|
"componentProvider": {
|
|
145
|
-
"
|
|
146
|
-
"LuggAppleMapView": "LuggAppleMapView",
|
|
148
|
+
"LuggMapView": "LuggMapView",
|
|
147
149
|
"LuggMarkerView": "LuggMarkerView",
|
|
150
|
+
"LuggCalloutView": "LuggCalloutView",
|
|
148
151
|
"LuggMapWrapperView": "LuggMapWrapperView",
|
|
149
|
-
"LuggPolylineView": "LuggPolylineView"
|
|
152
|
+
"LuggPolylineView": "LuggPolylineView",
|
|
153
|
+
"LuggPolygonView": "LuggPolygonView"
|
|
150
154
|
}
|
|
151
155
|
}
|
|
152
156
|
},
|
|
@@ -179,10 +183,8 @@
|
|
|
179
183
|
}
|
|
180
184
|
},
|
|
181
185
|
"hooks": {
|
|
182
|
-
"before:init":
|
|
183
|
-
|
|
184
|
-
"yarn test"
|
|
185
|
-
]
|
|
186
|
+
"before:init": "yarn test",
|
|
187
|
+
"after:bump": "yarn tidy"
|
|
186
188
|
},
|
|
187
189
|
"plugins": {
|
|
188
190
|
"@release-it/conventional-changelog": {
|
package/src/MapProvider.tsx
CHANGED
|
@@ -5,6 +5,4 @@ import type { MapProviderProps } from './MapProvider.types';
|
|
|
5
5
|
* On web, wraps children with Google Maps APIProvider.
|
|
6
6
|
* On native, passes children through.
|
|
7
7
|
*/
|
|
8
|
-
export
|
|
9
|
-
return children;
|
|
10
|
-
}
|
|
8
|
+
export const MapProvider = ({ children }: MapProviderProps) => children;
|
package/src/MapProvider.web.tsx
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
|
+
import { createContext, useContext } from 'react';
|
|
1
2
|
import { APIProvider } from '@vis.gl/react-google-maps';
|
|
2
3
|
import type { MapProviderProps } from './MapProvider.types';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
type CalloutCloseListener = () => void;
|
|
6
|
+
|
|
7
|
+
export const MapContext = createContext<{
|
|
8
|
+
map: google.maps.Map | null;
|
|
9
|
+
isDragging: boolean;
|
|
10
|
+
moveCamera: (coordinate: { latitude: number; longitude: number }) => void;
|
|
11
|
+
onCalloutClose: (listener: CalloutCloseListener) => () => void;
|
|
12
|
+
closeCallouts: (except?: CalloutCloseListener) => void;
|
|
13
|
+
}>({
|
|
14
|
+
map: null,
|
|
15
|
+
isDragging: false,
|
|
16
|
+
moveCamera: () => {},
|
|
17
|
+
onCalloutClose: () => () => {},
|
|
18
|
+
closeCallouts: () => {},
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const useMapContext = () => useContext(MapContext);
|
|
22
|
+
|
|
23
|
+
export const MapProvider = ({ apiKey = '', children }: MapProviderProps) => (
|
|
24
|
+
<APIProvider apiKey={apiKey}>{children}</APIProvider>
|
|
25
|
+
);
|
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,12 @@ export class MapView
|
|
|
87
89
|
scrollEnabled,
|
|
88
90
|
rotateEnabled,
|
|
89
91
|
pitchEnabled,
|
|
90
|
-
|
|
92
|
+
edgeInsets,
|
|
91
93
|
userLocationEnabled,
|
|
94
|
+
userLocationButtonEnabled,
|
|
95
|
+
theme,
|
|
96
|
+
onPress,
|
|
97
|
+
onLongPress,
|
|
92
98
|
onCameraMove,
|
|
93
99
|
onCameraIdle,
|
|
94
100
|
onReady,
|
|
@@ -96,15 +102,11 @@ export class MapView
|
|
|
96
102
|
...rest
|
|
97
103
|
} = this.props;
|
|
98
104
|
|
|
99
|
-
const NativeMapView =
|
|
100
|
-
Platform.OS === 'ios' && provider === 'apple'
|
|
101
|
-
? LuggAppleMapViewNativeComponent
|
|
102
|
-
: LuggGoogleMapViewNativeComponent;
|
|
103
|
-
|
|
104
105
|
return (
|
|
105
|
-
<
|
|
106
|
+
<LuggMapViewNativeComponent
|
|
106
107
|
ref={this.nativeRef}
|
|
107
108
|
{...rest}
|
|
109
|
+
provider={provider}
|
|
108
110
|
mapId={mapId}
|
|
109
111
|
initialCoordinate={initialCoordinate}
|
|
110
112
|
initialZoom={initialZoom}
|
|
@@ -114,15 +116,19 @@ export class MapView
|
|
|
114
116
|
scrollEnabled={scrollEnabled}
|
|
115
117
|
rotateEnabled={rotateEnabled}
|
|
116
118
|
pitchEnabled={pitchEnabled}
|
|
117
|
-
|
|
119
|
+
edgeInsets={edgeInsets}
|
|
118
120
|
userLocationEnabled={userLocationEnabled}
|
|
121
|
+
userLocationButtonEnabled={userLocationButtonEnabled}
|
|
122
|
+
theme={theme}
|
|
123
|
+
onMapPress={onPress}
|
|
124
|
+
onMapLongPress={onLongPress}
|
|
119
125
|
onCameraMove={onCameraMove}
|
|
120
126
|
onCameraIdle={onCameraIdle}
|
|
121
127
|
onReady={onReady}
|
|
122
128
|
>
|
|
123
129
|
<LuggMapWrapperViewNativeComponent style={StyleSheet.absoluteFill} />
|
|
124
130
|
{children}
|
|
125
|
-
</
|
|
131
|
+
</LuggMapViewNativeComponent>
|
|
126
132
|
);
|
|
127
133
|
}
|
|
128
134
|
}
|
package/src/MapView.types.ts
CHANGED
|
@@ -1,34 +1,46 @@
|
|
|
1
1
|
import type { ReactNode } from 'react';
|
|
2
2
|
import type { NativeSyntheticEvent, ViewProps } from 'react-native';
|
|
3
|
-
import type {
|
|
3
|
+
import type {
|
|
4
|
+
MapProvider,
|
|
5
|
+
Coordinate,
|
|
6
|
+
EdgeInsets,
|
|
7
|
+
MapTheme,
|
|
8
|
+
PressEventPayload,
|
|
9
|
+
} from './types';
|
|
4
10
|
|
|
5
11
|
/**
|
|
6
12
|
* Options for moving the camera
|
|
7
|
-
* @default duration -1
|
|
8
13
|
*/
|
|
9
14
|
export interface MoveCameraOptions {
|
|
10
|
-
zoom
|
|
15
|
+
zoom?: number;
|
|
11
16
|
duration?: number;
|
|
12
17
|
}
|
|
13
18
|
|
|
14
19
|
/**
|
|
15
20
|
* Options for fitting coordinates in view
|
|
16
|
-
* @default duration -1
|
|
17
21
|
*/
|
|
18
22
|
export interface FitCoordinatesOptions {
|
|
19
23
|
padding?: EdgeInsets;
|
|
20
24
|
duration?: number;
|
|
21
25
|
}
|
|
22
26
|
|
|
27
|
+
/**
|
|
28
|
+
* Options for setting edge insets
|
|
29
|
+
*/
|
|
30
|
+
export interface SetEdgeInsetsOptions {
|
|
31
|
+
duration?: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
23
34
|
/**
|
|
24
35
|
* MapView ref methods
|
|
25
36
|
*/
|
|
26
37
|
export interface MapViewRef {
|
|
27
|
-
moveCamera(coordinate: Coordinate, options
|
|
38
|
+
moveCamera(coordinate: Coordinate, options?: MoveCameraOptions): void;
|
|
28
39
|
fitCoordinates(
|
|
29
40
|
coordinates: Coordinate[],
|
|
30
41
|
options?: FitCoordinatesOptions
|
|
31
42
|
): void;
|
|
43
|
+
setEdgeInsets(edgeInsets: EdgeInsets, options?: SetEdgeInsetsOptions): void;
|
|
32
44
|
}
|
|
33
45
|
|
|
34
46
|
/**
|
|
@@ -40,6 +52,9 @@ export interface CameraEventPayload {
|
|
|
40
52
|
gesture: boolean;
|
|
41
53
|
}
|
|
42
54
|
|
|
55
|
+
export type MapCameraEvent = NativeSyntheticEvent<CameraEventPayload>;
|
|
56
|
+
export type MapPressEvent = NativeSyntheticEvent<PressEventPayload>;
|
|
57
|
+
|
|
43
58
|
/**
|
|
44
59
|
* MapView component props
|
|
45
60
|
*/
|
|
@@ -91,23 +106,42 @@ export interface MapViewProps extends ViewProps {
|
|
|
91
106
|
*/
|
|
92
107
|
pitchEnabled?: boolean;
|
|
93
108
|
/**
|
|
94
|
-
* Map content
|
|
109
|
+
* Map content edge insets
|
|
95
110
|
*/
|
|
96
|
-
|
|
111
|
+
edgeInsets?: EdgeInsets;
|
|
97
112
|
/**
|
|
98
113
|
* Show current user location on the map.
|
|
99
114
|
* Requires location permission to be granted, otherwise silently ignored.
|
|
100
115
|
* @default false
|
|
101
116
|
*/
|
|
102
117
|
userLocationEnabled?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* Show native my-location button when userLocationEnabled is true (Android only).
|
|
120
|
+
* @default false
|
|
121
|
+
* @platform android
|
|
122
|
+
*/
|
|
123
|
+
userLocationButtonEnabled?: boolean;
|
|
124
|
+
/**
|
|
125
|
+
* Map color theme
|
|
126
|
+
* @default 'system'
|
|
127
|
+
*/
|
|
128
|
+
theme?: MapTheme;
|
|
129
|
+
/**
|
|
130
|
+
* Called when the map is pressed
|
|
131
|
+
*/
|
|
132
|
+
onPress?: (event: MapPressEvent) => void;
|
|
133
|
+
/**
|
|
134
|
+
* Called when the map is long pressed
|
|
135
|
+
*/
|
|
136
|
+
onLongPress?: (event: MapPressEvent) => void;
|
|
103
137
|
/**
|
|
104
138
|
* Called when camera moves
|
|
105
139
|
*/
|
|
106
|
-
onCameraMove?: (event:
|
|
140
|
+
onCameraMove?: (event: MapCameraEvent) => void;
|
|
107
141
|
/**
|
|
108
142
|
* Called when camera stops moving
|
|
109
143
|
*/
|
|
110
|
-
onCameraIdle?: (event:
|
|
144
|
+
onCameraIdle?: (event: MapCameraEvent) => void;
|
|
111
145
|
/**
|
|
112
146
|
* Called when map is loaded and ready
|
|
113
147
|
*/
|