@react-native-kakao/map 2.2.7 → 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.
Files changed (165) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/README.md +5 -38
  3. package/RNCKakaoMap.podspec +16 -52
  4. package/android/build.gradle +12 -107
  5. package/android/consumer-rules.pro +2 -0
  6. package/android/src/main/AndroidManifest.xml +3 -1
  7. package/android/src/main/java/net/mjstudio/rnkakao/map/CameraOptions.kt +61 -0
  8. package/android/src/main/java/net/mjstudio/rnkakao/map/KakaoMapModule.kt +131 -0
  9. package/android/src/main/java/net/mjstudio/rnkakao/map/KakaoMapView.kt +1257 -0
  10. package/android/src/main/java/net/mjstudio/rnkakao/map/MapCameraCommands.kt +306 -0
  11. package/android/src/main/java/net/mjstudio/rnkakao/map/MapDimScreen.kt +431 -0
  12. package/android/src/main/java/net/mjstudio/rnkakao/map/MapGui.kt +899 -0
  13. package/android/src/main/java/net/mjstudio/rnkakao/map/MapImageLoader.kt +232 -0
  14. package/android/src/main/java/net/mjstudio/rnkakao/map/MapLabels.kt +1572 -0
  15. package/android/src/main/java/net/mjstudio/rnkakao/map/MapOptions.kt +360 -0
  16. package/android/src/main/java/net/mjstudio/rnkakao/map/MapRoutes.kt +805 -0
  17. package/android/src/main/java/net/mjstudio/rnkakao/map/MapShapes.kt +1096 -0
  18. package/android/src/main/java/net/mjstudio/rnkakao/map/MapUtilities.kt +495 -0
  19. package/expo-module.config.json +5 -0
  20. package/ios/CameraOptions.swift +41 -0
  21. package/ios/KakaoMapModule.swift +204 -0
  22. package/ios/KakaoMapView.swift +1018 -0
  23. package/ios/MapCameraCommands.swift +451 -0
  24. package/ios/MapDimScreen.swift +463 -0
  25. package/ios/MapGui.swift +1099 -0
  26. package/ios/MapImageLoader.swift +177 -0
  27. package/ios/MapLabels.swift +1676 -0
  28. package/ios/MapOptions.swift +374 -0
  29. package/ios/MapRoutes.swift +903 -0
  30. package/ios/MapShapes.swift +1294 -0
  31. package/ios/MapUnits.swift +20 -0
  32. package/ios/MapUtilities.swift +365 -0
  33. package/lib/commonjs/index.js +180 -29
  34. package/lib/commonjs/index.js.map +1 -1
  35. package/lib/commonjs/index.web.js +18 -0
  36. package/lib/commonjs/index.web.js.map +1 -0
  37. package/lib/commonjs/package.json +1 -0
  38. package/lib/commonjs/types-assets.js +2 -0
  39. package/lib/commonjs/types-assets.js.map +1 -0
  40. package/lib/commonjs/types-camera.js +6 -0
  41. package/lib/commonjs/types-camera.js.map +1 -0
  42. package/lib/commonjs/types-dim.js +6 -0
  43. package/lib/commonjs/types-dim.js.map +1 -0
  44. package/lib/commonjs/types-gui.js +6 -0
  45. package/lib/commonjs/types-gui.js.map +1 -0
  46. package/lib/commonjs/types-labels.js +6 -0
  47. package/lib/commonjs/types-labels.js.map +1 -0
  48. package/lib/commonjs/types-routes.js +6 -0
  49. package/lib/commonjs/types-routes.js.map +1 -0
  50. package/lib/commonjs/types-shapes.js +6 -0
  51. package/lib/commonjs/types-shapes.js.map +1 -0
  52. package/lib/commonjs/types-utilities.js +6 -0
  53. package/lib/commonjs/types-utilities.js.map +1 -0
  54. package/lib/commonjs/types.js +6 -0
  55. package/lib/commonjs/types.js.map +1 -0
  56. package/lib/module/index.js +180 -22
  57. package/lib/module/index.js.map +1 -1
  58. package/lib/module/index.web.js +13 -0
  59. package/lib/module/index.web.js.map +1 -0
  60. package/lib/module/types-assets.js +2 -0
  61. package/lib/module/types-assets.js.map +1 -0
  62. package/lib/module/types-camera.js +4 -0
  63. package/lib/module/types-camera.js.map +1 -0
  64. package/lib/module/types-dim.js +4 -0
  65. package/lib/module/types-dim.js.map +1 -0
  66. package/lib/module/types-gui.js +4 -0
  67. package/lib/module/types-gui.js.map +1 -0
  68. package/lib/module/types-labels.js +4 -0
  69. package/lib/module/types-labels.js.map +1 -0
  70. package/lib/module/types-routes.js +4 -0
  71. package/lib/module/types-routes.js.map +1 -0
  72. package/lib/module/types-shapes.js +4 -0
  73. package/lib/module/types-shapes.js.map +1 -0
  74. package/lib/module/types-utilities.js +4 -0
  75. package/lib/module/types-utilities.js.map +1 -0
  76. package/lib/module/types.js +4 -0
  77. package/lib/module/types.js.map +1 -0
  78. package/lib/typescript/src/index.d.ts +59 -9
  79. package/lib/typescript/src/index.d.ts.map +1 -1
  80. package/lib/typescript/src/types-assets.d.ts +9 -0
  81. package/lib/typescript/src/types-assets.d.ts.map +1 -0
  82. package/lib/typescript/src/types-camera.d.ts +123 -0
  83. package/lib/typescript/src/types-camera.d.ts.map +1 -0
  84. package/lib/typescript/src/types-dim.d.ts +54 -0
  85. package/lib/typescript/src/types-dim.d.ts.map +1 -0
  86. package/lib/typescript/src/types-gui.d.ts +189 -0
  87. package/lib/typescript/src/types-gui.d.ts.map +1 -0
  88. package/lib/typescript/src/types-labels.d.ts +246 -0
  89. package/lib/typescript/src/types-labels.d.ts.map +1 -0
  90. package/lib/typescript/src/types-routes.d.ts +162 -0
  91. package/lib/typescript/src/types-routes.d.ts.map +1 -0
  92. package/lib/typescript/src/types-shapes.d.ts +253 -0
  93. package/lib/typescript/src/types-shapes.d.ts.map +1 -0
  94. package/lib/typescript/src/types-utilities.d.ts +130 -0
  95. package/lib/typescript/src/types-utilities.d.ts.map +1 -0
  96. package/lib/typescript/src/types.d.ts +222 -0
  97. package/lib/typescript/src/types.d.ts.map +1 -0
  98. package/package.json +24 -77
  99. package/src/index.tsx +322 -0
  100. package/src/index.web.tsx +46 -0
  101. package/src/types-assets.ts +8 -0
  102. package/src/types-camera.ts +97 -0
  103. package/src/types-dim.ts +54 -0
  104. package/src/types-gui.ts +171 -0
  105. package/src/types-labels.ts +207 -0
  106. package/src/types-routes.ts +118 -0
  107. package/src/types-shapes.ts +244 -0
  108. package/src/types-utilities.ts +115 -0
  109. package/src/types.ts +223 -0
  110. package/android/gradle.properties +0 -1
  111. package/android/src/main/AndroidManifestNew.xml +0 -2
  112. package/android/src/main/java/net/mjstudio/rnkakao/map/RNCKakaoMapModule.kt +0 -25
  113. package/android/src/main/java/net/mjstudio/rnkakao/map/RNCKakaoMapPackage.kt +0 -35
  114. package/android/src/newarch/KakaoMapSpec.kt +0 -7
  115. package/android/src/oldarch/KakaoMapSpec.kt +0 -14
  116. package/ios/Component/Map/RNCKakaoMapView.h +0 -23
  117. package/ios/Component/Map/RNCKakaoMapView.mm +0 -209
  118. package/ios/Component/Map/RNCKakaoMapViewManager.mm +0 -19
  119. package/ios/NativeModule/RNCKakaoMap.h +0 -7
  120. package/ios/NativeModule/RNCKakaoMap.mm +0 -19
  121. package/ios/NativeModule/RNCKakaoMapManager.swift +0 -7
  122. package/ios/Util/Util.h +0 -97
  123. package/lib/commonjs/component/KakaoMapView.js +0 -54
  124. package/lib/commonjs/component/KakaoMapView.js.map +0 -1
  125. package/lib/commonjs/spec/NativeKakaoMap.js +0 -9
  126. package/lib/commonjs/spec/NativeKakaoMap.js.map +0 -1
  127. package/lib/commonjs/spec/RNCKakaoMapViewNativeComponent.js +0 -15
  128. package/lib/commonjs/spec/RNCKakaoMapViewNativeComponent.js.map +0 -1
  129. package/lib/commonjs/type/type.js +0 -2
  130. package/lib/commonjs/type/type.js.map +0 -1
  131. package/lib/commonjs/util/Const.js +0 -14
  132. package/lib/commonjs/util/Const.js.map +0 -1
  133. package/lib/commonjs/util/Util.js +0 -15
  134. package/lib/commonjs/util/Util.js.map +0 -1
  135. package/lib/module/component/KakaoMapView.js +0 -48
  136. package/lib/module/component/KakaoMapView.js.map +0 -1
  137. package/lib/module/spec/NativeKakaoMap.js +0 -3
  138. package/lib/module/spec/NativeKakaoMap.js.map +0 -1
  139. package/lib/module/spec/RNCKakaoMapViewNativeComponent.js +0 -10
  140. package/lib/module/spec/RNCKakaoMapViewNativeComponent.js.map +0 -1
  141. package/lib/module/type/type.js +0 -2
  142. package/lib/module/type/type.js.map +0 -1
  143. package/lib/module/util/Const.js +0 -8
  144. package/lib/module/util/Const.js.map +0 -1
  145. package/lib/module/util/Util.js +0 -9
  146. package/lib/module/util/Util.js.map +0 -1
  147. package/lib/typescript/src/component/KakaoMapView.d.ts +0 -25
  148. package/lib/typescript/src/component/KakaoMapView.d.ts.map +0 -1
  149. package/lib/typescript/src/spec/NativeKakaoMap.d.ts +0 -7
  150. package/lib/typescript/src/spec/NativeKakaoMap.d.ts.map +0 -1
  151. package/lib/typescript/src/spec/RNCKakaoMapViewNativeComponent.d.ts +0 -32
  152. package/lib/typescript/src/spec/RNCKakaoMapViewNativeComponent.d.ts.map +0 -1
  153. package/lib/typescript/src/type/type.d.ts +0 -8
  154. package/lib/typescript/src/type/type.d.ts.map +0 -1
  155. package/lib/typescript/src/util/Const.d.ts +0 -8
  156. package/lib/typescript/src/util/Const.d.ts.map +0 -1
  157. package/lib/typescript/src/util/Util.d.ts +0 -3
  158. package/lib/typescript/src/util/Util.d.ts.map +0 -1
  159. package/src/component/KakaoMapView.tsx +0 -82
  160. package/src/index.ts +0 -43
  161. package/src/spec/NativeKakaoMap.ts +0 -8
  162. package/src/spec/RNCKakaoMapViewNativeComponent.ts +0 -38
  163. package/src/type/type.ts +0 -7
  164. package/src/util/Const.ts +0 -7
  165. package/src/util/Util.ts +0 -11
