2016-11-06 67 views
0

我試圖實現我的反應,本機應用程序MapView成分,但是當我運行應用程序時,我得到的是一個空白的廣場,在那裏的地圖應(由紅色包圍使用MapView的時邊界。空白地圖在反應母語

我使用genymotion和我有谷歌播放服務進行安裝。

這是我的組件看起來像......

class MainMap extends Component { 
    constructor() { 
    super(); 
    } 
    render(){ 
     return (
      <View style={styles.container}> 
      <MapView 
     style={ styles.map } 
     initialRegion={{ 
      latitude: 37.78825, 
      longitude: -122.4324, 
      latitudeDelta: 0.0922, 
      longitudeDelta: 0.0421, 
     }} 
     /> 
    </View> 
     ) 
    } 
} 


const styles = StyleSheet.create({ 
    container: { 
    position: 'absolute', 
    top: 0, 
    left: 0, 
    right: 0, 
    bottom: 0, 
    justifyContent: 'flex-end', 
    alignItems: 'center', 
    }, 
    map: { 
    position: 'absolute', 
    top: 0, 
    left: 0, 
    right: 0, 
    bottom: 0, 
    }, 
}); 

function mapStateToProps(state) { 
    return { 
     users: state.users 
    }; 
} 

export default connect(mapStateToProps)(MainMap); 

爲什麼會這樣不行嗎?我已經配置更多在我的模擬器中?我注意到這是一個Android的重新發生的問題,但我找不到一個明確的解決方案。

+1

在react-native-maps文檔中有一個相當不錯的檢查列表 https://github.com/airbnb/react-native-maps/blob/master/docs/installation.md#troubleshooting – Thomas

回答