⋯ 96 lines Show the 96 lines above this hunk @@ -97,7 +97,7 @@ internal class CraftNativeMapView(context: Context) : FrameLayout(context), OnMa 97 97 nativeMap.uiSettings.isScrollGesturesEnabled = craftNativeBoolean(pendingProps.opt("scrollEnabled"), true) 98 98 nativeMap.uiSettings.isZoomGesturesEnabled = craftNativeBoolean(pendingProps.opt("zoomEnabled"), true) 99 99 nativeMap.uiSettings.isRotateGesturesEnabled = craftNativeBoolean(pendingProps.opt("rotateEnabled")) 100 - nativeMap.uiSettings.isTiltGesturesEnabled = true 100 + nativeMap.uiSettings.isTiltGesturesEnabled = craftNativeBoolean(pendingProps.opt("pitchEnabled"), true ) 101 101 // The authored attribution is kept visible rather than hidden in a menu. 102 102 nativeMap.uiSettings.isAttributionEnabled = false 103 103 nativeMap.uiSettings.isLogoEnabled = false ⋯ 24 lines Show the 24 lines above this hunk @@ -128,9 +128,10 @@ internal class CraftNativeMapView(context: Context) : FrameLayout(context), OnMa 128 128 val key = "region:${pendingProps.optJSONObject("initialRegion")}" 129 129 if (initialCameraKey != key) { moveCamera(initial, 0); initialCameraKey = key } 130 130 } else if (craftNativeBoolean(pendingProps.opt("fitToBounds"))) { 131 - val key = geometryPoints.joinToString(";") { "${it.latitude},${it.longitude}" } 131 + val key = "$width,$height:${pendingProps.optJSONObject("edgePadding")}:" + geometryPoints.joinToString(";") { "${it.latitude},${it.longitude}" } 132 132 if (initialCameraKey != key && geometryPoints.isNotEmpty() && width > 0 && height > 0) { 133 - if (geometryPoints.size = = 1) nativeMap.moveCamera(CameraUpdateFactory.newLatLngZoom( geometryPoints. first(), 15 . 0)) 133 + val distinct = geometryPoints. distinctBy { it . latitude to it.longitude } 134 + if (distinct.size == 1) nativeMap.moveCamera(CameraUpdateFactory.newLatLngZoom(distinct.first(), 15.0)) 134 135 else moveCamera(LatLngBounds.Builder().includes(geometryPoints).build(), if (pendingProps.has("edgePadding")) 0 else (24 * resources.displayMetrics.density).roundToInt()) 135 136 initialCameraKey = key 136 137 } ⋯ 167 lines Show the 167 lines above this hunk @@ -304,7 +305,7 @@ internal class CraftNativeMapView(context: Context) : FrameLayout(context), OnMa 304 305 305 306 override fun onSizeChanged(width: Int, height: Int, oldWidth: Int, oldHeight: Int) { 306 307 super.onSizeChanged(width, height, oldWidth, oldHeight) 307 - if (width > 0 && height > 0) { applyPadding(); updateScale(); if (initialCameraKey == null) applyPending() } 308 + if (width > 0 && height > 0) applyPending() 308 309 } 309 310 310 311 override fun onAttachedToWindow() {