@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.
Files changed (104) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/GraniteNaverMap.podspec +81 -0
  3. package/android/build.gradle +160 -0
  4. package/android/gradle.properties +5 -0
  5. package/android/src/builtinProvider/java/run/granite/navermap/builtinProvider/BuiltInGraniteNaverMapProvider.kt +549 -0
  6. package/android/src/main/AndroidManifest.xml +3 -0
  7. package/android/src/main/java/run/granite/navermap/GraniteNaverMapEvents.kt +91 -0
  8. package/android/src/main/java/run/granite/navermap/GraniteNaverMapPackage.kt +16 -0
  9. package/android/src/main/java/run/granite/navermap/GraniteNaverMapProvider.kt +242 -0
  10. package/android/src/main/java/run/granite/navermap/GraniteNaverMapRegistry.kt +116 -0
  11. package/android/src/main/java/run/granite/navermap/GraniteNaverMapView.kt +732 -0
  12. package/android/src/newarch/java/run/granite/navermap/GraniteNaverMapViewManager.kt +446 -0
  13. package/android/src/oldarch/java/run/granite/navermap/GraniteNaverMapViewManager.kt +249 -0
  14. package/dist/module/NaverMapView.js +110 -0
  15. package/dist/module/NaverMapView.js.map +1 -0
  16. package/dist/module/index.js +6 -0
  17. package/dist/module/index.js.map +1 -0
  18. package/dist/module/internals/colorUtils.js +624 -0
  19. package/dist/module/internals/colorUtils.js.map +1 -0
  20. package/dist/module/internals/context.js +8 -0
  21. package/dist/module/internals/context.js.map +1 -0
  22. package/dist/module/internals/id.js +10 -0
  23. package/dist/module/internals/id.js.map +1 -0
  24. package/dist/module/internals/useMapOverlay.js +44 -0
  25. package/dist/module/internals/useMapOverlay.js.map +1 -0
  26. package/dist/module/internals/usePreservedReference.js +36 -0
  27. package/dist/module/internals/usePreservedReference.js.map +1 -0
  28. package/dist/module/overlays/ArrowheadPath.js +37 -0
  29. package/dist/module/overlays/ArrowheadPath.js.map +1 -0
  30. package/dist/module/overlays/Circle.js +35 -0
  31. package/dist/module/overlays/Circle.js.map +1 -0
  32. package/dist/module/overlays/GroundOverlay.js +30 -0
  33. package/dist/module/overlays/GroundOverlay.js.map +1 -0
  34. package/dist/module/overlays/InfoWindow.js +32 -0
  35. package/dist/module/overlays/InfoWindow.js.map +1 -0
  36. package/dist/module/overlays/Marker.js +37 -0
  37. package/dist/module/overlays/Marker.js.map +1 -0
  38. package/dist/module/overlays/Path.js +41 -0
  39. package/dist/module/overlays/Path.js.map +1 -0
  40. package/dist/module/overlays/Polygon.js +51 -0
  41. package/dist/module/overlays/Polygon.js.map +1 -0
  42. package/dist/module/overlays/Polyline.js +60 -0
  43. package/dist/module/overlays/Polyline.js.map +1 -0
  44. package/dist/module/overlays/index.js +11 -0
  45. package/dist/module/overlays/index.js.map +1 -0
  46. package/dist/module/package.json +1 -0
  47. package/dist/module/specs/GraniteNaverMapViewNativeComponent.ts +352 -0
  48. package/dist/module/types/Coord.js +2 -0
  49. package/dist/module/types/Coord.js.map +1 -0
  50. package/dist/module/types/index.js +29 -0
  51. package/dist/module/types/index.js.map +1 -0
  52. package/dist/typescript/NaverMapView.d.ts +41 -0
  53. package/dist/typescript/index.d.ts +3 -0
  54. package/dist/typescript/internals/colorUtils.d.ts +10 -0
  55. package/dist/typescript/internals/context.d.ts +8 -0
  56. package/dist/typescript/internals/id.d.ts +1 -0
  57. package/dist/typescript/internals/useMapOverlay.d.ts +15 -0
  58. package/dist/typescript/internals/usePreservedReference.d.ts +6 -0
  59. package/dist/typescript/overlays/ArrowheadPath.d.ts +11 -0
  60. package/dist/typescript/overlays/Circle.d.ts +10 -0
  61. package/dist/typescript/overlays/GroundOverlay.d.ts +11 -0
  62. package/dist/typescript/overlays/InfoWindow.d.ts +14 -0
  63. package/dist/typescript/overlays/Marker.d.ts +16 -0
  64. package/dist/typescript/overlays/Path.d.ts +15 -0
  65. package/dist/typescript/overlays/Polygon.d.ts +10 -0
  66. package/dist/typescript/overlays/Polyline.d.ts +11 -0
  67. package/dist/typescript/overlays/index.d.ts +16 -0
  68. package/dist/typescript/specs/GraniteNaverMapViewNativeComponent.d.ts +92 -0
  69. package/dist/typescript/types/Coord.d.ts +4 -0
  70. package/dist/typescript/types/index.d.ts +55 -0
  71. package/ios/GraniteNaverMap-Bridging-Header.h +20 -0
  72. package/ios/GraniteNaverMapProvider.swift +312 -0
  73. package/ios/GraniteNaverMapRegistry.swift +91 -0
  74. package/ios/GraniteNaverMapView.h +15 -0
  75. package/ios/GraniteNaverMapView.mm +390 -0
  76. package/ios/GraniteNaverMapViewImpl.swift +496 -0
  77. package/ios/GraniteNaverMapViewManager.m +67 -0
  78. package/ios/GraniteNaverMapViewManager.swift +133 -0
  79. package/ios/GraniteNaverMapViewWrapper.swift +215 -0
  80. package/ios/builtinProvider/BuiltInNaverMapProvider.swift +489 -0
  81. package/ios/builtinProvider/GraniteNaverMapMarkerData.swift +66 -0
  82. package/ios/builtinProvider/NMFMarker+Extension.swift +65 -0
  83. package/ios/builtinProvider/RCTConvert+NMFMapView.h +17 -0
  84. package/ios/builtinProvider/RCTConvert+NMFMapView.m +67 -0
  85. package/package.json +103 -0
  86. package/src/NaverMapView.tsx +168 -0
  87. package/src/index.tsx +3 -0
  88. package/src/internals/colorUtils.ts +697 -0
  89. package/src/internals/context.ts +14 -0
  90. package/src/internals/id.ts +9 -0
  91. package/src/internals/useMapOverlay.ts +59 -0
  92. package/src/internals/usePreservedReference.ts +41 -0
  93. package/src/overlays/ArrowheadPath.ts +71 -0
  94. package/src/overlays/Circle.ts +68 -0
  95. package/src/overlays/GroundOverlay.ts +62 -0
  96. package/src/overlays/InfoWindow.ts +68 -0
  97. package/src/overlays/Marker.ts +83 -0
  98. package/src/overlays/Path.ts +87 -0
  99. package/src/overlays/Polygon.ts +83 -0
  100. package/src/overlays/Polyline.ts +93 -0
  101. package/src/overlays/index.ts +23 -0
  102. package/src/specs/GraniteNaverMapViewNativeComponent.ts +352 -0
  103. package/src/types/Coord.ts +4 -0
  104. package/src/types/index.ts +78 -0
