有没有办法在反应原生的Mapview组件中打开特定的注释:
我有以下组件:
<MapView
ref="mapview"
style={styles.restaurantsMap}
showsUserLocation={this.state.showsUserLocation}
followUserLocation={false}
annotations={_.map(this.state.data, (restaurant) => {
return {
latitude: restaurant.latitude,
longitude: restaurant.longitude,
title: restaurant.name,
subtitle: restaurant.food[1]
};
})}
region={this.state.center}
onAnnotationPress={this.onAnnotationPress}
onRegionChangeComplete={this.onRegionChangeComplete} />
我想在同一个类中打开一个特定注释的函数,如下所示:
openAnnotation = (id) => {
// Opens the annotation with the specific id
}
由于