react-native-google-maps-plus 1.0.2 → 1.1.0-dev.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 +127 -11
- package/android/src/main/java/com/rngooglemapsplus/GoogleMapsViewImpl.kt +359 -139
- package/android/src/main/java/com/rngooglemapsplus/LocationHandler.kt +44 -44
- package/android/src/main/java/com/rngooglemapsplus/MapCircleBuilder.kt +19 -0
- package/android/src/main/java/com/rngooglemapsplus/{MapMarker.kt → MapMarkerBuilder.kt} +7 -6
- package/android/src/main/java/com/rngooglemapsplus/{MapPolygon.kt → MapPolygonBuilder.kt} +4 -18
- package/android/src/main/java/com/rngooglemapsplus/{MapPolyline.kt → MapPolylineBuilder.kt.kt} +4 -19
- package/android/src/main/java/com/rngooglemapsplus/RNGoogleMapsPlusView.kt +145 -129
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNCameraExtension.kt +19 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNLocationPriorityExtension.kt +12 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNMapCircleExtension.kt +14 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNPolygonExtension.kt +20 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNPolylineExtension.kt +21 -0
- package/android/src/main/java/com/rngooglemapsplus/extensions/RNUserInterfaceExtension.kt +12 -0
- package/android/src/main/java/com/rngooglemapsplus/{Color.kt → extensions/StringExtension.kt} +1 -1
- package/android/src/main/java/com/rngooglemapsplus/extensions/ThrowableExtension.kt +38 -0
- package/ios/GoogleMapViewImpl.swift +348 -150
- package/ios/LocationHandler.swift +29 -69
- package/ios/MapCircleBuilder.swift +20 -0
- package/ios/{MapMarker.swift → MapMarkerBuilder.swift} +11 -42
- package/ios/MapPolygonBuilder.swift +20 -0
- package/ios/MapPolylineBuilder.swift +24 -0
- package/ios/PermissionHandler.swift +1 -1
- package/ios/RNGoogleMapsPlusModule.swift +1 -1
- package/ios/RNGoogleMapsPlusView.swift +159 -168
- package/ios/extensions/RNCamera+Extension.swift +22 -0
- package/ios/extensions/RNCircle+Extension.swift +24 -0
- package/ios/extensions/RNIOSLocationAccuracy+Extensions.swift +19 -0
- package/ios/extensions/RNMarker+Extension.swift +24 -0
- package/ios/{MapPolygon.swift → extensions/RNPolygon+Extension.swift.swift} +7 -23
- package/ios/extensions/RNPolyline+Extension.swift.swift +62 -0
- package/ios/extensions/RNUserInterface+Extension.swift +16 -0
- package/ios/{Color.swift → extensions/String+Extensions.swift} +20 -20
- package/lib/module/types.js +14 -0
- package/lib/module/types.js.map +1 -1
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts +21 -12
- package/lib/typescript/src/RNGoogleMapsPlusView.nitro.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +59 -3
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.cpp +233 -69
- package/nitrogen/generated/android/c++/JHybridRNGoogleMapsPlusViewSpec.hpp +40 -22
- package/nitrogen/generated/android/c++/JRNAndroidLocationConfig.hpp +63 -0
- package/nitrogen/generated/android/c++/JRNAndroidLocationPriority.hpp +65 -0
- package/nitrogen/generated/android/c++/JRNCircle.hpp +84 -0
- package/nitrogen/generated/android/c++/JRNIOSLocationAccuracy.hpp +65 -0
- package/nitrogen/generated/android/c++/JRNIOSLocationConfig.hpp +59 -0
- package/nitrogen/generated/android/c++/JRNInitialProps.hpp +66 -0
- package/nitrogen/generated/android/c++/JRNLocationConfig.hpp +65 -0
- package/nitrogen/generated/android/c++/JRNMapType.hpp +68 -0
- package/nitrogen/generated/android/c++/JRNMapUiSettings.hpp +93 -0
- package/nitrogen/generated/android/c++/JRNMarker.hpp +4 -4
- package/nitrogen/generated/android/c++/JRNPolygon.hpp +8 -4
- package/nitrogen/generated/android/c++/JRNPolyline.hpp +8 -4
- package/nitrogen/generated/android/c++/views/JHybridRNGoogleMapsPlusViewStateUpdater.cpp +40 -4
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/HybridRNGoogleMapsPlusViewSpec.kt +89 -11
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNAndroidLocationConfig.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNAndroidLocationPriority.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNCircle.kt +50 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNIOSLocationAccuracy.kt +23 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNIOSLocationConfig.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNInitialProps.kt +35 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNLocationConfig.kt +32 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMapType.kt +24 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMapUiSettings.kt +59 -0
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNMarker.kt +1 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPolygon.kt +4 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/RNPolyline.kt +4 -1
- package/nitrogen/generated/android/kotlin/com/margelo/nitro/rngooglemapsplus/views/HybridRNGoogleMapsPlusViewManager.kt +7 -1
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Bridge.hpp +296 -45
- package/nitrogen/generated/ios/RNGoogleMapsPlus-Swift-Cxx-Umbrella.hpp +27 -0
- package/nitrogen/generated/ios/c++/HybridRNGoogleMapsPlusViewSpecSwift.hpp +131 -37
- package/nitrogen/generated/ios/c++/views/HybridRNGoogleMapsPlusViewComponent.mm +61 -16
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec.swift +20 -11
- package/nitrogen/generated/ios/swift/HybridRNGoogleMapsPlusViewSpec_cxx.swift +378 -45
- package/nitrogen/generated/ios/swift/RNAndroidLocationConfig.swift +93 -0
- package/nitrogen/generated/ios/swift/RNAndroidLocationPriority.swift +48 -0
- package/nitrogen/generated/ios/swift/RNCircle.swift +198 -0
- package/nitrogen/generated/ios/swift/RNIOSLocationAccuracy.swift +48 -0
- package/nitrogen/generated/ios/swift/RNIOSLocationConfig.swift +70 -0
- package/nitrogen/generated/ios/swift/RNInitialProps.swift +107 -0
- package/nitrogen/generated/ios/swift/RNLocationConfig.swift +84 -0
- package/nitrogen/generated/ios/swift/RNMapType.swift +52 -0
- package/nitrogen/generated/ios/swift/RNMapUiSettings.swift +277 -0
- package/nitrogen/generated/ios/swift/RNMarker.swift +17 -5
- package/nitrogen/generated/ios/swift/RNPolygon.swift +40 -5
- package/nitrogen/generated/ios/swift/RNPolyline.swift +40 -5
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.cpp +20 -2
- package/nitrogen/generated/shared/c++/HybridRNGoogleMapsPlusViewSpec.hpp +59 -26
- package/nitrogen/generated/shared/c++/RNAndroidLocationConfig.hpp +77 -0
- package/nitrogen/generated/shared/c++/RNAndroidLocationPriority.hpp +64 -0
- package/nitrogen/generated/shared/c++/RNCircle.hpp +98 -0
- package/nitrogen/generated/shared/c++/RNIOSLocationAccuracy.hpp +64 -0
- package/nitrogen/generated/shared/c++/RNIOSLocationConfig.hpp +73 -0
- package/nitrogen/generated/shared/c++/RNInitialProps.hpp +78 -0
- package/nitrogen/generated/shared/c++/RNLocationConfig.hpp +76 -0
- package/nitrogen/generated/shared/c++/RNMapType.hpp +88 -0
- package/nitrogen/generated/shared/c++/RNMapUiSettings.hpp +107 -0
- package/nitrogen/generated/shared/c++/RNMarker.hpp +6 -6
- package/nitrogen/generated/shared/c++/RNPolygon.hpp +10 -6
- package/nitrogen/generated/shared/c++/RNPolyline.hpp +10 -6
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.cpp +138 -30
- package/nitrogen/generated/shared/c++/views/HybridRNGoogleMapsPlusViewComponent.hpp +27 -13
- package/nitrogen/generated/shared/json/RNGoogleMapsPlusViewConfig.json +10 -1
- package/package.json +5 -5
- package/src/RNGoogleMapsPlusView.nitro.ts +25 -11
- package/src/types.ts +67 -3
- package/ios/MapPolyline.swift +0 -83
|
@@ -16,21 +16,26 @@
|
|
|
16
16
|
#include <react/renderer/components/view/ConcreteViewShadowNode.h>
|
|
17
17
|
#include <react/renderer/components/view/ViewProps.h>
|
|
18
18
|
|
|
19
|
+
#include "RNInitialProps.hpp"
|
|
20
|
+
#include <optional>
|
|
21
|
+
#include "RNMapUiSettings.hpp"
|
|
19
22
|
#include <string>
|
|
20
|
-
#include "RNCamera.hpp"
|
|
21
23
|
#include "RNUserInterfaceStyle.hpp"
|
|
22
24
|
#include "RNMapPadding.hpp"
|
|
25
|
+
#include "RNMapType.hpp"
|
|
23
26
|
#include "RNMarker.hpp"
|
|
24
27
|
#include <vector>
|
|
25
28
|
#include "RNPolygon.hpp"
|
|
26
29
|
#include "RNPolyline.hpp"
|
|
30
|
+
#include "RNCircle.hpp"
|
|
31
|
+
#include "RNLocationConfig.hpp"
|
|
27
32
|
#include "RNMapErrorCode.hpp"
|
|
28
33
|
#include <functional>
|
|
29
|
-
#include <optional>
|
|
30
34
|
#include "RNLocation.hpp"
|
|
31
35
|
#include "RNLocationErrorCode.hpp"
|
|
32
36
|
#include "RNLatLng.hpp"
|
|
33
37
|
#include "RNRegion.hpp"
|
|
38
|
+
#include "RNCamera.hpp"
|
|
34
39
|
#include <memory>
|
|
35
40
|
#include "HybridRNGoogleMapsPlusViewSpec.hpp"
|
|
36
41
|
|
|
@@ -55,23 +60,32 @@ namespace margelo::nitro::rngooglemapsplus::views {
|
|
|
55
60
|
const react::RawProps& rawProps);
|
|
56
61
|
|
|
57
62
|
public:
|
|
58
|
-
CachedProp<
|
|
59
|
-
CachedProp<
|
|
60
|
-
CachedProp<std::
|
|
61
|
-
CachedProp<
|
|
62
|
-
CachedProp<
|
|
63
|
-
CachedProp<
|
|
64
|
-
CachedProp<
|
|
65
|
-
CachedProp<
|
|
66
|
-
CachedProp<std::
|
|
67
|
-
CachedProp<std::
|
|
68
|
-
CachedProp<std::
|
|
63
|
+
CachedProp<std::optional<RNInitialProps>> initialProps;
|
|
64
|
+
CachedProp<std::optional<RNMapUiSettings>> uiSettings;
|
|
65
|
+
CachedProp<std::optional<bool>> myLocationEnabled;
|
|
66
|
+
CachedProp<std::optional<bool>> buildingEnabled;
|
|
67
|
+
CachedProp<std::optional<bool>> trafficEnabled;
|
|
68
|
+
CachedProp<std::optional<bool>> indoorEnabled;
|
|
69
|
+
CachedProp<std::optional<std::string>> customMapStyle;
|
|
70
|
+
CachedProp<std::optional<RNUserInterfaceStyle>> userInterfaceStyle;
|
|
71
|
+
CachedProp<std::optional<double>> minZoomLevel;
|
|
72
|
+
CachedProp<std::optional<double>> maxZoomLevel;
|
|
73
|
+
CachedProp<std::optional<RNMapPadding>> mapPadding;
|
|
74
|
+
CachedProp<std::optional<RNMapType>> mapType;
|
|
75
|
+
CachedProp<std::optional<std::vector<RNMarker>>> markers;
|
|
76
|
+
CachedProp<std::optional<std::vector<RNPolygon>>> polygons;
|
|
77
|
+
CachedProp<std::optional<std::vector<RNPolyline>>> polylines;
|
|
78
|
+
CachedProp<std::optional<std::vector<RNCircle>>> circles;
|
|
79
|
+
CachedProp<std::optional<RNLocationConfig>> locationConfig;
|
|
69
80
|
CachedProp<std::optional<std::function<void(RNMapErrorCode /* error */)>>> onMapError;
|
|
70
81
|
CachedProp<std::optional<std::function<void(bool /* ready */)>>> onMapReady;
|
|
71
82
|
CachedProp<std::optional<std::function<void(const RNLocation& /* location */)>>> onLocationUpdate;
|
|
72
83
|
CachedProp<std::optional<std::function<void(RNLocationErrorCode /* error */)>>> onLocationError;
|
|
73
84
|
CachedProp<std::optional<std::function<void(const RNLatLng& /* coordinate */)>>> onMapPress;
|
|
74
85
|
CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> onMarkerPress;
|
|
86
|
+
CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> onPolylinePress;
|
|
87
|
+
CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> onPolygonPress;
|
|
88
|
+
CachedProp<std::optional<std::function<void(const std::string& /* id */)>>> onCirclePress;
|
|
75
89
|
CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>> onCameraChangeStart;
|
|
76
90
|
CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>> onCameraChange;
|
|
77
91
|
CachedProp<std::optional<std::function<void(const RNRegion& /* region */, const RNCamera& /* camera */, bool /* isGesture */)>>> onCameraChangeComplete;
|
|
@@ -4,23 +4,32 @@
|
|
|
4
4
|
"bubblingEventTypes": {},
|
|
5
5
|
"directEventTypes": {},
|
|
6
6
|
"validAttributes": {
|
|
7
|
+
"initialProps": true,
|
|
8
|
+
"uiSettings": true,
|
|
9
|
+
"myLocationEnabled": true,
|
|
7
10
|
"buildingEnabled": true,
|
|
8
11
|
"trafficEnabled": true,
|
|
12
|
+
"indoorEnabled": true,
|
|
9
13
|
"customMapStyle": true,
|
|
10
|
-
"initialCamera": true,
|
|
11
14
|
"userInterfaceStyle": true,
|
|
12
15
|
"minZoomLevel": true,
|
|
13
16
|
"maxZoomLevel": true,
|
|
14
17
|
"mapPadding": true,
|
|
18
|
+
"mapType": true,
|
|
15
19
|
"markers": true,
|
|
16
20
|
"polygons": true,
|
|
17
21
|
"polylines": true,
|
|
22
|
+
"circles": true,
|
|
23
|
+
"locationConfig": true,
|
|
18
24
|
"onMapError": true,
|
|
19
25
|
"onMapReady": true,
|
|
20
26
|
"onLocationUpdate": true,
|
|
21
27
|
"onLocationError": true,
|
|
22
28
|
"onMapPress": true,
|
|
23
29
|
"onMarkerPress": true,
|
|
30
|
+
"onPolylinePress": true,
|
|
31
|
+
"onPolygonPress": true,
|
|
32
|
+
"onCirclePress": true,
|
|
24
33
|
"onCameraChangeStart": true,
|
|
25
34
|
"onCameraChange": true,
|
|
26
35
|
"onCameraChangeComplete": true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-google-maps-plus",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.1.0-dev.1",
|
|
4
4
|
"description": "React-native wrapper for android & IOS google maps sdk",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"module": "./lib/module/index.js",
|
|
@@ -11,17 +11,17 @@
|
|
|
11
11
|
"lint": "yarn lint:js && yarn lint:android && yarn lint:ios",
|
|
12
12
|
"lint:js": "eslint . --max-warnings 0 && yarn prettier --check .",
|
|
13
13
|
"lint:android": "cd android && ktlint -F ./**/*.kt*",
|
|
14
|
-
"lint:ios": "cd ios && swiftlint --quiet",
|
|
14
|
+
"lint:ios": "cd ios && swiftlint --quiet && swiftformat . --lint",
|
|
15
15
|
"format": "yarn format:js && yarn format:ios && yarn format:android",
|
|
16
16
|
"format:js": "prettier --write .",
|
|
17
|
-
"format:android": "cd android && ktlint ./**/*.kt*",
|
|
18
|
-
"format:ios": "cd ios &&
|
|
17
|
+
"format:android": "cd android && ktlint --format ./**/*.kt*",
|
|
18
|
+
"format:ios": "cd ios && swiftformat .",
|
|
19
19
|
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
20
20
|
"test": "jest",
|
|
21
21
|
"git:clean": "git clean -dfX",
|
|
22
22
|
"release": "semantic-release",
|
|
23
23
|
"build": "yarn nitrogen && bob build",
|
|
24
|
-
"nitrogen": "nitrogen --logLevel=\"debug\" && node scripts/
|
|
24
|
+
"nitrogen": "nitrogen --logLevel=\"debug\" && node scripts/nitrogen-patch.js",
|
|
25
25
|
"prepare": "bob build"
|
|
26
26
|
},
|
|
27
27
|
"keywords": [
|
|
@@ -16,26 +16,40 @@ import type {
|
|
|
16
16
|
RNRegion,
|
|
17
17
|
RNLocation,
|
|
18
18
|
RNMapErrorCode,
|
|
19
|
+
RNMapType,
|
|
20
|
+
RNInitialProps,
|
|
21
|
+
RNCircle,
|
|
22
|
+
RNMapUiSettings,
|
|
23
|
+
RNLocationConfig,
|
|
19
24
|
} from './types';
|
|
20
25
|
|
|
21
26
|
export interface RNGoogleMapsPlusViewProps extends HybridViewProps {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
initialProps?: RNInitialProps;
|
|
28
|
+
uiSettings?: RNMapUiSettings;
|
|
29
|
+
myLocationEnabled?: boolean;
|
|
30
|
+
buildingEnabled?: boolean;
|
|
31
|
+
trafficEnabled?: boolean;
|
|
32
|
+
indoorEnabled?: boolean;
|
|
33
|
+
customMapStyle?: string;
|
|
34
|
+
userInterfaceStyle?: RNUserInterfaceStyle;
|
|
35
|
+
minZoomLevel?: number;
|
|
36
|
+
maxZoomLevel?: number;
|
|
37
|
+
mapPadding?: RNMapPadding;
|
|
38
|
+
mapType?: RNMapType;
|
|
39
|
+
markers?: RNMarker[];
|
|
40
|
+
polygons?: RNPolygon[];
|
|
41
|
+
polylines?: RNPolyline[];
|
|
42
|
+
circles?: RNCircle[];
|
|
43
|
+
locationConfig?: RNLocationConfig;
|
|
33
44
|
onMapError?: (error: RNMapErrorCode) => void;
|
|
34
45
|
onMapReady?: (ready: boolean) => void;
|
|
35
46
|
onLocationUpdate?: (location: RNLocation) => void;
|
|
36
47
|
onLocationError?: (error: RNLocationErrorCode) => void;
|
|
37
48
|
onMapPress?: (coordinate: RNLatLng) => void;
|
|
38
49
|
onMarkerPress?: (id: string) => void;
|
|
50
|
+
onPolylinePress?: (id: string) => void;
|
|
51
|
+
onPolygonPress?: (id: string) => void;
|
|
52
|
+
onCirclePress?: (id: string) => void;
|
|
39
53
|
onCameraChangeStart?: (
|
|
40
54
|
region: RNRegion,
|
|
41
55
|
camera: RNCamera,
|
package/src/types.ts
CHANGED
|
@@ -3,6 +3,26 @@ import type { HybridView } from 'react-native-nitro-modules';
|
|
|
3
3
|
|
|
4
4
|
export type GoogleMapsViewRef = HybridView<RNGoogleMapsPlusViewMethods>;
|
|
5
5
|
|
|
6
|
+
export type RNInitialProps = {
|
|
7
|
+
mapId?: string;
|
|
8
|
+
liteMode?: boolean;
|
|
9
|
+
camera?: RNCamera;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export type RNMapUiSettings = {
|
|
13
|
+
allGesturesEnabled?: boolean;
|
|
14
|
+
compassEnabled?: boolean;
|
|
15
|
+
indoorLevelPickerEnabled?: boolean;
|
|
16
|
+
mapToolbarEnabled?: boolean;
|
|
17
|
+
myLocationButtonEnabled?: boolean;
|
|
18
|
+
rotateEnabled?: boolean;
|
|
19
|
+
scrollEnabled?: boolean;
|
|
20
|
+
scrollDuringRotateOrZoomEnabled?: boolean;
|
|
21
|
+
tiltEnabled?: boolean;
|
|
22
|
+
zoomControlsEnabled?: boolean;
|
|
23
|
+
zoomGesturesEnabled?: boolean;
|
|
24
|
+
};
|
|
25
|
+
|
|
6
26
|
export type RNLatLng = { latitude: number; longitude: number };
|
|
7
27
|
|
|
8
28
|
export type RNBoundingBox = { northEast: RNLatLng; southWest: RNLatLng };
|
|
@@ -14,6 +34,8 @@ export type RNMapPadding = {
|
|
|
14
34
|
right: number;
|
|
15
35
|
};
|
|
16
36
|
|
|
37
|
+
export type RNMapType = 'none' | 'normal' | 'hybrid' | 'satellite' | 'terrain';
|
|
38
|
+
|
|
17
39
|
export type RNUserInterfaceStyle = 'light' | 'dark' | 'default';
|
|
18
40
|
|
|
19
41
|
export type RNFeatureType = string;
|
|
@@ -106,7 +128,7 @@ export type RNLineJoinType = 'miter' | 'round' | 'bevel';
|
|
|
106
128
|
|
|
107
129
|
export type RNMarker = {
|
|
108
130
|
id: string;
|
|
109
|
-
zIndex
|
|
131
|
+
zIndex?: number;
|
|
110
132
|
coordinate: RNLatLng;
|
|
111
133
|
anchor?: RNPosition;
|
|
112
134
|
width: number;
|
|
@@ -116,7 +138,8 @@ export type RNMarker = {
|
|
|
116
138
|
|
|
117
139
|
export type RNPolygon = {
|
|
118
140
|
id: string;
|
|
119
|
-
zIndex
|
|
141
|
+
zIndex?: number;
|
|
142
|
+
pressable?: boolean;
|
|
120
143
|
coordinates: RNLatLng[];
|
|
121
144
|
fillColor?: string;
|
|
122
145
|
strokeColor?: string;
|
|
@@ -125,7 +148,8 @@ export type RNPolygon = {
|
|
|
125
148
|
|
|
126
149
|
export type RNPolyline = {
|
|
127
150
|
id: string;
|
|
128
|
-
zIndex
|
|
151
|
+
zIndex?: number;
|
|
152
|
+
pressable?: boolean;
|
|
129
153
|
coordinates: RNLatLng[];
|
|
130
154
|
lineCap?: RNLineCapType;
|
|
131
155
|
lineJoin?: RNLineJoinType;
|
|
@@ -133,6 +157,46 @@ export type RNPolyline = {
|
|
|
133
157
|
width?: number;
|
|
134
158
|
};
|
|
135
159
|
|
|
160
|
+
export type RNCircle = {
|
|
161
|
+
id: string;
|
|
162
|
+
pressable?: boolean;
|
|
163
|
+
zIndex?: number;
|
|
164
|
+
center: RNLatLng;
|
|
165
|
+
radius?: number;
|
|
166
|
+
strokeWidth?: number;
|
|
167
|
+
strokeColor?: string;
|
|
168
|
+
fillColor?: string;
|
|
169
|
+
};
|
|
170
|
+
|
|
171
|
+
export type RNLocationConfig = {
|
|
172
|
+
android?: RNAndroidLocationConfig;
|
|
173
|
+
ios?: RNIOSLocationConfig;
|
|
174
|
+
};
|
|
175
|
+
export type RNAndroidLocationConfig = {
|
|
176
|
+
priority?: RNAndroidLocationPriority;
|
|
177
|
+
interval?: number;
|
|
178
|
+
minUpdateInterval?: number;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export enum RNAndroidLocationPriority {
|
|
182
|
+
PRIORITY_HIGH_ACCURACY = 0,
|
|
183
|
+
PRIORITY_BALANCED_POWER_ACCURACY = 1,
|
|
184
|
+
PRIORITY_LOW_POWER = 2,
|
|
185
|
+
PRIORITY_PASSIVE = 3,
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export type RNIOSLocationConfig = {
|
|
189
|
+
desiredAccuracy?: RNIOSLocationAccuracy;
|
|
190
|
+
distanceFilterMeters?: number;
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
export enum RNIOSLocationAccuracy {
|
|
194
|
+
ACCURACY_BEST = 0,
|
|
195
|
+
ACCURACY_NEAREST_TEN_METER = 1,
|
|
196
|
+
ACCURACY_NEAREST_HUNDRED_METER = 2,
|
|
197
|
+
ACCURACY_KILOMETER = 3,
|
|
198
|
+
}
|
|
199
|
+
|
|
136
200
|
export type RNLocationPermissionResult = {
|
|
137
201
|
android?: RNAndroidLocationPermissionResult;
|
|
138
202
|
ios?: RNIOSPermissionResult;
|
package/ios/MapPolyline.swift
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import GoogleMaps
|
|
2
|
-
|
|
3
|
-
class MapPolylineOptions {
|
|
4
|
-
func buildPolyline(_ p: RNPolyline) -> GMSPolyline {
|
|
5
|
-
let path = GMSMutablePath()
|
|
6
|
-
p.coordinates.forEach {
|
|
7
|
-
path.add(
|
|
8
|
-
CLLocationCoordinate2D(latitude: $0.latitude, longitude: $0.longitude)
|
|
9
|
-
)
|
|
10
|
-
}
|
|
11
|
-
let pl = GMSPolyline(path: path)
|
|
12
|
-
if let w = p.width { pl.strokeWidth = CGFloat(w) }
|
|
13
|
-
if let c = p.color?.toUIColor() { pl.strokeColor = c }
|
|
14
|
-
pl.zIndex = Int32(p.zIndex)
|
|
15
|
-
if let cap = p.lineCap {
|
|
16
|
-
/// pl.lineCap = mapLineCap(cap)
|
|
17
|
-
}
|
|
18
|
-
if let join = p.lineJoin {
|
|
19
|
-
/// pl.strokeJoin = mapLineJoin(join)
|
|
20
|
-
}
|
|
21
|
-
return pl
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
func mapLineCap(_ t: RNLineCapType?) -> CGLineCap {
|
|
26
|
-
switch t {
|
|
27
|
-
case .round: return .round
|
|
28
|
-
case .square: return .square
|
|
29
|
-
default: return .butt
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
func mapLineJoin(_ t: RNLineJoinType?) -> CGLineJoin {
|
|
34
|
-
switch t {
|
|
35
|
-
case .round: return .round
|
|
36
|
-
case .bevel: return .bevel
|
|
37
|
-
default: return .miter
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
extension RNPolyline {
|
|
42
|
-
func updatePolyline(_ next: RNPolyline, _ pl: GMSPolyline) {
|
|
43
|
-
let path = GMSMutablePath()
|
|
44
|
-
next.coordinates.forEach {
|
|
45
|
-
path.add(
|
|
46
|
-
CLLocationCoordinate2D(
|
|
47
|
-
latitude: $0.latitude,
|
|
48
|
-
longitude: $0.longitude
|
|
49
|
-
)
|
|
50
|
-
)
|
|
51
|
-
}
|
|
52
|
-
pl.path = path
|
|
53
|
-
if let w = next.width { pl.strokeWidth = CGFloat(w) }
|
|
54
|
-
if let cap = next.lineCap {
|
|
55
|
-
pl.spans = nil
|
|
56
|
-
/// gms.lineCap = mapLineCap(cap)
|
|
57
|
-
}
|
|
58
|
-
if let join = next.lineJoin {
|
|
59
|
-
/// gms.strokeJoin = mapLineJoin(join)
|
|
60
|
-
}
|
|
61
|
-
if let c = next.color?.toUIColor() {
|
|
62
|
-
pl.strokeColor = c
|
|
63
|
-
}
|
|
64
|
-
pl.zIndex = Int32(next.zIndex)
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
func polylineEquals(_ b: RNPolyline) -> Bool {
|
|
68
|
-
guard zIndex == b.zIndex,
|
|
69
|
-
(width ?? 0) == (b.width ?? 0),
|
|
70
|
-
lineCap == b.lineCap,
|
|
71
|
-
lineJoin == b.lineJoin,
|
|
72
|
-
color == b.color,
|
|
73
|
-
coordinates.count == b.coordinates.count
|
|
74
|
-
else { return false }
|
|
75
|
-
for i in 0..<coordinates.count {
|
|
76
|
-
if coordinates[i].latitude != b.coordinates[i].latitude
|
|
77
|
-
|| coordinates[i].longitude != b.coordinates[i].longitude {
|
|
78
|
-
return false
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return true
|
|
82
|
-
}
|
|
83
|
-
}
|