Commit ceb0acce authored by Qiu Xiang's avatar Qiu Xiang

优化 Overlay 更新通知

parent 8d35f57c
...@@ -2,8 +2,6 @@ import React, {PropTypes, Component} from 'react' ...@@ -2,8 +2,6 @@ import React, {PropTypes, Component} from 'react'
import { import {
View, View,
UIManager, UIManager,
Platform,
NativeModules,
findNodeHandle, findNodeHandle,
requireNativeComponent, requireNativeComponent,
} from 'react-native' } from 'react-native'
...@@ -13,7 +11,7 @@ class Overlay extends Component { ...@@ -13,7 +11,7 @@ class Overlay extends Component {
...View.propTypes, ...View.propTypes,
} }
componentDidUpdate() { _update() {
setTimeout(() => { setTimeout(() => {
UIManager.dispatchViewManagerCommand( UIManager.dispatchViewManagerCommand(
findNodeHandle(this), findNodeHandle(this),
...@@ -23,6 +21,9 @@ class Overlay extends Component { ...@@ -23,6 +21,9 @@ class Overlay extends Component {
}, 0) }, 0)
} }
componentDidUpdate = this._update
componentDidMount = this._update
render() { render() {
return <AMapOverlay {...this.props}/> return <AMapOverlay {...this.props}/>
} }
......
...@@ -40,7 +40,6 @@ export default class MarkerExample extends Component { ...@@ -40,7 +40,6 @@ export default class MarkerExample extends Component {
/> />
<Marker <Marker
icon='green' icon='green'
infoWindowWidth={100}
coordinate={{ coordinate={{
latitude: 39.806901, latitude: 39.806901,
longitude: 116.297972, longitude: 116.297972,
......
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