Skip to content

Commit

Permalink
Fix #20
Browse files Browse the repository at this point in the history
  • Loading branch information
qiuxiang committed Mar 4, 2018
1 parent c44c281 commit fb89cd2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package cn.qiuxiang.react.baidumap.mapview

import android.content.Context
import android.view.MotionEvent
import android.view.View
import android.widget.FrameLayout
import cn.qiuxiang.react.baidumap.toLatLng
Expand Down Expand Up @@ -122,6 +123,15 @@ class BaiduMapView(context: Context) : FrameLayout(context) {
})
}

override fun dispatchTouchEvent(event: MotionEvent): Boolean {
if (event.action == MotionEvent.ACTION_DOWN) {
parent.requestDisallowInterceptTouchEvent(true)
} else if (event.action == MotionEvent.ACTION_UP) {
parent.requestDisallowInterceptTouchEvent(false)
}
return super.dispatchTouchEvent(event)
}

fun emit(id: Int?, name: String, data: WritableMap = Arguments.createMap()) {
id?.let { emitter.receiveEvent(it, name, data) }
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"location",
"baidumap"
],
"version": "0.4.1",
"version": "0.5.0",
"author": "7c00 <[email protected]>",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ render() {

### 显示卫星图
```javascript
<MapView satellite>
<MapView satellite />
```
<img src="https://user-images.githubusercontent.com/1709072/36829451-37e03fba-1d5a-11e8-8cb4-7d4a5296a083.png" width=300>

Expand Down

1 comment on commit fb89cd2

@linwenchao
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

iOS也有相同的问题喔

Please sign in to comment.