@@ -0,0 +1,360 @@
1
+ package net.mjstudio.rnkakao.map
2
+
3
+ import com.kakao.vectormap.GestureType
4
+ import com.kakao.vectormap.MapGravity
5
+ import com.kakao.vectormap.MapOverlay
6
+ import com.kakao.vectormap.MapType
7
+ import com.kakao.vectormap.PoiScale
8
+ import expo.modules.kotlin.exception.CodedException
9
+ import expo.modules.kotlin.records.Field
10
+ import expo.modules.kotlin.records.Record
11
+ import expo.modules.kotlin.records.Required
12
+
13
+ class CoordinateRecord : Record {
14
+ @Field @Required
15
+ var latitude: Double = Double.NaN
16
+
17
+ @Field @Required
18
+ var longitude: Double = Double.NaN
19
+
20
+ fun validate(name: String = "Coordinate") {
21
+ if (!latitude.isFinite() || !longitude.isFinite() || latitude !in -90.0..90.0 || longitude !in -180.0..180.0) {
22
+ throw CodedException(INVALID_ARGUMENT, "$name must contain a valid latitude and longitude.", null)
23
+ }
24
+ }
25
+ }
26
+
27
+ class ScreenPointRecord : Record {
28
+ @Field @Required
29
+ var x: Double = Double.NaN
30
+
31
+ @Field @Required
32
+ var y: Double = Double.NaN
33
+
34
+ fun validate(name: String = "Screen point") {
35
+ if (!x.isFinite() || !y.isFinite()) {
36
+ throw CodedException(INVALID_ARGUMENT, "$name must contain finite x and y values.", null)
37
+ }
38
+ }
39
+ }
40
+
41
+ class MapPaddingRecord : Record {
42
+ @Field @Required
43
+ var top: Double = Double.NaN
44
+
45
+ @Field @Required
46
+ var right: Double = Double.NaN
47
+
48
+ @Field @Required
49
+ var bottom: Double = Double.NaN
50
+
51
+ @Field @Required
52
+ var left: Double = Double.NaN
53
+
54
+ fun validate() {
55
+ if (!listOf(top, right, bottom, left).all { it.isFinite() && it >= 0.0 }) {
56
+ throw CodedException(INVALID_ARGUMENT, "Map padding values must be finite and non-negative.", null)
57
+ }
58
+ }
59
+ }
60
+
61
+ class MapViewInfoRecord : Record {
62
+ @Field @Required
63
+ var name: String = ""
64
+
65
+ @Field var appName: String? = null
66
+
67
+ fun validate() {
68
+ if (name.isBlank() || appName?.isBlank() == true) {
69
+ throw CodedException(INVALID_ARGUMENT, "View info name and app name must not be blank.", null)
70
+ }
71
+ }
72
+ }
73
+
74
+ class PoiOptionsRecord : Record {
75
+ @Field var visible: Boolean? = null
76
+
77
+ @Field var clickable: Boolean? = null
78
+
79
+ @Field var scale: String? = null
80
+ }
81
+
82
+ class ZoomRangeRecord : Record {
83
+ @Field @Required
84
+ var min: Double = Double.NaN
85
+
86
+ @Field @Required
87
+ var max: Double = Double.NaN
88
+ }
89
+
90
+ class MapWidgetPositionRecord : Record {
91
+ @Field @Required
92
+ var x: Double = Double.NaN
93
+
94
+ @Field @Required
95
+ var y: Double = Double.NaN
96
+
97
+ @Field @Required
98
+ var gravity: String = ""
99
+
100
+ fun validate(name: String) {
101
+ if (!x.isFinite() || !y.isFinite() || gravity !in gravityValues) {
102
+ throw CodedException(INVALID_ARGUMENT, "$name must contain a supported gravity and finite x and y values.", null)
103
+ }
104
+ }
105
+
106
+ fun nativeGravity() =
107
+ when (gravity) {
108
+ "topLeft" -> MapGravity.TOP or MapGravity.LEFT
109
+ "topCenter" -> MapGravity.TOP or MapGravity.CENTER_HORIZONTAL
110
+ "topRight" -> MapGravity.TOP or MapGravity.RIGHT
111
+ "centerLeft" -> MapGravity.CENTER_VERTICAL or MapGravity.LEFT
112
+ "center" -> MapGravity.CENTER
113
+ "centerRight" -> MapGravity.CENTER_VERTICAL or MapGravity.RIGHT
114
+ "bottomLeft" -> MapGravity.BOTTOM or MapGravity.LEFT
115
+ "bottomCenter" -> MapGravity.BOTTOM or MapGravity.CENTER_HORIZONTAL
116
+ "bottomRight" -> MapGravity.BOTTOM or MapGravity.RIGHT
117
+ else -> error("Position must be validated before conversion.")
118
+ }
119
+
120
+ companion object {
121
+ private val gravityValues =
122
+ setOf(
123
+ "topLeft",
124
+ "topCenter",
125
+ "topRight",
126
+ "centerLeft",
127
+ "center",
128
+ "centerRight",
129
+ "bottomLeft",
130
+ "bottomCenter",
131
+ "bottomRight",
132
+ )
133
+ }
134
+ }
135
+
136
+ class CompassOptionsRecord : Record {
137
+ @Field var visible: Boolean? = null
138
+
139
+ @Field var position: MapWidgetPositionRecord? = null
140
+ }
141
+
142
+ class ScaleBarOptionsRecord : Record {
143
+ @Field var visible: Boolean? = null
144
+
145
+ @Field var position: MapWidgetPositionRecord? = null
146
+
147
+ @Field var autoHide: Boolean? = null
148
+
149
+ @Field var fade: ScaleBarFadeRecord? = null
150
+ }
151
+
152
+ class ScaleBarFadeRecord : Record {
153
+ @Field @Required
154
+ var inDuration: Double = Double.NaN
155
+
156
+ @Field @Required
157
+ var outDuration: Double = Double.NaN
158
+
159
+ @Field @Required
160
+ var retentionDuration: Double = Double.NaN
161
+ }
162
+
163
+ class MapOptionsRecord : Record {
164
+ @Field var mapType: String? = null
165
+
166
+ @Field var viewInfo: MapViewInfoRecord? = null
167
+
168
+ @Field var overlays: List<String>? = null
169
+
170
+ @Field var customOverlays: List<String>? = null
171
+
172
+ @Field var language: String? = null
173
+
174
+ @Field var poi: PoiOptionsRecord? = null
175
+
176
+ @Field var buildingScale: Double? = null
177
+
178
+ @Field var padding: MapPaddingRecord? = null
179
+
180
+ @Field var zoomRange: ZoomRangeRecord? = null
181
+
182
+ @Field var gestures: Map<String, Boolean>? = null
183
+
184
+ @Field var compass: CompassOptionsRecord? = null
185
+
186
+ @Field var scaleBar: ScaleBarOptionsRecord? = null
187
+
188
+ @Field var logo: MapWidgetPositionRecord? = null
189
+ }
190
+
191
+ class CameraUpdateRecord : Record {
192
+ @Field @Required
193
+ var type: String = ""
194
+
195
+ @Field var position: CoordinateRecord? = null
196
+
197
+ @Field var zoomLevel: Double? = null
198
+
199
+ @Field var rotation: Double? = null
200
+
201
+ @Field var tilt: Double? = null
202
+
203
+ @Field var coordinates: List<CoordinateRecord>? = null
204
+ }
205
+
206
+ internal fun mergeMapOptions(
207
+ base: MapOptionsRecord?,
208
+ patch: MapOptionsRecord,
209
+ ): MapOptionsRecord {
210
+ val result = base ?: MapOptionsRecord()
211
+ patch.mapType?.let {
212
+ result.mapType = it
213
+ result.viewInfo = null
214
+ }
215
+ patch.viewInfo?.let {
216
+ result.viewInfo = it
217
+ result.mapType = null
218
+ }
219
+ patch.overlays?.let { result.overlays = it }
220
+ patch.customOverlays?.let { result.customOverlays = it }
221
+ patch.language?.let { result.language = it }
222
+ patch.poi?.let { poiPatch ->
223
+ val poi = result.poi ?: PoiOptionsRecord()
224
+ poiPatch.visible?.let { poi.visible = it }
225
+ poiPatch.clickable?.let { poi.clickable = it }
226
+ poiPatch.scale?.let { poi.scale = it }
227
+ result.poi = poi
228
+ }
229
+ patch.buildingScale?.let { result.buildingScale = it }
230
+ patch.padding?.let { result.padding = it }
231
+ patch.zoomRange?.let { result.zoomRange = it }
232
+ patch.gestures?.let { result.gestures = result.gestures.orEmpty() + it }
233
+ patch.compass?.let { compassPatch ->
234
+ val compass = result.compass ?: CompassOptionsRecord()
235
+ compassPatch.visible?.let { compass.visible = it }
236
+ compassPatch.position?.let { compass.position = it }
237
+ result.compass = compass
238
+ }
239
+ patch.scaleBar?.let { scaleBarPatch ->
240
+ val scaleBar = result.scaleBar ?: ScaleBarOptionsRecord()
241
+ scaleBarPatch.visible?.let { scaleBar.visible = it }
242
+ scaleBarPatch.position?.let { scaleBar.position = it }
243
+ scaleBarPatch.autoHide?.let { scaleBar.autoHide = it }
244
+ scaleBarPatch.fade?.let { scaleBar.fade = it }
245
+ result.scaleBar = scaleBar
246
+ }
247
+ patch.logo?.let { result.logo = it }
248
+ return result
249
+ }
250
+
251
+ internal fun changedMapOptions(
252
+ applied: MapOptionsRecord,
253
+ patch: MapOptionsRecord,
254
+ ): MapOptionsRecord {
255
+ val changed = MapOptionsRecord()
256
+ patch.mapType?.takeIf { it != applied.mapType }?.let { changed.mapType = it }
257
+ patch.viewInfo?.takeIf { !it.sameAs(applied.viewInfo) }?.let { changed.viewInfo = it }
258
+ patch.overlays?.takeIf { it.toSet() != applied.overlays?.toSet() }?.let { changed.overlays = it }
259
+ patch.customOverlays?.takeIf { it.toSet() != applied.customOverlays?.toSet() }?.let { changed.customOverlays = it }
260
+ patch.language?.takeIf { it != applied.language }?.let { changed.language = it }
261
+ patch.poi?.let { poiPatch ->
262
+ val poi = PoiOptionsRecord()
263
+ poiPatch.visible?.takeIf { it != applied.poi?.visible }?.let { poi.visible = it }
264
+ poiPatch.clickable?.takeIf { it != applied.poi?.clickable }?.let { poi.clickable = it }
265
+ poiPatch.scale?.takeIf { it != applied.poi?.scale }?.let { poi.scale = it }
266
+ if (poi.visible != null || poi.clickable != null || poi.scale != null) changed.poi = poi
267
+ }
268
+ patch.buildingScale?.takeIf { it != applied.buildingScale }?.let { changed.buildingScale = it }
269
+ patch.padding?.takeIf { !it.sameAs(applied.padding) }?.let { changed.padding = it }
270
+ patch.zoomRange?.takeIf { !it.sameAs(applied.zoomRange) }?.let { changed.zoomRange = it }
271
+ patch.gestures?.filter { (gesture, enabled) -> applied.gestures?.get(gesture) != enabled }?.takeIf { it.isNotEmpty() }?.let {
272
+ changed.gestures = it
273
+ }
274
+ patch.compass?.let { compassPatch ->
275
+ val compass = CompassOptionsRecord()
276
+ compassPatch.visible?.takeIf { it != applied.compass?.visible }?.let { compass.visible = it }
277
+ compassPatch.position?.takeIf { !it.sameAs(applied.compass?.position) }?.let { compass.position = it }
278
+ if (compass.visible != null || compass.position != null) changed.compass = compass
279
+ }
280
+ patch.scaleBar?.let { scaleBarPatch ->
281
+ val scaleBar = ScaleBarOptionsRecord()
282
+ scaleBarPatch.visible?.takeIf { it != applied.scaleBar?.visible }?.let { scaleBar.visible = it }
283
+ scaleBarPatch.position?.takeIf { !it.sameAs(applied.scaleBar?.position) }?.let { scaleBar.position = it }
284
+ scaleBarPatch.autoHide?.takeIf { it != applied.scaleBar?.autoHide }?.let { scaleBar.autoHide = it }
285
+ scaleBarPatch.fade?.takeIf { !it.sameAs(applied.scaleBar?.fade) }?.let { scaleBar.fade = it }
286
+ if (scaleBar.visible != null || scaleBar.position != null || scaleBar.autoHide != null || scaleBar.fade != null) {
287
+ changed.scaleBar = scaleBar
288
+ }
289
+ }
290
+ patch.logo?.takeIf { !it.sameAs(applied.logo) }?.let { changed.logo = it }
291
+ return changed
292
+ }
293
+
294
+ internal fun MapOptionsRecord.isEmpty() =
295
+ mapType == null &&
296
+ viewInfo == null &&
297
+ overlays == null &&
298
+ customOverlays == null &&
299
+ language == null &&
300
+ poi == null &&
301
+ buildingScale == null &&
302
+ padding == null &&
303
+ zoomRange == null &&
304
+ gestures == null &&
305
+ compass == null &&
306
+ scaleBar == null &&
307
+ logo == null
308
+
309
+ private fun MapViewInfoRecord.sameAs(other: MapViewInfoRecord?) = name == other?.name && appName == other.appName
310
+
311
+ private fun MapPaddingRecord.sameAs(other: MapPaddingRecord?) =
312
+ top == other?.top && right == other.right && bottom == other.bottom && left == other.left
313
+
314
+ private fun ZoomRangeRecord.sameAs(other: ZoomRangeRecord?) = min == other?.min && max == other.max
315
+
316
+ private fun MapWidgetPositionRecord.sameAs(other: MapWidgetPositionRecord?) = x == other?.x && y == other.y && gravity == other.gravity
317
+
318
+ private fun ScaleBarFadeRecord.sameAs(other: ScaleBarFadeRecord?) =
319
+ inDuration == other?.inDuration && outDuration == other.outDuration && retentionDuration == other.retentionDuration
320
+
321
+ internal fun nativeMapType(value: String) =
322
+ when (value) {
323
+ "normal" -> MapType.NORMAL
324
+ "skyview" -> MapType.SKYVIEW
325
+ else -> throw CodedException(INVALID_ARGUMENT, "Unsupported map type: $value.", null)
326
+ }
327
+
328
+ internal fun nativeMapOverlay(value: String) =
329
+ when (value) {
330
+ "roadviewLine" -> MapOverlay.ROADVIEW_LINE
331
+ "hillShading" -> MapOverlay.HILLSHADING
332
+ "bicycleRoad" -> MapOverlay.BICYCLE_ROAD
333
+ "hybrid" -> MapOverlay.SKYVIEW_HYBRID
334
+ else -> throw CodedException(INVALID_ARGUMENT, "Unsupported map overlay: $value.", null)
335
+ }
336
+
337
+ internal fun nativeGesture(value: String) =
338
+ when (value) {
339
+ "doubleTapZoomIn" -> GestureType.OneFingerDoubleTap
340
+ "twoFingerTapZoomOut" -> GestureType.TwoFingerSingleTap
341
+ "pan" -> GestureType.Pan
342
+ "rotate" -> GestureType.Rotate
343
+ "zoom" -> GestureType.Zoom
344
+ "tilt" -> GestureType.Tilt
345
+ "longTapAndDrag" -> GestureType.LongTapAndDrag
346
+ "rotateZoom" -> GestureType.RotateZoom
347
+ "oneFingerZoom" -> GestureType.OneFingerZoom
348
+ else -> throw CodedException(INVALID_ARGUMENT, "Unsupported map gesture: $value.", null)
349
+ }
350
+
351
+ internal fun nativePoiScale(value: String) =
352
+ when (value) {
353
+ "small" -> PoiScale.SMALL
354
+ "regular" -> PoiScale.REGULAR
355
+ "large" -> PoiScale.LARGE
356
+ "xLarge" -> PoiScale.XLARGE
357
+ else -> throw CodedException(INVALID_ARGUMENT, "Unsupported POI scale: $value.", null)
358
+ }
359
+
360
+ internal fun mapTypePayload(value: String) = if (value == MapType.SKYVIEW.value) "skyview" else "normal"