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 {
marker?.isDraggable = value
}
var disabled: Boolean = false
var clickDisabled: Boolean = false
set(value) {
field = value
marker?.isClickable = !value
}
var infoWindowDisabled: Boolean = false
set(value) {
field = value
marker?.isInfoWindowEnable = !value
}
var active: Boolean = false
set(value) {
field = value
......@@ -107,13 +113,13 @@ class AMapMarker(context: Context) : ReactViewGroup(context), AMapOverlay {
.draggable(draggable)
.position(position)
.anchor(anchorU, anchorV)
.infoWindowEnable(!infoWindowDisabled)
.title(title)
.infoWindowEnable(true)
.snippet(snippet)
.zIndex(zIndex))
this.clickDisabled = clickDisabled
this.active = active
this.disabled = this.disabled
}
override fun remove() {
......
......@@ -90,9 +90,14 @@ internal class AMapMarkerManager : ViewGroupManager<AMapMarker>() {
marker.draggable = draggable
}
@ReactProp(name = "disabled")
fun setDisabled(marker: AMapMarker, disabled: Boolean) {
marker.disabled = disabled
@ReactProp(name = "clickDisabled")
fun setClickDisabled(marker: AMapMarker, disabled: Boolean) {
marker.clickDisabled = disabled
}
@ReactProp(name = "infoWindowDisabled")
fun setInfoWindowDisabled(marker: AMapMarker, disabled: Boolean) {
marker.infoWindowDisabled = disabled
}
@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