@react-native-kakao/map 2.2.6 → 3.1.0-next.2
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/CHANGELOG.md +14 -0
- package/README.md +5 -38
- package/RNCKakaoMap.podspec +16 -52
- package/android/build.gradle +12 -107
- package/android/consumer-rules.pro +2 -0
- package/android/src/main/AndroidManifest.xml +3 -1
- package/android/src/main/java/net/mjstudio/rnkakao/map/CameraOptions.kt +61 -0
- package/android/src/main/java/net/mjstudio/rnkakao/map/KakaoMapModule.kt +131 -0
- package/android/src/main/java/net/mjstudio/rnkakao/map/KakaoMapView.kt +1257 -0
- package/android/src/main/java/net/mjstudio/rnkakao/map/MapCameraCommands.kt +306 -0
- package/android/src/main/java/net/mjstudio/rnkakao/map/MapDimScreen.kt +431 -0
- package/android/src/main/java/net/mjstudio/rnkakao/map/MapGui.kt +899 -0
- package/android/src/main/java/net/mjstudio/rnkakao/map/MapImageLoader.kt +232 -0
- package/android/src/main/java/net/mjstudio/rnkakao/map/MapLabels.kt +1572 -0
- package/android/src/main/java/net/mjstudio/rnkakao/map/MapOptions.kt +360 -0
- package/android/src/main/java/net/mjstudio/rnkakao/map/MapRoutes.kt +805 -0
- package/android/src/main/java/net/mjstudio/rnkakao/map/MapShapes.kt +1096 -0
- package/android/src/main/java/net/mjstudio/rnkakao/map/MapUtilities.kt +495 -0
- package/expo-module.config.json +5 -0
- package/ios/CameraOptions.swift +41 -0
- package/ios/KakaoMapModule.swift +204 -0
- package/ios/KakaoMapView.swift +1018 -0
- package/ios/MapCameraCommands.swift +451 -0
- package/ios/MapDimScreen.swift +463 -0
- package/ios/MapGui.swift +1099 -0
- package/ios/MapImageLoader.swift +177 -0
- package/ios/MapLabels.swift +1676 -0
- package/ios/MapOptions.swift +374 -0
- package/ios/MapRoutes.swift +903 -0
- package/ios/MapShapes.swift +1294 -0
- package/ios/MapUnits.swift +20 -0
- package/ios/MapUtilities.swift +365 -0
- package/lib/commonjs/index.js +180 -29
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/index.web.js +18 -0
- package/lib/commonjs/index.web.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/types-assets.js +2 -0
- package/lib/commonjs/types-assets.js.map +1 -0
- package/lib/commonjs/types-camera.js +6 -0
- package/lib/commonjs/types-camera.js.map +1 -0
- package/lib/commonjs/types-dim.js +6 -0
- package/lib/commonjs/types-dim.js.map +1 -0
- package/lib/commonjs/types-gui.js +6 -0
- package/lib/commonjs/types-gui.js.map +1 -0
- package/lib/commonjs/types-labels.js +6 -0
- package/lib/commonjs/types-labels.js.map +1 -0
- package/lib/commonjs/types-routes.js +6 -0
- package/lib/commonjs/types-routes.js.map +1 -0
- package/lib/commonjs/types-shapes.js +6 -0
- package/lib/commonjs/types-shapes.js.map +1 -0
- package/lib/commonjs/types-utilities.js +6 -0
- package/lib/commonjs/types-utilities.js.map +1 -0
- package/lib/commonjs/types.js +6 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/module/index.js +180 -22
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +13 -0
- package/lib/module/index.web.js.map +1 -0
- package/lib/module/types-assets.js +2 -0
- package/lib/module/types-assets.js.map +1 -0
- package/lib/module/types-camera.js +4 -0
- package/lib/module/types-camera.js.map +1 -0
- package/lib/module/types-dim.js +4 -0
- package/lib/module/types-dim.js.map +1 -0
- package/lib/module/types-gui.js +4 -0
- package/lib/module/types-gui.js.map +1 -0
- package/lib/module/types-labels.js +4 -0
- package/lib/module/types-labels.js.map +1 -0
- package/lib/module/types-routes.js +4 -0
- package/lib/module/types-routes.js.map +1 -0
- package/lib/module/types-shapes.js +4 -0
- package/lib/module/types-shapes.js.map +1 -0
- package/lib/module/types-utilities.js +4 -0
- package/lib/module/types-utilities.js.map +1 -0
- package/lib/module/types.js +4 -0
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/src/index.d.ts +59 -9
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/types-assets.d.ts +9 -0
- package/lib/typescript/src/types-assets.d.ts.map +1 -0
- package/lib/typescript/src/types-camera.d.ts +123 -0
- package/lib/typescript/src/types-camera.d.ts.map +1 -0
- package/lib/typescript/src/types-dim.d.ts +54 -0
- package/lib/typescript/src/types-dim.d.ts.map +1 -0
- package/lib/typescript/src/types-gui.d.ts +189 -0
- package/lib/typescript/src/types-gui.d.ts.map +1 -0
- package/lib/typescript/src/types-labels.d.ts +246 -0
- package/lib/typescript/src/types-labels.d.ts.map +1 -0
- package/lib/typescript/src/types-routes.d.ts +162 -0
- package/lib/typescript/src/types-routes.d.ts.map +1 -0
- package/lib/typescript/src/types-shapes.d.ts +253 -0
- package/lib/typescript/src/types-shapes.d.ts.map +1 -0
- package/lib/typescript/src/types-utilities.d.ts +130 -0
- package/lib/typescript/src/types-utilities.d.ts.map +1 -0
- package/lib/typescript/src/types.d.ts +222 -0
- package/lib/typescript/src/types.d.ts.map +1 -0
- package/package.json +24 -77
- package/src/index.tsx +322 -0
- package/src/index.web.tsx +46 -0
- package/src/types-assets.ts +8 -0
- package/src/types-camera.ts +97 -0
- package/src/types-dim.ts +54 -0
- package/src/types-gui.ts +171 -0
- package/src/types-labels.ts +207 -0
- package/src/types-routes.ts +118 -0
- package/src/types-shapes.ts +244 -0
- package/src/types-utilities.ts +115 -0
- package/src/types.ts +223 -0
- package/android/gradle.properties +0 -1
- package/android/src/main/AndroidManifestNew.xml +0 -2
- package/android/src/main/java/net/mjstudio/rnkakao/map/RNCKakaoMapModule.kt +0 -25
- package/android/src/main/java/net/mjstudio/rnkakao/map/RNCKakaoMapPackage.kt +0 -35
- package/android/src/newarch/KakaoMapSpec.kt +0 -7
- package/android/src/oldarch/KakaoMapSpec.kt +0 -14
- package/ios/Component/Map/RNCKakaoMapView.h +0 -23
- package/ios/Component/Map/RNCKakaoMapView.mm +0 -209
- package/ios/Component/Map/RNCKakaoMapViewManager.mm +0 -19
- package/ios/NativeModule/RNCKakaoMap.h +0 -7
- package/ios/NativeModule/RNCKakaoMap.mm +0 -19
- package/ios/NativeModule/RNCKakaoMapManager.swift +0 -7
- package/ios/Util/Util.h +0 -97
- package/lib/commonjs/component/KakaoMapView.js +0 -54
- package/lib/commonjs/component/KakaoMapView.js.map +0 -1
- package/lib/commonjs/spec/NativeKakaoMap.js +0 -9
- package/lib/commonjs/spec/NativeKakaoMap.js.map +0 -1
- package/lib/commonjs/spec/RNCKakaoMapViewNativeComponent.js +0 -15
- package/lib/commonjs/spec/RNCKakaoMapViewNativeComponent.js.map +0 -1
- package/lib/commonjs/type/type.js +0 -2
- package/lib/commonjs/type/type.js.map +0 -1
- package/lib/commonjs/util/Const.js +0 -14
- package/lib/commonjs/util/Const.js.map +0 -1
- package/lib/commonjs/util/Util.js +0 -15
- package/lib/commonjs/util/Util.js.map +0 -1
- package/lib/module/component/KakaoMapView.js +0 -48
- package/lib/module/component/KakaoMapView.js.map +0 -1
- package/lib/module/spec/NativeKakaoMap.js +0 -3
- package/lib/module/spec/NativeKakaoMap.js.map +0 -1
- package/lib/module/spec/RNCKakaoMapViewNativeComponent.js +0 -10
- package/lib/module/spec/RNCKakaoMapViewNativeComponent.js.map +0 -1
- package/lib/module/type/type.js +0 -2
- package/lib/module/type/type.js.map +0 -1
- package/lib/module/util/Const.js +0 -8
- package/lib/module/util/Const.js.map +0 -1
- package/lib/module/util/Util.js +0 -9
- package/lib/module/util/Util.js.map +0 -1
- package/lib/typescript/src/component/KakaoMapView.d.ts +0 -25
- package/lib/typescript/src/component/KakaoMapView.d.ts.map +0 -1
- package/lib/typescript/src/spec/NativeKakaoMap.d.ts +0 -7
- package/lib/typescript/src/spec/NativeKakaoMap.d.ts.map +0 -1
- package/lib/typescript/src/spec/RNCKakaoMapViewNativeComponent.d.ts +0 -32
- package/lib/typescript/src/spec/RNCKakaoMapViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/src/type/type.d.ts +0 -8
- package/lib/typescript/src/type/type.d.ts.map +0 -1
- package/lib/typescript/src/util/Const.d.ts +0 -8
- package/lib/typescript/src/util/Const.d.ts.map +0 -1
- package/lib/typescript/src/util/Util.d.ts +0 -3
- package/lib/typescript/src/util/Util.d.ts.map +0 -1
- package/src/component/KakaoMapView.tsx +0 -82
- package/src/index.ts +0 -43
- package/src/spec/NativeKakaoMap.ts +0 -8
- package/src/spec/RNCKakaoMapViewNativeComponent.ts +0 -38
- package/src/type/type.ts +0 -7
- package/src/util/Const.ts +0 -7
- package/src/util/Util.ts +0 -11
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
import type { Coordinate } from './types';
|
|
2
|
+
|
|
3
|
+
export type ShapeColor = string;
|
|
4
|
+
/** Model-space meters; not an equal-ground-distance contract. */
|
|
5
|
+
export type ShapePoint = { x: number; y: number };
|
|
6
|
+
export type ShapeLayerPass = 'default' | 'overlay' | 'route';
|
|
7
|
+
export type ShapeInterpolation = 'linear' | 'cubicIn' | 'cubicOut' | 'cubicInOut';
|
|
8
|
+
|
|
9
|
+
export type ShapePolygonPart<T> = {
|
|
10
|
+
outer: T[];
|
|
11
|
+
holes?: T[][];
|
|
12
|
+
styleIndex?: number;
|
|
13
|
+
mergeOverlappedHoles?: boolean;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export type ShapeLinePart<T> = { points: T[]; styleIndex?: number };
|
|
17
|
+
|
|
18
|
+
export type GeographicPolygonGeometry = {
|
|
19
|
+
type: 'geographicPolygon';
|
|
20
|
+
parts: ShapePolygonPart<Coordinate>[];
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export type ModelPolygonGeometry = {
|
|
24
|
+
type: 'modelPolygon';
|
|
25
|
+
base: Coordinate;
|
|
26
|
+
orientation?: number;
|
|
27
|
+
parts: ShapePolygonPart<ShapePoint>[];
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export type GeographicPolylineGeometry = {
|
|
31
|
+
type: 'geographicPolyline';
|
|
32
|
+
parts: ShapeLinePart<Coordinate>[];
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export type ModelPolylineGeometry = {
|
|
36
|
+
type: 'modelPolyline';
|
|
37
|
+
base: Coordinate;
|
|
38
|
+
orientation?: number;
|
|
39
|
+
parts: ShapeLinePart<ShapePoint>[];
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export type ShapePrimitiveGeometry =
|
|
43
|
+
| {
|
|
44
|
+
type: 'modelCircle';
|
|
45
|
+
base: Coordinate;
|
|
46
|
+
/** Model-space meters. */
|
|
47
|
+
radius: number;
|
|
48
|
+
pointCount?: number;
|
|
49
|
+
clockwise?: boolean;
|
|
50
|
+
orientation?: number;
|
|
51
|
+
styleIndex?: number;
|
|
52
|
+
}
|
|
53
|
+
| {
|
|
54
|
+
type: 'modelRectangle';
|
|
55
|
+
base: Coordinate;
|
|
56
|
+
/** Model-space meters. */
|
|
57
|
+
width: number;
|
|
58
|
+
/** Model-space meters. */
|
|
59
|
+
height: number;
|
|
60
|
+
clockwise?: boolean;
|
|
61
|
+
orientation?: number;
|
|
62
|
+
styleIndex?: number;
|
|
63
|
+
}
|
|
64
|
+
| {
|
|
65
|
+
type: 'geographicCircle';
|
|
66
|
+
center: Coordinate;
|
|
67
|
+
/** Meters. */
|
|
68
|
+
radius: number;
|
|
69
|
+
pointCount?: number;
|
|
70
|
+
clockwise?: boolean;
|
|
71
|
+
styleIndex?: number;
|
|
72
|
+
}
|
|
73
|
+
| {
|
|
74
|
+
type: 'geographicRectangle';
|
|
75
|
+
center: Coordinate;
|
|
76
|
+
/** Meters. */
|
|
77
|
+
width: number;
|
|
78
|
+
/** Meters. */
|
|
79
|
+
height: number;
|
|
80
|
+
clockwise?: boolean;
|
|
81
|
+
styleIndex?: number;
|
|
82
|
+
}
|
|
83
|
+
| {
|
|
84
|
+
type: 'geographicCurve';
|
|
85
|
+
start: Coordinate;
|
|
86
|
+
end: Coordinate;
|
|
87
|
+
side: 'left' | 'right';
|
|
88
|
+
styleIndex?: number;
|
|
89
|
+
}
|
|
90
|
+
| {
|
|
91
|
+
type: 'modelArc';
|
|
92
|
+
base: Coordinate;
|
|
93
|
+
/** Model-space meters. */
|
|
94
|
+
radius: number;
|
|
95
|
+
/** Degrees clockwise from north. */
|
|
96
|
+
startAngle: number;
|
|
97
|
+
/** Degrees clockwise from north. */
|
|
98
|
+
endAngle: number;
|
|
99
|
+
pointCount?: number;
|
|
100
|
+
clockwise?: boolean;
|
|
101
|
+
orientation?: number;
|
|
102
|
+
styleIndex?: number;
|
|
103
|
+
}
|
|
104
|
+
| {
|
|
105
|
+
type: 'geographicArc';
|
|
106
|
+
center: Coordinate;
|
|
107
|
+
/** Meters. */
|
|
108
|
+
radius: number;
|
|
109
|
+
/** Degrees clockwise from north. */
|
|
110
|
+
startAngle: number;
|
|
111
|
+
/** Degrees clockwise from north. */
|
|
112
|
+
endAngle: number;
|
|
113
|
+
pointCount?: number;
|
|
114
|
+
clockwise?: boolean;
|
|
115
|
+
styleIndex?: number;
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
export type ShapeGeometry =
|
|
119
|
+
| GeographicPolygonGeometry
|
|
120
|
+
| ModelPolygonGeometry
|
|
121
|
+
| GeographicPolylineGeometry
|
|
122
|
+
| ModelPolylineGeometry
|
|
123
|
+
| ShapePrimitiveGeometry;
|
|
124
|
+
|
|
125
|
+
export type PolygonStyleLevel = {
|
|
126
|
+
level: number;
|
|
127
|
+
fillColor: ShapeColor;
|
|
128
|
+
strokeColor?: ShapeColor;
|
|
129
|
+
/** Density-independent pixels. */
|
|
130
|
+
strokeWidth?: number;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export type PolylineStyleLevel = {
|
|
134
|
+
level: number;
|
|
135
|
+
color: ShapeColor;
|
|
136
|
+
/** Density-independent pixels. */
|
|
137
|
+
width: number;
|
|
138
|
+
strokeColor?: ShapeColor;
|
|
139
|
+
/** Density-independent pixels. */
|
|
140
|
+
strokeWidth?: number;
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export type PolygonStyleSet = {
|
|
144
|
+
type: 'polygon';
|
|
145
|
+
id: string;
|
|
146
|
+
styles: { levels: PolygonStyleLevel[] }[];
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export type PolylineStyleSet = {
|
|
150
|
+
type: 'polyline';
|
|
151
|
+
id: string;
|
|
152
|
+
cap?: 'butt' | 'round' | 'square';
|
|
153
|
+
styles: { levels: PolylineStyleLevel[] }[];
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
export type ShapeStyleSet = PolygonStyleSet | PolylineStyleSet;
|
|
157
|
+
|
|
158
|
+
export type ShapeLayerSpec = {
|
|
159
|
+
id: string;
|
|
160
|
+
zIndex?: number;
|
|
161
|
+
visible?: boolean;
|
|
162
|
+
/** `route` requires SDK support; capability is reported by the native manager. */
|
|
163
|
+
pass?: ShapeLayerPass;
|
|
164
|
+
};
|
|
165
|
+
|
|
166
|
+
export type ShapeSpec = {
|
|
167
|
+
id: string;
|
|
168
|
+
layerId: string;
|
|
169
|
+
styleSetId: string;
|
|
170
|
+
zIndex?: number;
|
|
171
|
+
visible?: boolean;
|
|
172
|
+
geometry: ShapeGeometry;
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
export type ShapeScene = {
|
|
176
|
+
styleSets?: ShapeStyleSet[];
|
|
177
|
+
layers?: ShapeLayerSpec[];
|
|
178
|
+
shapes?: ShapeSpec[];
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
export type ShapeWaveAnimation = {
|
|
182
|
+
animationId: string;
|
|
183
|
+
shapeIds: string[];
|
|
184
|
+
duration: number;
|
|
185
|
+
frames: {
|
|
186
|
+
level: number;
|
|
187
|
+
startAlpha: number;
|
|
188
|
+
endAlpha: number;
|
|
189
|
+
/** Density-independent pixels. */
|
|
190
|
+
startRadius: number;
|
|
191
|
+
/** Density-independent pixels. */
|
|
192
|
+
endRadius: number;
|
|
193
|
+
}[];
|
|
194
|
+
interpolation?: ShapeInterpolation;
|
|
195
|
+
repeat?: number;
|
|
196
|
+
hideAtStop?: boolean;
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
export type ShapeCommand =
|
|
200
|
+
| { type: 'setVisible'; ids: string[]; visible: boolean }
|
|
201
|
+
| { type: 'setZIndex'; id: string; zIndex: number }
|
|
202
|
+
| { type: 'setPosition'; id: string; position: Coordinate }
|
|
203
|
+
| { type: 'setOrientation'; id: string; orientation: number }
|
|
204
|
+
| { type: 'changeData'; id: string; styleSetId: string; geometry: ShapeGeometry }
|
|
205
|
+
| { type: 'startWave'; animation: ShapeWaveAnimation }
|
|
206
|
+
| { type: 'stopAnimation'; animationId: string }
|
|
207
|
+
| { type: 'getState'; id: string }
|
|
208
|
+
| { type: 'getCounts' }
|
|
209
|
+
| { type: 'getCapabilities' }
|
|
210
|
+
| { type: 'remove'; ids: string[] };
|
|
211
|
+
|
|
212
|
+
export type ShapeCounts = { type: 'counts'; layers: number; shapes: number; animations: number };
|
|
213
|
+
|
|
214
|
+
export type ShapeCommandResult =
|
|
215
|
+
| { type: 'none' }
|
|
216
|
+
| {
|
|
217
|
+
type: 'state';
|
|
218
|
+
id: string;
|
|
219
|
+
layerId: string;
|
|
220
|
+
visible: boolean;
|
|
221
|
+
zIndex: number;
|
|
222
|
+
geometryType: ShapeGeometry['type'];
|
|
223
|
+
position: Coordinate | null;
|
|
224
|
+
orientation: number | null;
|
|
225
|
+
}
|
|
226
|
+
| ShapeCounts
|
|
227
|
+
| ({ type: 'capabilities' } & ShapeCapabilities);
|
|
228
|
+
|
|
229
|
+
export type ShapeCapabilities = {
|
|
230
|
+
layerPasses: ShapeLayerPass[];
|
|
231
|
+
geographicPrimitives: boolean;
|
|
232
|
+
modelPrimitives: boolean;
|
|
233
|
+
geographicPosition: boolean;
|
|
234
|
+
geographicOrientation: boolean;
|
|
235
|
+
modelPosition: boolean;
|
|
236
|
+
modelOrientation: boolean;
|
|
237
|
+
zIndexMutation: boolean;
|
|
238
|
+
fractionalStyleWidth: boolean;
|
|
239
|
+
waveAnimation: boolean;
|
|
240
|
+
waveTargets: ('polygon' | 'polyline')[];
|
|
241
|
+
waveNaturalStopEvent: boolean;
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
export type ShapeAnimationStopEvent = { animationId: string };
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import type { MapViewport } from './types';
|
|
2
|
+
|
|
3
|
+
export type MapPoiCategory =
|
|
4
|
+
| 'policyCategory'
|
|
5
|
+
| 'address'
|
|
6
|
+
| 'district'
|
|
7
|
+
| 'busStop'
|
|
8
|
+
| 'railroadPlatform'
|
|
9
|
+
| 'railroadEntrance'
|
|
10
|
+
| 'railroadLine'
|
|
11
|
+
| 'brand'
|
|
12
|
+
| 'place'
|
|
13
|
+
| 'climb'
|
|
14
|
+
| 'climbWave'
|
|
15
|
+
| 'road'
|
|
16
|
+
| 'roadNumber'
|
|
17
|
+
| 'roadInfo'
|
|
18
|
+
| 'facilities'
|
|
19
|
+
| 'publicFacilities'
|
|
20
|
+
| 'apartNumber'
|
|
21
|
+
| 'apartDetail'
|
|
22
|
+
| 'houseNumber'
|
|
23
|
+
| 'land'
|
|
24
|
+
| 'indoor'
|
|
25
|
+
| 'indoorPlace'
|
|
26
|
+
| 'detailCategory';
|
|
27
|
+
|
|
28
|
+
export type MapCoordinateSystem = 'wgs84' | 'wtm' | 'wcong' | 'kakao';
|
|
29
|
+
export type MapCoordinateValue = { x: number; y: number };
|
|
30
|
+
export type MapCacheKind = 'disk' | 'memory' | 'viewInfo' | 'all';
|
|
31
|
+
export type MapPoiScale = 'small' | 'regular' | 'large' | 'xLarge';
|
|
32
|
+
export type MapPoiState = {
|
|
33
|
+
visible: boolean;
|
|
34
|
+
clickable: boolean;
|
|
35
|
+
scale: MapPoiScale;
|
|
36
|
+
language: string | null;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export type MapUtilityCommand =
|
|
40
|
+
| { type: 'getCapabilities' }
|
|
41
|
+
| { type: 'getState' }
|
|
42
|
+
| { type: 'setPoiVisible'; visible: boolean }
|
|
43
|
+
| { type: 'setPoiCategoryVisible'; category: MapPoiCategory; visible: boolean }
|
|
44
|
+
| { type: 'setPoiCategoryMaxCount'; category: MapPoiCategory; count: number }
|
|
45
|
+
| { type: 'resetPoiCategoryMaxCount'; category: MapPoiCategory }
|
|
46
|
+
| { type: 'setTapInterval'; milliseconds: number }
|
|
47
|
+
| { type: 'setCameraAnimationEnabled'; enabled: boolean }
|
|
48
|
+
| { type: 'setEnabled'; enabled: boolean }
|
|
49
|
+
| { type: 'setVisible'; visible: boolean }
|
|
50
|
+
| { type: 'setKeepLevelOnResize'; enabled: boolean }
|
|
51
|
+
| { type: 'getViewport' }
|
|
52
|
+
| { type: 'setViewport'; viewport: MapViewport }
|
|
53
|
+
| { type: 'refresh' }
|
|
54
|
+
| { type: 'registerFont'; resourceName: string; name?: string }
|
|
55
|
+
| { type: 'getVersion'; component: 'sdk' | 'engine' }
|
|
56
|
+
| {
|
|
57
|
+
type: 'convertCoordinate';
|
|
58
|
+
from: MapCoordinateSystem;
|
|
59
|
+
to: MapCoordinateSystem;
|
|
60
|
+
coordinate: MapCoordinateValue;
|
|
61
|
+
}
|
|
62
|
+
| { type: 'clearCache'; kind: MapCacheKind };
|
|
63
|
+
|
|
64
|
+
export type MapUtilityCapabilities = {
|
|
65
|
+
type: 'capabilities';
|
|
66
|
+
poi: {
|
|
67
|
+
visibility: boolean;
|
|
68
|
+
visibilityReadable: boolean;
|
|
69
|
+
categoryVisibility: boolean;
|
|
70
|
+
categoryMaxCount: boolean;
|
|
71
|
+
stateRequest: boolean;
|
|
72
|
+
categories: MapPoiCategory[];
|
|
73
|
+
};
|
|
74
|
+
settings: {
|
|
75
|
+
tapInterval: boolean;
|
|
76
|
+
cameraAnimationEnabled: boolean;
|
|
77
|
+
cameraAnimationEnabledReadable: boolean;
|
|
78
|
+
enabled: boolean;
|
|
79
|
+
visible: boolean;
|
|
80
|
+
keepLevelOnResize: boolean;
|
|
81
|
+
refresh: boolean;
|
|
82
|
+
focusedReadable: boolean;
|
|
83
|
+
};
|
|
84
|
+
viewport: { readable: boolean; writable: boolean };
|
|
85
|
+
fontRegistration: boolean;
|
|
86
|
+
versionComponents: ('sdk' | 'engine')[];
|
|
87
|
+
coordinateSystems: MapCoordinateSystem[];
|
|
88
|
+
coordinateConversions: `${MapCoordinateSystem}:${MapCoordinateSystem}`[];
|
|
89
|
+
cacheKinds: MapCacheKind[];
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
export type MapUtilityState = {
|
|
93
|
+
type: 'state';
|
|
94
|
+
tapInterval: number;
|
|
95
|
+
cameraAnimationEnabled?: boolean;
|
|
96
|
+
poiVisible?: boolean;
|
|
97
|
+
enabled?: boolean;
|
|
98
|
+
visible?: boolean;
|
|
99
|
+
keepLevelOnResize?: boolean;
|
|
100
|
+
focused?: boolean;
|
|
101
|
+
};
|
|
102
|
+
|
|
103
|
+
export type MapUtilityResult =
|
|
104
|
+
| { type: 'none' }
|
|
105
|
+
| MapUtilityCapabilities
|
|
106
|
+
| MapUtilityState
|
|
107
|
+
| { type: 'version'; component: 'sdk' | 'engine'; version: string }
|
|
108
|
+
| { type: 'viewport'; viewport: MapViewport }
|
|
109
|
+
| {
|
|
110
|
+
type: 'coordinate';
|
|
111
|
+
system: MapCoordinateSystem;
|
|
112
|
+
coordinate: MapCoordinateValue;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
export type MapPoiStateResult = { type: 'poiState'; state: MapPoiState };
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import type { ViewProps } from 'react-native';
|
|
2
|
+
|
|
3
|
+
import type {
|
|
4
|
+
AdvancedCameraCommand,
|
|
5
|
+
AdvancedCameraCommandResult,
|
|
6
|
+
AdvancedCameraOperationEvent,
|
|
7
|
+
} from './types-camera';
|
|
8
|
+
import type { DimScreenEvent, DimScreenOptions, DimScreenStatus } from './types-dim';
|
|
9
|
+
import type {
|
|
10
|
+
AnimatedImageAction,
|
|
11
|
+
MapGuiEvent,
|
|
12
|
+
MapGuiScene,
|
|
13
|
+
MapGuiStatus,
|
|
14
|
+
MoveInfoWindowOptions,
|
|
15
|
+
ShowInfoWindowOptions,
|
|
16
|
+
} from './types-gui';
|
|
17
|
+
import type {
|
|
18
|
+
LabelAnimationEvent,
|
|
19
|
+
LabelCapabilities,
|
|
20
|
+
LabelClickEvent,
|
|
21
|
+
LabelCommand,
|
|
22
|
+
LabelRuntimeState,
|
|
23
|
+
LabelScene,
|
|
24
|
+
} from './types-labels';
|
|
25
|
+
import type {
|
|
26
|
+
RouteAnimationStopEvent,
|
|
27
|
+
RouteCommand,
|
|
28
|
+
RouteCommandResult,
|
|
29
|
+
RouteCounts,
|
|
30
|
+
RouteProgressEvent,
|
|
31
|
+
RouteScene,
|
|
32
|
+
} from './types-routes';
|
|
33
|
+
import type {
|
|
34
|
+
ShapeAnimationStopEvent,
|
|
35
|
+
ShapeCommand,
|
|
36
|
+
ShapeCommandResult,
|
|
37
|
+
ShapeCounts,
|
|
38
|
+
ShapeScene,
|
|
39
|
+
} from './types-shapes';
|
|
40
|
+
import type { MapPoiStateResult, MapUtilityCommand, MapUtilityResult } from './types-utilities';
|
|
41
|
+
|
|
42
|
+
export type Coordinate = {
|
|
43
|
+
latitude: number;
|
|
44
|
+
longitude: number;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export type ScreenPoint = { x: number; y: number };
|
|
48
|
+
export type MapViewport = ScreenPoint & { width: number; height: number };
|
|
49
|
+
export type MapPadding = { top: number; right: number; bottom: number; left: number };
|
|
50
|
+
export type MapType = 'normal' | 'skyview';
|
|
51
|
+
export type MapOverlay = 'roadviewLine' | 'hillShading' | 'bicycleRoad' | 'hybrid';
|
|
52
|
+
export type MapGesture =
|
|
53
|
+
| 'doubleTapZoomIn'
|
|
54
|
+
| 'twoFingerTapZoomOut'
|
|
55
|
+
| 'pan'
|
|
56
|
+
| 'rotate'
|
|
57
|
+
| 'zoom'
|
|
58
|
+
| 'tilt'
|
|
59
|
+
| 'longTapAndDrag'
|
|
60
|
+
| 'rotateZoom'
|
|
61
|
+
| 'oneFingerZoom';
|
|
62
|
+
export type MapWidgetPosition = ScreenPoint & {
|
|
63
|
+
gravity:
|
|
64
|
+
| 'topLeft'
|
|
65
|
+
| 'topCenter'
|
|
66
|
+
| 'topRight'
|
|
67
|
+
| 'centerLeft'
|
|
68
|
+
| 'center'
|
|
69
|
+
| 'centerRight'
|
|
70
|
+
| 'bottomLeft'
|
|
71
|
+
| 'bottomCenter'
|
|
72
|
+
| 'bottomRight';
|
|
73
|
+
};
|
|
74
|
+
export type MapOptions = {
|
|
75
|
+
mapType?: MapType;
|
|
76
|
+
/** Mutually exclusive with mapType. Custom configurations may require a Kakao agreement. */
|
|
77
|
+
viewInfo?: { name: string; appName?: string };
|
|
78
|
+
overlays?: MapOverlay[];
|
|
79
|
+
/** Raw SDK overlay IDs for separately licensed map data. */
|
|
80
|
+
customOverlays?: string[];
|
|
81
|
+
language?: string;
|
|
82
|
+
poi?: {
|
|
83
|
+
visible?: boolean;
|
|
84
|
+
clickable?: boolean;
|
|
85
|
+
scale?: 'small' | 'regular' | 'large' | 'xLarge';
|
|
86
|
+
};
|
|
87
|
+
buildingScale?: number;
|
|
88
|
+
padding?: MapPadding;
|
|
89
|
+
zoomRange?: { min: number; max: number };
|
|
90
|
+
gestures?: Partial<Record<MapGesture, boolean>>;
|
|
91
|
+
compass?: { visible?: boolean; position?: MapWidgetPosition };
|
|
92
|
+
scaleBar?: {
|
|
93
|
+
visible?: boolean;
|
|
94
|
+
position?: MapWidgetPosition;
|
|
95
|
+
autoHide?: boolean;
|
|
96
|
+
fade?: { inDuration: number; outDuration: number; retentionDuration: number };
|
|
97
|
+
};
|
|
98
|
+
logo?: MapWidgetPosition;
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
export type MapInfo = {
|
|
102
|
+
mapType: MapType;
|
|
103
|
+
viewInfoName: string;
|
|
104
|
+
zoomRange: { min: number; max: number };
|
|
105
|
+
padding: MapPadding;
|
|
106
|
+
size: { width: number; height: number };
|
|
107
|
+
viewport: MapViewport;
|
|
108
|
+
language: string;
|
|
109
|
+
supportedLanguages: string[];
|
|
110
|
+
capabilities: { coordinateToScreen: boolean };
|
|
111
|
+
};
|
|
112
|
+
|
|
113
|
+
export type CameraUpdate =
|
|
114
|
+
| { type: 'position'; position: Coordinate }
|
|
115
|
+
| { type: 'zoom'; zoomLevel: number }
|
|
116
|
+
| { type: 'orientation'; rotation: number; tilt: number }
|
|
117
|
+
| { type: 'fit'; coordinates: Coordinate[] };
|
|
118
|
+
|
|
119
|
+
export type CameraPosition = Coordinate & {
|
|
120
|
+
zoomLevel: number;
|
|
121
|
+
/** Degrees from the vertical. The SDK may limit tilt at the current zoom. */
|
|
122
|
+
tilt: number;
|
|
123
|
+
/** Counterclockwise camera angle from north in degrees; returned as [0, 360). */
|
|
124
|
+
rotation: number;
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
export type CameraOptions = Omit<CameraPosition, 'tilt' | 'rotation'> & {
|
|
128
|
+
tilt?: number;
|
|
129
|
+
rotation?: number;
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
export type KakaoMapError = { code: string; message: string };
|
|
133
|
+
export type CameraMoveEvent = { reason: 'gesture' | 'developer' };
|
|
134
|
+
export type MapClickEvent = { latitude: number; longitude: number; x: number; y: number };
|
|
135
|
+
export type PoiClickEvent = Coordinate & { id: string; layerId: string };
|
|
136
|
+
|
|
137
|
+
export type KakaoMapViewProps = ViewProps & {
|
|
138
|
+
initialCamera?: CameraOptions;
|
|
139
|
+
camera?: CameraOptions;
|
|
140
|
+
/** Applies the supplied fields; omitted fields retain their current SDK values. */
|
|
141
|
+
options?: MapOptions;
|
|
142
|
+
labels?: LabelScene;
|
|
143
|
+
shapes?: ShapeScene;
|
|
144
|
+
routes?: RouteScene;
|
|
145
|
+
onMapReady?: () => void;
|
|
146
|
+
onError?: (error: KakaoMapError) => void;
|
|
147
|
+
onCameraMoveStart?: (event: CameraMoveEvent) => void;
|
|
148
|
+
onCameraIdle?: (event: CameraMoveEvent & { camera: CameraPosition }) => void;
|
|
149
|
+
onMapClick?: (event: MapClickEvent) => void;
|
|
150
|
+
onMapLongClick?: (event: Coordinate) => void;
|
|
151
|
+
onTerrainClick?: (event: Coordinate) => void;
|
|
152
|
+
/** Android only: receives SDK viewport taps, including object taps. */
|
|
153
|
+
onViewportClick?: (event: MapClickEvent) => void;
|
|
154
|
+
/** Android only. */
|
|
155
|
+
onVisibilityChanged?: (event: { visible: boolean }) => void;
|
|
156
|
+
/** iOS only. */
|
|
157
|
+
onFocusChanged?: (event: { focused: boolean }) => void;
|
|
158
|
+
onPoiClick?: (event: PoiClickEvent) => void;
|
|
159
|
+
onCompassClick?: () => void;
|
|
160
|
+
onMapTypeChanged?: (event: { viewInfoName: string }) => void;
|
|
161
|
+
onPaddingChanged?: (event: MapPadding) => void;
|
|
162
|
+
onViewportChanged?: (event: MapViewport) => void;
|
|
163
|
+
onLabelClick?: (event: LabelClickEvent) => void;
|
|
164
|
+
onLabelAnimationStopped?: (event: LabelAnimationEvent) => void;
|
|
165
|
+
onLabelsChanged?: (event: LabelRuntimeState) => void;
|
|
166
|
+
onShapeAnimationStop?: (event: ShapeAnimationStopEvent) => void;
|
|
167
|
+
onShapesChanged?: (event: ShapeCounts) => void;
|
|
168
|
+
onRoutesChanged?: (event: RouteCounts) => void;
|
|
169
|
+
onRouteProgress?: (event: RouteProgressEvent) => void;
|
|
170
|
+
onRouteAnimationStop?: (event: RouteAnimationStopEvent) => void;
|
|
171
|
+
onGuiEvent?: (event: MapGuiEvent) => void;
|
|
172
|
+
onDimScreenEvent?: (event: DimScreenEvent) => void;
|
|
173
|
+
onCameraOperation?: (event: AdvancedCameraOperationEvent) => void;
|
|
174
|
+
};
|
|
175
|
+
|
|
176
|
+
export type KakaoMapViewRef = {
|
|
177
|
+
/** Resolves on command dispatch. Duration is milliseconds; omitted means immediate. */
|
|
178
|
+
moveCamera: (camera: CameraOptions, options?: { duration?: number }) => Promise<void>;
|
|
179
|
+
getCamera: () => Promise<CameraPosition>;
|
|
180
|
+
updateCamera: (update: CameraUpdate, options?: { duration?: number }) => Promise<void>;
|
|
181
|
+
getMapInfo: () => Promise<MapInfo>;
|
|
182
|
+
screenToCoordinate: (point: ScreenPoint) => Promise<Coordinate>;
|
|
183
|
+
/** Android only: iOS SDK does not expose this projection. */
|
|
184
|
+
coordinateToScreen: (coordinate: Coordinate) => Promise<ScreenPoint>;
|
|
185
|
+
clearCache: () => Promise<void>;
|
|
186
|
+
runLabelCommand: (command: LabelCommand) => Promise<void>;
|
|
187
|
+
getLabelCapabilities: () => Promise<LabelCapabilities>;
|
|
188
|
+
getLabelState: () => Promise<LabelRuntimeState>;
|
|
189
|
+
applyShapes: (scene: ShapeScene) => Promise<ShapeCounts>;
|
|
190
|
+
executeShapeCommand: (command: ShapeCommand) => Promise<ShapeCommandResult>;
|
|
191
|
+
applyRoutes: (scene: RouteScene) => Promise<RouteCounts>;
|
|
192
|
+
executeRouteCommand: (command: RouteCommand) => Promise<RouteCommandResult>;
|
|
193
|
+
applyGui: (scene: MapGuiScene) => Promise<void>;
|
|
194
|
+
showInfoWindow: (id: string, options?: ShowInfoWindowOptions) => Promise<void>;
|
|
195
|
+
hideInfoWindow: (id: string) => Promise<void>;
|
|
196
|
+
moveInfoWindow: (
|
|
197
|
+
id: string,
|
|
198
|
+
position: Coordinate,
|
|
199
|
+
options?: MoveInfoWindowOptions,
|
|
200
|
+
) => Promise<void>;
|
|
201
|
+
showWidget: (id: string) => Promise<void>;
|
|
202
|
+
hideWidget: (id: string) => Promise<void>;
|
|
203
|
+
positionWidget: (id: string, position: MapWidgetPosition) => Promise<void>;
|
|
204
|
+
rotateWidget: (id: string, rotation: number) => Promise<void>;
|
|
205
|
+
startGuiAnimation: (id: string) => Promise<void>;
|
|
206
|
+
stopGuiAnimation: (id: string) => Promise<void>;
|
|
207
|
+
controlAnimatedImage: (
|
|
208
|
+
ownerType: 'infoWindow' | 'widget',
|
|
209
|
+
ownerId: string,
|
|
210
|
+
componentId: string,
|
|
211
|
+
action: AnimatedImageAction,
|
|
212
|
+
) => Promise<void>;
|
|
213
|
+
getGuiStatus: () => Promise<MapGuiStatus>;
|
|
214
|
+
applyDimScreen: (options: DimScreenOptions) => Promise<void>;
|
|
215
|
+
setDimHighlightVisible: (id: string, visible: boolean) => Promise<void>;
|
|
216
|
+
startDimAnimation: (id: string) => Promise<void>;
|
|
217
|
+
stopDimAnimation: (id: string) => Promise<void>;
|
|
218
|
+
getDimScreenStatus: () => Promise<DimScreenStatus>;
|
|
219
|
+
executeUtilityCommand: (command: MapUtilityCommand) => Promise<MapUtilityResult>;
|
|
220
|
+
/** Android only: resolves with the SDK's asynchronous POI state response. */
|
|
221
|
+
requestPoiState: () => Promise<MapPoiStateResult>;
|
|
222
|
+
executeCameraCommand: (command: AdvancedCameraCommand) => Promise<AdvancedCameraCommandResult>;
|
|
223
|
+
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Kakao_kotlinVersion=1.7.0
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
package net.mjstudio.rnkakao.map
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.bridge.Promise
|
|
4
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
5
|
-
import com.facebook.react.bridge.ReactMethod
|
|
6
|
-
import com.kakao.vectormap.KakaoMapSdk
|
|
7
|
-
|
|
8
|
-
class RNCKakaoMapModule internal constructor(
|
|
9
|
-
context: ReactApplicationContext,
|
|
10
|
-
) : KakaoMapSpec(context) {
|
|
11
|
-
override fun getName(): String = NAME
|
|
12
|
-
|
|
13
|
-
@ReactMethod
|
|
14
|
-
override fun initializeKakaoMapSDK(
|
|
15
|
-
appKey: String,
|
|
16
|
-
promise: Promise,
|
|
17
|
-
) {
|
|
18
|
-
KakaoMapSdk.init(reactApplicationContext, appKey)
|
|
19
|
-
promise.resolve(42)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
companion object {
|
|
23
|
-
const val NAME = "RNCKakaoMap"
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
package net.mjstudio.rnkakao.map
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.TurboReactPackage
|
|
4
|
-
import com.facebook.react.bridge.NativeModule
|
|
5
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
6
|
-
import com.facebook.react.module.model.ReactModuleInfo
|
|
7
|
-
import com.facebook.react.module.model.ReactModuleInfoProvider
|
|
8
|
-
|
|
9
|
-
class RNCKakaoMapPackage : TurboReactPackage() {
|
|
10
|
-
override fun getModule(
|
|
11
|
-
name: String,
|
|
12
|
-
reactContext: ReactApplicationContext,
|
|
13
|
-
): NativeModule? =
|
|
14
|
-
if (name == RNCKakaoMapModule.NAME) {
|
|
15
|
-
RNCKakaoMapModule(reactContext)
|
|
16
|
-
} else {
|
|
17
|
-
null
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
override fun getReactModuleInfoProvider(): ReactModuleInfoProvider =
|
|
21
|
-
ReactModuleInfoProvider {
|
|
22
|
-
val moduleInfos: MutableMap<String, ReactModuleInfo> = HashMap()
|
|
23
|
-
val isTurboModule: Boolean = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED
|
|
24
|
-
moduleInfos[RNCKakaoMapModule.NAME] =
|
|
25
|
-
ReactModuleInfo(
|
|
26
|
-
RNCKakaoMapModule.NAME,
|
|
27
|
-
RNCKakaoMapModule.NAME,
|
|
28
|
-
false, // canOverrideExistingModule
|
|
29
|
-
false, // needsEagerInit
|
|
30
|
-
false, // isCxxModule
|
|
31
|
-
isTurboModule, // isTurboModule
|
|
32
|
-
)
|
|
33
|
-
moduleInfos
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
package net.mjstudio.rnkakao.map
|
|
2
|
-
|
|
3
|
-
import com.facebook.react.bridge.Promise
|
|
4
|
-
import com.facebook.react.bridge.ReactApplicationContext
|
|
5
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule
|
|
6
|
-
|
|
7
|
-
abstract class KakaoMapSpec internal constructor(
|
|
8
|
-
context: ReactApplicationContext,
|
|
9
|
-
) : ReactContextBaseJavaModule(context) {
|
|
10
|
-
abstract fun initializeKakaoMapSDK(
|
|
11
|
-
appKey: String,
|
|
12
|
-
promise: Promise,
|
|
13
|
-
)
|
|
14
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// RNCKakaoMapView.h
|
|
3
|
-
// RNCKakaoMap
|
|
4
|
-
//
|
|
5
|
-
// Created by mj on 5/5/24.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#import "RCTFabricComponentsPlugins.h"
|
|
9
|
-
#import <KakaoMapsSDK/KakaoMapsSDK-Swift.h>
|
|
10
|
-
#import <KakaoMapsSDK/KakaoMapsSDK.h>
|
|
11
|
-
#import <React/RCTViewComponentView.h>
|
|
12
|
-
#import <React/UIView+ComponentViewProtocol.h>
|
|
13
|
-
#import <UIKit/UIKit.h>
|
|
14
|
-
#import <react/renderer/components/RNCKakaoMapSpec/ComponentDescriptors.h>
|
|
15
|
-
#import <react/renderer/components/RNCKakaoMapSpec/EventEmitters.h>
|
|
16
|
-
#import <react/renderer/components/RNCKakaoMapSpec/Props.h>
|
|
17
|
-
#import <react/renderer/components/RNCKakaoMapSpec/RCTComponentViewHelpers.h>
|
|
18
|
-
|
|
19
|
-
@interface RNCKakaoMapView : RCTViewComponentView
|
|
20
|
-
|
|
21
|
-
@property(nonatomic, assign) double cameraAnimationDuration;
|
|
22
|
-
|
|
23
|
-
@end
|