Commit 9da9785a authored by 7c00's avatar 7c00

Marker 新增 active 方法

parent 3c30f511
...@@ -37,15 +37,20 @@ internal class AMapMarkerManager : ViewGroupManager<AMapMarker>() { ...@@ -37,15 +37,20 @@ internal class AMapMarkerManager : ViewGroupManager<AMapMarker>() {
companion object { companion object {
val UPDATE = 1 val UPDATE = 1
val ACTIVE = 2
} }
override fun getCommandsMap(): Map<String, Int> { override fun getCommandsMap(): Map<String, Int> {
return mapOf("update" to UPDATE) return mapOf(
"update" to UPDATE,
"active" to ACTIVE
)
} }
override fun receiveCommand(marker: AMapMarker, commandId: Int, args: ReadableArray?) { override fun receiveCommand(marker: AMapMarker, commandId: Int, args: ReadableArray?) {
when (commandId) { when (commandId) {
UPDATE -> marker.updateIcon() UPDATE -> marker.updateIcon()
ACTIVE -> marker.active = true
} }
} }
......
...@@ -148,6 +148,10 @@ export default class Marker extends BaseComponent { ...@@ -148,6 +148,10 @@ export default class Marker extends BaseComponent {
} }
} }
active() {
this._sendCommand('active')
}
componentDidUpdate() { componentDidUpdate() {
if (this._icon && Platform.OS === 'android') { if (this._icon && Platform.OS === 'android') {
setTimeout(() => this._sendCommand('update'), 0) setTimeout(() => this._sendCommand('update'), 0)
......
{ {
"name": "react-native-amap3d", "name": "react-native-amap3d",
"version": "0.7.1", "version": "0.7.2",
"description": "react-native 高德地图组件", "description": "react-native 高德地图组件",
"author": "Qiu Xiang <i@7c00.cc>", "author": "Qiu Xiang <i@7c00.cc>",
"license": "MIT", "license": "MIT",
......
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