@exterio/react-native-yamap-lite 1.0.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/LICENSE +20 -0
- package/README.md +510 -0
- package/YamapLite.podspec +21 -0
- package/android/build.gradle +101 -0
- package/android/gradle.properties +14 -0
- package/android/settings.gradle +1 -0
- package/android/src/main/AndroidManifest.xml +2 -0
- package/android/src/main/java/com/yamaplite/ClusteredYamapLiteViewManager.kt +181 -0
- package/android/src/main/java/com/yamaplite/Components/ClusteredYamapLiteView.kt +169 -0
- package/android/src/main/java/com/yamaplite/Components/YamapLiteCircleView.kt +145 -0
- package/android/src/main/java/com/yamaplite/Components/YamapLiteMarkerView.kt +214 -0
- package/android/src/main/java/com/yamaplite/Components/YamapLitePolygon.kt +149 -0
- package/android/src/main/java/com/yamaplite/Components/YamapLitePolyline.kt +171 -0
- package/android/src/main/java/com/yamaplite/Components/YamapLiteView.kt +678 -0
- package/android/src/main/java/com/yamaplite/Events/CameraPositionChangeEvent.kt +38 -0
- package/android/src/main/java/com/yamaplite/Events/MapLoadEvent.kt +34 -0
- package/android/src/main/java/com/yamaplite/Events/PressEvent.kt +24 -0
- package/android/src/main/java/com/yamaplite/Utils/ImageCache.kt +45 -0
- package/android/src/main/java/com/yamaplite/Utils/PointParser.kt +39 -0
- package/android/src/main/java/com/yamaplite/Utils/ResolveImageHelper.kt +122 -0
- package/android/src/main/java/com/yamaplite/Utils/YamapUtils.kt +169 -0
- package/android/src/main/java/com/yamaplite/YamapLiteCircleViewManager.kt +67 -0
- package/android/src/main/java/com/yamaplite/YamapLiteMarkerViewManager.kt +82 -0
- package/android/src/main/java/com/yamaplite/YamapLitePackage.kt +41 -0
- package/android/src/main/java/com/yamaplite/YamapLitePolygonViewManager.kt +61 -0
- package/android/src/main/java/com/yamaplite/YamapLitePolylineViewManager.kt +75 -0
- package/android/src/main/java/com/yamaplite/YamapLiteViewManager.kt +176 -0
- package/ios/ClusteredYamapLiteView.h +15 -0
- package/ios/ClusteredYamapLiteView.mm +325 -0
- package/ios/ClusteredYamapLiteViewManager.mm +17 -0
- package/ios/Components/Circle.swift +108 -0
- package/ios/Components/ClusteredYamap.swift +190 -0
- package/ios/Components/Marker.swift +187 -0
- package/ios/Components/Polygon.swift +108 -0
- package/ios/Components/Polyline.swift +125 -0
- package/ios/Components/Yamap.swift +585 -0
- package/ios/Listeners/CameraListener.swift +54 -0
- package/ios/Listeners/ClusterListener.swift +38 -0
- package/ios/Listeners/MapInputListener.swift +35 -0
- package/ios/Listeners/MapLoadListener.swift +35 -0
- package/ios/Listeners/MapObjectTap.swift +12 -0
- package/ios/Listeners/UserLocationObjectListener.swift +29 -0
- package/ios/Models/YamapModels.swift +77 -0
- package/ios/Utils/ImageCache.swift +20 -0
- package/ios/Utils/PointsEqual.h +45 -0
- package/ios/Utils/ResolveImageHelper.swift +142 -0
- package/ios/YamapLiteCircleView.h +15 -0
- package/ios/YamapLiteCircleView.mm +102 -0
- package/ios/YamapLiteMarkerView.h +15 -0
- package/ios/YamapLiteMarkerView.mm +102 -0
- package/ios/YamapLitePolygonView.h +15 -0
- package/ios/YamapLitePolygonView.mm +120 -0
- package/ios/YamapLitePolylineView.h +15 -0
- package/ios/YamapLitePolylineView.mm +115 -0
- package/ios/YamapLiteView.h +15 -0
- package/ios/YamapLiteView.mm +361 -0
- package/ios/YamapLiteViewManager.mm +17 -0
- package/ios/YamapUtils.h +5 -0
- package/ios/YamapUtils.mm +205 -0
- package/lib/module/@types/index.js +8 -0
- package/lib/module/@types/index.js.map +1 -0
- package/lib/module/ClusteredYamapLiteViewNativeComponent.ts +98 -0
- package/lib/module/Components/Circle.js +20 -0
- package/lib/module/Components/Circle.js.map +1 -0
- package/lib/module/Components/ClusteredYamap.js +133 -0
- package/lib/module/Components/ClusteredYamap.js.map +1 -0
- package/lib/module/Components/Marker.js +40 -0
- package/lib/module/Components/Marker.js.map +1 -0
- package/lib/module/Components/Polygon.js +25 -0
- package/lib/module/Components/Polygon.js.map +1 -0
- package/lib/module/Components/Polyline.js +25 -0
- package/lib/module/Components/Polyline.js.map +1 -0
- package/lib/module/Components/Yamap.js +124 -0
- package/lib/module/Components/Yamap.js.map +1 -0
- package/lib/module/Components/index.js +9 -0
- package/lib/module/Components/index.js.map +1 -0
- package/lib/module/NativeYamapUtils.js +5 -0
- package/lib/module/NativeYamapUtils.js.map +1 -0
- package/lib/module/Utils/YamapUtils.js +14 -0
- package/lib/module/Utils/YamapUtils.js.map +1 -0
- package/lib/module/YamapCircleViewNativeComponent.ts +28 -0
- package/lib/module/YamapLiteViewNativeComponent.ts +93 -0
- package/lib/module/YamapMarkerViewNativeComponent.ts +32 -0
- package/lib/module/YamapPolygonViewNativeComponent.ts +28 -0
- package/lib/module/YamapPolylineViewNativeComponent.ts +31 -0
- package/lib/module/index.js +7 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/@types/index.d.ts +257 -0
- package/lib/typescript/src/@types/index.d.ts.map +1 -0
- package/lib/typescript/src/ClusteredYamapLiteViewNativeComponent.d.ts +82 -0
- package/lib/typescript/src/ClusteredYamapLiteViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/Components/Circle.d.ts +4 -0
- package/lib/typescript/src/Components/Circle.d.ts.map +1 -0
- package/lib/typescript/src/Components/ClusteredYamap.d.ts +3 -0
- package/lib/typescript/src/Components/ClusteredYamap.d.ts.map +1 -0
- package/lib/typescript/src/Components/Marker.d.ts +3 -0
- package/lib/typescript/src/Components/Marker.d.ts.map +1 -0
- package/lib/typescript/src/Components/Polygon.d.ts +4 -0
- package/lib/typescript/src/Components/Polygon.d.ts.map +1 -0
- package/lib/typescript/src/Components/Polyline.d.ts +4 -0
- package/lib/typescript/src/Components/Polyline.d.ts.map +1 -0
- package/lib/typescript/src/Components/Yamap.d.ts +3 -0
- package/lib/typescript/src/Components/Yamap.d.ts.map +1 -0
- package/lib/typescript/src/Components/index.d.ts +7 -0
- package/lib/typescript/src/Components/index.d.ts.map +1 -0
- package/lib/typescript/src/NativeYamapUtils.d.ts +30 -0
- package/lib/typescript/src/NativeYamapUtils.d.ts.map +1 -0
- package/lib/typescript/src/Utils/YamapUtils.d.ts +27 -0
- package/lib/typescript/src/Utils/YamapUtils.d.ts.map +1 -0
- package/lib/typescript/src/YamapCircleViewNativeComponent.d.ts +20 -0
- package/lib/typescript/src/YamapCircleViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/YamapLiteViewNativeComponent.d.ts +80 -0
- package/lib/typescript/src/YamapLiteViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/YamapMarkerViewNativeComponent.d.ts +25 -0
- package/lib/typescript/src/YamapMarkerViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/YamapPolygonViewNativeComponent.d.ts +20 -0
- package/lib/typescript/src/YamapPolygonViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/YamapPolylineViewNativeComponent.d.ts +23 -0
- package/lib/typescript/src/YamapPolylineViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +5 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +189 -0
- package/src/@types/index.ts +314 -0
- package/src/ClusteredYamapLiteViewNativeComponent.ts +98 -0
- package/src/Components/Circle.tsx +22 -0
- package/src/Components/ClusteredYamap.tsx +194 -0
- package/src/Components/Marker.tsx +50 -0
- package/src/Components/Polygon.tsx +27 -0
- package/src/Components/Polyline.tsx +27 -0
- package/src/Components/Yamap.tsx +176 -0
- package/src/Components/index.ts +6 -0
- package/src/NativeYamapUtils.ts +47 -0
- package/src/Utils/YamapUtils.ts +63 -0
- package/src/YamapCircleViewNativeComponent.ts +28 -0
- package/src/YamapLiteViewNativeComponent.ts +93 -0
- package/src/YamapMarkerViewNativeComponent.ts +32 -0
- package/src/YamapPolygonViewNativeComponent.ts +28 -0
- package/src/YamapPolylineViewNativeComponent.ts +31 -0
- package/src/index.tsx +5 -0
package/package.json
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@exterio/react-native-yamap-lite",
|
|
3
|
+
"version": "1.0.1",
|
|
4
|
+
"description": "A lightweight wrapper for the Yandex MapKit SDK",
|
|
5
|
+
"main": "./lib/module/index.js",
|
|
6
|
+
"module": "./lib/module/index.js",
|
|
7
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"source": "./src/index.tsx",
|
|
11
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
12
|
+
"default": "./lib/module/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./package.json": "./package.json"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"src",
|
|
18
|
+
"lib",
|
|
19
|
+
"android",
|
|
20
|
+
"ios",
|
|
21
|
+
"cpp",
|
|
22
|
+
"*.podspec",
|
|
23
|
+
"react-native.config.js",
|
|
24
|
+
"!ios/build",
|
|
25
|
+
"!android/app",
|
|
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
|
+
"prepare": "lefthook install",
|
|
38
|
+
"example": "yarn workspace react-native-yamap-lite-example",
|
|
39
|
+
"test": "jest",
|
|
40
|
+
"test:harness": "cd example && yarn test:harness",
|
|
41
|
+
"test:harness:ios": "cd example && yarn test:harness:ios",
|
|
42
|
+
"test:harness:android": "cd example && yarn test:harness:android",
|
|
43
|
+
"typecheck": "tsc",
|
|
44
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
45
|
+
"clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
|
|
46
|
+
"prepack": "bob build",
|
|
47
|
+
"codegenIos": "yarn react-native codegen --path example/ --outputPath ./",
|
|
48
|
+
"codegenAndroid": "yarn react-native codegen --path example/ --outputPath ./",
|
|
49
|
+
"release": "release-it --only-version"
|
|
50
|
+
},
|
|
51
|
+
"keywords": [
|
|
52
|
+
"react-native",
|
|
53
|
+
"ios",
|
|
54
|
+
"android",
|
|
55
|
+
"yandex",
|
|
56
|
+
"maps",
|
|
57
|
+
"mapkit",
|
|
58
|
+
"mapkit-lite",
|
|
59
|
+
"react-native-yamap",
|
|
60
|
+
"react-native-yamap-lite"
|
|
61
|
+
],
|
|
62
|
+
"repository": {
|
|
63
|
+
"type": "git",
|
|
64
|
+
"url": "git+https://github.com/All-time-coding/react-native-yamap-lite.git"
|
|
65
|
+
},
|
|
66
|
+
"author": "hydromoll <hydromoll@mail.ru> (https://github.com/hydromoll)",
|
|
67
|
+
"contributors": [
|
|
68
|
+
"pe1ros <ilya.ezy@gmail.com> (https://github.com/pe1ros)"
|
|
69
|
+
],
|
|
70
|
+
"license": "MIT",
|
|
71
|
+
"bugs": {
|
|
72
|
+
"url": "https://github.com/All-time-coding/react-native-yamap-lite/issues"
|
|
73
|
+
},
|
|
74
|
+
"homepage": "https://github.com/All-time-coding/react-native-yamap-lite#readme",
|
|
75
|
+
"publishConfig": {
|
|
76
|
+
"registry": "https://registry.npmjs.org/",
|
|
77
|
+
"access": "public"
|
|
78
|
+
},
|
|
79
|
+
"devDependencies": {
|
|
80
|
+
"@commitlint/config-conventional": "^19.6.0",
|
|
81
|
+
"@eslint/compat": "^1.2.7",
|
|
82
|
+
"@eslint/eslintrc": "^3.3.0",
|
|
83
|
+
"@eslint/js": "^9.22.0",
|
|
84
|
+
"@evilmartians/lefthook": "^1.5.0",
|
|
85
|
+
"@react-native-community/cli": "15.0.0-alpha.2",
|
|
86
|
+
"@react-native/babel-preset": "0.79.2",
|
|
87
|
+
"@react-native/eslint-config": "^0.78.0",
|
|
88
|
+
"@release-it/conventional-changelog": "^9.0.2",
|
|
89
|
+
"@types/jest": "^29.5.5",
|
|
90
|
+
"@types/react": "^19.0.0",
|
|
91
|
+
"@types/react-test-renderer": "^19.1.0",
|
|
92
|
+
"commitlint": "^19.6.1",
|
|
93
|
+
"del-cli": "^5.1.0",
|
|
94
|
+
"eslint": "^9.22.0",
|
|
95
|
+
"eslint-config-prettier": "^10.1.1",
|
|
96
|
+
"eslint-plugin-prettier": "^5.2.3",
|
|
97
|
+
"jest": "^29.7.0",
|
|
98
|
+
"prettier": "^3.0.3",
|
|
99
|
+
"react": "19.0.0",
|
|
100
|
+
"react-native": "0.79.2",
|
|
101
|
+
"react-native-builder-bob": "^0.40.11",
|
|
102
|
+
"react-test-renderer": "19.0.0",
|
|
103
|
+
"release-it": "^17.10.0",
|
|
104
|
+
"turbo": "^1.10.7",
|
|
105
|
+
"typescript": "^5.8.3"
|
|
106
|
+
},
|
|
107
|
+
"peerDependencies": {
|
|
108
|
+
"react": "*",
|
|
109
|
+
"react-native": "*"
|
|
110
|
+
},
|
|
111
|
+
"workspaces": [
|
|
112
|
+
"example"
|
|
113
|
+
],
|
|
114
|
+
"packageManager": "yarn@3.6.1",
|
|
115
|
+
"jest": {
|
|
116
|
+
"preset": "react-native",
|
|
117
|
+
"modulePathIgnorePatterns": [
|
|
118
|
+
"<rootDir>/example/node_modules",
|
|
119
|
+
"<rootDir>/lib/"
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
"release-it": {
|
|
123
|
+
"git": {
|
|
124
|
+
"commitMessage": "chore(🔖): release ${version}",
|
|
125
|
+
"tagName": "v${version}"
|
|
126
|
+
},
|
|
127
|
+
"npm": {
|
|
128
|
+
"publish": true
|
|
129
|
+
},
|
|
130
|
+
"github": {
|
|
131
|
+
"release": true
|
|
132
|
+
},
|
|
133
|
+
"plugins": {
|
|
134
|
+
"@release-it/conventional-changelog": {
|
|
135
|
+
"preset": {
|
|
136
|
+
"name": "angular"
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
"prettier": {
|
|
142
|
+
"quoteProps": "consistent",
|
|
143
|
+
"singleQuote": true,
|
|
144
|
+
"tabWidth": 2,
|
|
145
|
+
"trailingComma": "es5",
|
|
146
|
+
"useTabs": false
|
|
147
|
+
},
|
|
148
|
+
"react-native-builder-bob": {
|
|
149
|
+
"source": "src",
|
|
150
|
+
"output": "lib",
|
|
151
|
+
"targets": [
|
|
152
|
+
[
|
|
153
|
+
"module",
|
|
154
|
+
{
|
|
155
|
+
"esm": true
|
|
156
|
+
}
|
|
157
|
+
],
|
|
158
|
+
[
|
|
159
|
+
"typescript",
|
|
160
|
+
{
|
|
161
|
+
"project": "tsconfig.build.json"
|
|
162
|
+
}
|
|
163
|
+
]
|
|
164
|
+
]
|
|
165
|
+
},
|
|
166
|
+
"codegenConfig": {
|
|
167
|
+
"name": "YamapLiteViewSpec",
|
|
168
|
+
"type": "all",
|
|
169
|
+
"jsSrcsDir": "src",
|
|
170
|
+
"android": {
|
|
171
|
+
"javaPackageName": "com.yamaplite"
|
|
172
|
+
},
|
|
173
|
+
"ios": {
|
|
174
|
+
"componentProvider": {
|
|
175
|
+
"YamapLiteView": "YamapLiteView",
|
|
176
|
+
"YamapLiteMarkerView": "YamapLiteMarkerView",
|
|
177
|
+
"YamapLiteCircleView": "YamapLiteCircleView",
|
|
178
|
+
"YamapLitePolygonView": "YamapLitePolygonView",
|
|
179
|
+
"YamapLitePolylineView": "YamapLitePolylineView",
|
|
180
|
+
"ClusteredYamapLiteView": "ClusteredYamapLiteView"
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
},
|
|
184
|
+
"create-react-native-library": {
|
|
185
|
+
"languages": "kotlin-objc",
|
|
186
|
+
"type": "fabric-view",
|
|
187
|
+
"version": "0.50.3"
|
|
188
|
+
}
|
|
189
|
+
}
|
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
import type { ImageSourcePropType, ViewProps } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export type CameraPositionResult = {
|
|
4
|
+
lat: number;
|
|
5
|
+
lon: number;
|
|
6
|
+
zoom: number;
|
|
7
|
+
azimuth: number;
|
|
8
|
+
tilt: number;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export type YaMapRef = {
|
|
12
|
+
getCameraPosition: () => Promise<CameraPositionResult>;
|
|
13
|
+
getVisibleRegion: () => Promise<VisibleRegion>;
|
|
14
|
+
getScreenPoints: (points: Point[]) => Promise<ScreenPoint[]>;
|
|
15
|
+
getWorldPoints: (points: ScreenPoint[]) => Promise<Point[]>;
|
|
16
|
+
setZoom: (
|
|
17
|
+
zoom: number,
|
|
18
|
+
duration?: number,
|
|
19
|
+
animation?: 'LINEAR' | 'SMOOTH'
|
|
20
|
+
) => Promise<void>;
|
|
21
|
+
setCenter: (
|
|
22
|
+
center: { lat: number; lon: number },
|
|
23
|
+
zoom?: number,
|
|
24
|
+
azimuth?: number,
|
|
25
|
+
tilt?: number,
|
|
26
|
+
duration?: number,
|
|
27
|
+
animation?: 'LINEAR' | 'SMOOTH'
|
|
28
|
+
) => Promise<void>;
|
|
29
|
+
fitAllMarkers: () => Promise<void>;
|
|
30
|
+
/** Alias for fitAllMarkers — lite SDK does not support targeting specific markers */
|
|
31
|
+
fitMarkers: (markers: any[]) => Promise<void>;
|
|
32
|
+
/** No-op — traffic layer is not available in lite SDK */
|
|
33
|
+
setTrafficVisible: (visible: boolean) => void;
|
|
34
|
+
getMapObjectCount: () => Promise<number>;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export type MarkerRef = {
|
|
38
|
+
/**
|
|
39
|
+
* @deprecated Not supported in lite SDK. Update the `point` prop instead
|
|
40
|
+
*/
|
|
41
|
+
animatedMoveTo: (point: Point, duration: number) => void;
|
|
42
|
+
/**
|
|
43
|
+
* @deprecated Not supported in lite SDK
|
|
44
|
+
*/
|
|
45
|
+
animatedRotateTo: (angle: number, duration: number) => void;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export interface MarkerProps extends ViewProps {
|
|
49
|
+
point: Point;
|
|
50
|
+
zIndex?: number;
|
|
51
|
+
scale?: number;
|
|
52
|
+
rotated?: boolean;
|
|
53
|
+
onPress?: (event: Point) => void;
|
|
54
|
+
source?: ImageSourcePropType;
|
|
55
|
+
anchor?: {
|
|
56
|
+
x: number;
|
|
57
|
+
y: number;
|
|
58
|
+
};
|
|
59
|
+
visible?: boolean;
|
|
60
|
+
handled?: boolean;
|
|
61
|
+
size?: number;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export interface CircleProps extends ViewProps {
|
|
65
|
+
fillColor?: string;
|
|
66
|
+
strokeColor?: string;
|
|
67
|
+
strokeWidth?: number;
|
|
68
|
+
zIndex?: number;
|
|
69
|
+
onPress?: (event: Point) => void;
|
|
70
|
+
center: Point;
|
|
71
|
+
radius: number;
|
|
72
|
+
handled?: boolean;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export interface PolygonProps extends ViewProps {
|
|
76
|
+
fillColor?: string;
|
|
77
|
+
strokeColor?: string;
|
|
78
|
+
strokeWidth?: number;
|
|
79
|
+
zIndex?: number;
|
|
80
|
+
onPress?: (event: Point) => void;
|
|
81
|
+
points: Point[];
|
|
82
|
+
innerRings?: Point[][];
|
|
83
|
+
handled?: boolean;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface PolylineProps extends ViewProps {
|
|
87
|
+
strokeColor?: string;
|
|
88
|
+
strokeWidth?: number;
|
|
89
|
+
outlineColor?: string;
|
|
90
|
+
outlineWidth?: number;
|
|
91
|
+
zIndex?: number;
|
|
92
|
+
dashLength?: number;
|
|
93
|
+
gapLength?: number;
|
|
94
|
+
dashOffset?: number;
|
|
95
|
+
onPress?: (event: Point) => void;
|
|
96
|
+
points: Point[];
|
|
97
|
+
handled?: boolean;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export interface YaMapProps extends ViewProps {
|
|
101
|
+
userLocationIcon?: ImageSourcePropType;
|
|
102
|
+
|
|
103
|
+
/** @default 1 */
|
|
104
|
+
userLocationIconScale?: number;
|
|
105
|
+
|
|
106
|
+
/** @default false */
|
|
107
|
+
showUserPosition?: boolean;
|
|
108
|
+
|
|
109
|
+
/** @default false */
|
|
110
|
+
nightMode?: boolean;
|
|
111
|
+
|
|
112
|
+
mapStyle?: string;
|
|
113
|
+
|
|
114
|
+
onCameraPositionChange?: (event: CameraPosition) => void;
|
|
115
|
+
|
|
116
|
+
onCameraPositionChangeEnd?: (event: CameraPosition) => void;
|
|
117
|
+
|
|
118
|
+
onMapPress?: (event: Point) => void;
|
|
119
|
+
|
|
120
|
+
onMapLongPress?: (event: Point) => void;
|
|
121
|
+
|
|
122
|
+
onMapLoaded?: (event: MapLoaded) => void;
|
|
123
|
+
|
|
124
|
+
/** @default #00FF00 */
|
|
125
|
+
userLocationAccuracyFillColor?: string;
|
|
126
|
+
|
|
127
|
+
/** @default #000000 */
|
|
128
|
+
userLocationAccuracyStrokeColor?: string;
|
|
129
|
+
|
|
130
|
+
/** @default 2 */
|
|
131
|
+
userLocationAccuracyStrokeWidth?: number;
|
|
132
|
+
|
|
133
|
+
/** @default true */
|
|
134
|
+
scrollGesturesEnabled?: boolean;
|
|
135
|
+
|
|
136
|
+
/** @default true */
|
|
137
|
+
zoomGesturesEnabled?: boolean;
|
|
138
|
+
|
|
139
|
+
/** @default true */
|
|
140
|
+
tiltGesturesEnabled?: boolean;
|
|
141
|
+
|
|
142
|
+
/** @default true */
|
|
143
|
+
rotateGesturesEnabled?: boolean;
|
|
144
|
+
|
|
145
|
+
/** @default true */
|
|
146
|
+
fastTapEnabled?: boolean;
|
|
147
|
+
|
|
148
|
+
initialRegion?: InitialRegion;
|
|
149
|
+
|
|
150
|
+
/** @default 60 */
|
|
151
|
+
maxFps?: number;
|
|
152
|
+
|
|
153
|
+
/** @default 'map' */
|
|
154
|
+
mapType?: 'map' | 'satellite' | 'hybrid';
|
|
155
|
+
|
|
156
|
+
/** @default false */
|
|
157
|
+
followUser?: boolean;
|
|
158
|
+
|
|
159
|
+
logoPosition?: YandexLogoPosition;
|
|
160
|
+
|
|
161
|
+
logoPadding?: YandexLogoPadding;
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Disables all map gestures when false.
|
|
165
|
+
* @default true
|
|
166
|
+
*/
|
|
167
|
+
interactive?: boolean;
|
|
168
|
+
|
|
169
|
+
/** Fired after getCameraPosition() resolves — for backward compatibility with react-native-yamap */
|
|
170
|
+
onCameraPositionReceived?: (event: {
|
|
171
|
+
nativeEvent: CameraPositionResult;
|
|
172
|
+
}) => void;
|
|
173
|
+
|
|
174
|
+
/** Fired after getVisibleRegion() resolves — for backward compatibility with react-native-yamap */
|
|
175
|
+
onVisibleRegionReceived?: (event: { nativeEvent: VisibleRegion }) => void;
|
|
176
|
+
|
|
177
|
+
/** Fired after getScreenPoints() resolves — for backward compatibility with react-native-yamap */
|
|
178
|
+
onWorldToScreenPointsReceived?: (event: {
|
|
179
|
+
nativeEvent: { points: ScreenPoint[] };
|
|
180
|
+
}) => void;
|
|
181
|
+
|
|
182
|
+
/** Fired after getWorldPoints() resolves — for backward compatibility with react-native-yamap */
|
|
183
|
+
onScreenToWorldPointsReceived?: (event: {
|
|
184
|
+
nativeEvent: { points: Point[] };
|
|
185
|
+
}) => void;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export interface ClusteredYamapProps<T = any> extends YaMapProps {
|
|
189
|
+
clusteredMarkers: ReadonlyArray<{ point: Point; data: T }>;
|
|
190
|
+
renderMarker: (
|
|
191
|
+
info: { point: Point; data: T },
|
|
192
|
+
index: number
|
|
193
|
+
) => React.ReactElement;
|
|
194
|
+
/** @default #FF0000 */
|
|
195
|
+
clusterColor?: string;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export interface Point {
|
|
199
|
+
lat: number;
|
|
200
|
+
lon: number;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export interface BoundingBox {
|
|
204
|
+
southWest: Point;
|
|
205
|
+
northEast: Point;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export interface ScreenPoint {
|
|
209
|
+
x: number;
|
|
210
|
+
y: number;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export interface MapLoaded {
|
|
214
|
+
nativeEvent: {
|
|
215
|
+
renderObjectCount: number;
|
|
216
|
+
curZoomModelsLoaded: number;
|
|
217
|
+
curZoomPlacemarksLoaded: number;
|
|
218
|
+
curZoomLabelsLoaded: number;
|
|
219
|
+
curZoomGeometryLoaded: number;
|
|
220
|
+
tileMemoryUsage: number;
|
|
221
|
+
delayedGeometryLoaded: number;
|
|
222
|
+
fullyAppeared: number;
|
|
223
|
+
fullyLoaded: number;
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export interface InitialRegion {
|
|
228
|
+
lat: number;
|
|
229
|
+
lon: number;
|
|
230
|
+
zoom?: number;
|
|
231
|
+
azimuth?: number;
|
|
232
|
+
tilt?: number;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
export type MasstransitVehicles =
|
|
236
|
+
| 'bus'
|
|
237
|
+
| 'trolleybus'
|
|
238
|
+
| 'tramway'
|
|
239
|
+
| 'minibus'
|
|
240
|
+
| 'suburban'
|
|
241
|
+
| 'underground'
|
|
242
|
+
| 'ferry'
|
|
243
|
+
| 'cable'
|
|
244
|
+
| 'funicular';
|
|
245
|
+
|
|
246
|
+
export type Vehicles = MasstransitVehicles | 'walk' | 'car';
|
|
247
|
+
|
|
248
|
+
export interface DrivingInfo {
|
|
249
|
+
time: string;
|
|
250
|
+
timeWithTraffic: string;
|
|
251
|
+
distance: number;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
export interface MasstransitInfo {
|
|
255
|
+
time: string;
|
|
256
|
+
transferCount: number;
|
|
257
|
+
walkingDistance: number;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
export interface RouteInfo<T extends DrivingInfo | MasstransitInfo> {
|
|
261
|
+
id: string;
|
|
262
|
+
sections: {
|
|
263
|
+
points: Point[];
|
|
264
|
+
sectionInfo: T;
|
|
265
|
+
routeInfo: T;
|
|
266
|
+
routeIndex: number;
|
|
267
|
+
stops: any[];
|
|
268
|
+
type: string;
|
|
269
|
+
transports?: any;
|
|
270
|
+
sectionColor?: string;
|
|
271
|
+
}[];
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export interface RoutesFoundEvent<T extends DrivingInfo | MasstransitInfo> {
|
|
275
|
+
nativeEvent: {
|
|
276
|
+
status: 'success' | 'error';
|
|
277
|
+
id: string;
|
|
278
|
+
routes: RouteInfo<T>[];
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export interface CameraPosition {
|
|
283
|
+
nativeEvent: {
|
|
284
|
+
zoom: number;
|
|
285
|
+
tilt: number;
|
|
286
|
+
azimuth: number;
|
|
287
|
+
point: { lat: number; lon: number };
|
|
288
|
+
finished: boolean;
|
|
289
|
+
target: number;
|
|
290
|
+
reason: 'GESTURES' | 'APPLICATION';
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
export type VisibleRegion = {
|
|
295
|
+
bottomLeft: Point;
|
|
296
|
+
bottomRight: Point;
|
|
297
|
+
topLeft: Point;
|
|
298
|
+
topRight: Point;
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
export enum Animation {
|
|
302
|
+
SMOOTH,
|
|
303
|
+
LINEAR,
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export type YandexLogoPosition = {
|
|
307
|
+
horizontal?: 'left' | 'center' | 'right';
|
|
308
|
+
vertical?: 'top' | 'bottom';
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
export type YandexLogoPadding = {
|
|
312
|
+
horizontal?: number;
|
|
313
|
+
vertical?: number;
|
|
314
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
2
|
+
import type { HostComponent, ViewProps } from 'react-native';
|
|
3
|
+
import type {
|
|
4
|
+
DirectEventHandler,
|
|
5
|
+
Double,
|
|
6
|
+
Float,
|
|
7
|
+
WithDefault,
|
|
8
|
+
} from 'react-native/Libraries/Types/CodegenTypes';
|
|
9
|
+
|
|
10
|
+
interface Point {
|
|
11
|
+
lat: Double;
|
|
12
|
+
lon: Double;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
interface YandexLogoPosition {
|
|
16
|
+
vertical?: WithDefault<'top' | 'bottom', 'bottom'>;
|
|
17
|
+
horizontal?: WithDefault<'left' | 'center' | 'right', 'left'>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface YandexLogoPadding {
|
|
21
|
+
vertical?: Double;
|
|
22
|
+
horizontal?: Double;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
interface MapLoad {
|
|
26
|
+
renderObjectCount: Double;
|
|
27
|
+
curZoomModelsLoaded: Double;
|
|
28
|
+
curZoomPlacemarksLoaded: Double;
|
|
29
|
+
curZoomLabelsLoaded: Double;
|
|
30
|
+
curZoomGeometryLoaded: Double;
|
|
31
|
+
tileMemoryUsage: Double;
|
|
32
|
+
delayedGeometryLoaded: Double;
|
|
33
|
+
fullyAppeared: Double;
|
|
34
|
+
fullyLoaded: Double;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface InitialRegion {
|
|
38
|
+
lat: Double;
|
|
39
|
+
lon: Double;
|
|
40
|
+
zoom?: Double;
|
|
41
|
+
azimuth?: Double;
|
|
42
|
+
tilt?: Double;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
interface CameraPosition {
|
|
46
|
+
finished: boolean;
|
|
47
|
+
point: {
|
|
48
|
+
lat: Double;
|
|
49
|
+
lon: Double;
|
|
50
|
+
};
|
|
51
|
+
zoom: Double;
|
|
52
|
+
azimuth: Double;
|
|
53
|
+
tilt: Double;
|
|
54
|
+
target: Double;
|
|
55
|
+
reason: 'GESTURES' | 'APPLICATION';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
interface ClusteredNativeProps extends ViewProps {
|
|
59
|
+
userLocationIcon?: string;
|
|
60
|
+
userLocationIconScale?: Float;
|
|
61
|
+
/** @default false */
|
|
62
|
+
showUserPosition?: boolean;
|
|
63
|
+
/** @default false */
|
|
64
|
+
nightMode?: boolean;
|
|
65
|
+
mapStyle?: string;
|
|
66
|
+
onCameraPositionChange?: DirectEventHandler<Readonly<CameraPosition>>;
|
|
67
|
+
onCameraPositionChangeEnd?: DirectEventHandler<Readonly<CameraPosition>>;
|
|
68
|
+
onMapPress?: DirectEventHandler<Readonly<Point>>;
|
|
69
|
+
onMapLongPress?: DirectEventHandler<Readonly<Point>>;
|
|
70
|
+
onMapLoaded?: DirectEventHandler<Readonly<MapLoad>>;
|
|
71
|
+
/** @default #00FF00 */
|
|
72
|
+
userLocationAccuracyFillColor?: string;
|
|
73
|
+
/** @default #000000 */
|
|
74
|
+
userLocationAccuracyStrokeColor?: string;
|
|
75
|
+
/** @default 2 */
|
|
76
|
+
userLocationAccuracyStrokeWidth?: Float;
|
|
77
|
+
scrollGesturesEnabled?: WithDefault<boolean, true>;
|
|
78
|
+
zoomGesturesEnabled?: WithDefault<boolean, true>;
|
|
79
|
+
tiltGesturesEnabled?: WithDefault<boolean, true>;
|
|
80
|
+
rotateGesturesEnabled?: WithDefault<boolean, true>;
|
|
81
|
+
fastTapEnabled?: WithDefault<boolean, true>;
|
|
82
|
+
initialRegion?: InitialRegion;
|
|
83
|
+
maxFps?: Float;
|
|
84
|
+
mapType?: WithDefault<'map' | 'satellite' | 'hybrid', 'map'>;
|
|
85
|
+
/** @default false */
|
|
86
|
+
followUser?: boolean;
|
|
87
|
+
logoPosition?: YandexLogoPosition;
|
|
88
|
+
logoPadding?: YandexLogoPadding;
|
|
89
|
+
|
|
90
|
+
clusteredMarkers: ReadonlyArray<Point>;
|
|
91
|
+
clusterColor?: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
export type ClusteredYamapViewComponent = HostComponent<ClusteredNativeProps>;
|
|
95
|
+
|
|
96
|
+
export default codegenNativeComponent<ClusteredNativeProps>(
|
|
97
|
+
'ClusteredYamapLiteView'
|
|
98
|
+
);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { CircleProps, Point } from '../@types';
|
|
3
|
+
import { type NativeSyntheticEvent } from 'react-native';
|
|
4
|
+
import YamapLiteCircleView from '../YamapCircleViewNativeComponent';
|
|
5
|
+
|
|
6
|
+
export const Circle: React.FC<CircleProps> = ({
|
|
7
|
+
onPress,
|
|
8
|
+
zIndex,
|
|
9
|
+
...props
|
|
10
|
+
}) => {
|
|
11
|
+
const handleCirclePress = (event: NativeSyntheticEvent<Point>) => {
|
|
12
|
+
onPress?.(event.nativeEvent);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<YamapLiteCircleView
|
|
17
|
+
{...props}
|
|
18
|
+
zInd={zIndex}
|
|
19
|
+
onCirclePress={handleCirclePress}
|
|
20
|
+
/>
|
|
21
|
+
);
|
|
22
|
+
};
|