@lugg/maps 0.2.0-alpha.9 → 1.0.0-beta.1
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/README.md +21 -20
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/luggmaps/LuggCalloutView.kt +74 -0
- package/android/src/main/java/com/luggmaps/LuggCalloutViewManager.kt +38 -0
- package/android/src/main/java/com/luggmaps/LuggMapView.kt +290 -0
- package/android/src/main/java/com/luggmaps/{LuggGoogleMapViewManager.kt → LuggMapViewManager.kt} +99 -36
- package/android/src/main/java/com/luggmaps/LuggMapWrapperView.kt +11 -14
- package/android/src/main/java/com/luggmaps/LuggMarkerView.kt +187 -21
- package/android/src/main/java/com/luggmaps/LuggMarkerViewManager.kt +28 -0
- package/android/src/main/java/com/luggmaps/LuggPackage.kt +8 -4
- package/android/src/main/java/com/luggmaps/LuggPolygonView.kt +85 -0
- package/android/src/main/java/com/luggmaps/LuggPolygonViewManager.kt +100 -0
- package/android/src/main/java/com/luggmaps/LuggPolylineView.kt +16 -0
- package/android/src/main/java/com/luggmaps/LuggPolylineViewManager.kt +22 -0
- package/android/src/main/java/com/luggmaps/core/GoogleMapProvider.kt +874 -0
- package/android/src/main/java/com/luggmaps/core/MapProviderDelegate.kt +60 -0
- package/android/src/main/java/com/luggmaps/core/PolylineAnimator.kt +89 -24
- package/android/src/main/java/com/luggmaps/events/LongPressEvent.kt +29 -0
- package/android/src/main/java/com/luggmaps/events/MarkerDragEvent.kt +41 -0
- package/android/src/main/java/com/luggmaps/events/MarkerPressEvent.kt +34 -0
- package/android/src/main/java/com/luggmaps/events/PolygonPressEvent.kt +12 -0
- package/android/src/main/java/com/luggmaps/events/PressEvent.kt +29 -0
- package/ios/LuggCalloutView.h +23 -0
- package/ios/LuggCalloutView.mm +145 -0
- package/ios/LuggMapView.h +9 -0
- package/ios/LuggMapView.mm +343 -0
- package/ios/LuggMarkerView.h +15 -0
- package/ios/LuggMarkerView.mm +136 -2
- package/ios/LuggPolygonView.h +31 -0
- package/ios/LuggPolygonView.mm +151 -0
- package/ios/LuggPolylineView.h +4 -0
- package/ios/LuggPolylineView.mm +23 -0
- package/ios/core/AppleMapProvider.h +15 -0
- package/ios/core/AppleMapProvider.mm +1173 -0
- package/ios/core/GMSPolylineAnimator.h +3 -0
- package/ios/core/GMSPolylineAnimator.m +101 -15
- package/ios/core/GoogleMapProvider.h +13 -0
- package/ios/core/GoogleMapProvider.mm +798 -0
- package/ios/core/LuggAnnotationView.h +12 -0
- package/ios/core/LuggAnnotationView.mm +55 -0
- package/ios/core/MKPolylineAnimator.h +4 -0
- package/ios/core/MKPolylineAnimator.m +167 -42
- package/ios/core/MapProviderDelegate.h +84 -0
- package/ios/core/PolylineAnimatorBase.h +24 -1
- package/ios/core/PolylineAnimatorBase.m +82 -19
- package/ios/events/LongPressEvent.h +29 -0
- package/ios/events/MarkerDragEvent.h +69 -0
- package/ios/events/MarkerPressEvent.h +29 -0
- package/ios/events/PolygonPressEvent.h +20 -0
- package/ios/events/PressEvent.h +29 -0
- package/ios/extensions/MKMapView+Zoom.h +2 -0
- package/ios/extensions/MKMapView+Zoom.m +14 -4
- package/lib/module/MapProvider.js +2 -4
- package/lib/module/MapProvider.js.map +1 -1
- package/lib/module/MapProvider.web.js +14 -7
- package/lib/module/MapProvider.web.js.map +1 -1
- package/lib/module/MapView.js +33 -16
- package/lib/module/MapView.js.map +1 -1
- package/lib/module/MapView.web.js +296 -181
- package/lib/module/MapView.web.js.map +1 -1
- package/lib/module/components/GeoJson.js +159 -0
- package/lib/module/components/GeoJson.js.map +1 -0
- package/lib/module/components/GeoJson.types.js +4 -0
- package/lib/module/components/GeoJson.types.js.map +1 -0
- package/lib/module/components/Marker.js +49 -8
- package/lib/module/components/Marker.js.map +1 -1
- package/lib/module/components/Marker.types.js +4 -0
- package/lib/module/components/Marker.types.js.map +1 -0
- package/lib/module/components/Marker.web.js +159 -24
- package/lib/module/components/Marker.web.js.map +1 -1
- package/lib/module/components/Polygon.js +46 -0
- package/lib/module/components/Polygon.js.map +1 -0
- package/lib/module/components/Polygon.types.js +4 -0
- package/lib/module/components/Polygon.types.js.map +1 -0
- package/lib/module/components/Polygon.web.js +87 -0
- package/lib/module/components/Polygon.web.js.map +1 -0
- package/lib/module/components/Polyline.js +17 -4
- package/lib/module/components/Polyline.js.map +1 -1
- package/lib/module/components/Polyline.types.js +4 -0
- package/lib/module/components/Polyline.types.js.map +1 -0
- package/lib/module/components/Polyline.web.js +108 -31
- package/lib/module/components/Polyline.web.js.map +1 -1
- package/lib/module/components/index.js +4 -2
- package/lib/module/components/index.js.map +1 -1
- package/lib/module/components/index.web.js +2 -0
- package/lib/module/components/index.web.js.map +1 -1
- package/lib/module/fabric/LuggCalloutViewNativeComponent.ts +20 -0
- package/lib/module/fabric/{LuggGoogleMapViewNativeComponent.ts → LuggMapViewNativeComponent.ts} +43 -7
- package/lib/module/fabric/LuggMarkerViewNativeComponent.ts +49 -1
- package/lib/module/fabric/LuggPolygonViewNativeComponent.ts +25 -0
- package/lib/module/fabric/LuggPolylineViewNativeComponent.ts +8 -0
- package/lib/module/index.js +4 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/index.web.js +4 -1
- package/lib/module/index.web.js.map +1 -1
- package/lib/typescript/src/MapProvider.d.ts +1 -1
- package/lib/typescript/src/MapProvider.d.ts.map +1 -1
- package/lib/typescript/src/MapProvider.web.d.ts +23 -1
- package/lib/typescript/src/MapProvider.web.d.ts.map +1 -1
- package/lib/typescript/src/MapView.d.ts +4 -4
- package/lib/typescript/src/MapView.d.ts.map +1 -1
- package/lib/typescript/src/MapView.types.d.ts +35 -9
- package/lib/typescript/src/MapView.types.d.ts.map +1 -1
- package/lib/typescript/src/MapView.web.d.ts +2 -11
- package/lib/typescript/src/MapView.web.d.ts.map +1 -1
- package/lib/typescript/src/components/GeoJson.d.ts +4 -0
- package/lib/typescript/src/components/GeoJson.d.ts.map +1 -0
- package/lib/typescript/src/components/GeoJson.types.d.ts +89 -0
- package/lib/typescript/src/components/GeoJson.types.d.ts.map +1 -0
- package/lib/typescript/src/components/Marker.d.ts +6 -33
- package/lib/typescript/src/components/Marker.d.ts.map +1 -1
- package/lib/typescript/src/components/Marker.types.d.ts +100 -0
- package/lib/typescript/src/components/Marker.types.d.ts.map +1 -0
- package/lib/typescript/src/components/Marker.web.d.ts +2 -5
- package/lib/typescript/src/components/Marker.web.d.ts.map +1 -1
- package/lib/typescript/src/components/Polygon.d.ts +10 -0
- package/lib/typescript/src/components/Polygon.d.ts.map +1 -0
- package/lib/typescript/src/components/Polygon.types.d.ts +33 -0
- package/lib/typescript/src/components/Polygon.types.d.ts.map +1 -0
- package/lib/typescript/src/components/Polygon.web.d.ts +3 -0
- package/lib/typescript/src/components/Polygon.web.d.ts.map +1 -0
- package/lib/typescript/src/components/Polyline.d.ts +6 -21
- package/lib/typescript/src/components/Polyline.d.ts.map +1 -1
- package/lib/typescript/src/components/Polyline.types.d.ts +53 -0
- package/lib/typescript/src/components/Polyline.types.d.ts.map +1 -0
- package/lib/typescript/src/components/Polyline.web.d.ts +2 -5
- package/lib/typescript/src/components/Polyline.web.d.ts.map +1 -1
- package/lib/typescript/src/components/index.d.ts +8 -2
- package/lib/typescript/src/components/index.d.ts.map +1 -1
- package/lib/typescript/src/components/index.web.d.ts +6 -2
- package/lib/typescript/src/components/index.web.d.ts.map +1 -1
- package/lib/typescript/src/fabric/LuggCalloutViewNativeComponent.d.ts +13 -0
- package/lib/typescript/src/fabric/LuggCalloutViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/{LuggGoogleMapViewNativeComponent.d.ts → LuggMapViewNativeComponent.d.ts} +30 -4
- package/lib/typescript/src/fabric/LuggMapViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/LuggMarkerViewNativeComponent.d.ts +45 -1
- package/lib/typescript/src/fabric/LuggMarkerViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/fabric/LuggPolygonViewNativeComponent.d.ts +18 -0
- package/lib/typescript/src/fabric/LuggPolygonViewNativeComponent.d.ts.map +1 -0
- package/lib/typescript/src/fabric/LuggPolylineViewNativeComponent.d.ts +7 -0
- package/lib/typescript/src/fabric/LuggPolylineViewNativeComponent.d.ts.map +1 -1
- package/lib/typescript/src/index.d.ts +11 -3
- package/lib/typescript/src/index.d.ts.map +1 -1
- package/lib/typescript/src/index.web.d.ts +9 -1
- package/lib/typescript/src/index.web.d.ts.map +1 -1
- package/lib/typescript/src/types.d.ts +11 -0
- package/lib/typescript/src/types.d.ts.map +1 -1
- package/package.json +11 -9
- package/src/MapProvider.tsx +1 -3
- package/src/MapProvider.web.tsx +22 -3
- package/src/MapView.tsx +32 -26
- package/src/MapView.types.ts +43 -9
- package/src/MapView.web.tsx +368 -210
- package/src/components/GeoJson.tsx +221 -0
- package/src/components/GeoJson.types.ts +118 -0
- package/src/components/Marker.tsx +75 -38
- package/src/components/Marker.types.ts +102 -0
- package/src/components/Marker.web.tsx +197 -19
- package/src/components/Polygon.tsx +52 -0
- package/src/components/Polygon.types.ts +33 -0
- package/src/components/Polygon.web.tsx +104 -0
- package/src/components/Polyline.tsx +23 -22
- package/src/components/Polyline.types.ts +55 -0
- package/src/components/Polyline.web.tsx +151 -37
- package/src/components/index.ts +17 -2
- package/src/components/index.web.ts +6 -2
- package/src/fabric/LuggCalloutViewNativeComponent.ts +20 -0
- package/src/fabric/{LuggGoogleMapViewNativeComponent.ts → LuggMapViewNativeComponent.ts} +43 -7
- package/src/fabric/LuggMarkerViewNativeComponent.ts +49 -1
- package/src/fabric/LuggPolygonViewNativeComponent.ts +25 -0
- package/src/fabric/LuggPolylineViewNativeComponent.ts +8 -0
- package/src/index.ts +30 -1
- package/src/index.web.ts +16 -1
- package/src/types.ts +13 -0
- package/android/src/main/java/com/luggmaps/LuggGoogleMapView.kt +0 -511
- package/ios/LuggAppleMapView.h +0 -16
- package/ios/LuggAppleMapView.mm +0 -592
- package/ios/LuggGoogleMapView.h +0 -13
- package/ios/LuggGoogleMapView.mm +0 -455
- package/lib/module/fabric/LuggAppleMapViewNativeComponent.ts +0 -83
- package/lib/typescript/src/fabric/LuggAppleMapViewNativeComponent.d.ts +0 -54
- package/lib/typescript/src/fabric/LuggAppleMapViewNativeComponent.d.ts.map +0 -1
- package/lib/typescript/src/fabric/LuggGoogleMapViewNativeComponent.d.ts.map +0 -1
- package/src/fabric/LuggAppleMapViewNativeComponent.ts +0 -83
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
package com.luggmaps
|
|
2
|
+
|
|
3
|
+
import android.content.Context
|
|
4
|
+
import android.graphics.Color
|
|
5
|
+
import com.facebook.react.views.view.ReactViewGroup
|
|
6
|
+
import com.google.android.gms.maps.model.LatLng
|
|
7
|
+
import com.google.android.gms.maps.model.Polygon
|
|
8
|
+
import com.luggmaps.events.PolygonPressEvent
|
|
9
|
+
import com.luggmaps.extensions.dispatchEvent
|
|
10
|
+
|
|
11
|
+
interface LuggPolygonViewDelegate {
|
|
12
|
+
fun polygonViewDidUpdate(polygonView: LuggPolygonView)
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
class LuggPolygonView(context: Context) : ReactViewGroup(context) {
|
|
16
|
+
var coordinates: List<LatLng> = emptyList()
|
|
17
|
+
private set
|
|
18
|
+
|
|
19
|
+
var holes: List<List<LatLng>> = emptyList()
|
|
20
|
+
private set
|
|
21
|
+
|
|
22
|
+
var strokeColor: Int = Color.BLACK
|
|
23
|
+
private set
|
|
24
|
+
|
|
25
|
+
var fillColor: Int = Color.argb(77, 0, 0, 0)
|
|
26
|
+
private set
|
|
27
|
+
|
|
28
|
+
var strokeWidth: Float = 1f
|
|
29
|
+
private set
|
|
30
|
+
|
|
31
|
+
var zIndex: Float = 0f
|
|
32
|
+
private set
|
|
33
|
+
|
|
34
|
+
var tappable: Boolean = false
|
|
35
|
+
private set
|
|
36
|
+
|
|
37
|
+
var delegate: LuggPolygonViewDelegate? = null
|
|
38
|
+
var polygon: Polygon? = null
|
|
39
|
+
|
|
40
|
+
init {
|
|
41
|
+
visibility = GONE
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
fun setCoordinates(coords: List<LatLng>) {
|
|
45
|
+
coordinates = coords
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
fun setHoles(value: List<List<LatLng>>) {
|
|
49
|
+
holes = value
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
fun setStrokeColor(color: Int) {
|
|
53
|
+
strokeColor = color
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
fun setFillColor(color: Int) {
|
|
57
|
+
fillColor = color
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
fun setStrokeWidth(width: Float) {
|
|
61
|
+
strokeWidth = width
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
fun setZIndex(value: Float) {
|
|
65
|
+
zIndex = value
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
fun setTappable(value: Boolean) {
|
|
69
|
+
tappable = value
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
fun emitPressEvent() {
|
|
73
|
+
dispatchEvent(PolygonPressEvent(this))
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
fun onAfterUpdateTransaction() {
|
|
77
|
+
delegate?.polygonViewDidUpdate(this)
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
fun onDropViewInstance() {
|
|
81
|
+
delegate = null
|
|
82
|
+
polygon?.remove()
|
|
83
|
+
polygon = null
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
package com.luggmaps
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReadableArray
|
|
4
|
+
import com.facebook.react.module.annotations.ReactModule
|
|
5
|
+
import com.facebook.react.uimanager.ThemedReactContext
|
|
6
|
+
import com.facebook.react.uimanager.ViewGroupManager
|
|
7
|
+
import com.facebook.react.uimanager.ViewManagerDelegate
|
|
8
|
+
import com.facebook.react.uimanager.annotations.ReactProp
|
|
9
|
+
import com.facebook.react.viewmanagers.LuggPolygonViewManagerDelegate
|
|
10
|
+
import com.facebook.react.viewmanagers.LuggPolygonViewManagerInterface
|
|
11
|
+
import com.google.android.gms.maps.model.LatLng
|
|
12
|
+
|
|
13
|
+
@ReactModule(name = LuggPolygonViewManager.NAME)
|
|
14
|
+
class LuggPolygonViewManager :
|
|
15
|
+
ViewGroupManager<LuggPolygonView>(),
|
|
16
|
+
LuggPolygonViewManagerInterface<LuggPolygonView> {
|
|
17
|
+
private val delegate: ViewManagerDelegate<LuggPolygonView> = LuggPolygonViewManagerDelegate(this)
|
|
18
|
+
|
|
19
|
+
override fun getDelegate(): ViewManagerDelegate<LuggPolygonView> = delegate
|
|
20
|
+
override fun getName(): String = NAME
|
|
21
|
+
override fun createViewInstance(context: ThemedReactContext): LuggPolygonView = LuggPolygonView(context)
|
|
22
|
+
|
|
23
|
+
override fun getExportedCustomDirectEventTypeConstants(): Map<String, Any> =
|
|
24
|
+
mapOf("topPolygonPress" to mapOf("registrationName" to "onPolygonPress"))
|
|
25
|
+
|
|
26
|
+
override fun onDropViewInstance(view: LuggPolygonView) {
|
|
27
|
+
super.onDropViewInstance(view)
|
|
28
|
+
view.onDropViewInstance()
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
override fun onAfterUpdateTransaction(view: LuggPolygonView) {
|
|
32
|
+
super.onAfterUpdateTransaction(view)
|
|
33
|
+
view.onAfterUpdateTransaction()
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@ReactProp(name = "coordinates")
|
|
37
|
+
override fun setCoordinates(view: LuggPolygonView, value: ReadableArray?) {
|
|
38
|
+
value?.let { array ->
|
|
39
|
+
val coords = mutableListOf<LatLng>()
|
|
40
|
+
for (i in 0 until array.size()) {
|
|
41
|
+
val coord = array.getMap(i)
|
|
42
|
+
val lat = coord?.getDouble("latitude") ?: 0.0
|
|
43
|
+
val lng = coord?.getDouble("longitude") ?: 0.0
|
|
44
|
+
coords.add(LatLng(lat, lng))
|
|
45
|
+
}
|
|
46
|
+
view.setCoordinates(coords)
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@ReactProp(name = "holes")
|
|
51
|
+
override fun setHoles(view: LuggPolygonView, value: ReadableArray?) {
|
|
52
|
+
value?.let { array ->
|
|
53
|
+
val holesList = mutableListOf<List<LatLng>>()
|
|
54
|
+
for (i in 0 until array.size()) {
|
|
55
|
+
val holeArray = array.getArray(i)
|
|
56
|
+
val hole = mutableListOf<LatLng>()
|
|
57
|
+
if (holeArray != null) {
|
|
58
|
+
for (j in 0 until holeArray.size()) {
|
|
59
|
+
val coord = holeArray.getMap(j)
|
|
60
|
+
val lat = coord?.getDouble("latitude") ?: 0.0
|
|
61
|
+
val lng = coord?.getDouble("longitude") ?: 0.0
|
|
62
|
+
hole.add(LatLng(lat, lng))
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
holesList.add(hole)
|
|
66
|
+
}
|
|
67
|
+
view.setHoles(holesList)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@ReactProp(name = "strokeColor", customType = "Color")
|
|
72
|
+
override fun setStrokeColor(view: LuggPolygonView, value: Int?) {
|
|
73
|
+
view.setStrokeColor(value ?: android.graphics.Color.BLACK)
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@ReactProp(name = "fillColor", customType = "Color")
|
|
77
|
+
override fun setFillColor(view: LuggPolygonView, value: Int?) {
|
|
78
|
+
view.setFillColor(value ?: android.graphics.Color.argb(77, 0, 0, 0))
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
@ReactProp(name = "strokeWidth", defaultDouble = 1.0)
|
|
82
|
+
override fun setStrokeWidth(view: LuggPolygonView, value: Double) {
|
|
83
|
+
view.setStrokeWidth(value.toFloat())
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@ReactProp(name = "tappable")
|
|
87
|
+
override fun setTappable(view: LuggPolygonView, value: Boolean) {
|
|
88
|
+
view.setTappable(value)
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@ReactProp(name = "zIndex", defaultFloat = 0f)
|
|
92
|
+
override fun setZIndex(view: LuggPolygonView, value: Float) {
|
|
93
|
+
super.setZIndex(view, value)
|
|
94
|
+
view.setZIndex(value)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
companion object {
|
|
98
|
+
const val NAME = "LuggPolygonView"
|
|
99
|
+
}
|
|
100
|
+
}
|
|
@@ -12,6 +12,8 @@ interface LuggPolylineViewDelegate {
|
|
|
12
12
|
fun polylineViewDidUpdate(polylineView: LuggPolylineView)
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
data class AnimatedOptions(val duration: Long = 2150L, val easing: String = "linear", val trailLength: Float = 1f, val delay: Long = 0L)
|
|
16
|
+
|
|
15
17
|
class LuggPolylineView(context: Context) : ReactViewGroup(context) {
|
|
16
18
|
var coordinates: List<LatLng> = emptyList()
|
|
17
19
|
private set
|
|
@@ -25,6 +27,12 @@ class LuggPolylineView(context: Context) : ReactViewGroup(context) {
|
|
|
25
27
|
var animated: Boolean = false
|
|
26
28
|
private set
|
|
27
29
|
|
|
30
|
+
var animatedOptions: AnimatedOptions = AnimatedOptions()
|
|
31
|
+
private set
|
|
32
|
+
|
|
33
|
+
var zIndex: Float = 0f
|
|
34
|
+
private set
|
|
35
|
+
|
|
28
36
|
var cachedSpans: List<StyleSpan>? = null
|
|
29
37
|
private set
|
|
30
38
|
|
|
@@ -55,6 +63,14 @@ class LuggPolylineView(context: Context) : ReactViewGroup(context) {
|
|
|
55
63
|
animated = value
|
|
56
64
|
}
|
|
57
65
|
|
|
66
|
+
fun setAnimatedOptions(options: AnimatedOptions) {
|
|
67
|
+
animatedOptions = options
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
fun setZIndex(value: Float) {
|
|
71
|
+
zIndex = value
|
|
72
|
+
}
|
|
73
|
+
|
|
58
74
|
fun getOrCreateSpans(): List<StyleSpan> {
|
|
59
75
|
cachedSpans?.let { return it }
|
|
60
76
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
package com.luggmaps
|
|
2
2
|
|
|
3
3
|
import com.facebook.react.bridge.ReadableArray
|
|
4
|
+
import com.facebook.react.bridge.ReadableMap
|
|
4
5
|
import com.facebook.react.module.annotations.ReactModule
|
|
5
6
|
import com.facebook.react.uimanager.ThemedReactContext
|
|
6
7
|
import com.facebook.react.uimanager.ViewGroupManager
|
|
@@ -65,6 +66,27 @@ class LuggPolylineViewManager :
|
|
|
65
66
|
view.setAnimated(value)
|
|
66
67
|
}
|
|
67
68
|
|
|
69
|
+
@ReactProp(name = "animatedOptions")
|
|
70
|
+
override fun setAnimatedOptions(view: LuggPolylineView, value: ReadableMap?) {
|
|
71
|
+
val options = if (value != null) {
|
|
72
|
+
AnimatedOptions(
|
|
73
|
+
duration = if (value.hasKey("duration")) value.getDouble("duration").toLong() else 2150L,
|
|
74
|
+
easing = if (value.hasKey("easing")) value.getString("easing") ?: "linear" else "linear",
|
|
75
|
+
trailLength = if (value.hasKey("trailLength")) value.getDouble("trailLength").toFloat() else 1f,
|
|
76
|
+
delay = if (value.hasKey("delay")) value.getDouble("delay").toLong() else 0L
|
|
77
|
+
)
|
|
78
|
+
} else {
|
|
79
|
+
AnimatedOptions()
|
|
80
|
+
}
|
|
81
|
+
view.setAnimatedOptions(options)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@ReactProp(name = "zIndex", defaultFloat = 0f)
|
|
85
|
+
override fun setZIndex(view: LuggPolylineView, value: Float) {
|
|
86
|
+
super.setZIndex(view, value)
|
|
87
|
+
view.setZIndex(value)
|
|
88
|
+
}
|
|
89
|
+
|
|
68
90
|
companion object {
|
|
69
91
|
const val NAME = "LuggPolylineView"
|
|
70
92
|
}
|