2017-01-08 2 views
1

사용할 때의 아이디어 https://github.com/airbnb/react-native-maps 시각적으로 보이지 않지만 맵 그리드가 생깁니 까? 나는 점안 지시 사항을 따르고 Google에서 내 것과 같은 오류를 발견 할 수 없습니다. 점안 과정 후 작동하는 코드입니다. 그것은 단지 더지도 먼저이 명령 [https://github.com/airbnb/react-native-maps/blob/master/docs/installation.md][1]에 따라 모든 단계를 확인해야합니다에서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

에게 표를 보여줍니다에로 작동합니다.

실제 장치의 에뮬레이터 (예 : 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 }, });