2017-01-08 23 views
1

使用時のアイディアhttps://github.com/airbnb/react-native-maps 地図のグリッドは表示されますが、ビジュアルは表示されません。私は点滴の指示に従って、私のような私のようなエラーを見つけることができません。点滴プロセス後に動作する私のコードです。それのような作品だけ最初にあなたは、この指示に従って、すべての手順を確認する必要があり、グリッドをマップMapView airbnb ReactNative no visual

import MapView from 'react-native-maps'; 
import React, { Component } from 'react'; 
import { 
    View, 
    StyleSheet 
} from 'react-native'; 

const styles = StyleSheet.create({ 
    container: { 
    position: 'absolute', 
    top: 0, 
    left: 0, 
    right: 0, 
    bottom: 0, 


    }, 
    map: { 
    position: 'absolute', 
    top: 0, 
    left: 0, 
    right: 0, 
    bottom: 0, 
    }, 
}); 

class Navigatord 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> 
    ); 
    } 

} 

export default Navigatord; 

答えて

1

を示していない[https://github.com/airbnb/react-native-maps/blob/master/docs/installation.md][1]

実際のデバイスのエミュレータ(Genymotionなど)を使用している場合は、Google Playサポートをインストールしてください。

お使いの端末でインターネット(GPS/Wi-Fi /データ)が有効になっていることを確認してください。

、マップのスタイルに高さを追加することを忘れないでください。

const styles = StyleSheet.create({ container: { position: 'absolute', top: 0, left: 0, right: 0, bottom: 0 }, map: { position: 'absolute', top: 0, left: 0, right: 0, bottom: 0, width: 200, height: 200 }, });