@granite-js/naver-map 1.0.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/CHANGELOG.md +7 -0
- package/GraniteNaverMap.podspec +81 -0
- package/android/build.gradle +160 -0
- package/android/gradle.properties +5 -0
- package/android/src/builtinProvider/java/run/granite/navermap/builtinProvider/BuiltInGraniteNaverMapProvider.kt +549 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/run/granite/navermap/GraniteNaverMapEvents.kt +91 -0
- package/android/src/main/java/run/granite/navermap/GraniteNaverMapPackage.kt +16 -0
- package/android/src/main/java/run/granite/navermap/GraniteNaverMapProvider.kt +242 -0
- package/android/src/main/java/run/granite/navermap/GraniteNaverMapRegistry.kt +116 -0
- package/android/src/main/java/run/granite/navermap/GraniteNaverMapView.kt +732 -0
- package/android/src/newarch/java/run/granite/navermap/GraniteNaverMapViewManager.kt +446 -0
- package/android/src/oldarch/java/run/granite/navermap/GraniteNaverMapViewManager.kt +249 -0
- package/dist/module/NaverMapView.js +110 -0
- package/dist/module/NaverMapView.js.map +1 -0
- package/dist/module/index.js +6 -0
- package/dist/module/index.js.map +1 -0
- package/dist/module/internals/colorUtils.js +624 -0
- package/dist/module/internals/colorUtils.js.map +1 -0
- package/dist/module/internals/context.js +8 -0
- package/dist/module/internals/context.js.map +1 -0
- package/dist/module/internals/id.js +10 -0
- package/dist/module/internals/id.js.map +1 -0
- package/dist/module/internals/useMapOverlay.js +44 -0
- package/dist/module/internals/useMapOverlay.js.map +1 -0
- package/dist/module/internals/usePreservedReference.js +36 -0
- package/dist/module/internals/usePreservedReference.js.map +1 -0
- package/dist/module/overlays/ArrowheadPath.js +37 -0
- package/dist/module/overlays/ArrowheadPath.js.map +1 -0
- package/dist/module/overlays/Circle.js +35 -0
- package/dist/module/overlays/Circle.js.map +1 -0
- package/dist/module/overlays/GroundOverlay.js +30 -0
- package/dist/module/overlays/GroundOverlay.js.map +1 -0
- package/dist/module/overlays/InfoWindow.js +32 -0
- package/dist/module/overlays/InfoWindow.js.map +1 -0
- package/dist/module/overlays/Marker.js +37 -0
- package/dist/module/overlays/Marker.js.map +1 -0
- package/dist/module/overlays/Path.js +41 -0
- package/dist/module/overlays/Path.js.map +1 -0
- package/dist/module/overlays/Polygon.js +51 -0
- package/dist/module/overlays/Polygon.js.map +1 -0
- package/dist/module/overlays/Polyline.js +60 -0
- package/dist/module/overlays/Polyline.js.map +1 -0
- package/dist/module/overlays/index.js +11 -0
- package/dist/module/overlays/index.js.map +1 -0
- package/dist/module/package.json +1 -0
- package/dist/module/specs/GraniteNaverMapViewNativeComponent.ts +352 -0
- package/dist/module/types/Coord.js +2 -0
- package/dist/module/types/Coord.js.map +1 -0
- package/dist/module/types/index.js +29 -0
- package/dist/module/types/index.js.map +1 -0
- package/dist/typescript/NaverMapView.d.ts +41 -0
- package/dist/typescript/index.d.ts +3 -0
- package/dist/typescript/internals/colorUtils.d.ts +10 -0
- package/dist/typescript/internals/context.d.ts +8 -0
- package/dist/typescript/internals/id.d.ts +1 -0
- package/dist/typescript/internals/useMapOverlay.d.ts +15 -0
- package/dist/typescript/internals/usePreservedReference.d.ts +6 -0
- package/dist/typescript/overlays/ArrowheadPath.d.ts +11 -0
- package/dist/typescript/overlays/Circle.d.ts +10 -0
- package/dist/typescript/overlays/GroundOverlay.d.ts +11 -0
- package/dist/typescript/overlays/InfoWindow.d.ts +14 -0
- package/dist/typescript/overlays/Marker.d.ts +16 -0
- package/dist/typescript/overlays/Path.d.ts +15 -0
- package/dist/typescript/overlays/Polygon.d.ts +10 -0
- package/dist/typescript/overlays/Polyline.d.ts +11 -0
- package/dist/typescript/overlays/index.d.ts +16 -0
- package/dist/typescript/specs/GraniteNaverMapViewNativeComponent.d.ts +92 -0
- package/dist/typescript/types/Coord.d.ts +4 -0
- package/dist/typescript/types/index.d.ts +55 -0
- package/ios/GraniteNaverMap-Bridging-Header.h +20 -0
- package/ios/GraniteNaverMapProvider.swift +312 -0
- package/ios/GraniteNaverMapRegistry.swift +91 -0
- package/ios/GraniteNaverMapView.h +15 -0
- package/ios/GraniteNaverMapView.mm +390 -0
- package/ios/GraniteNaverMapViewImpl.swift +496 -0
- package/ios/GraniteNaverMapViewManager.m +67 -0
- package/ios/GraniteNaverMapViewManager.swift +133 -0
- package/ios/GraniteNaverMapViewWrapper.swift +215 -0
- package/ios/builtinProvider/BuiltInNaverMapProvider.swift +489 -0
- package/ios/builtinProvider/GraniteNaverMapMarkerData.swift +66 -0
- package/ios/builtinProvider/NMFMarker+Extension.swift +65 -0
- package/ios/builtinProvider/RCTConvert+NMFMapView.h +17 -0
- package/ios/builtinProvider/RCTConvert+NMFMapView.m +67 -0
- package/package.json +103 -0
- package/src/NaverMapView.tsx +168 -0
- package/src/index.tsx +3 -0
- package/src/internals/colorUtils.ts +697 -0
- package/src/internals/context.ts +14 -0
- package/src/internals/id.ts +9 -0
- package/src/internals/useMapOverlay.ts +59 -0
- package/src/internals/usePreservedReference.ts +41 -0
- package/src/overlays/ArrowheadPath.ts +71 -0
- package/src/overlays/Circle.ts +68 -0
- package/src/overlays/GroundOverlay.ts +62 -0
- package/src/overlays/InfoWindow.ts +68 -0
- package/src/overlays/Marker.ts +83 -0
- package/src/overlays/Path.ts +87 -0
- package/src/overlays/Polygon.ts +83 -0
- package/src/overlays/Polyline.ts +93 -0
- package/src/overlays/index.ts +23 -0
- package/src/specs/GraniteNaverMapViewNativeComponent.ts +352 -0
- package/src/types/Coord.ts +4 -0
- package/src/types/index.ts +78 -0
|
@@ -0,0 +1,352 @@
|
|
|
1
|
+
import type { HostComponent, ViewProps } from 'react-native';
|
|
2
|
+
import type { DirectEventHandler, Double, Float, Int32, WithDefault } from 'react-native/Libraries/Types/CodegenTypes';
|
|
3
|
+
import codegenNativeCommands from 'react-native/Libraries/Utilities/codegenNativeCommands';
|
|
4
|
+
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
5
|
+
|
|
6
|
+
// ============================================================
|
|
7
|
+
// Event Types
|
|
8
|
+
// ============================================================
|
|
9
|
+
|
|
10
|
+
export type OnCameraChangeEvent = Readonly<{
|
|
11
|
+
latitude: Double;
|
|
12
|
+
longitude: Double;
|
|
13
|
+
zoom: Double;
|
|
14
|
+
}>;
|
|
15
|
+
|
|
16
|
+
export type OnTouchEvent = Readonly<{
|
|
17
|
+
reason: Int32;
|
|
18
|
+
animated: boolean;
|
|
19
|
+
}>;
|
|
20
|
+
|
|
21
|
+
export type OnMapClickEvent = Readonly<{
|
|
22
|
+
x: Double;
|
|
23
|
+
y: Double;
|
|
24
|
+
latitude: Double;
|
|
25
|
+
longitude: Double;
|
|
26
|
+
}>;
|
|
27
|
+
|
|
28
|
+
export type OnMarkerClickEvent = Readonly<{
|
|
29
|
+
id: string;
|
|
30
|
+
}>;
|
|
31
|
+
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
|
|
33
|
+
export type OnInitializedEvent = Readonly<{}>;
|
|
34
|
+
|
|
35
|
+
// Center prop type
|
|
36
|
+
type CenterProp = Readonly<{
|
|
37
|
+
latitude: Double;
|
|
38
|
+
longitude: Double;
|
|
39
|
+
zoom?: Double;
|
|
40
|
+
tilt?: Double;
|
|
41
|
+
bearing?: Double;
|
|
42
|
+
}>;
|
|
43
|
+
|
|
44
|
+
// Padding prop type
|
|
45
|
+
type PaddingProp = Readonly<{
|
|
46
|
+
top?: Double;
|
|
47
|
+
left?: Double;
|
|
48
|
+
bottom?: Double;
|
|
49
|
+
right?: Double;
|
|
50
|
+
}>;
|
|
51
|
+
|
|
52
|
+
export interface NativeProps extends ViewProps {
|
|
53
|
+
// Camera
|
|
54
|
+
center?: CenterProp;
|
|
55
|
+
|
|
56
|
+
// UI Controls
|
|
57
|
+
showsMyLocationButton?: boolean;
|
|
58
|
+
compass?: boolean;
|
|
59
|
+
scaleBar?: boolean;
|
|
60
|
+
zoomControl?: boolean;
|
|
61
|
+
|
|
62
|
+
// Map settings
|
|
63
|
+
mapType?: WithDefault<Int32, 0>;
|
|
64
|
+
minZoomLevel?: WithDefault<Double, 0>;
|
|
65
|
+
maxZoomLevel?: WithDefault<Double, 21>;
|
|
66
|
+
buildingHeight?: WithDefault<Float, 1>;
|
|
67
|
+
nightMode?: boolean;
|
|
68
|
+
mapPadding?: PaddingProp;
|
|
69
|
+
locationTrackingMode?: WithDefault<Int32, 0>;
|
|
70
|
+
|
|
71
|
+
// Gestures
|
|
72
|
+
scrollGesturesEnabled?: WithDefault<boolean, true>;
|
|
73
|
+
zoomGesturesEnabled?: WithDefault<boolean, true>;
|
|
74
|
+
tiltGesturesEnabled?: WithDefault<boolean, true>;
|
|
75
|
+
rotateGesturesEnabled?: WithDefault<boolean, true>;
|
|
76
|
+
stopGesturesEnabled?: WithDefault<boolean, true>;
|
|
77
|
+
|
|
78
|
+
// Events
|
|
79
|
+
onInitialized?: DirectEventHandler<OnInitializedEvent>;
|
|
80
|
+
onCameraChange?: DirectEventHandler<OnCameraChangeEvent>;
|
|
81
|
+
onTouch?: DirectEventHandler<OnTouchEvent>;
|
|
82
|
+
onMapClick?: DirectEventHandler<OnMapClickEvent>;
|
|
83
|
+
onMarkerClick?: DirectEventHandler<OnMarkerClickEvent>;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
type ComponentType = HostComponent<NativeProps>;
|
|
87
|
+
|
|
88
|
+
interface NativeCommands {
|
|
89
|
+
animateToCoordinate: (viewRef: React.ElementRef<ComponentType>, latitude: Double, longitude: Double) => void;
|
|
90
|
+
animateToTwoCoordinates: (
|
|
91
|
+
viewRef: React.ElementRef<ComponentType>,
|
|
92
|
+
lat1: Double,
|
|
93
|
+
lng1: Double,
|
|
94
|
+
lat2: Double,
|
|
95
|
+
lng2: Double
|
|
96
|
+
) => void;
|
|
97
|
+
animateToRegion: (
|
|
98
|
+
viewRef: React.ElementRef<ComponentType>,
|
|
99
|
+
latitude: Double,
|
|
100
|
+
longitude: Double,
|
|
101
|
+
latitudeDelta: Double,
|
|
102
|
+
longitudeDelta: Double
|
|
103
|
+
) => void;
|
|
104
|
+
setLayerGroupEnabled: (viewRef: React.ElementRef<ComponentType>, group: string, enabled: boolean) => void;
|
|
105
|
+
// Marker
|
|
106
|
+
addMarker: (
|
|
107
|
+
viewRef: React.ElementRef<ComponentType>,
|
|
108
|
+
identifier: string,
|
|
109
|
+
latitude: Double,
|
|
110
|
+
longitude: Double,
|
|
111
|
+
width: Int32,
|
|
112
|
+
height: Int32,
|
|
113
|
+
zIndex: Int32,
|
|
114
|
+
rotation: Float,
|
|
115
|
+
flat: boolean,
|
|
116
|
+
alpha: Float,
|
|
117
|
+
pinColor: Int32,
|
|
118
|
+
image: string
|
|
119
|
+
) => void;
|
|
120
|
+
updateMarker: (
|
|
121
|
+
viewRef: React.ElementRef<ComponentType>,
|
|
122
|
+
identifier: string,
|
|
123
|
+
latitude: Double,
|
|
124
|
+
longitude: Double,
|
|
125
|
+
width: Int32,
|
|
126
|
+
height: Int32,
|
|
127
|
+
zIndex: Int32,
|
|
128
|
+
rotation: Float,
|
|
129
|
+
flat: boolean,
|
|
130
|
+
alpha: Float,
|
|
131
|
+
pinColor: Int32,
|
|
132
|
+
image: string
|
|
133
|
+
) => void;
|
|
134
|
+
removeMarker: (viewRef: React.ElementRef<ComponentType>, identifier: string) => void;
|
|
135
|
+
// Polyline
|
|
136
|
+
addPolyline: (
|
|
137
|
+
viewRef: React.ElementRef<ComponentType>,
|
|
138
|
+
identifier: string,
|
|
139
|
+
coordsJson: string,
|
|
140
|
+
strokeWidth: Float,
|
|
141
|
+
strokeColor: Int32,
|
|
142
|
+
zIndex: Int32,
|
|
143
|
+
lineCap: Int32,
|
|
144
|
+
lineJoin: Int32,
|
|
145
|
+
patternJson: string
|
|
146
|
+
) => void;
|
|
147
|
+
updatePolyline: (
|
|
148
|
+
viewRef: React.ElementRef<ComponentType>,
|
|
149
|
+
identifier: string,
|
|
150
|
+
coordsJson: string,
|
|
151
|
+
strokeWidth: Float,
|
|
152
|
+
strokeColor: Int32,
|
|
153
|
+
zIndex: Int32,
|
|
154
|
+
lineCap: Int32,
|
|
155
|
+
lineJoin: Int32,
|
|
156
|
+
patternJson: string
|
|
157
|
+
) => void;
|
|
158
|
+
removePolyline: (viewRef: React.ElementRef<ComponentType>, identifier: string) => void;
|
|
159
|
+
// Polygon
|
|
160
|
+
addPolygon: (
|
|
161
|
+
viewRef: React.ElementRef<ComponentType>,
|
|
162
|
+
identifier: string,
|
|
163
|
+
coordsJson: string,
|
|
164
|
+
holesJson: string,
|
|
165
|
+
fillColor: Int32,
|
|
166
|
+
strokeColor: Int32,
|
|
167
|
+
strokeWidth: Float,
|
|
168
|
+
zIndex: Int32
|
|
169
|
+
) => void;
|
|
170
|
+
updatePolygon: (
|
|
171
|
+
viewRef: React.ElementRef<ComponentType>,
|
|
172
|
+
identifier: string,
|
|
173
|
+
coordsJson: string,
|
|
174
|
+
holesJson: string,
|
|
175
|
+
fillColor: Int32,
|
|
176
|
+
strokeColor: Int32,
|
|
177
|
+
strokeWidth: Float,
|
|
178
|
+
zIndex: Int32
|
|
179
|
+
) => void;
|
|
180
|
+
removePolygon: (viewRef: React.ElementRef<ComponentType>, identifier: string) => void;
|
|
181
|
+
// Circle
|
|
182
|
+
addCircle: (
|
|
183
|
+
viewRef: React.ElementRef<ComponentType>,
|
|
184
|
+
identifier: string,
|
|
185
|
+
latitude: Double,
|
|
186
|
+
longitude: Double,
|
|
187
|
+
radius: Double,
|
|
188
|
+
fillColor: Int32,
|
|
189
|
+
strokeColor: Int32,
|
|
190
|
+
strokeWidth: Float,
|
|
191
|
+
zIndex: Int32
|
|
192
|
+
) => void;
|
|
193
|
+
updateCircle: (
|
|
194
|
+
viewRef: React.ElementRef<ComponentType>,
|
|
195
|
+
identifier: string,
|
|
196
|
+
latitude: Double,
|
|
197
|
+
longitude: Double,
|
|
198
|
+
radius: Double,
|
|
199
|
+
fillColor: Int32,
|
|
200
|
+
strokeColor: Int32,
|
|
201
|
+
strokeWidth: Float,
|
|
202
|
+
zIndex: Int32
|
|
203
|
+
) => void;
|
|
204
|
+
removeCircle: (viewRef: React.ElementRef<ComponentType>, identifier: string) => void;
|
|
205
|
+
// Path
|
|
206
|
+
addPath: (
|
|
207
|
+
viewRef: React.ElementRef<ComponentType>,
|
|
208
|
+
identifier: string,
|
|
209
|
+
coordsJson: string,
|
|
210
|
+
width: Float,
|
|
211
|
+
outlineWidth: Float,
|
|
212
|
+
color: Int32,
|
|
213
|
+
outlineColor: Int32,
|
|
214
|
+
passedColor: Int32,
|
|
215
|
+
passedOutlineColor: Int32,
|
|
216
|
+
patternImage: string,
|
|
217
|
+
patternInterval: Int32,
|
|
218
|
+
progress: Float,
|
|
219
|
+
zIndex: Int32
|
|
220
|
+
) => void;
|
|
221
|
+
updatePath: (
|
|
222
|
+
viewRef: React.ElementRef<ComponentType>,
|
|
223
|
+
identifier: string,
|
|
224
|
+
coordsJson: string,
|
|
225
|
+
width: Float,
|
|
226
|
+
outlineWidth: Float,
|
|
227
|
+
color: Int32,
|
|
228
|
+
outlineColor: Int32,
|
|
229
|
+
passedColor: Int32,
|
|
230
|
+
passedOutlineColor: Int32,
|
|
231
|
+
patternImage: string,
|
|
232
|
+
patternInterval: Int32,
|
|
233
|
+
progress: Float,
|
|
234
|
+
zIndex: Int32
|
|
235
|
+
) => void;
|
|
236
|
+
removePath: (viewRef: React.ElementRef<ComponentType>, identifier: string) => void;
|
|
237
|
+
// ArrowheadPath
|
|
238
|
+
addArrowheadPath: (
|
|
239
|
+
viewRef: React.ElementRef<ComponentType>,
|
|
240
|
+
identifier: string,
|
|
241
|
+
coordsJson: string,
|
|
242
|
+
width: Float,
|
|
243
|
+
outlineWidth: Float,
|
|
244
|
+
color: Int32,
|
|
245
|
+
outlineColor: Int32,
|
|
246
|
+
headSizeRatio: Float,
|
|
247
|
+
zIndex: Int32
|
|
248
|
+
) => void;
|
|
249
|
+
updateArrowheadPath: (
|
|
250
|
+
viewRef: React.ElementRef<ComponentType>,
|
|
251
|
+
identifier: string,
|
|
252
|
+
coordsJson: string,
|
|
253
|
+
width: Float,
|
|
254
|
+
outlineWidth: Float,
|
|
255
|
+
color: Int32,
|
|
256
|
+
outlineColor: Int32,
|
|
257
|
+
headSizeRatio: Float,
|
|
258
|
+
zIndex: Int32
|
|
259
|
+
) => void;
|
|
260
|
+
removeArrowheadPath: (viewRef: React.ElementRef<ComponentType>, identifier: string) => void;
|
|
261
|
+
// GroundOverlay
|
|
262
|
+
addGroundOverlay: (
|
|
263
|
+
viewRef: React.ElementRef<ComponentType>,
|
|
264
|
+
identifier: string,
|
|
265
|
+
southWestLat: Double,
|
|
266
|
+
southWestLng: Double,
|
|
267
|
+
northEastLat: Double,
|
|
268
|
+
northEastLng: Double,
|
|
269
|
+
image: string,
|
|
270
|
+
alpha: Float,
|
|
271
|
+
zIndex: Int32
|
|
272
|
+
) => void;
|
|
273
|
+
updateGroundOverlay: (
|
|
274
|
+
viewRef: React.ElementRef<ComponentType>,
|
|
275
|
+
identifier: string,
|
|
276
|
+
southWestLat: Double,
|
|
277
|
+
southWestLng: Double,
|
|
278
|
+
northEastLat: Double,
|
|
279
|
+
northEastLng: Double,
|
|
280
|
+
image: string,
|
|
281
|
+
alpha: Float,
|
|
282
|
+
zIndex: Int32
|
|
283
|
+
) => void;
|
|
284
|
+
removeGroundOverlay: (viewRef: React.ElementRef<ComponentType>, identifier: string) => void;
|
|
285
|
+
// InfoWindow
|
|
286
|
+
addInfoWindow: (
|
|
287
|
+
viewRef: React.ElementRef<ComponentType>,
|
|
288
|
+
identifier: string,
|
|
289
|
+
latitude: Double,
|
|
290
|
+
longitude: Double,
|
|
291
|
+
text: string,
|
|
292
|
+
alpha: Float,
|
|
293
|
+
zIndex: Int32,
|
|
294
|
+
offsetX: Int32,
|
|
295
|
+
offsetY: Int32
|
|
296
|
+
) => void;
|
|
297
|
+
updateInfoWindow: (
|
|
298
|
+
viewRef: React.ElementRef<ComponentType>,
|
|
299
|
+
identifier: string,
|
|
300
|
+
latitude: Double,
|
|
301
|
+
longitude: Double,
|
|
302
|
+
text: string,
|
|
303
|
+
alpha: Float,
|
|
304
|
+
zIndex: Int32,
|
|
305
|
+
offsetX: Int32,
|
|
306
|
+
offsetY: Int32
|
|
307
|
+
) => void;
|
|
308
|
+
removeInfoWindow: (viewRef: React.ElementRef<ComponentType>, identifier: string) => void;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
export const Commands: NativeCommands = codegenNativeCommands<NativeCommands>({
|
|
312
|
+
supportedCommands: [
|
|
313
|
+
'animateToCoordinate',
|
|
314
|
+
'animateToTwoCoordinates',
|
|
315
|
+
'animateToRegion',
|
|
316
|
+
'setLayerGroupEnabled',
|
|
317
|
+
// Marker
|
|
318
|
+
'addMarker',
|
|
319
|
+
'updateMarker',
|
|
320
|
+
'removeMarker',
|
|
321
|
+
// Polyline
|
|
322
|
+
'addPolyline',
|
|
323
|
+
'updatePolyline',
|
|
324
|
+
'removePolyline',
|
|
325
|
+
// Polygon
|
|
326
|
+
'addPolygon',
|
|
327
|
+
'updatePolygon',
|
|
328
|
+
'removePolygon',
|
|
329
|
+
// Circle
|
|
330
|
+
'addCircle',
|
|
331
|
+
'updateCircle',
|
|
332
|
+
'removeCircle',
|
|
333
|
+
// Path
|
|
334
|
+
'addPath',
|
|
335
|
+
'updatePath',
|
|
336
|
+
'removePath',
|
|
337
|
+
// ArrowheadPath
|
|
338
|
+
'addArrowheadPath',
|
|
339
|
+
'updateArrowheadPath',
|
|
340
|
+
'removeArrowheadPath',
|
|
341
|
+
// GroundOverlay
|
|
342
|
+
'addGroundOverlay',
|
|
343
|
+
'updateGroundOverlay',
|
|
344
|
+
'removeGroundOverlay',
|
|
345
|
+
// InfoWindow
|
|
346
|
+
'addInfoWindow',
|
|
347
|
+
'updateInfoWindow',
|
|
348
|
+
'removeInfoWindow',
|
|
349
|
+
],
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
export default codegenNativeComponent<NativeProps>('GraniteNaverMapView') as ComponentType;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/Coord.ts"],"mappings":"","ignoreList":[]}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
export * from "./Coord.js";
|
|
4
|
+
|
|
5
|
+
// ============================================================
|
|
6
|
+
// Event Types
|
|
7
|
+
// ============================================================
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Camera change event data
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Touch event data
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Map click event data
|
|
19
|
+
*/
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Marker click event data
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
// ============================================================
|
|
26
|
+
// Component Props
|
|
27
|
+
// ============================================================
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sourceRoot":"../../../src","sources":["types/index.ts"],"mappings":";;AAQA,cAAc,YAAS;;AAEvB;AACA;AACA;;AAEA;AACA;AACA;;AAOA;AACA;AACA;;AAMA;AACA;AACA;;AAQA;AACA;AACA;;AAKA;AACA;AACA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type NativeSyntheticEvent, type StyleProp, type ViewStyle } from 'react-native';
|
|
3
|
+
import { OnCameraChangeEvent, OnTouchEvent, OnMapClickEvent } from './specs/GraniteNaverMapViewNativeComponent';
|
|
4
|
+
import type { Coord } from './types';
|
|
5
|
+
export interface MapViewProps {
|
|
6
|
+
style?: StyleProp<ViewStyle>;
|
|
7
|
+
center?: Coord & {
|
|
8
|
+
zoom?: number;
|
|
9
|
+
tilt?: number;
|
|
10
|
+
bearing?: number;
|
|
11
|
+
};
|
|
12
|
+
showsMyLocationButton?: boolean;
|
|
13
|
+
compass?: boolean;
|
|
14
|
+
scaleBar?: boolean;
|
|
15
|
+
zoomControl?: boolean;
|
|
16
|
+
mapType?: number;
|
|
17
|
+
minZoomLevel?: number;
|
|
18
|
+
maxZoomLevel?: number;
|
|
19
|
+
buildingHeight?: number;
|
|
20
|
+
locationTrackingMode?: number;
|
|
21
|
+
tilt?: number;
|
|
22
|
+
bearing?: number;
|
|
23
|
+
nightMode?: boolean;
|
|
24
|
+
mapPadding?: {
|
|
25
|
+
top?: number;
|
|
26
|
+
left?: number;
|
|
27
|
+
bottom?: number;
|
|
28
|
+
right?: number;
|
|
29
|
+
};
|
|
30
|
+
scrollGesturesEnabled?: boolean;
|
|
31
|
+
zoomGesturesEnabled?: boolean;
|
|
32
|
+
tiltGesturesEnabled?: boolean;
|
|
33
|
+
rotateGesturesEnabled?: boolean;
|
|
34
|
+
stopGesturesEnabled?: boolean;
|
|
35
|
+
onCameraChange?: (event: NativeSyntheticEvent<OnCameraChangeEvent>) => void;
|
|
36
|
+
onTouch?: (event: NativeSyntheticEvent<OnTouchEvent>) => void;
|
|
37
|
+
onMapClick?: (event: NativeSyntheticEvent<OnMapClickEvent>) => void;
|
|
38
|
+
onInitialized?: () => void;
|
|
39
|
+
children?: React.ReactNode;
|
|
40
|
+
}
|
|
41
|
+
export declare function NaverMapView({ style, onTouch, onMapClick, onCameraChange, onInitialized, children, center, mapPadding, ...props }: MapViewProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const rgbaToArgb: (rgba: number) => number;
|
|
2
|
+
export declare const toSignedInt32: (n: number) => number;
|
|
3
|
+
export declare const processColor: (color: number | null | undefined, defaultColor?: number) => number;
|
|
4
|
+
export declare const processArgbColor: (color: number | null | undefined, defaultColor?: number) => number;
|
|
5
|
+
/**
|
|
6
|
+
* Process raw color input from user (handles both string and number inputs)
|
|
7
|
+
* - String colors (e.g., "#FF0000", "red") → normalize → RRGGBBAA → convert to AARRGGBB → signed
|
|
8
|
+
* - Number colors (e.g., 0xFFFF0000) → assume AARRGGBB → just convert to signed
|
|
9
|
+
*/
|
|
10
|
+
export declare const processColorInput: (color: number | string | null | undefined, defaultColorArgb?: number) => number;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { View } from 'react-native';
|
|
2
|
+
import type { MarkerEventListeners } from '../overlays/Marker';
|
|
3
|
+
export interface MapContextValue {
|
|
4
|
+
readonly mapView: View;
|
|
5
|
+
markers: Map<string, MarkerEventListeners>;
|
|
6
|
+
}
|
|
7
|
+
export declare const MapContext: import("react").Context<MapContextValue | null>;
|
|
8
|
+
export declare function useMapContext(): MapContextValue | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useOverlayId(): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { View } from 'react-native';
|
|
2
|
+
import { type MapContextValue } from './context';
|
|
3
|
+
interface MapOverlayProps<EventListeners, Props> {
|
|
4
|
+
registrySelector: (c: MapContextValue) => Map<string, Partial<EventListeners>>;
|
|
5
|
+
methods: MapOverlayMethods<Props>;
|
|
6
|
+
props: Props;
|
|
7
|
+
eventListeners: Partial<EventListeners>;
|
|
8
|
+
}
|
|
9
|
+
interface MapOverlayMethods<Props> {
|
|
10
|
+
add: (v: View, id: string, args: Props) => void;
|
|
11
|
+
update: (v: View, id: string, args: Props) => void;
|
|
12
|
+
remove: (v: View, id: string) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function useMapOverlay<EventListeners, Props>({ props, eventListeners, methods, registrySelector, }: MapOverlayProps<EventListeners, Props>): void;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a memoized reference that only changes when the object's content changes.
|
|
3
|
+
* This is useful for preventing unnecessary re-renders when object references change
|
|
4
|
+
* but the content remains the same.
|
|
5
|
+
*/
|
|
6
|
+
export declare function usePreservedReference<T>(value: T): T;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Coord } from '../types/Coord';
|
|
2
|
+
export interface ArrowheadPathProps {
|
|
3
|
+
coordinates: Coord[];
|
|
4
|
+
color?: number | string;
|
|
5
|
+
outlineColor?: number | string;
|
|
6
|
+
width?: number;
|
|
7
|
+
outlineWidth?: number;
|
|
8
|
+
headSizeRatio?: number;
|
|
9
|
+
zIndex?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function ArrowheadPath(props: ArrowheadPathProps): null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Coord } from '../types/Coord';
|
|
2
|
+
export interface CircleProps {
|
|
3
|
+
center: Coord;
|
|
4
|
+
radius: number;
|
|
5
|
+
fillColor?: number | string;
|
|
6
|
+
strokeColor?: number | string;
|
|
7
|
+
strokeWidth?: number;
|
|
8
|
+
zIndex?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function Circle(props: CircleProps): null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Coord } from '../types/Coord';
|
|
2
|
+
export interface GroundOverlayProps {
|
|
3
|
+
bounds: {
|
|
4
|
+
northEast: Coord;
|
|
5
|
+
southWest: Coord;
|
|
6
|
+
};
|
|
7
|
+
image: string;
|
|
8
|
+
alpha?: number;
|
|
9
|
+
zIndex?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function GroundOverlay(props: GroundOverlayProps): null;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Coord } from '../types/Coord';
|
|
2
|
+
export interface InfoWindowProps {
|
|
3
|
+
coordinate: Coord;
|
|
4
|
+
text: string;
|
|
5
|
+
alpha?: number;
|
|
6
|
+
zIndex?: number;
|
|
7
|
+
offsetX?: number;
|
|
8
|
+
offsetY?: number;
|
|
9
|
+
onPress?: () => void;
|
|
10
|
+
}
|
|
11
|
+
export interface InfoWindowEventListeners {
|
|
12
|
+
onPress?: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function InfoWindow(props: InfoWindowProps): null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Coord } from '../types/Coord';
|
|
2
|
+
export interface MarkerProps extends MarkerEventListeners {
|
|
3
|
+
coordinate: Coord;
|
|
4
|
+
pinColor?: number | string;
|
|
5
|
+
image?: string;
|
|
6
|
+
rotation?: number;
|
|
7
|
+
flat?: boolean;
|
|
8
|
+
width?: number;
|
|
9
|
+
height?: number;
|
|
10
|
+
alpha?: number;
|
|
11
|
+
zIndex?: number;
|
|
12
|
+
}
|
|
13
|
+
export interface MarkerEventListeners {
|
|
14
|
+
onPress?: () => void;
|
|
15
|
+
}
|
|
16
|
+
export declare function Marker(props: MarkerProps): null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Coord } from '../types/Coord';
|
|
2
|
+
export interface PathProps {
|
|
3
|
+
coordinates: Coord[];
|
|
4
|
+
color?: number | string;
|
|
5
|
+
outlineColor?: number | string;
|
|
6
|
+
passedColor?: number | string;
|
|
7
|
+
passedOutlineColor?: number | string;
|
|
8
|
+
width?: number;
|
|
9
|
+
outlineWidth?: number;
|
|
10
|
+
patternImage?: string;
|
|
11
|
+
patternInterval?: number;
|
|
12
|
+
progress?: number;
|
|
13
|
+
zIndex?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function Path(props: PathProps): null;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Coord } from '../types/Coord';
|
|
2
|
+
export interface PolygonProps {
|
|
3
|
+
coordinates: Coord[];
|
|
4
|
+
holes?: Coord[][];
|
|
5
|
+
fillColor?: number | string;
|
|
6
|
+
strokeColor?: number | string;
|
|
7
|
+
strokeWidth?: number;
|
|
8
|
+
zIndex?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function Polygon(props: PolygonProps): null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Coord } from '../types/Coord';
|
|
2
|
+
export interface PolylineProps {
|
|
3
|
+
coordinates: Coord[];
|
|
4
|
+
strokeColor?: number | string;
|
|
5
|
+
strokeWidth?: number;
|
|
6
|
+
zIndex?: number;
|
|
7
|
+
lineCap?: 'butt' | 'round' | 'square';
|
|
8
|
+
lineJoin?: 'bevel' | 'miter' | 'round';
|
|
9
|
+
pattern?: number[];
|
|
10
|
+
}
|
|
11
|
+
export declare function Polyline(props: PolylineProps): null;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { Marker } from './Marker';
|
|
2
|
+
export type { MarkerProps, MarkerEventListeners } from './Marker';
|
|
3
|
+
export { Polyline } from './Polyline';
|
|
4
|
+
export type { PolylineProps } from './Polyline';
|
|
5
|
+
export { Polygon } from './Polygon';
|
|
6
|
+
export type { PolygonProps } from './Polygon';
|
|
7
|
+
export { Circle } from './Circle';
|
|
8
|
+
export type { CircleProps } from './Circle';
|
|
9
|
+
export { Path } from './Path';
|
|
10
|
+
export type { PathProps } from './Path';
|
|
11
|
+
export { ArrowheadPath } from './ArrowheadPath';
|
|
12
|
+
export type { ArrowheadPathProps } from './ArrowheadPath';
|
|
13
|
+
export { GroundOverlay } from './GroundOverlay';
|
|
14
|
+
export type { GroundOverlayProps } from './GroundOverlay';
|
|
15
|
+
export { InfoWindow } from './InfoWindow';
|
|
16
|
+
export type { InfoWindowProps, InfoWindowEventListeners } from './InfoWindow';
|