@@ -0,0 +1,390 @@
1
+ //
2
+ // GraniteNaverMapView.mm
3
+ // GraniteNaverMap
4
+ //
5
+
6
+ #import <UIKit/UIKit.h>
7
+
8
+ #import <React/RCTViewComponentView.h>
9
+ #import <React/RCTConversions.h>
10
+ #import <React/RCTFabricComponentsPlugins.h>
11
+ #import <React/RCTComponentViewFactory.h>
12
+
13
+ #import <react/renderer/components/GraniteNaverMapViewSpec/ComponentDescriptors.h>
14
+ #import <react/renderer/components/GraniteNaverMapViewSpec/EventEmitters.h>
15
+ #import <react/renderer/components/GraniteNaverMapViewSpec/Props.h>
16
+ #import <react/renderer/components/GraniteNaverMapViewSpec/RCTComponentViewHelpers.h>
17
+
18
+ // Import Swift module - the header is generated during build
19
+ #if __has_include(<GraniteNaverMap/GraniteNaverMap-Swift.h>)
20
+ #import <GraniteNaverMap/GraniteNaverMap-Swift.h>
21
+ #elif __has_include(<granite_naver_map/granite_naver_map-Swift.h>)
22
+ #import <granite_naver_map/granite_naver_map-Swift.h>
23
+ #else
24
+ #import "GraniteNaverMap-Swift.h"
25
+ #endif
26
+
27
+ using namespace facebook::react;
28
+
29
+ // Define GraniteNaverMapView inheriting from RCTViewComponentView here in .mm file
30
+ // The header declares it as UIView to avoid exposing C++ headers to Swift module
31
+ @interface GraniteNaverMapView : RCTViewComponentView <RCTGraniteNaverMapViewViewProtocol, GraniteNaverMapViewDelegate>
32
+ @end
33
+
34
+ @implementation GraniteNaverMapView {
35
+ GraniteNaverMapViewImpl *_mapView;
36
+ NSMutableDictionary<NSString *, id> *_markers;
37
+ }
38
+
39
+ + (ComponentDescriptorProvider)componentDescriptorProvider
40
+ {
41
+ return concreteComponentDescriptorProvider<GraniteNaverMapViewComponentDescriptor>();
42
+ }
43
+
44
+ - (instancetype)initWithFrame:(CGRect)frame
45
+ {
46
+ if (self = [super initWithFrame:frame]) {
47
+ static const auto defaultProps = std::make_shared<const GraniteNaverMapViewProps>();
48
+ _props = defaultProps;
49
+
50
+ _mapView = [[GraniteNaverMapViewImpl alloc] initWithFrame:self.bounds];
51
+ _mapView.eventDelegate = self;
52
+ _markers = [NSMutableDictionary new];
53
+
54
+ self.contentView = _mapView;
55
+ }
56
+ return self;
57
+ }
58
+
59
+ - (void)updateProps:(Props::Shared const &)props oldProps:(Props::Shared const &)oldProps
60
+ {
61
+ const auto &oldViewProps = *std::static_pointer_cast<GraniteNaverMapViewProps const>(_props);
62
+ const auto &newViewProps = *std::static_pointer_cast<GraniteNaverMapViewProps const>(props);
63
+
64
+ // center
65
+ if (oldViewProps.center.latitude != newViewProps.center.latitude ||
66
+ oldViewProps.center.longitude != newViewProps.center.longitude ||
67
+ oldViewProps.center.zoom != newViewProps.center.zoom ||
68
+ oldViewProps.center.tilt != newViewProps.center.tilt ||
69
+ oldViewProps.center.bearing != newViewProps.center.bearing) {
70
+ [_mapView setCenterWithLatitude:newViewProps.center.latitude
71
+ longitude:newViewProps.center.longitude
72
+ zoom:newViewProps.center.zoom
73
+ tilt:newViewProps.center.tilt
74
+ bearing:newViewProps.center.bearing];
75
+ }
76
+
77
+ // showsMyLocationButton
78
+ if (oldViewProps.showsMyLocationButton != newViewProps.showsMyLocationButton) {
79
+ _mapView.showsMyLocationButton = newViewProps.showsMyLocationButton;
80
+ }
81
+
82
+ // compass
83
+ if (oldViewProps.compass != newViewProps.compass) {
84
+ _mapView.compass = newViewProps.compass;
85
+ }
86
+
87
+ // scaleBar
88
+ if (oldViewProps.scaleBar != newViewProps.scaleBar) {
89
+ _mapView.scaleBar = newViewProps.scaleBar;
90
+ }
91
+
92
+ // zoomControl
93
+ if (oldViewProps.zoomControl != newViewProps.zoomControl) {
94
+ _mapView.zoomControl = newViewProps.zoomControl;
95
+ }
96
+
97
+ // mapType
98
+ if (oldViewProps.mapType != newViewProps.mapType) {
99
+ [_mapView setMapType:newViewProps.mapType];
100
+ }
101
+
102
+ // minZoomLevel
103
+ if (oldViewProps.minZoomLevel != newViewProps.minZoomLevel) {
104
+ _mapView.minZoomLevel = newViewProps.minZoomLevel;
105
+ }
106
+
107
+ // maxZoomLevel
108
+ if (oldViewProps.maxZoomLevel != newViewProps.maxZoomLevel) {
109
+ _mapView.maxZoomLevel = newViewProps.maxZoomLevel;
110
+ }
111
+
112
+ // buildingHeight
113
+ if (oldViewProps.buildingHeight != newViewProps.buildingHeight) {
114
+ _mapView.buildingHeight = newViewProps.buildingHeight;
115
+ }
116
+
117
+ // nightMode
118
+ if (oldViewProps.nightMode != newViewProps.nightMode) {
119
+ _mapView.nightMode = newViewProps.nightMode;
120
+ }
121
+
122
+ // mapPadding
123
+ if (oldViewProps.mapPadding.top != newViewProps.mapPadding.top ||
124
+ oldViewProps.mapPadding.left != newViewProps.mapPadding.left ||
125
+ oldViewProps.mapPadding.bottom != newViewProps.mapPadding.bottom ||
126
+ oldViewProps.mapPadding.right != newViewProps.mapPadding.right) {
127
+ UIEdgeInsets padding = UIEdgeInsetsMake(
128
+ newViewProps.mapPadding.top,
129
+ newViewProps.mapPadding.left,
130
+ newViewProps.mapPadding.bottom,
131
+ newViewProps.mapPadding.right
132
+ );
133
+ _mapView.mapPadding = padding;
134
+ }
135
+
136
+ // locationTrackingMode
137
+ if (oldViewProps.locationTrackingMode != newViewProps.locationTrackingMode) {
138
+ _mapView.locationTrackingMode = newViewProps.locationTrackingMode;
139
+ }
140
+
141
+ // scrollGesturesEnabled
142
+ if (oldViewProps.scrollGesturesEnabled != newViewProps.scrollGesturesEnabled) {
143
+ _mapView.scrollGesturesEnabled = newViewProps.scrollGesturesEnabled;
144
+ }
145
+
146
+ // zoomGesturesEnabled
147
+ if (oldViewProps.zoomGesturesEnabled != newViewProps.zoomGesturesEnabled) {
148
+ _mapView.zoomGesturesEnabled = newViewProps.zoomGesturesEnabled;
149
+ }
150
+
151
+ // tiltGesturesEnabled
152
+ if (oldViewProps.tiltGesturesEnabled != newViewProps.tiltGesturesEnabled) {
153
+ _mapView.tiltGesturesEnabled = newViewProps.tiltGesturesEnabled;
154
+ }
155
+
156
+ // rotateGesturesEnabled
157
+ if (oldViewProps.rotateGesturesEnabled != newViewProps.rotateGesturesEnabled) {
158
+ _mapView.rotateGesturesEnabled = newViewProps.rotateGesturesEnabled;
159
+ }
160
+
161
+ // stopGesturesEnabled
162
+ if (oldViewProps.stopGesturesEnabled != newViewProps.stopGesturesEnabled) {
163
+ _mapView.stopGesturesEnabled = newViewProps.stopGesturesEnabled;
164
+ }
165
+
166
+ [super updateProps:props oldProps:oldProps];
167
+ }
168
+
169
+ #pragma mark - RCTGraniteNaverMapViewViewProtocol
170
+
171
+ - (void)animateToCoordinate:(double)latitude longitude:(double)longitude
172
+ {
173
+ [_mapView animateToCoordinateWithLatitude:latitude longitude:longitude];
174
+ }
175
+
176
+ - (void)animateToTwoCoordinates:(double)lat1 lng1:(double)lng1 lat2:(double)lat2 lng2:(double)lng2
177
+ {
178
+ [_mapView animateToTwoCoordinatesWithLat1:lat1 lng1:lng1 lat2:lat2 lng2:lng2];
179
+ }
180
+
181
+ - (void)animateToRegion:(double)latitude longitude:(double)longitude latitudeDelta:(double)latitudeDelta longitudeDelta:(double)longitudeDelta
182
+ {
183
+ [_mapView animateToRegionWithLatitude:latitude longitude:longitude latitudeDelta:latitudeDelta longitudeDelta:longitudeDelta];
184
+ }
185
+
186
+ - (void)setLayerGroupEnabled:(NSString *)group enabled:(BOOL)enabled
187
+ {
188
+ [_mapView setLayerGroupEnabledWithGroup:group enabled:enabled];
189
+ }
190
+
191
+ - (void)addMarker:(NSString *)identifier latitude:(double)latitude longitude:(double)longitude width:(NSInteger)width height:(NSInteger)height zIndex:(NSInteger)zIndex rotation:(float)rotation flat:(BOOL)flat alpha:(float)alpha pinColor:(NSInteger)pinColor image:(NSString *)image
192
+ {
193
+ [_mapView addMarkerWithIdentifier:identifier latitude:latitude longitude:longitude width:width height:height zIndex:zIndex rotation:rotation flat:flat alpha:alpha pinColor:pinColor image:image];
194
+ }
195
+
196
+ - (void)updateMarker:(NSString *)identifier latitude:(double)latitude longitude:(double)longitude width:(NSInteger)width height:(NSInteger)height zIndex:(NSInteger)zIndex rotation:(float)rotation flat:(BOOL)flat alpha:(float)alpha pinColor:(NSInteger)pinColor image:(NSString *)image
197
+ {
198
+ [_mapView updateMarkerWithIdentifier:identifier latitude:latitude longitude:longitude width:width height:height zIndex:zIndex rotation:rotation flat:flat alpha:alpha pinColor:pinColor image:image];
199
+ }
200
+
201
+ - (void)removeMarker:(NSString *)identifier
202
+ {
203
+ [_mapView removeMarkerWithIdentifier:identifier];
204
+ }
205
+
206
+ #pragma mark - Polyline Commands
207
+
208
+ - (void)addPolyline:(NSString *)identifier coordsJson:(NSString *)coordsJson strokeWidth:(float)strokeWidth strokeColor:(NSInteger)strokeColor zIndex:(NSInteger)zIndex lineCap:(NSInteger)lineCap lineJoin:(NSInteger)lineJoin patternJson:(NSString *)patternJson
209
+ {
210
+ [_mapView addPolylineWithIdentifier:identifier coordsJson:coordsJson strokeWidth:strokeWidth strokeColor:strokeColor zIndex:zIndex lineCap:lineCap lineJoin:lineJoin patternJson:patternJson];
211
+ }
212
+
213
+ - (void)updatePolyline:(NSString *)identifier coordsJson:(NSString *)coordsJson strokeWidth:(float)strokeWidth strokeColor:(NSInteger)strokeColor zIndex:(NSInteger)zIndex lineCap:(NSInteger)lineCap lineJoin:(NSInteger)lineJoin patternJson:(NSString *)patternJson
214
+ {
215
+ [_mapView updatePolylineWithIdentifier:identifier coordsJson:coordsJson strokeWidth:strokeWidth strokeColor:strokeColor zIndex:zIndex lineCap:lineCap lineJoin:lineJoin patternJson:patternJson];
216
+ }
217
+
218
+ - (void)removePolyline:(NSString *)identifier
219
+ {
220
+ [_mapView removePolylineWithIdentifier:identifier];
221
+ }
222
+
223
+ #pragma mark - Polygon Commands
224
+
225
+ - (void)addPolygon:(NSString *)identifier coordsJson:(NSString *)coordsJson holesJson:(NSString *)holesJson fillColor:(NSInteger)fillColor strokeColor:(NSInteger)strokeColor strokeWidth:(float)strokeWidth zIndex:(NSInteger)zIndex
226
+ {
227
+ [_mapView addPolygonWithIdentifier:identifier coordsJson:coordsJson holesJson:holesJson fillColor:fillColor strokeColor:strokeColor strokeWidth:strokeWidth zIndex:zIndex];
228
+ }
229
+
230
+ - (void)updatePolygon:(NSString *)identifier coordsJson:(NSString *)coordsJson holesJson:(NSString *)holesJson fillColor:(NSInteger)fillColor strokeColor:(NSInteger)strokeColor strokeWidth:(float)strokeWidth zIndex:(NSInteger)zIndex
231
+ {
232
+ [_mapView updatePolygonWithIdentifier:identifier coordsJson:coordsJson holesJson:holesJson fillColor:fillColor strokeColor:strokeColor strokeWidth:strokeWidth zIndex:zIndex];
233
+ }
234
+
235
+ - (void)removePolygon:(NSString *)identifier
236
+ {
237
+ [_mapView removePolygonWithIdentifier:identifier];
238
+ }
239
+
240
+ #pragma mark - Circle Commands
241
+
242
+ - (void)addCircle:(NSString *)identifier latitude:(double)latitude longitude:(double)longitude radius:(double)radius fillColor:(NSInteger)fillColor strokeColor:(NSInteger)strokeColor strokeWidth:(float)strokeWidth zIndex:(NSInteger)zIndex
243
+ {
244
+ [_mapView addCircleWithIdentifier:identifier latitude:latitude longitude:longitude radius:radius fillColor:fillColor strokeColor:strokeColor strokeWidth:strokeWidth zIndex:zIndex];
245
+ }
246
+
247
+ - (void)updateCircle:(NSString *)identifier latitude:(double)latitude longitude:(double)longitude radius:(double)radius fillColor:(NSInteger)fillColor strokeColor:(NSInteger)strokeColor strokeWidth:(float)strokeWidth zIndex:(NSInteger)zIndex
248
+ {
249
+ [_mapView updateCircleWithIdentifier:identifier latitude:latitude longitude:longitude radius:radius fillColor:fillColor strokeColor:strokeColor strokeWidth:strokeWidth zIndex:zIndex];
250
+ }
251
+
252
+ - (void)removeCircle:(NSString *)identifier
253
+ {
254
+ [_mapView removeCircleWithIdentifier:identifier];
255
+ }
256
+
257
+ #pragma mark - Path Commands
258
+
259
+ - (void)addPath:(NSString *)identifier coordsJson:(NSString *)coordsJson width:(float)width outlineWidth:(float)outlineWidth color:(NSInteger)color outlineColor:(NSInteger)outlineColor passedColor:(NSInteger)passedColor passedOutlineColor:(NSInteger)passedOutlineColor patternImage:(NSString *)patternImage patternInterval:(NSInteger)patternInterval progress:(float)progress zIndex:(NSInteger)zIndex
260
+ {
261
+ [_mapView addPathWithIdentifier:identifier coordsJson:coordsJson width:width outlineWidth:outlineWidth color:color outlineColor:outlineColor passedColor:passedColor passedOutlineColor:passedOutlineColor patternImage:patternImage patternInterval:patternInterval progress:progress zIndex:zIndex];
262
+ }
263
+
264
+ - (void)updatePath:(NSString *)identifier coordsJson:(NSString *)coordsJson width:(float)width outlineWidth:(float)outlineWidth color:(NSInteger)color outlineColor:(NSInteger)outlineColor passedColor:(NSInteger)passedColor passedOutlineColor:(NSInteger)passedOutlineColor patternImage:(NSString *)patternImage patternInterval:(NSInteger)patternInterval progress:(float)progress zIndex:(NSInteger)zIndex
265
+ {
266
+ [_mapView updatePathWithIdentifier:identifier coordsJson:coordsJson width:width outlineWidth:outlineWidth color:color outlineColor:outlineColor passedColor:passedColor passedOutlineColor:passedOutlineColor patternImage:patternImage patternInterval:patternInterval progress:progress zIndex:zIndex];
267
+ }
268
+
269
+ - (void)removePath:(NSString *)identifier
270
+ {
271
+ [_mapView removePathWithIdentifier:identifier];
272
+ }
273
+
274
+ #pragma mark - ArrowheadPath Commands
275
+
276
+ - (void)addArrowheadPath:(NSString *)identifier coordsJson:(NSString *)coordsJson width:(float)width outlineWidth:(float)outlineWidth color:(NSInteger)color outlineColor:(NSInteger)outlineColor headSizeRatio:(float)headSizeRatio zIndex:(NSInteger)zIndex
277
+ {
278
+ [_mapView addArrowheadPathWithIdentifier:identifier coordsJson:coordsJson width:width outlineWidth:outlineWidth color:color outlineColor:outlineColor headSizeRatio:headSizeRatio zIndex:zIndex];
279
+ }
280
+
281
+ - (void)updateArrowheadPath:(NSString *)identifier coordsJson:(NSString *)coordsJson width:(float)width outlineWidth:(float)outlineWidth color:(NSInteger)color outlineColor:(NSInteger)outlineColor headSizeRatio:(float)headSizeRatio zIndex:(NSInteger)zIndex
282
+ {
283
+ [_mapView updateArrowheadPathWithIdentifier:identifier coordsJson:coordsJson width:width outlineWidth:outlineWidth color:color outlineColor:outlineColor headSizeRatio:headSizeRatio zIndex:zIndex];
284
+ }
285
+
286
+ - (void)removeArrowheadPath:(NSString *)identifier
287
+ {
288
+ [_mapView removeArrowheadPathWithIdentifier:identifier];
289
+ }
290
+
291
+ #pragma mark - GroundOverlay Commands
292
+
293
+ - (void)addGroundOverlay:(NSString *)identifier southWestLat:(double)southWestLat southWestLng:(double)southWestLng northEastLat:(double)northEastLat northEastLng:(double)northEastLng image:(NSString *)image alpha:(float)alpha zIndex:(NSInteger)zIndex
294
+ {
295
+ [_mapView addGroundOverlayWithIdentifier:identifier southWestLat:southWestLat southWestLng:southWestLng northEastLat:northEastLat northEastLng:northEastLng image:image alpha:alpha zIndex:zIndex];
296
+ }
297
+
298
+ - (void)updateGroundOverlay:(NSString *)identifier southWestLat:(double)southWestLat southWestLng:(double)southWestLng northEastLat:(double)northEastLat northEastLng:(double)northEastLng image:(NSString *)image alpha:(float)alpha zIndex:(NSInteger)zIndex
299
+ {
300
+ [_mapView updateGroundOverlayWithIdentifier:identifier southWestLat:southWestLat southWestLng:southWestLng northEastLat:northEastLat northEastLng:northEastLng image:image alpha:alpha zIndex:zIndex];
301
+ }
302
+
303
+ - (void)removeGroundOverlay:(NSString *)identifier
304
+ {
305
+ [_mapView removeGroundOverlayWithIdentifier:identifier];
306
+ }
307
+
308
+ #pragma mark - InfoWindow Commands
309
+
310
+ - (void)addInfoWindow:(NSString *)identifier latitude:(double)latitude longitude:(double)longitude text:(NSString *)text alpha:(float)alpha zIndex:(NSInteger)zIndex offsetX:(NSInteger)offsetX offsetY:(NSInteger)offsetY
311
+ {
312
+ [_mapView addInfoWindowWithIdentifier:identifier latitude:latitude longitude:longitude text:text alpha:alpha zIndex:zIndex offsetX:offsetX offsetY:offsetY];
313
+ }
314
+
315
+ - (void)updateInfoWindow:(NSString *)identifier latitude:(double)latitude longitude:(double)longitude text:(NSString *)text alpha:(float)alpha zIndex:(NSInteger)zIndex offsetX:(NSInteger)offsetX offsetY:(NSInteger)offsetY
316
+ {
317
+ [_mapView updateInfoWindowWithIdentifier:identifier latitude:latitude longitude:longitude text:text alpha:alpha zIndex:zIndex offsetX:offsetX offsetY:offsetY];
318
+ }
319
+
320
+ - (void)removeInfoWindow:(NSString *)identifier
321
+ {
322
+ [_mapView removeInfoWindowWithIdentifier:identifier];
323
+ }
324
+
325
+ - (void)handleCommand:(const NSString *)commandName args:(const NSArray *)args
326
+ {
327
+ RCTGraniteNaverMapViewHandleCommand(self, commandName, args);
328
+ }
329
+
330
+ #pragma mark - GraniteNaverMapViewDelegate
331
+
332
+ - (void)mapViewDidInitialize
333
+ {
334
+ if (_eventEmitter) {
335
+ std::dynamic_pointer_cast<const GraniteNaverMapViewEventEmitter>(_eventEmitter)->onInitialized({});
336
+ }
337
+ }
338
+
339
+ - (void)mapViewDidChangeCameraWithLatitude:(double)latitude longitude:(double)longitude zoom:(double)zoom
340
+ {
341
+ if (_eventEmitter) {
342
+ GraniteNaverMapViewEventEmitter::OnCameraChange event = {
343
+ .latitude = latitude,
344
+ .longitude = longitude,
345
+ .zoom = zoom
346
+ };
347
+ std::dynamic_pointer_cast<const GraniteNaverMapViewEventEmitter>(_eventEmitter)->onCameraChange(event);
348
+ }
349
+ }
350
+
351
+ - (void)mapViewDidTouchWithReason:(NSInteger)reason animated:(BOOL)animated
352
+ {
353
+ if (_eventEmitter) {
354
+ GraniteNaverMapViewEventEmitter::OnTouch event = {
355
+ .reason = static_cast<int>(reason),
356
+ .animated = animated
357
+ };
358
+ std::dynamic_pointer_cast<const GraniteNaverMapViewEventEmitter>(_eventEmitter)->onTouch(event);
359
+ }
360
+ }
361
+
362
+ - (void)mapViewDidClickWithX:(double)x y:(double)y latitude:(double)latitude longitude:(double)longitude
363
+ {
364
+ if (_eventEmitter) {
365
+ GraniteNaverMapViewEventEmitter::OnMapClick event = {
366
+ .x = x,
367
+ .y = y,
368
+ .latitude = latitude,
369
+ .longitude = longitude
370
+ };
371
+ std::dynamic_pointer_cast<const GraniteNaverMapViewEventEmitter>(_eventEmitter)->onMapClick(event);
372
+ }
373
+ }
374
+
375
+ - (void)mapViewDidClickMarkerWithId:(NSString *)markerId
376
+ {
377
+ if (_eventEmitter) {
378
+ GraniteNaverMapViewEventEmitter::OnMarkerClick event = {
379
+ .id = std::string([markerId UTF8String])
380
+ };
381
+ std::dynamic_pointer_cast<const GraniteNaverMapViewEventEmitter>(_eventEmitter)->onMarkerClick(event);
382
+ }
383
+ }
384
+
385
+ @end
386
+
387
+ Class<RCTComponentViewProtocol> GraniteNaverMapViewCls(void)
388
+ {
389
+ return GraniteNaverMapView.class;
390
+ }