@lugg/maps 0.2.0-alpha.0
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/LICENSE +20 -0
- package/LuggMaps.podspec +23 -0
- package/README.md +119 -0
- package/android/build.gradle +78 -0
- package/android/gradle.properties +5 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/luggmaps/LuggMapsGoogleMapView.kt +438 -0
- package/android/src/main/java/com/luggmaps/LuggMapsGoogleMapViewManager.kt +144 -0
- package/android/src/main/java/com/luggmaps/LuggMapsMarkerView.kt +134 -0
- package/android/src/main/java/com/luggmaps/LuggMapsMarkerViewManager.kt +69 -0
- package/android/src/main/java/com/luggmaps/LuggMapsPackage.kt +13 -0
- package/android/src/main/java/com/luggmaps/LuggMapsPolylineView.kt +79 -0
- package/android/src/main/java/com/luggmaps/LuggMapsPolylineViewManager.kt +71 -0
- package/android/src/main/java/com/luggmaps/LuggMapsWrapperView.kt +39 -0
- package/android/src/main/java/com/luggmaps/LuggMapsWrapperViewManager.kt +25 -0
- package/android/src/main/java/com/luggmaps/core/PolylineAnimator.kt +180 -0
- package/android/src/main/java/com/luggmaps/events/CameraIdleEvent.kt +21 -0
- package/android/src/main/java/com/luggmaps/events/CameraMoveEvent.kt +28 -0
- package/app.plugin.js +1 -0
- package/ios/LuggMapsAppleMapView.h +16 -0
- package/ios/LuggMapsAppleMapView.mm +544 -0
- package/ios/LuggMapsGoogleMapView.h +13 -0
- package/ios/LuggMapsGoogleMapView.mm +439 -0
- package/ios/LuggMapsMarkerView.h +29 -0
- package/ios/LuggMapsMarkerView.mm +154 -0
- package/ios/LuggMapsPolylineView.h +27 -0
- package/ios/LuggMapsPolylineView.mm +116 -0
- package/ios/LuggMapsWrapperView.h +9 -0
- package/ios/LuggMapsWrapperView.mm +36 -0
- package/ios/core/GMSPolylineAnimator.h +11 -0
- package/ios/core/GMSPolylineAnimator.m +151 -0
- package/ios/core/MKPolylineAnimator.h +12 -0
- package/ios/core/MKPolylineAnimator.m +252 -0
- package/ios/core/PolylineAnimatorBase.h +22 -0
- package/ios/core/PolylineAnimatorBase.m +35 -0
- package/ios/events/CameraIdleEvent.h +24 -0
- package/ios/events/CameraMoveEvent.h +26 -0
- package/ios/extensions/MKMapView+Zoom.h +19 -0
- package/ios/extensions/MKMapView+Zoom.m +45 -0
- package/lib/module/MapView.js +87 -0
- package/lib/module/MapView.js.map +1 -0
- package/lib/module/MapView.types.js +4 -0
- package/lib/module/MapView.types.js.map +1 -0
- package/lib/module/Marker.js +34 -0
- package/lib/module/Marker.js.map +1 -0
- package/lib/module/Marker.types.js +4 -0
- package/lib/module/Marker.types.js.map +1 -0
- package/lib/module/Polyline.js +30 -0
- package/lib/module/Polyline.js.map +1 -0
- package/lib/module/Polyline.types.js +4 -0
- package/lib/module/Polyline.types.js.map +1 -0
- package/lib/module/fabric/LuggMapsAppleMapViewNativeComponent.ts +73 -0
- package/lib/module/fabric/LuggMapsGoogleMapViewNativeComponent.ts +74 -0
- package/lib/module/fabric/LuggMapsMarkerViewNativeComponent.ts +25 -0
- package/lib/module/fabric/LuggMapsPolylineViewNativeComponent.ts +19 -0
- package/lib/module/fabric/LuggMapsWrapperViewNativeComponent.ts +8 -0
- package/lib/module/index.js +6 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/types.js +2 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/plugin/src/index.d.ts +16 -0
- package/lib/typescript/plugin/src/index.d.ts.map +1 -0
- package/lib/typescript/plugin/src/withMapsAndroid.d.ts +6 -0
- package/lib/typescript/plugin/src/withMapsAndroid.d.ts.map +1 -0
- package/lib/typescript/plugin/src/withMapsIOS.d.ts +6 -0
- package/lib/typescript/plugin/src/withMapsIOS.d.ts.map +1 -0
- package/lib/typescript/src/MapView.d.ts +12 -0
- package/lib/typescript/src/MapView.d.ts.map +1 -0
- package/lib/typescript/src/MapView.types.d.ts +102 -0
- package/lib/typescript/src/MapView.types.d.ts.map +1 -0
- package/lib/typescript/src/Marker.d.ts +6 -0
- package/lib/typescript/src/Marker.d.ts.map +1 -0
- package/lib/typescript/src/Marker.types.d.ts +32 -0
- package/lib/typescript/src/Marker.types.d.ts.map +1 -0
- package/lib/typescript/src/Polyline.d.ts +6 -0
- package/lib/typescript/src/Polyline.d.ts.map +1 -0
- package/lib/typescript/src/Polyline.types.d.ts +24 -0
- package/lib/typescript/src/Polyline.types.d.ts.map +1 -0
- package/lib/typescript/src/fabric/LuggMapsAppleMapViewNativeComponent.d.ts +47 -0
- package/lib/typescript/src/fabric/LuggMapsAppleMapViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/LuggMapsGoogleMapViewNativeComponent.d.ts +48 -0
- package/lib/typescript/src/fabric/LuggMapsGoogleMapViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/LuggMapsMarkerViewNativeComponent.d.ts +20 -0
- package/lib/typescript/src/fabric/LuggMapsMarkerViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/LuggMapsPolylineViewNativeComponent.d.ts +15 -0
- package/lib/typescript/src/fabric/LuggMapsPolylineViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/LuggMapsWrapperViewNativeComponent.d.ts +6 -0
- package/lib/typescript/src/fabric/LuggMapsWrapperViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +8 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +28 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/package.json +200 -0
- package/plugin/build/index.d.ts +15 -0
- package/plugin/build/index.js +13 -0
- package/plugin/build/withMapsAndroid.d.ts +5 -0
- package/plugin/build/withMapsAndroid.js +15 -0
- package/plugin/build/withMapsIOS.d.ts +5 -0
- package/plugin/build/withMapsIOS.js +27 -0
- package/src/MapView.tsx +111 -0
- package/src/MapView.types.ts +110 -0
- package/src/Marker.tsx +31 -0
- package/src/Marker.types.ts +32 -0
- package/src/Polyline.tsx +32 -0
- package/src/Polyline.types.ts +24 -0
- package/src/fabric/LuggMapsAppleMapViewNativeComponent.ts +73 -0
- package/src/fabric/LuggMapsGoogleMapViewNativeComponent.ts +74 -0
- package/src/fabric/LuggMapsMarkerViewNativeComponent.ts +25 -0
- package/src/fabric/LuggMapsPolylineViewNativeComponent.ts +19 -0
- package/src/fabric/LuggMapsWrapperViewNativeComponent.ts +8 -0
- package/src/index.ts +13 -0
- package/src/types.ts +30 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Marker.d.ts","sourceRoot":"","sources":["../../../src/Marker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAGlD,qBAAa,MAAO,SAAQ,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC;IACtD,MAAM;CAiBP"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { Coordinate, Point } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Marker component props
|
|
5
|
+
*/
|
|
6
|
+
export interface MarkerProps {
|
|
7
|
+
/**
|
|
8
|
+
* Name used for debugging purposes
|
|
9
|
+
*/
|
|
10
|
+
name?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Marker position
|
|
13
|
+
*/
|
|
14
|
+
coordinate: Coordinate;
|
|
15
|
+
/**
|
|
16
|
+
* Callout title
|
|
17
|
+
*/
|
|
18
|
+
title?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Callout description
|
|
21
|
+
*/
|
|
22
|
+
description?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Anchor point for custom marker views
|
|
25
|
+
*/
|
|
26
|
+
anchor?: Point;
|
|
27
|
+
/**
|
|
28
|
+
* Custom marker view
|
|
29
|
+
*/
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=Marker.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Marker.types.d.ts","sourceRoot":"","sources":["../../../src/Marker.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEjD;;GAEG;AACH,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Polyline.d.ts","sourceRoot":"","sources":["../../../src/Polyline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGtD,qBAAa,QAAS,SAAQ,KAAK,CAAC,SAAS,CAAC,aAAa,CAAC;IAC1D,MAAM;CAkBP"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ColorValue } from 'react-native';
|
|
2
|
+
import type { Coordinate } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Polyline component props
|
|
5
|
+
*/
|
|
6
|
+
export interface PolylineProps {
|
|
7
|
+
/**
|
|
8
|
+
* Array of coordinates forming the polyline
|
|
9
|
+
*/
|
|
10
|
+
coordinates: Coordinate[];
|
|
11
|
+
/**
|
|
12
|
+
* Gradient colors along the polyline
|
|
13
|
+
*/
|
|
14
|
+
strokeColors?: ColorValue[];
|
|
15
|
+
/**
|
|
16
|
+
* Line width in points
|
|
17
|
+
*/
|
|
18
|
+
strokeWidth?: number;
|
|
19
|
+
/**
|
|
20
|
+
* Animate the polyline with a snake effect
|
|
21
|
+
*/
|
|
22
|
+
animated?: boolean;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=Polyline.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Polyline.types.d.ts","sourceRoot":"","sources":["../../../src/Polyline.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE1C;;GAEG;AACH,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;CACpB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { ViewProps, HostComponent } from 'react-native';
|
|
2
|
+
import type { Double, DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
export interface Coordinate {
|
|
4
|
+
latitude: Double;
|
|
5
|
+
longitude: Double;
|
|
6
|
+
}
|
|
7
|
+
export interface EdgeInsets {
|
|
8
|
+
top: Double;
|
|
9
|
+
left: Double;
|
|
10
|
+
bottom: Double;
|
|
11
|
+
right: Double;
|
|
12
|
+
}
|
|
13
|
+
export interface CameraMoveEvent {
|
|
14
|
+
coordinate: {
|
|
15
|
+
latitude: Double;
|
|
16
|
+
longitude: Double;
|
|
17
|
+
};
|
|
18
|
+
zoom: Double;
|
|
19
|
+
dragging: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface CameraIdleEvent {
|
|
22
|
+
coordinate: {
|
|
23
|
+
latitude: Double;
|
|
24
|
+
longitude: Double;
|
|
25
|
+
};
|
|
26
|
+
zoom: Double;
|
|
27
|
+
}
|
|
28
|
+
export interface NativeProps extends ViewProps {
|
|
29
|
+
initialCoordinate?: Coordinate;
|
|
30
|
+
initialZoom?: Double;
|
|
31
|
+
zoomEnabled?: boolean;
|
|
32
|
+
scrollEnabled?: boolean;
|
|
33
|
+
rotateEnabled?: boolean;
|
|
34
|
+
pitchEnabled?: boolean;
|
|
35
|
+
padding?: EdgeInsets;
|
|
36
|
+
onCameraMove?: DirectEventHandler<CameraMoveEvent>;
|
|
37
|
+
onCameraIdle?: DirectEventHandler<CameraIdleEvent>;
|
|
38
|
+
}
|
|
39
|
+
type ComponentType = HostComponent<NativeProps>;
|
|
40
|
+
interface NativeCommands {
|
|
41
|
+
moveCamera: (viewRef: React.ElementRef<ComponentType>, latitude: Double, longitude: Double, zoom: Double, duration: Double) => void;
|
|
42
|
+
fitCoordinates: (viewRef: React.ElementRef<ComponentType>, coordinates: Coordinate[], padding: Double, duration: Double) => void;
|
|
43
|
+
}
|
|
44
|
+
export declare const Commands: NativeCommands;
|
|
45
|
+
declare const _default: ComponentType;
|
|
46
|
+
export default _default;
|
|
47
|
+
//# sourceMappingURL=LuggMapsAppleMapViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LuggMapsAppleMapViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/LuggMapsAppleMapViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7D,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,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,YAAY,CAAC,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC;IACnD,YAAY,CAAC,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,KAAK,aAAa,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;AAEhD,UAAU,cAAc;IACtB,UAAU,EAAE,CACV,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,EACxC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;IACV,cAAc,EAAE,CACd,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,EACxC,WAAW,EAAE,UAAU,EAAE,EACzB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;CACX;AAED,eAAO,MAAM,QAAQ,gBAEnB,CAAC;wBAIE,aAAa;AAFlB,wBAEmB"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { ViewProps, HostComponent } from 'react-native';
|
|
2
|
+
import type { Double, DirectEventHandler } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
export interface Coordinate {
|
|
4
|
+
latitude: Double;
|
|
5
|
+
longitude: Double;
|
|
6
|
+
}
|
|
7
|
+
export interface EdgeInsets {
|
|
8
|
+
top: Double;
|
|
9
|
+
left: Double;
|
|
10
|
+
bottom: Double;
|
|
11
|
+
right: Double;
|
|
12
|
+
}
|
|
13
|
+
export interface CameraMoveEvent {
|
|
14
|
+
coordinate: {
|
|
15
|
+
latitude: Double;
|
|
16
|
+
longitude: Double;
|
|
17
|
+
};
|
|
18
|
+
zoom: Double;
|
|
19
|
+
dragging: boolean;
|
|
20
|
+
}
|
|
21
|
+
export interface CameraIdleEvent {
|
|
22
|
+
coordinate: {
|
|
23
|
+
latitude: Double;
|
|
24
|
+
longitude: Double;
|
|
25
|
+
};
|
|
26
|
+
zoom: Double;
|
|
27
|
+
}
|
|
28
|
+
export interface NativeProps extends ViewProps {
|
|
29
|
+
mapId?: string;
|
|
30
|
+
initialCoordinate?: Coordinate;
|
|
31
|
+
initialZoom?: Double;
|
|
32
|
+
zoomEnabled?: boolean;
|
|
33
|
+
scrollEnabled?: boolean;
|
|
34
|
+
rotateEnabled?: boolean;
|
|
35
|
+
pitchEnabled?: boolean;
|
|
36
|
+
padding?: EdgeInsets;
|
|
37
|
+
onCameraMove?: DirectEventHandler<CameraMoveEvent>;
|
|
38
|
+
onCameraIdle?: DirectEventHandler<CameraIdleEvent>;
|
|
39
|
+
}
|
|
40
|
+
type ComponentType = HostComponent<NativeProps>;
|
|
41
|
+
interface NativeCommands {
|
|
42
|
+
moveCamera: (viewRef: React.ElementRef<ComponentType>, latitude: Double, longitude: Double, zoom: Double, duration: Double) => void;
|
|
43
|
+
fitCoordinates: (viewRef: React.ElementRef<ComponentType>, coordinates: Coordinate[], padding: Double, duration: Double) => void;
|
|
44
|
+
}
|
|
45
|
+
export declare const Commands: NativeCommands;
|
|
46
|
+
declare const _default: ComponentType;
|
|
47
|
+
export default _default;
|
|
48
|
+
//# sourceMappingURL=LuggMapsGoogleMapViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LuggMapsGoogleMapViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/LuggMapsGoogleMapViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7D,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,UAAU;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE;QACV,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,CAAC,EAAE,UAAU,CAAC;IACrB,YAAY,CAAC,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC;IACnD,YAAY,CAAC,EAAE,kBAAkB,CAAC,eAAe,CAAC,CAAC;CACpD;AAED,KAAK,aAAa,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC;AAEhD,UAAU,cAAc;IACtB,UAAU,EAAE,CACV,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,EACxC,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;IACV,cAAc,EAAE,CACd,OAAO,EAAE,KAAK,CAAC,UAAU,CAAC,aAAa,CAAC,EACxC,WAAW,EAAE,UAAU,EAAE,EACzB,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,MAAM,KACb,IAAI,CAAC;CACX;AAED,eAAO,MAAM,QAAQ,gBAEnB,CAAC;wBAIE,aAAa;AAFlB,wBAEmB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ViewProps, HostComponent } from 'react-native';
|
|
2
|
+
import type { Double } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
export interface Coordinate {
|
|
4
|
+
latitude: Double;
|
|
5
|
+
longitude: Double;
|
|
6
|
+
}
|
|
7
|
+
export interface Point {
|
|
8
|
+
x: Double;
|
|
9
|
+
y: Double;
|
|
10
|
+
}
|
|
11
|
+
export interface NativeProps extends ViewProps {
|
|
12
|
+
name?: string;
|
|
13
|
+
coordinate: Coordinate;
|
|
14
|
+
title?: string;
|
|
15
|
+
description?: string;
|
|
16
|
+
anchor?: Point;
|
|
17
|
+
}
|
|
18
|
+
declare const _default: HostComponent<NativeProps>;
|
|
19
|
+
export default _default;
|
|
20
|
+
//# sourceMappingURL=LuggMapsMarkerViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LuggMapsMarkerViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/LuggMapsMarkerViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7D,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,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;CAChB;wBAII,aAAa,CAAC,WAAW,CAAC;AAF/B,wBAEgC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ViewProps, HostComponent, ColorValue } from 'react-native';
|
|
2
|
+
import type { Double } 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
|
+
strokeColors?: ReadonlyArray<ColorValue>;
|
|
10
|
+
strokeWidth?: Double;
|
|
11
|
+
animated?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const _default: HostComponent<NativeProps>;
|
|
14
|
+
export default _default;
|
|
15
|
+
//# sourceMappingURL=LuggMapsPolylineViewNativeComponent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LuggMapsPolylineViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/LuggMapsPolylineViewNativeComponent.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;CACpB;wBAII,aAAa,CAAC,WAAW,CAAC;AAF/B,wBAEgC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LuggMapsWrapperViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../../src/fabric/LuggMapsWrapperViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7D,MAAM,WAAW,WAAY,SAAQ,SAAS;CAAG;wBAI5C,aAAa,CAAC,WAAW,CAAC;AAF/B,wBAEgC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { MapView } from './MapView';
|
|
2
|
+
export { Marker } from './Marker';
|
|
3
|
+
export { Polyline } from './Polyline';
|
|
4
|
+
export type { MapViewProps, MapViewRef, MoveCameraOptions, CameraMoveEvent, CameraIdleEvent, } from './MapView.types';
|
|
5
|
+
export type { MarkerProps } from './Marker.types';
|
|
6
|
+
export type { PolylineProps } from './Polyline.types';
|
|
7
|
+
export type { MapProvider, Coordinate, Point, EdgeInsets } from './types';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +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,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EACV,YAAY,EACZ,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,eAAe,GAChB,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,YAAY,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACtD,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map provider type
|
|
3
|
+
*/
|
|
4
|
+
export type MapProvider = 'google' | 'apple';
|
|
5
|
+
/**
|
|
6
|
+
* Geographic coordinate with latitude and longitude
|
|
7
|
+
*/
|
|
8
|
+
export interface Coordinate {
|
|
9
|
+
latitude: number;
|
|
10
|
+
longitude: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* 2D point representing x and y positions
|
|
14
|
+
*/
|
|
15
|
+
export interface Point {
|
|
16
|
+
x: number;
|
|
17
|
+
y: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Edge insets for padding
|
|
21
|
+
*/
|
|
22
|
+
export interface EdgeInsets {
|
|
23
|
+
top: number;
|
|
24
|
+
left: number;
|
|
25
|
+
bottom: number;
|
|
26
|
+
right: number;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +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"}
|
package/package.json
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@lugg/maps",
|
|
3
|
+
"version": "0.2.0-alpha.0",
|
|
4
|
+
"description": "Universal maps for React Native.",
|
|
5
|
+
"main": "./lib/module/index.js",
|
|
6
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"source": "./src/index.ts",
|
|
10
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
+
"default": "./lib/module/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"src",
|
|
17
|
+
"lib",
|
|
18
|
+
"android",
|
|
19
|
+
"ios",
|
|
20
|
+
"cpp",
|
|
21
|
+
"plugin/build",
|
|
22
|
+
"app.plugin.js",
|
|
23
|
+
"*.podspec",
|
|
24
|
+
"react-native.config.js",
|
|
25
|
+
"!ios/build",
|
|
26
|
+
"!android/build",
|
|
27
|
+
"!android/gradle",
|
|
28
|
+
"!android/gradlew",
|
|
29
|
+
"!android/gradlew.bat",
|
|
30
|
+
"!android/local.properties",
|
|
31
|
+
"!**/__tests__",
|
|
32
|
+
"!**/__fixtures__",
|
|
33
|
+
"!**/__mocks__",
|
|
34
|
+
"!**/.*"
|
|
35
|
+
],
|
|
36
|
+
"scripts": {
|
|
37
|
+
"bare": "yarn workspace @lugg/bare-example",
|
|
38
|
+
"expo": "yarn workspace @lugg/expo-example",
|
|
39
|
+
"test": "jest",
|
|
40
|
+
"typecheck": "tsc",
|
|
41
|
+
"lint": "eslint --fix \"**/*.{ts,tsx}\"",
|
|
42
|
+
"format": "prettier --write \"**/*.{ts,tsx}\"",
|
|
43
|
+
"tidy": "yarn typecheck && yarn lint && yarn format && scripts/objclint.sh && scripts/ktlint.sh",
|
|
44
|
+
"clean": "scripts/clean.sh",
|
|
45
|
+
"prepare": "bob build && yarn build:plugin",
|
|
46
|
+
"build:plugin": "tsc --project plugin",
|
|
47
|
+
"release": "release-it --preRelease=alpha"
|
|
48
|
+
},
|
|
49
|
+
"keywords": [
|
|
50
|
+
"react-native",
|
|
51
|
+
"ios",
|
|
52
|
+
"android"
|
|
53
|
+
],
|
|
54
|
+
"repository": {
|
|
55
|
+
"type": "git",
|
|
56
|
+
"url": "git+https://github.com/lugg/maps.git"
|
|
57
|
+
},
|
|
58
|
+
"author": "lodev09 <lodev09@gmail.com> (https://github.com/lodev09)",
|
|
59
|
+
"license": "MIT",
|
|
60
|
+
"bugs": {
|
|
61
|
+
"url": "https://github.com/lugg/maps/issues"
|
|
62
|
+
},
|
|
63
|
+
"homepage": "https://github.com/lugg/maps#readme",
|
|
64
|
+
"publishConfig": {
|
|
65
|
+
"registry": "https://registry.npmjs.org/"
|
|
66
|
+
},
|
|
67
|
+
"devDependencies": {
|
|
68
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
69
|
+
"@eslint/compat": "^1.3.2",
|
|
70
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
71
|
+
"@eslint/js": "^9.35.0",
|
|
72
|
+
"@react-native/babel-preset": "0.83.0",
|
|
73
|
+
"@react-native/eslint-config": "0.83.0",
|
|
74
|
+
"@release-it/conventional-changelog": "^10.0.1",
|
|
75
|
+
"@types/jest": "^29.5.14",
|
|
76
|
+
"@types/react": "^19.2.0",
|
|
77
|
+
"commitlint": "^19.8.1",
|
|
78
|
+
"del-cli": "^6.0.0",
|
|
79
|
+
"eslint": "^9.35.0",
|
|
80
|
+
"eslint-config-prettier": "^10.1.8",
|
|
81
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
82
|
+
"jest": "^29.7.0",
|
|
83
|
+
"lefthook": "^2.0.3",
|
|
84
|
+
"prettier": "^2.8.8",
|
|
85
|
+
"react": "19.2.0",
|
|
86
|
+
"react-native": "0.83.0",
|
|
87
|
+
"react-native-builder-bob": "^0.40.13",
|
|
88
|
+
"release-it": "^19.0.4",
|
|
89
|
+
"turbo": "^2.5.6",
|
|
90
|
+
"typescript": "^5.9.2"
|
|
91
|
+
},
|
|
92
|
+
"peerDependencies": {
|
|
93
|
+
"react": "*",
|
|
94
|
+
"react-native": "*"
|
|
95
|
+
},
|
|
96
|
+
"dependencies": {
|
|
97
|
+
"@expo/config-plugins": "^9.0.0"
|
|
98
|
+
},
|
|
99
|
+
"workspaces": [
|
|
100
|
+
"example/bare",
|
|
101
|
+
"example/expo",
|
|
102
|
+
"example/shared"
|
|
103
|
+
],
|
|
104
|
+
"packageManager": "yarn@4.11.0",
|
|
105
|
+
"react-native-builder-bob": {
|
|
106
|
+
"source": "src",
|
|
107
|
+
"output": "lib",
|
|
108
|
+
"targets": [
|
|
109
|
+
[
|
|
110
|
+
"module",
|
|
111
|
+
{
|
|
112
|
+
"esm": true
|
|
113
|
+
}
|
|
114
|
+
],
|
|
115
|
+
[
|
|
116
|
+
"typescript",
|
|
117
|
+
{
|
|
118
|
+
"project": "tsconfig.build.json"
|
|
119
|
+
}
|
|
120
|
+
]
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
"codegenConfig": {
|
|
124
|
+
"name": "RNMapsSpec",
|
|
125
|
+
"type": "all",
|
|
126
|
+
"jsSrcsDir": "src/fabric",
|
|
127
|
+
"android": {
|
|
128
|
+
"javaPackageName": "com.luggmaps"
|
|
129
|
+
},
|
|
130
|
+
"ios": {
|
|
131
|
+
"componentProvider": {
|
|
132
|
+
"LuggMapsGoogleMapView": "LuggMapsGoogleMapView",
|
|
133
|
+
"LuggMapsAppleMapView": "LuggMapsAppleMapView",
|
|
134
|
+
"LuggMapsMarkerView": "LuggMapsMarkerView",
|
|
135
|
+
"LuggMapsWrapperView": "LuggMapsWrapperView",
|
|
136
|
+
"LuggMapsPolylineView": "LuggMapsPolylineView"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"jest": {
|
|
141
|
+
"preset": "react-native",
|
|
142
|
+
"modulePathIgnorePatterns": [
|
|
143
|
+
"<rootDir>/example/bare/node_modules",
|
|
144
|
+
"<rootDir>/lib/"
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
"commitlint": {
|
|
148
|
+
"extends": [
|
|
149
|
+
"@commitlint/config-conventional"
|
|
150
|
+
]
|
|
151
|
+
},
|
|
152
|
+
"release-it": {
|
|
153
|
+
"git": {
|
|
154
|
+
"commitMessage": "chore: release ${version}",
|
|
155
|
+
"tagName": "v${version}"
|
|
156
|
+
},
|
|
157
|
+
"npm": {
|
|
158
|
+
"publish": false
|
|
159
|
+
},
|
|
160
|
+
"github": {
|
|
161
|
+
"release": true,
|
|
162
|
+
"comments": {
|
|
163
|
+
"submit": true,
|
|
164
|
+
"issue": ":rocket: _This issue has been resolved in v${version}. See [${releaseName}](${releaseUrl}) for release notes._",
|
|
165
|
+
"pr": ":rocket: _This pull request is included in v${version}. See [${releaseName}](${releaseUrl}) for release notes._"
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"hooks": {
|
|
169
|
+
"before:init": [
|
|
170
|
+
"yarn tidy",
|
|
171
|
+
"yarn test"
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
"plugins": {
|
|
175
|
+
"@release-it/conventional-changelog": {
|
|
176
|
+
"preset": {
|
|
177
|
+
"name": "angular"
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
"prettier": {
|
|
183
|
+
"quoteProps": "consistent",
|
|
184
|
+
"singleQuote": true,
|
|
185
|
+
"tabWidth": 2,
|
|
186
|
+
"trailingComma": "es5",
|
|
187
|
+
"useTabs": false
|
|
188
|
+
},
|
|
189
|
+
"create-react-native-library": {
|
|
190
|
+
"type": "fabric-view",
|
|
191
|
+
"languages": "kotlin-objc",
|
|
192
|
+
"tools": [
|
|
193
|
+
"jest",
|
|
194
|
+
"lefthook",
|
|
195
|
+
"release-it",
|
|
196
|
+
"eslint"
|
|
197
|
+
],
|
|
198
|
+
"version": "0.56.0"
|
|
199
|
+
}
|
|
200
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ConfigPlugin } from '@expo/config-plugins';
|
|
2
|
+
export interface MapsPluginProps {
|
|
3
|
+
/**
|
|
4
|
+
* Google Maps API key for iOS.
|
|
5
|
+
* Required if using Google Maps provider on iOS.
|
|
6
|
+
*/
|
|
7
|
+
iosGoogleMapsApiKey?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Google Maps API key for Android.
|
|
10
|
+
* Required for Android as it only supports Google Maps.
|
|
11
|
+
*/
|
|
12
|
+
androidGoogleMapsApiKey?: string;
|
|
13
|
+
}
|
|
14
|
+
declare const _default: ConfigPlugin<void | MapsPluginProps>;
|
|
15
|
+
export default _default;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
4
|
+
const withMapsAndroid_1 = require("./withMapsAndroid");
|
|
5
|
+
const withMapsIOS_1 = require("./withMapsIOS");
|
|
6
|
+
const pkg = require('../../package.json');
|
|
7
|
+
const withMaps = (config, props = {}) => {
|
|
8
|
+
const { iosGoogleMapsApiKey, androidGoogleMapsApiKey } = props ?? {};
|
|
9
|
+
config = (0, withMapsIOS_1.withLuggMapsIOS)(config, { apiKey: iosGoogleMapsApiKey });
|
|
10
|
+
config = (0, withMapsAndroid_1.withLuggMapsAndroid)(config, { apiKey: androidGoogleMapsApiKey });
|
|
11
|
+
return config;
|
|
12
|
+
};
|
|
13
|
+
exports.default = (0, config_plugins_1.createRunOncePlugin)(withMaps, pkg.name, pkg.version);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withLuggMapsAndroid = void 0;
|
|
4
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
5
|
+
const withLuggMapsAndroid = (config, { apiKey }) => {
|
|
6
|
+
if (!apiKey) {
|
|
7
|
+
return config;
|
|
8
|
+
}
|
|
9
|
+
return (0, config_plugins_1.withAndroidManifest)(config, (c) => {
|
|
10
|
+
const mainApplication = config_plugins_1.AndroidConfig.Manifest.getMainApplicationOrThrow(c.modResults);
|
|
11
|
+
config_plugins_1.AndroidConfig.Manifest.addMetaDataItemToMainApplication(mainApplication, 'com.google.android.geo.API_KEY', apiKey);
|
|
12
|
+
return c;
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
exports.withLuggMapsAndroid = withLuggMapsAndroid;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withLuggMapsIOS = void 0;
|
|
4
|
+
const config_plugins_1 = require("@expo/config-plugins");
|
|
5
|
+
const withLuggMapsIOS = (config, { apiKey }) => {
|
|
6
|
+
if (!apiKey) {
|
|
7
|
+
return config;
|
|
8
|
+
}
|
|
9
|
+
config = (0, config_plugins_1.withInfoPlist)(config, (c) => {
|
|
10
|
+
c.modResults.GMSApiKey = apiKey;
|
|
11
|
+
return c;
|
|
12
|
+
});
|
|
13
|
+
config = (0, config_plugins_1.withAppDelegate)(config, (c) => {
|
|
14
|
+
const contents = c.modResults.contents;
|
|
15
|
+
// Add import for GoogleMaps
|
|
16
|
+
if (!contents.includes('import GoogleMaps')) {
|
|
17
|
+
c.modResults.contents = contents.replace(/(import (?:UIKit|Expo))/, '$1\nimport GoogleMaps');
|
|
18
|
+
}
|
|
19
|
+
// Add GMSServices.provideAPIKey call
|
|
20
|
+
if (!c.modResults.contents.includes('GMSServices.provideAPIKey')) {
|
|
21
|
+
c.modResults.contents = c.modResults.contents.replace(/(func application\([^)]+\)[^{]*\{)/, `$1\n GMSServices.provideAPIKey("${apiKey}")\n`);
|
|
22
|
+
}
|
|
23
|
+
return c;
|
|
24
|
+
});
|
|
25
|
+
return config;
|
|
26
|
+
};
|
|
27
|
+
exports.withLuggMapsIOS = withLuggMapsIOS;
|