I am using react-native-maps for android development. I followed the instruction from this link: https://github.com/lelandrichardson/react-native-maps/blob/master/docs/installation.md. After launch the app, the UI doesn't show the map. Instead, it shows an empty page. Below is the code I used. The similar code works fine on iOS simulator. I don't know why not working on android.
import React, {
AppRegistry,
Component,
StyleSheet,
Text,
View,
Image,
ListView,
TextInput,
TouchableHighlight,
Dimensions,
MaterialButtonFixed,
//MapView,
} from 'react-native';
import MapView from 'react-native-maps';
class MapPage extends Component{
constructor(props){
super(props);
this.state = {
region:{
latitude: 4.21048,
longitude: 101.97577,
latitudeDelta: 1,
longitudeDelta: 10,
}
}
}
onRegionChange(region){
console.log('region changed ', region);
this.setState({region});
}
render() {
return(
<View style={styles.container}>
<MapView
ref="map"
style={ styles.map }
mapType={"standard"}
region={this.state.region}
zoomEnabled={true}
scrollEnabled={true}
showsScale={true}
onRegionChange={this.onRegionChange.bind(this)}
>
</MapView>
</View>
)
}
}
const styles = StyleSheet.create({
map: {
position: 'absolute',
top: 0,
left: 0,
right: 0,
bottom: 0,
},
container: {
flexDirection: 'row',
justifyContent: 'space-between',
padding: 30,
marginTop: 65,
flex:1,
padding: 30,
alignItems: 'center',
// flexDirection: 'row',
alignSelf: 'stretch',
backgroundColor: 'red',
},
inputText: {
height: 36,
padding: 4,
marginRight: 5,
flex: 4,
fontSize: 18,
borderWidth: 1,
borderColor: '#48BBEC',
borderRadius: 8,
color: '#48BBEC'
}
});
module.exports = MapPage;