react-native-baidumap-sdk icon indicating copy to clipboard operation
react-native-baidumap-sdk copied to clipboard

想写一个根据 事件 onStatusChange 改变的标记 MapView.Marker, MapView.Marker的coordinate改变之后会触发onStatusChange,这样会一直触发onStatusChange,形成死循环

Open hengziyou opened this issue 6 years ago • 2 comments

代码:

<MapView style={{width: '100%', height: '50%'}} center={this.state.ownPosition} zoomLevel={15} locationMode="follow" onStatusChange={obj => this.onStatusChange(obj)} locationEnabled > <MapView.Marker title="your own position" color="#3498db" coordinate={this.state.location} /> </MapView>

onStatusChange 事件: onStatusChange (obj) { // 滑动地图 this.setState({ location: obj.center }, () => { this.getAroundList(1) }) }

onStatusChange事件从打开时候之后触发,死循环了

hengziyou avatar Jan 03 '19 02:01 hengziyou

你好,你解决了这个问题吗

zhllucky avatar Jun 04 '19 07:06 zhllucky

@zhllucky iOS出现的吧?我也遇见了,你解决了么

AtoyGG avatar Jan 14 '20 13:01 AtoyGG