@lugg/maps 1.0.0-beta.11 → 1.0.0-beta.12
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.
|
@@ -7,9 +7,9 @@ import android.view.accessibility.AccessibilityEvent
|
|
|
7
7
|
import androidx.core.graphics.createBitmap
|
|
8
8
|
import androidx.core.view.isNotEmpty
|
|
9
9
|
import com.facebook.react.views.view.ReactViewGroup
|
|
10
|
-
import com.google.android.gms.maps.model.AdvancedMarker
|
|
11
10
|
import com.google.android.gms.maps.model.BitmapDescriptor
|
|
12
11
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory
|
|
12
|
+
import com.google.android.gms.maps.model.Marker
|
|
13
13
|
import com.luggmaps.events.MarkerDragEvent
|
|
14
14
|
import com.luggmaps.events.MarkerPressEvent
|
|
15
15
|
import com.luggmaps.extensions.dispatchEvent
|
|
@@ -38,7 +38,7 @@ class LuggMarkerView(context: Context) : ReactViewGroup(context) {
|
|
|
38
38
|
private set
|
|
39
39
|
|
|
40
40
|
var delegate: LuggMarkerViewDelegate? = null
|
|
41
|
-
var marker:
|
|
41
|
+
var marker: Marker? = null
|
|
42
42
|
|
|
43
43
|
var anchorX: Float = 0.5f
|
|
44
44
|
private set
|
|
@@ -15,8 +15,6 @@ import com.google.android.gms.maps.GoogleMap
|
|
|
15
15
|
import com.google.android.gms.maps.GoogleMapOptions
|
|
16
16
|
import com.google.android.gms.maps.MapView
|
|
17
17
|
import com.google.android.gms.maps.OnMapReadyCallback
|
|
18
|
-
import com.google.android.gms.maps.model.AdvancedMarker
|
|
19
|
-
import com.google.android.gms.maps.model.AdvancedMarkerOptions
|
|
20
18
|
import com.google.android.gms.maps.model.BitmapDescriptorFactory
|
|
21
19
|
import com.google.android.gms.maps.model.Circle
|
|
22
20
|
import com.google.android.gms.maps.model.CircleOptions
|
|
@@ -26,6 +24,7 @@ import com.google.android.gms.maps.model.LatLng
|
|
|
26
24
|
import com.google.android.gms.maps.model.LatLngBounds
|
|
27
25
|
import com.google.android.gms.maps.model.MapColorScheme
|
|
28
26
|
import com.google.android.gms.maps.model.Marker
|
|
27
|
+
import com.google.android.gms.maps.model.MarkerOptions
|
|
29
28
|
import com.google.android.gms.maps.model.Polygon
|
|
30
29
|
import com.google.android.gms.maps.model.PolygonOptions
|
|
31
30
|
import com.google.android.gms.maps.model.PolylineOptions
|
|
@@ -692,12 +691,12 @@ class GoogleMapProvider(private val context: Context) :
|
|
|
692
691
|
val map = googleMap ?: return
|
|
693
692
|
|
|
694
693
|
val position = LatLng(markerView.latitude, markerView.longitude)
|
|
695
|
-
val options =
|
|
694
|
+
val options = MarkerOptions()
|
|
696
695
|
.position(position)
|
|
697
696
|
.title(markerView.title)
|
|
698
697
|
.snippet(markerView.description)
|
|
699
698
|
|
|
700
|
-
val marker = map.addMarker(options)
|
|
699
|
+
val marker = map.addMarker(options) ?: return
|
|
701
700
|
marker.setAnchor(markerView.anchorX, markerView.anchorY)
|
|
702
701
|
marker.zIndex = markerView.zIndex
|
|
703
702
|
marker.rotation = markerView.rotate
|
|
@@ -715,9 +714,8 @@ class GoogleMapProvider(private val context: Context) :
|
|
|
715
714
|
}
|
|
716
715
|
}
|
|
717
716
|
|
|
718
|
-
//
|
|
719
|
-
//
|
|
720
|
-
// marker uses a transparent bitmap matching the content size so taps still trigger onMarkerClick.
|
|
717
|
+
// Live marker: content view is added to the wrapper and positioned via screen projection.
|
|
718
|
+
// The underlying marker uses a transparent bitmap matching the content size so taps still trigger onMarkerClick.
|
|
721
719
|
private fun showLiveMarker(markerView: LuggMarkerView) {
|
|
722
720
|
val wrapper = wrapperView ?: return
|
|
723
721
|
|