Commit 87ccaf18 authored by 7c00's avatar 7c00

Add android Marker clickDisabled and infoWindowDisabled props

ref #143
parent bc6ff3b7
...@@ -77,12 +77,18 @@ class AMapMarker(context: Context) : ReactViewGroup(context), AMapOverlay { ...@@ -77,12 +77,18 @@ class AMapMarker(context: Context) : ReactViewGroup(context), AMapOverlay {
marker?.isDraggable = value marker?.isDraggable = value
} }
var disabled: Boolean = false var clickDisabled: Boolean = false
set(value) { set(value) {
field = value field = value
marker?.isClickable = !value marker?.isClickable = !value
} }
var infoWindowDisabled: Boolean = false
set(value) {
field = value
marker?.isInfoWindowEnable = !value
}
var active: Boolean = false var active: Boolean = false
set(value) { set(value) {
field = value field = value
...@@ -107,13 +113,13 @@ class AMapMarker(context: Context) : ReactViewGroup(context), AMapOverlay { ...@@ -107,13 +113,13 @@ class AMapMarker(context: Context) : ReactViewGroup(context), AMapOverlay {
.draggable(draggable) .draggable(draggable)
.position(position) .position(position)
.anchor(anchorU, anchorV) .anchor(anchorU, anchorV)
.infoWindowEnable(!infoWindowDisabled)
.title(title) .title(title)
.infoWindowEnable(true)
.snippet(snippet) .snippet(snippet)
.zIndex(zIndex)) .zIndex(zIndex))
this.clickDisabled = clickDisabled
this.active = active this.active = active
this.disabled = this.disabled
} }
override fun remove() { override fun remove() {
......
...@@ -90,9 +90,14 @@ internal class AMapMarkerManager : ViewGroupManager<AMapMarker>() { ...@@ -90,9 +90,14 @@ internal class AMapMarkerManager : ViewGroupManager<AMapMarker>() {
marker.draggable = draggable marker.draggable = draggable
} }
@ReactProp(name = "disabled") @ReactProp(name = "clickDisabled")
fun setDisabled(marker: AMapMarker, disabled: Boolean) { fun setClickDisabled(marker: AMapMarker, disabled: Boolean) {
marker.disabled = disabled marker.clickDisabled = disabled
}
@ReactProp(name = "infoWindowDisabled")
fun setInfoWindowDisabled(marker: AMapMarker, disabled: Boolean) {
marker.infoWindowDisabled = disabled
} }
@ReactProp(name = "active") @ReactProp(name = "active")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment