Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions android/src/main/java/com/luggmaps/LuggMarkerView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.facebook.react.views.view.ReactViewGroup
import com.google.android.gms.maps.model.AdvancedMarker
import com.google.android.gms.maps.model.BitmapDescriptor
import com.google.android.gms.maps.model.BitmapDescriptorFactory
import com.google.android.gms.maps.model.LatLng
import com.luggmaps.events.MarkerDragEvent
import com.luggmaps.events.MarkerPressEvent
import com.luggmaps.extensions.dispatchEvent
Expand Down Expand Up @@ -246,6 +247,13 @@ class LuggMarkerView(context: Context) : ReactViewGroup(context) {
fun setCoordinate(latitude: Double, longitude: Double) {
this.latitude = latitude
this.longitude = longitude
val m = marker ?: return
if (!isDragging) {
m.position = LatLng(latitude, longitude)
if (!rasterize) {
onUpdate?.invoke()
}
}
}

fun setTitle(title: String?) {
Expand Down
2 changes: 2 additions & 0 deletions android/src/main/java/com/luggmaps/LuggPolygonView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@ class LuggPolygonView(context: Context) : ReactViewGroup(context) {

fun setCoordinates(coords: List<LatLng>) {
coordinates = coords
polygon?.points = coords
}

fun setHoles(value: List<List<LatLng>>) {
holes = value
polygon?.holes = value
}

fun setStrokeColor(color: Int) {
Expand Down
1 change: 1 addition & 0 deletions android/src/main/java/com/luggmaps/LuggPolylineView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class LuggPolylineView(context: Context) : ReactViewGroup(context) {

fun setCoordinates(coords: List<LatLng>) {
coordinates = coords
polyline?.points = coords
}

fun setStrokeColors(colors: List<Int>) {
Expand Down